| |
|
| java.lang.Object java.awt.EventQueue
EventQueue | public class EventQueue (Code) | | EventQueue is a platform-independent class that queues events, both
from the underlying peer classes and from trusted application classes.
There is only one EventQueue for each AppContext.
author: Thomas Ball author: Fred Ecks author: David Mendenhall version: 1.67, 02/11/00 since: 1.1 |
NUM_PRIORITIES | final static int NUM_PRIORITIES(Code) | | |
EventQueue | public EventQueue()(Code) | | |
changeKeyEventFocus | final void changeKeyEventFocus(Object newSource)(Code) | | |
dispatchEvent | protected void dispatchEvent(AWTEvent event)(Code) | | Dispatch an event. The manner in which the event is
dispatched depends upon the type of the event and the
type of the event's source
object:
Event Type |
Source Type |
Dispatched To |
ActiveEvent |
Any |
event.dispatch() |
Other |
Component |
source.dispatchEvent(AWTEvent) |
Other |
MenuComponent |
source.dispatchEvent(AWTEvent) |
Other |
Other |
No action (ignored) |
Parameters: theEvent - an instance of java.awt.AWTEvent, or asubclass of it. |
getCurrentEvent | public static AWTEvent getCurrentEvent()(Code) | | Returns the the event currently being dispatched by the
EventQueue associated with the calling thread. This is
useful if a method needs access to the event, but was not designed to
receive a reference to it as an argument. Note that this method should
only be invoked from an application's event dispatching thread. If this
method is invoked from another thread, null will be returned.
the event currently being dispatched, or null if this method isinvoked on a thread other than an event dispatching thread since: 1.4 |
getMostRecentEventTime | public static long getMostRecentEventTime()(Code) | | |
getNextEvent | public AWTEvent getNextEvent() throws InterruptedException(Code) | | Remove an event from the EventQueue and return it. This method will
block until an event has been posted by another thread.
the next AWTEvent exception: InterruptedException - if another thread has interrupted this thread. |
invokeAndWait | public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException(Code) | | Causes runnable to have its run() method called in the dispatch
thread of the EventQueue. This will happen after all pending events
are processed. The call blocks until this has happened. This method
will throw an Error if called from the event dispatcher thread.
Parameters: runnable - the Runnable whose run() method should be executedsynchronously on the EventQueue exception: InterruptedException - if another thread hasinterrupted this thread exception: InvocationTargetException - if an exception is thrownwhen running runnable See Also: EventQueue.invokeLater since: 1.2 |
invokeLater | public static void invokeLater(Runnable runnable)(Code) | | Causes runnable to have its run() method called in the dispatch
thread of the EventQueue. This will happen after all pending events
are processed.
Parameters: runnable - the Runnable whose run() method should be executedsynchronously on the EventQueue See Also: EventQueue.invokeAndWait since: 1.2 |
isDispatchThread | public static boolean isDispatchThread()(Code) | | Returns true if the calling thread is the current AWT EventQueue's
dispatch thread. Use this call the ensure that a given
task is being executed (or not being) on the current AWT
EventDispatchThread.
true if running on the current AWT EventQueue's dispatch thread. |
peekEvent | public AWTEvent peekEvent()(Code) | | Return the first event on the EventQueue without removing it.
the first event |
peekEvent | public AWTEvent peekEvent(int id)(Code) | | Return the first event with the specified id, if any.
Parameters: id - the id of the type of event desired. the first event of the specified id |
pop | protected void pop() throws EmptyStackException(Code) | | Stop dispatching events using this EventQueue instance.
Any pending events are transferred to the previous
EventQueue for processing by it.
if no previous push was made on this EventQueue. See Also: java.awt.EventQueue.push |
postEvent | public void postEvent(AWTEvent theEvent)(Code) | | Post a 1.1-style event to the EventQueue. If there is an
existing event on the queue with the same ID and event source,
the source Component's coalesceEvents method will be called.
Parameters: theEvent - an instance of java.awt.AWTEvent, or asubclass of it. |
postEventPrivate | final void postEventPrivate(AWTEvent theEvent)(Code) | | Post a 1.1-style event to the EventQueue. If there is an
existing event on the queue with the same ID and event source,
the source Component's coalesceEvents method will be called.
Parameters: theEvent - an instance of java.awt.AWTEvent, or asubclass of it. |
push | public void push(EventQueue newEventQueue)(Code) | | Replace the existing EventQueue with the specified one.
Any pending events are transferred to the new EventQueue
for processing by it.
Parameters: an - EventQueue (or subclass thereof) instance to be used. See Also: java.awt.EventQueue.pop |
removeEvents | final void removeEvents(Class type, int id)(Code) | | |
removeSourceEvents | final void removeSourceEvents(Object source)(Code) | | |
removeSourceEvents | final void removeSourceEvents(Object source, boolean removeAllEvents)(Code) | | |
setCurrentEventAndMostRecentTime | static void setCurrentEventAndMostRecentTime(AWTEvent e)(Code) | | |
|
|
|