java.lang.Object | |||
↳ | java.util.EventObject | ||
↳ | java.awt.AWTEvent | ||
↳ | java.awt.event.InvocationEvent |
Known Direct Subclasses |
An event which executes the run()
method on a Runnable
when dispatched by the AWT event dispatcher thread. This class can
be used as a reference implementation of ActiveEvent
rather
than declaring a new class and defining dispatch()
.
Instances of this class are placed on the EventQueue
by calls
to invokeLater
and invokeAndWait
. Client code
can use this fact to write replacement functions for invokeLater
and invokeAndWait
without writing special-case code
in any AWTEventListener
objects.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | INVOCATION_DEFAULT | The default id for all InvocationEvents. | |||||||||
int | INVOCATION_FIRST | Marks the first integer id for the range of invocation event ids. | |||||||||
int | INVOCATION_LAST | Marks the last integer id for the range of invocation event ids. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.awt.AWTEvent
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
catchExceptions | Set to true if dispatch() catches Throwable and stores it in the exception instance variable. | ||||||||||
notifier | The (potentially null) Object whose notifyAll() method will be called immediately after the Runnable.run() method returns. | ||||||||||
runnable | The Runnable whose run() method will be called. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.awt.AWTEvent
| |||||||||||
From class
java.util.EventObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an
InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched. | |||||||||||
Constructs an
InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an
InvocationEvent with the specified
source and ID which will execute the runnable's run
method when dispatched. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Executes the Runnable's
run() method and notifies the
notifier (if any) when run() returns. | |||||||||||
Returns any Exception caught while executing the Runnable's
run()
method. | |||||||||||
Returns any Throwable caught while executing the Runnable's
run()
method. | |||||||||||
Returns the timestamp of when this event occurred.
| |||||||||||
Returns a parameter string identifying this event.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.awt.AWTEvent
| |||||||||||
From class
java.util.EventObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.awt.ActiveEvent
|
The default id for all InvocationEvents.
Marks the first integer id for the range of invocation event ids.
Marks the last integer id for the range of invocation event ids.
Set to true if dispatch() catches Throwable and stores it in the exception instance variable. If false, Throwables are propagated up to the EventDispatchThread's dispatch loop.
The (potentially null) Object whose notifyAll() method will be called immediately after the Runnable.run() method returns.
Constructs an InvocationEvent
with the specified
source which will execute the runnable's run
method when dispatched.
This is a convenience constructor. An invocation of the form
InvocationEvent(source, runnable)
behaves in exactly the same way as the invocation of
InvocationEvent
(source, runnable, null, false).
This method throws an IllegalArgumentException
if source
is null
.
source | the Object that originated the event |
---|---|
runnable | the Runnable whose run
method will be executed |
IllegalArgumentException | if source is null |
---|
Constructs an InvocationEvent
with the specified
source which will execute the runnable's run
method when dispatched. If notifier is non-null
,
notifyAll()
will be called on it
immediately after run
returns.
An invocation of the form InvocationEvent(source,
runnable, notifier, catchThrowables)
behaves in exactly the same way as the invocation of
InvocationEvent
(source, InvocationEvent.INVOCATION_DEFAULT, runnable, notifier, catchThrowables).
This method throws an IllegalArgumentException
if source
is null
.
source | the Object that originated
the event |
---|---|
runnable | the Runnable whose
run method will be
executed |
notifier | the Object whose notifyAll
method will be called after
Runnable.run has returned |
catchThrowables | specifies whether dispatch
should catch Throwable when executing
the Runnable 's run
method, or should instead propagate those
Throwables to the EventDispatchThread's
dispatch loop |
IllegalArgumentException | if source is null |
---|
Constructs an InvocationEvent
with the specified
source and ID which will execute the runnable's run
method when dispatched. If notifier is non-null
,
notifyAll
will be called on it
immediately after run
returns.
Note that passing in an invalid id
results in
unspecified behavior. This method throws an
IllegalArgumentException
if source
is null
.
source | the Object that originated
the event |
---|---|
id | the ID for the event |
runnable | the Runnable whose
run method will be executed |
notifier | the Object whose notifyAll
method will be called after
Runnable.run has returned |
catchThrowables | specifies whether dispatch
should catch Throwable when executing the
Runnable 's run
method, or should instead propagate those
Throwables to the EventDispatchThread's
dispatch loop |
IllegalArgumentException | if source is null
|
---|
Executes the Runnable's run()
method and notifies the
notifier (if any) when run()
returns.
Returns any Exception caught while executing the Runnable's run()
method.
Returns any Throwable caught while executing the Runnable's run()
method.
Returns the timestamp of when this event occurred.
Returns a parameter string identifying this event. This method is useful for event-logging and for debugging.