|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.ui.ActionProcessor
public class ActionProcessor
This class processes "discardable" events. This is typically used for mouse-moved or mouse-dragged events, where significant time is needed to process each event, and they might be delivered faster than they can be processed.
Callback objects corresponding to particular events are passed to addEvent() as they occur. They are called one at a time. If several new events are delivered before the last one has been finished, all but the most recent one are discarded.
This class is not thread safe. addEvent() and stopProcessing() should only ever be invoked from the event dispatch thread. In turn, all processing of events is guaranteed to be done on the event dispatch thread.
Constructor Summary | |
---|---|
ActionProcessor()
|
Method Summary | |
---|---|
void |
addEvent(java.lang.Runnable event)
Add an event to the queue. |
boolean |
hasBeenStopped()
Determine whether this stopProcessing() has been invoked. |
boolean |
hasEvent()
Determine whether there is an event waiting to be processed. |
void |
stopProcessing()
Halt processing, and discard any further events that are added to the queue. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionProcessor()
Method Detail |
---|
public void addEvent(java.lang.Runnable event)
public void stopProcessing()
public boolean hasBeenStopped()
public boolean hasEvent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |