com.jpeterson.x10
Class AWTGatewayQueue

java.lang.Object
  |
  +--com.jpeterson.x10.GatewayQueue
        |
        +--com.jpeterson.x10.AWTGatewayQueue

public class AWTGatewayQueue
extends GatewayQueue

The AWTGatewayQueue uses the AWT event queue to synchronize control events with all other AWT events. This should make a Swing GUI thread safe.

The method post is used by the class to submit ControlEvents to the AWTEvent queue. An AWTEventSync object is used to receive the event from the AWTEvent. The actual ControlEvent is contained within the AWTEngineEvent received by AWTEventSync. Therefore, AWTEventSync "cracks" the AWTGatewayEvent, pulling out the ControlEvent and then calls ControlEventDispather's dispatch method, passing in the ControlEvent.


Inner Class Summary
protected  class AWTGatewayQueue.AWTControlEvent
          Encapsulate a control event within an AWT event.
protected  class AWTGatewayQueue.AWTEventSync
          Component used to synch ControlEvents with the AWT event queue.
 
Field Summary
protected static int CONTROL_EVENT_ID
           
 
Fields inherited from class com.jpeterson.x10.GatewayQueue
dispatcher
 
Constructor Summary
AWTGatewayQueue(ControlEventDispatcher dispatcher)
          Create a new gateway queue for processing control messages.
 
Method Summary
 void post(ControlEvent event)
          Put an event on the AWT event queue for subsequent processing by the dispatcher.
 
Methods inherited from class com.jpeterson.x10.GatewayQueue
getDispatcher, setDispatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTROL_EVENT_ID

protected static final int CONTROL_EVENT_ID
Constructor Detail

AWTGatewayQueue

public AWTGatewayQueue(ControlEventDispatcher dispatcher)
Create a new gateway queue for processing control messages.
Parameters:
dispatcher - ControlEventDispatcher that will dispatch the control event.
Method Detail

post

public void post(ControlEvent event)
Put an event on the AWT event queue for subsequent processing by the dispatcher.
Overrides:
post in class GatewayQueue
Parameters:
event - ControlEvent to be placed on the queue for subsequent processing.