abbot.util
Class SingleThreadedEventListener

java.lang.Object
  extended by abbot.util.SingleThreadedEventListener
All Implemented Interfaces:
AWTEventListener, EventListener

public abstract class SingleThreadedEventListener
extends Object
implements AWTEventListener

Provide an AWTEventListener which ensures all events are handled on the event dispatch thread. This allows the recorders and other listeners to safely manipulate GUI objects without concern for event dispatch thread-safety.

Window.show generates WINDOW_OPENED (and possibly hierarchy and other events) to any listeners from whatever thread the method was invoked on.

NOTE: Applet runners may run several simultaneous event dispatch threads when displaying multiple applets simultaneously. If this listener is installed in the parent context of those dispatch threads, it will be invoked on each of those threads, possibly simultaneously.


Constructor Summary
SingleThreadedEventListener()
           
 
Method Summary
 void eventDispatched(AWTEvent event)
          Event reception callback.
protected  void processDeferredEvents()
          Process any events that were generated off the event queue but not immediately handled.
protected abstract  void processEvent(AWTEvent event)
          This method is not protected by any synchronization locks (nor should it be); in the presence of multiple simultaneous event dispatch threads, the listener must be threadsafe.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleThreadedEventListener

public SingleThreadedEventListener()
Method Detail

eventDispatched

public void eventDispatched(AWTEvent event)
Event reception callback.

Specified by:
eventDispatched in interface AWTEventListener

processDeferredEvents

protected void processDeferredEvents()
Process any events that were generated off the event queue but not immediately handled.


processEvent

protected abstract void processEvent(AWTEvent event)
This method is not protected by any synchronization locks (nor should it be); in the presence of multiple simultaneous event dispatch threads, the listener must be threadsafe.



Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge