Package java.awt

Examples of java.awt.EventQueue$EventQueueCoreAtomicReference


         */
        private void forwardMouseEvent(Component parent, MouseEvent e) {

            popupShouldShow = false;
           
            EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
            Point newLocation = SwingUtilities.convertPoint((Component) e.getSource(), e.getPoint(), parent);
            Component newSource = parent.getComponentAt(newLocation);

            if (newSource == null) {
                // Happens if you click on the border of a component.
                return;
            }

            newLocation = SwingUtilities.convertPoint(parent, newLocation, newSource);
           
            queue.postEvent(new MouseEvent(newSource,
                    e.getID(),
                    System.currentTimeMillis(),
                    e.getModifiers(),
                    newLocation.x,
                    newLocation.y,
View Full Code Here


    private synchronized void startModal() {

        try {
            if (SwingUtilities.isEventDispatchThread()) {
                EventQueue theQueue = getToolkit().getSystemEventQueue();
                while (isVisible()) {
                    AWTEvent event = theQueue.getNextEvent();
                    Object source = event.getSource();
                    boolean dispatch = true;

                    if (event.getSource() != null && event.getSource() instanceof TrayIcon) {
                        return;
View Full Code Here

    /**
     * Processes the next GUI event.
     */
    public void dispatchNextGuiEvent() throws InterruptedException {
        EventQueue queue = awtEventQueue;
        if (queue == null) {
            queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
            awtEventQueue = queue;
        }
        AWTEvent event = queue.getNextEvent();
        if (event instanceof ActiveEvent) {
            ((ActiveEvent)event).dispatch();
        } else {
            Object source = event.getSource();
            if (source instanceof Component) {
View Full Code Here

    /**
     * Processes the next GUI event.
     */
    public void dispatchNextGuiEvent() throws InterruptedException {
        EventQueue queue = awtEventQueue;
        if (queue == null) {
            queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
            awtEventQueue = queue;
        }
        AWTEvent event = queue.getNextEvent();
        if (event instanceof ActiveEvent) {
            ((ActiveEvent)event).dispatch();
        } else {
            Object source = event.getSource();
            if (source instanceof Component) {
View Full Code Here

    lp.add(modalInterceptor);
    f.toFront();

    // We need to explicitly dispatch events when we are blocking the event
    // dispatch thread.
    EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
    try
      {
        while (! f.isClosed())
          {
            if (EventQueue.isDispatchThread())
              {
                // The getNextEventMethod() issues wait() when no
                // event is available, so we don't need do explicitly wait().
                AWTEvent ev = queue.getNextEvent();
                // This mimics EventQueue.dispatchEvent(). We can't use
                // EventQueue.dispatchEvent() directly, because it is
                // protected, unfortunately.
                if (ev instanceof ActiveEvent)
                  ((ActiveEvent) ev).dispatch();
View Full Code Here

  public static MainQtThread guiThread = null;
  public static QtGraphicsEnvironment graphicsEnv = null;

  private static void initToolkit()
  {
    eventQueue = new EventQueue();
    repaintThread = new QtRepaintThread();
    System.loadLibrary("qtpeer");

    String theme = null;
    try
View Full Code Here

        public PostShutdownEventRunnable(AppContext ac) {
            appContext = ac;
        }

        public void run() {
            final EventQueue eq = (EventQueue)appContext.get(EVENT_QUEUE_KEY);
            if (eq != null) {
                eq.postEvent(AWTAutoShutdown.getShutdownEvent());
            }
        }
View Full Code Here

    hotkeyActionMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
        mask),
        machineControlsPanel.showHideJogControlsWindowAction);

    Toolkit.getDefaultToolkit().getSystemEventQueue()
        .push(new EventQueue() {
          @Override
          protected void dispatchEvent(AWTEvent event) {
            if (event instanceof KeyEvent) {
              KeyStroke ks = KeyStroke
                  .getKeyStrokeForEvent((KeyEvent) event);
View Full Code Here

        public PostShutdownEventRunnable(AppContext ac) {
            appContext = ac;
        }

        public void run() {
            final EventQueue eq = (EventQueue)appContext.get(EVENT_QUEUE_KEY);
            if (eq != null) {
                eq.postEvent(AWTAutoShutdown.getShutdownEvent());
            }
        }
View Full Code Here

                    // The native side is currently waiting, so we set a timeout and do some pumping.
                    SWTNativeInterface.getInstance().getDisplay().readAndDispatch();
                  } else {
                    // On Mac OS, under rare circumstances, we have a situation where SWT is waiting synchronously on AWT, while AWT is blocked here.
                    // We have to use a similar forced dispatching trick.
                    EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
                    AWTEvent nextEvent = eventQueue.peekEvent();
                    if(nextEvent != null) {
                      nextEvent = eventQueue.getNextEvent();
                      if(nextEvent != null) {
                        Method dispatchMethod = EventQueue.class.getDeclaredMethod("dispatchEvent", AWTEvent.class);
                        dispatchMethod.setAccessible(true);
                        dispatchMethod.invoke(eventQueue, nextEvent);
                      }
View Full Code Here

TOP

Related Classes of java.awt.EventQueue$EventQueueCoreAtomicReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.