com.jpeterson.x10
Class ControlEvent
java.lang.Object
|
+--java.util.EventObject
|
+--com.jpeterson.x10.ControlEvent
- Direct Known Subclasses:
- CM11AEvent, CM11AStatusEvent, GatewayEvent, TransmitterEvent
- public class ControlEvent
- extends java.util.EventObject
The root event class for all control events. All events from an x10 engine
(transmitter or receiver) are synchronized with the AWT event queue. This
allows an application to mix control and AWT events without being concerned
with multi-threading problesm.
Note to Gateway Developers
The AWT event queue is obtained through the AWT Toolkit:
import java.awt.*;
...
EventQueue q = Toolkit.getDefaultToolkit().getSystemEventQueue();
A gateway should create a sub-class of AWTEvent that can be placed on the
AWT event queue. The gateway also needs to create a non-visual AWT
Component
to receive the gateway's AWTEvent
. When
the AWT event is notified to the gateway's component, the gateway should issue
the appropriate control event. The control event can be issued either from
the AWT event thread or from a sparate thread created by the gateway.
(Note that ControlEvent
is not a sub-class of
AWTEvent
so control events can not be placed directly on the
AWT event queue.)
- See Also:
- Serialized Form
Field Summary |
protected int |
id
Event identifier. |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
protected |
ControlEvent(java.lang.Object source)
Constructs a ControlEvent with a specified source. |
protected |
ControlEvent(java.lang.Object source,
int id)
Constructs a ControlEvent |
Method Summary |
int |
getId()
Return the event identifier. |
java.lang.String |
paramString()
Returns a parameter string identifying this event. |
java.lang.String |
toString()
Return a printable String. |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
id
protected int id
- Event identifier. Id values are defined for each sub-class of
ControlEvent
.
- See Also:
getId
ControlEvent
protected ControlEvent(java.lang.Object source)
- Constructs a
ControlEvent
with a specified source. The
source must be non-null.
ControlEvent
protected ControlEvent(java.lang.Object source,
int id)
- Constructs a
ControlEvent
- Parameters:
source
- the object that issued the eventid
- the identifier for the event type
getId
public int getId()
- Return the event identifier. Id values are defined for each sub-class
of
ControlEvent
.
paramString
public java.lang.String paramString()
- Returns a parameter string identifying this event. This method is
useful for event-logging and for debugging.
- Returns:
- a string identifying the event
toString
public java.lang.String toString()
- Return a printable String. Useful for event-logging and debugging.
- Overrides:
- toString in class java.util.EventObject