Package de.sciss.app
Class LaterInvocationManager
- java.lang.Object
-
- de.sciss.app.EventManager
-
- de.sciss.app.LaterInvocationManager
-
- All Implemented Interfaces:
EventManager.Processor,java.lang.Runnable
public class LaterInvocationManager extends EventManager implements EventManager.Processor
The LaterInvocationManager is a utility bastard synthesized from an EventManager and a Runnable. It's useful for queueing activities from outside the Swing event thread to be processed later in the event thread.Note that in test scenarios on apple's VM, PreferenceChangeEvents were dispatched in a thread different from the normal Swing event thread. Due to this fact a lot of synchronization issues arise, so we decided to pass more or less all preference changes to a LaterInvocationManager.Listener instance...
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLaterInvocationManager.ListenerA simple interface describing the method that gets called from the event dispatching thread when new objects have been queued.-
Nested classes/interfaces inherited from class de.sciss.app.EventManager
EventManager.Processor
-
-
Field Summary
-
Fields inherited from class de.sciss.app.EventManager
DEBUG_EVENTS, eventProcessor
-
-
Constructor Summary
Constructors Constructor Description LaterInvocationManager(LaterInvocationManager.Listener listener)Constructs a newLaterInvocationManagerwith one particular listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocessEvent(BasicEvent e)This is called by the EventManager which is in fact ourself ;-) if new events are to be processed.voidqueue(java.lang.Object o)Queues an object for later processing.-
Methods inherited from class de.sciss.app.EventManager
addListener, countListeners, debugDump, dispatchEvent, dispose, getListener, pause, removeListener, resume, run
-
-
-
-
Constructor Detail
-
LaterInvocationManager
public LaterInvocationManager(LaterInvocationManager.Listener listener)
Constructs a newLaterInvocationManagerwith one particular listener. Note that it's possible to add more listeners through the standard mechanism ofEventManager, however situations are rare where this would be useful.- Parameters:
listener- This listener's laterInvocation method gets called, when new objects have been queued and the VM arrives at the event dispatching thread.
-
-
Method Detail
-
queue
public void queue(java.lang.Object o)
Queues an object for later processing. The listener's laterInvocation method will be called later in the event dispatcher thread- Parameters:
o- the object to pass to the laterInvocation method. beware not to pass a null value which will result in an IllegalArgumentException.
-
processEvent
public void processEvent(BasicEvent e)
This is called by the EventManager which is in fact ourself ;-) if new events are to be processed. This will invoke the listener'slaterInvocationmethod.- Specified by:
processEventin interfaceEventManager.Processor
-
-