java.awt.event
Class InvocationEvent
- java.lang.Object
-
- java.util.EventObject
-
- java.awt.AWTEvent
-
- java.awt.event.InvocationEvent
-
- All Implemented Interfaces:
- ActiveEvent, java.io.Serializable
An event which executes therun()
method on aRunnable
when dispatched by the AWT event dispatcher thread. This class can be used as a reference implementation ofActiveEvent
rather than declaring a new class and definingdispatch()
.Instances of this class are placed on the
EventQueue
by calls toinvokeLater
andinvokeAndWait
. Client code can use this fact to write replacement functions forinvokeLater
andinvokeAndWait
without writing special-case code in anyAWTEventListener
objects.An unspecified behavior will be caused if the
id
parameter of any particularInvocationEvent
instance is not in the range fromINVOCATION_FIRST
toINVOCATION_LAST
.
-
-
Fields Modifier and Type Field and Description ACTION_EVENT_MASK The event mask for selecting action events.ADJUSTMENT_EVENT_MASK The event mask for selecting adjustment events.catchExceptions Set to true if dispatch() catches Throwable and stores it in the exception instance variable.COMPONENT_EVENT_MASK The event mask for selecting component events.consumed Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not.CONTAINER_EVENT_MASK The event mask for selecting container events.FOCUS_EVENT_MASK The event mask for selecting focus events.HIERARCHY_BOUNDS_EVENT_MASK The event mask for selecting hierarchy bounds events.HIERARCHY_EVENT_MASK The event mask for selecting hierarchy events.id The event's id.INPUT_METHOD_EVENT_MASK The event mask for selecting input method events.INVOCATION_DEFAULT The default id for all InvocationEvents.INVOCATION_EVENT_MASK The event mask for selecting invocation events.INVOCATION_FIRST Marks the first integer id for the range of invocation event ids.INVOCATION_LAST Marks the last integer id for the range of invocation event ids.ITEM_EVENT_MASK The event mask for selecting item events.KEY_EVENT_MASK The event mask for selecting key events.MOUSE_EVENT_MASK The event mask for selecting mouse events.MOUSE_MOTION_EVENT_MASK The event mask for selecting mouse motion events.MOUSE_WHEEL_EVENT_MASK The event mask for selecting mouse wheel events.notifier The (potentially null) Object whose notifyAll() method will be called immediately after the Runnable.run() method has returned or thrown an exception.PAINT_EVENT_MASK The event mask for selecting paint events.RESERVED_ID_MAX The maximum value for reserved AWT event IDs.runnable The Runnable whose run() method will be called.source The object on which the Event initially occurred.TEXT_EVENT_MASK The event mask for selecting text events.WINDOW_EVENT_MASK The event mask for selecting window events.WINDOW_FOCUS_EVENT_MASK The event mask for selecting window focus events.WINDOW_STATE_EVENT_MASK The event mask for selecting window state events.
-
Methods Modifier and Type Method and Description consume Consumes this event, if this event can be consumed.dispatch Executes the Runnable'srun()
method and notifies the notifier (if any) whenrun()
has returned or thrown an exception.getException Returns any Exception caught while executing the Runnable'srun()
method.getID Returns the event type.getSource The object on which the Event initially occurred.getThrowable Returns any Throwable caught while executing the Runnable'srun()
method.getWhen Returns the timestamp of when this event occurred.isConsumed Returns whether this event has been consumed.isDispatched Returnstrue
if the event is dispatched or any exception is thrown while dispatching,false
otherwise.paramString Returns a parameter string identifying this event.setSource Retargets an event to a new source.toString Returns a String representation of this object.
-