|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.monte.media.concurrent.EventLoop
ch.randelshofer.gui.event.EventDispatcher
public class EventDispatcher
Processes java.awt.ActiveEvent's on a background thread.
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);
| Field Summary |
|---|
| Fields inherited from class org.monte.media.concurrent.EventLoop |
|---|
eventProcessor |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.monte.media.concurrent.EventLoop |
|---|
clear, collectEvent, isCoalesce, join, processEvents, setCoalesce, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventDispatcher()
public EventDispatcher(int threadPriority)
threadPriority - The Thread priority of the event processor.| Method Detail |
|---|
protected void processEvent(java.lang.Object event)
processEvent in class org.monte.media.concurrent.EventLoopevent - An instance of java.awt.ActiveEvent.public void dispatch(java.awt.ActiveEvent event)
|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||