public class EventDispatcher
extends org.monte.media.concurrent.EventLoop
Example
This writes Hello World on the background thread
of the EventDispatcher:
ActiveEvent event = new ActiveEvent() { public void dispatch() { System.out.println("Hello World"); } }; EventDispatcher dispatcher = new EventDispatcher(); dispatcher.dispatch(event);
Constructor and Description |
---|
EventDispatcher()
Creates a new event dispatcher which dispatches events at Thread.NORM_PRIORITY.
|
EventDispatcher(int threadPriority)
Creates a new EventDispatcher which processes events at the
desired thread priority.
|
Modifier and Type | Method and Description |
---|---|
void |
dispatch(java.awt.ActiveEvent event)
Collects an event for later processing.
|
protected void |
processEvent(java.lang.Object event)
Calls the #dispatch method of the ActiveEvent.
|
public EventDispatcher()
public EventDispatcher(int threadPriority)
threadPriority
- The Thread priority of the event processor.protected void processEvent(java.lang.Object event)
processEvent
in class org.monte.media.concurrent.EventLoop
event
- An instance of java.awt.ActiveEvent.public void dispatch(java.awt.ActiveEvent event)