|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.swing.common.event.EventLoop
A replacement for Swing's event loop. To install it globally call
#install(). To make another non-global event loop (e.g. to process
awt events while waiting for another thread) call
#processEvents(EventFilter, EventFilter) or
#processEvents(EventFilter, EventFilter, ExceptionHandler) to
install a temporary event loop. The loop finishes, when the
runCondition EventLoop.EventFilter does not accept
an awt event.
| Nested Class Summary | |
static interface |
EventLoop.EventFilter
An interface used to accept or deny events. |
static interface |
EventLoop.ExceptionHandler
An interface that should be used to handle exceptions occured at the system event queue. |
| Method Summary | |
void |
addEventFilter(EventLoop.EventFilter event_filter)
Adds the EventLoop.EventFilter used to filter dispatched events. |
static EventLoop |
getCurrentEventLoop()
Returns the current EventLoop instance. |
EventLoop.ExceptionHandler |
getExceptionHandler()
Returns the EventLoop.ExceptionHandler used. |
static EventLoop |
getGlobalEventLoop()
Returns the global event loop. |
EventLoop |
getParentEventLoop()
Returns the parent EventLoop of this one or null,
if this EventLoop is the global EventLoop. |
EventLoop.EventFilter |
getRunCondition()
|
static void |
installGlobalEventLoop()
Installs the global EventLoop. |
boolean |
isRunning()
Returns true, while the event loop is running and processing
AWT events. |
static void |
processEvents(EventLoop.EventFilter runCondition,
EventLoop.EventFilter eventFilter)
This method does the event processing of the system event queue until the run condition does no more accept events. |
static void |
processEvents(EventLoop.EventFilter runCondition,
EventLoop.EventFilter eventFilter,
EventLoop.ExceptionHandler exceptionHandler)
This method does the event processing of the system event queue until the run condition does no more accept events. |
void |
removeEventFilter(EventLoop.EventFilter event_filter)
Removes a previously added EventLoop.EventFilter from the EventLoop. |
void |
setExceptionHandler(EventLoop.ExceptionHandler exceptionHandler)
Sets the EventLoop.ExceptionHandler used to handle uncatched exceptions. |
void |
setRunCondition(EventLoop.EventFilter runCondition)
Sets the EventLoop.EventFilter which accepts events as long as the loop runs. |
java.lang.String |
toString()
|
static void |
uninstallGlobalEventLoop()
Uninstalls the previously installed global EventLoop. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public EventLoop getParentEventLoop()
EventLoop of this one or null,
if this EventLoop is the global EventLoop.
public static void installGlobalEventLoop()
EventLoop. The method will return immediately;
the event loop will be installed, after the last event on the system event
queue is processed by the awt event loop. Subsequent calls to
#install() will need the same number of calls to
#uninstall() in order to uninstall the global EventLoop
properly.
public static void uninstallGlobalEventLoop()
EventLoop.
#install()public static EventLoop getGlobalEventLoop()
EventLoop will not run
until someone calls uninstallGlobalEventLoop().
EventLoop
public static void processEvents(EventLoop.EventFilter runCondition,
EventLoop.EventFilter eventFilter)
EventLoop.
runCondition - an EventLoop.EventFilter defining a condition that
should be true as long as this method should run. The
condition will be checked after the event was processedeventFilter - an EventLoop.EventFilter, that filters events, so that only
accepted events might be processed by clients
public static void processEvents(EventLoop.EventFilter runCondition,
EventLoop.EventFilter eventFilter,
EventLoop.ExceptionHandler exceptionHandler)
runCondition - an EventLoop.EventFilter defining a condition that
should be true as long as this method should run. The
condition will be checked after the event was processedeventFilter - an EventLoop.EventFilter, that filters events, so that only
accepted events might be processed by clientsexceptionHandler - an EventLoop.ExceptionHandler used for fatal clean up
exceptions that are not be caught by clients. If null, the
exception handler of the global EventLoop will be used.public static EventLoop getCurrentEventLoop()
EventLoop instance. If not called by the
event dispatch thread, this returns the last started EventLoop
instance.
public boolean isRunning()
true, while the event loop is running and processing
AWT events.
true, while the event loop is running.public EventLoop.ExceptionHandler getExceptionHandler()
EventLoop.ExceptionHandler used. If this EventLoop has
no own EventLoop.ExceptionHandler, it uses the one of the global event loop.
public EventLoop.EventFilter getRunCondition()
public void addEventFilter(EventLoop.EventFilter event_filter)
EventLoop.EventFilter used to filter dispatched events.
event_filter - the EventLoop.EventFilter to add (not null)public void removeEventFilter(EventLoop.EventFilter event_filter)
EventLoop.EventFilter from the EventLoop.
event_filter - the EventLoop.EventFilter to remove (not null)public void setExceptionHandler(EventLoop.ExceptionHandler exceptionHandler)
EventLoop.ExceptionHandler used to handle uncatched exceptions.
exceptionHandler - the EventLoop.ExceptionHandler to setpublic void setRunCondition(EventLoop.EventFilter runCondition)
EventLoop.EventFilter which accepts events as long as the loop runs.
runCondition - the run condition EventLoop.EventFilter to setpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||