Examples of InvocationEvent


Examples of java.awt.event.InvocationEvent

                class AWTInvocationLock {
                }
                Object lock = new AWTInvocationLock();

                InvocationEvent event = new InvocationEvent(Toolkit.getDefaultToolkit(), run, lock, true);

                try {
                    synchronized (lock) {
                        eq.postEvent(event);
                        lock.wait();
                    }
                } catch (Exception x) {
                    throw new RuntimeException(x);
                }

                Throwable eventThrowable = event.getThrowable();
                if (eventThrowable != null) {
                    throw new RuntimeException(eventThrowable);
                }

                 // --invoke and wait
View Full Code Here

Examples of java.awt.event.InvocationEvent

            }
        };
        if (Thread.currentThread() instanceof EventDispatchThread) {
            r.run();
        } else {
            toolkit.getSystemEventQueueImpl().postEvent(new InvocationEvent(this, r));
        }
    }
View Full Code Here

Examples of java.awt.event.InvocationEvent

            }
        };
        if (Thread.currentThread() instanceof EventDispatchThread) {
            r.run();
        } else {
            toolkit.getSystemEventQueueImpl().postEvent(new InvocationEvent(this, r));
        }
    }
View Full Code Here

Examples of java.awt.event.InvocationEvent

        setValueIsAdjusting(stateController.isSliderDragged());
    }

    private void postAdjustmentEvent(final int type) {
        // create and post invocation event here:
        comp.postEvent(new InvocationEvent(ScrollPaneAdjustable.this, new Runnable() {
            public void run() {
                AdjustmentEvent event = new AdjustmentEvent(ScrollPaneAdjustable.this,
                        AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED, type, value,
                        getValueIsAdjusting());
                if (callAWTListener) {
View Full Code Here

Examples of java.awt.event.InvocationEvent

            }
        };
        if (Thread.currentThread() instanceof EventDispatchThread) {
            r.run();
        } else {
            toolkit.getSystemEventQueueImpl().postEvent(new InvocationEvent(this, r));
        }
    }
View Full Code Here

Examples of java.awt.event.InvocationEvent

  // Indicates whether we timed out waiting for the invocation to run
  @RunsInEDT
  private boolean postInvocationEvent(EventQueue eventQueue, long timeout) {
    Object lock = new RobotIdleLock();
    synchronized (lock) {
      eventQueue.postEvent(new InvocationEvent(toolkit, EMPTY_RUNNABLE, lock, true));
      long start = currentTimeMillis();
      try {
        // NOTE: on fast linux systems when showing a dialog, if we don't provide a timeout, we're never notified, and
        // the test will wait forever (up through 1.5.0_05).
        lock.wait(timeout);
View Full Code Here

Examples of java.awt.event.InvocationEvent

            }
        };
        if (Thread.currentThread() instanceof EventDispatchThread) {
            r.run();
        } else {
            toolkit.getSystemEventQueueImpl().postEvent(new InvocationEvent(this, r));
        }
    }
View Full Code Here

Examples of java.awt.event.InvocationEvent

            final XWindowPeer parentXWindow = getParentTopLevel();
            Window parentWindow = (Window)parentXWindow.getTarget();
            if (parentXWindow.isFocusableWindow() && parentXWindow.isSimpleWindow() &&
                XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() != parentWindow)
            {
                postEvent(new InvocationEvent(parentWindow, new  Runnable() {
                        public void run() {
                            // Request focus on the EDT of 'parentWindow' because
                            // XDecoratedPeer.requestWindowFocus() calls client code.
                            parentXWindow.requestXFocus();
                        }
View Full Code Here

Examples of java.awt.event.InvocationEvent

             * The fix is based on the empiric fact consisting in that the component
             * receives native mouse event nearly at the same time the Frame receives
             * WM_TAKE_FOCUS (when FocusIn is generated via XSetInputFocus call) but
             * definetely before the Frame gets FocusIn event (when this method is called).
             */
            postEvent(new InvocationEvent(target, new Runnable() {
                public void run() {
                    XWindowPeer fw = null;
                    synchronized (getStateLock()) {
                        fw = actualFocusedWindow;
                        actualFocusedWindow = null;
View Full Code Here

Examples of java.awt.event.InvocationEvent

        }

        class AWTInvocationLock {}
        Object lock = new AWTInvocationLock();

        InvocationEvent event =
                new InvocationEvent(requester,
                                    new Runnable() {
                                        public void run() {
                                            showInputMethodMenu();
                                        }
                                    },
                                    lock,
                                    true);

        AppContext requesterAppContext = SunToolkit.targetToAppContext(requester);
        synchronized (lock) {
            SunToolkit.postEvent(requesterAppContext, event);
        }

        Throwable eventThrowable = event.getThrowable();
        if (eventThrowable != null) {
            throw new InvocationTargetException(eventThrowable);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.