Methods Summary |
---|
protected void | dispatchEvent(java.awt.AWTEvent event)Dispatches the specified event.
getCore().dispatchEventImpl(event);
|
EventQueueCore | getCore()Gets the core.
return coreRef.get();
|
public static java.awt.AWTEvent | getCurrentEvent()Returns the the currently dispatched event by the EventQueue associated
with the calling thread.
EventQueue eq = getSystemEventQueue();
return (eq != null) ? eq.getCurrentEventImpl() : null;
|
private java.awt.AWTEvent | getCurrentEventImpl()Gets the current event impl.
return getCore().getCurrentEvent();
|
public static long | getMostRecentEventTime()Gets the most recent event's timestamp. This event was dispatched from
the EventQueue associated with the calling thread.
EventQueue eq = getSystemEventQueue();
return (eq != null) ? eq.getMostRecentEventTimeImpl() : System.currentTimeMillis();
|
private long | getMostRecentEventTimeImpl()Gets the most recent event time impl.
return getCore().getMostRecentEventTime();
|
public java.awt.AWTEvent | getNextEvent()Returns an event from the EventQueue and removes it from this queue.
return getCore().getNextEvent();
|
java.awt.AWTEvent | getNextEventNoWait()Gets the next event no wait.
return getCore().getNextEventNoWait();
|
private static java.awt.EventQueue | getSystemEventQueue()Gets the system event queue.
Thread th = Thread.currentThread();
if (th instanceof EventDispatchThread) {
return ((EventDispatchThread)th).toolkit.getSystemEventQueueImpl();
}
return null;
|
public static void | invokeAndWait(java.lang.Runnable runnable)Posts an InvocationEvent which executes the run() method on a Runnable
when dispatched by the AWT event dispatcher thread and the notifyAll
method is called on it immediately after run returns.
if (isDispatchThread()) {
throw new Error();
}
final Toolkit toolkit = Toolkit.getDefaultToolkit();
final Object notifier = new Object(); // $NON-LOCK-1$
InvocationEvent event = new InvocationEvent(toolkit, runnable, notifier, true);
synchronized (notifier) {
toolkit.getSystemEventQueueImpl().postEvent(event);
notifier.wait();
}
Exception exception = event.getException();
if (exception != null) {
throw new InvocationTargetException(exception);
}
|
public static void | invokeLater(java.lang.Runnable runnable)Posts an InvocationEvent which executes the run() method on a Runnable
when dispatched by the AWT event dispatcher thread.
Toolkit toolkit = Toolkit.getDefaultToolkit();
InvocationEvent event = new InvocationEvent(toolkit, runnable);
toolkit.getSystemEventQueueImpl().postEvent(event);
|
public static boolean | isDispatchThread()Returns true if the calling thread is the current AWT EventQueue's
dispatch thread.
return Thread.currentThread() instanceof EventDispatchThread;
|
boolean | isEmpty()Checks if the queue is empty.
return getCore().isEmpty();
|
public java.awt.AWTEvent | peekEvent()Returns the first event of the EventQueue (without removing it from the
queue).
return getCore().peekEvent();
|
public java.awt.AWTEvent | peekEvent(int id)Returns the first event of the EventQueue with the specified ID (without
removing it from the queue).
return getCore().peekEvent(id);
|
protected void | pop()Stops dispatching events using this EventQueue. Any pending events are
transferred to the previous EventQueue.
getCore().pop();
|
public void | postEvent(java.awt.AWTEvent event)Posts a event to the EventQueue.
event.isPosted = true;
getCore().postEvent(event);
|
public void | push(java.awt.EventQueue newEventQueue)Replaces the existing EventQueue with the specified EventQueue. Any
pending events are transferred to the new EventQueue.
getCore().push(newEventQueue);
|
void | setCore(EventQueueCore newCore)Sets the core.
coreRef.set((newCore != null) ? newCore : new EventQueueCore(this));
|