|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Dispatcher
public class Dispatcher
| Constructor Summary | |
|---|---|
Dispatcher()
|
|
| Method Summary | |
|---|---|
void |
abort()
|
static boolean |
anyActiveDispatchers()
|
boolean |
childRun()
Recursively invokes this Dispatcher's event pump. |
boolean |
childRunDone()
Unwinds a recursive invocation of this Dispatcher's event pump. |
Event |
event()
Return an event initialized with the given parameters. |
Event |
event(Event orig)
Return an event initialized with the given parameters. |
Event |
event(int type)
Return an event initialized with the given parameters. |
Event |
event(int type,
int what)
Return an event initialized with the given parameters. |
Event |
event(int type,
int what,
int data)
Return an event initialized with the given parameters. |
Event |
event(int type,
int what,
int data,
Object argument)
Return an event initialized with the given parameters. |
Event |
event(Listener target,
int type)
Return an event initialized with the given parameters. |
Event |
event(Listener target,
int type,
int what)
Return an event initialized with the given parameters. |
Event |
event(Listener target,
int type,
int what,
int data)
Return an event initialized with the given parameters. |
Event |
event(Listener target,
int type,
int what,
int data,
int modifiers)
Return an event initialized with the given parameters. |
Event |
event(Listener target,
int type,
int what,
int data,
int modifiers,
int timestamp,
Object argument)
Return an event initialized with the given parameters. |
Event |
event(Listener target,
int type,
int what,
int data,
Object argument)
Return an event initialized with the given parameters. |
boolean |
eventProblem(Event event,
Throwable ex)
Handle an exception caused by event processing. |
boolean |
isDispatchingThread()
Returns whether the current thread is the Dispatcher thread. |
void |
run()
|
void |
sendEvent(Event e)
|
void |
sendEvent(int type)
Construct and send an event. |
void |
sendEvent(int type,
int what)
Construct and send an event. |
void |
sendEvent(int type,
int what,
int data)
Construct and send an event. |
void |
sendEvent(int type,
int what,
int data,
Object arg)
Construct and send an event. |
void |
sendLowPriorityEvent(Event e)
|
void |
setDefaultListener(Listener l)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Dispatcher()
| Method Detail |
|---|
public void setDefaultListener(Listener l)
public void abort()
public final void sendEvent(int type,
int what,
int data,
Object arg)
Event using
the given arguments (recycling a used event if possible), targetting
the default listener of this instance, and then queues it up by
calling sendEvent(Event).
type - the type of the eventwhat - the sub-type of the eventdata - additional data for the eventarg - null-ok; an object related to the event
public final void sendEvent(int type,
int what,
int data)
Event using
the given arguments (recycling a used event if possible), targetting
the default listener of this instance, and then queues it up by
calling sendEvent(Event).
type - the type of the eventwhat - the sub-type of the eventdata - additional data for the event
public final void sendEvent(int type,
int what)
Event using
the given arguments (recycling a used event if possible), targetting
the default listener of this instance, and then queues it up by
calling sendEvent(Event).
type - the type of the eventwhat - the sub-type of the eventpublic final void sendEvent(int type)
Event using
the given arguments (recycling a used event if possible), targetting
the default listener of this instance, and then queues it up by
calling sendEvent(Event).
type - the type of the eventpublic final void sendEvent(Event e)
public final void sendLowPriorityEvent(Event e)
public final boolean eventProblem(Event event,
Throwable ex)
Listener.eventProblem(danger.app.Event, java.lang.Throwable), which is itself called by an instance of
this class on its default listener when it catches any exception (in
the generic sense, that is any Throwable). This is also called
directly by an instance when there's an event dispatch problem if
the instance has no default listener.
This implementation prints out an informative message (including
the event and the exception stack trace) and returns
true, for all exceptions other than ThreadDeath
(which are not printed and for which this method returns
false).
event - non-null; the event whose processing caused the exceptionex - non-null; the exception that was thrown
true) or not (false) to
continue running the dispatcher looppublic boolean childRun()
Object.wait() on the Dispatcher thread, as it will
block any user input from reaching the Application. Use this method
instead.
This method should only be called from the Dispatcher thread. Calling this method from any other thread has no effect.
childRunDone()public boolean childRunDone()
childRun().
This method should only be called from the Dispatcher thread, and
must be proceeded by a call to childRun(). Calling
this method under other circumstances has no effect.
childRun()public boolean isDispatchingThread()
public void run()
run in interface Runnablepublic static boolean anyActiveDispatchers()
public Event event(Listener target,
int type,
int what,
int data,
int modifiers,
int timestamp,
Object argument)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(Listener target,
int type,
int what,
int data,
Object argument)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(Listener target,
int type,
int what,
int data,
int modifiers)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(int type,
int what,
int data,
Object argument)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(int type,
int what,
int data)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(int type,
int what)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(int type)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event()
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(Listener target,
int type,
int what,
int data)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(Listener target,
int type,
int what)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(Listener target,
int type)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
public Event event(Event orig)
Event constructor with the same arguments,
except that the actual instance may have been recycled rather than
constructed afresh.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||