|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.util.EventObject
|
+--java.awt.AWTEvent
|
+--edu.umd.cs.jazz.event.ZGroupEvent
ZGroupEvent is an event which indicates that a group node has changed.
Group events are provided for notification purposes ONLY; Jazz will automatically handle changes to the group contents internally so that the program works properly regardless of whether the program is receiving these events or not.
This event is generated by a ZGroup when a node is added or removed from it. The event is passed to every ZGroupListener or ZGroupAdapter object which registered to receive such events using the group's addGroupListener method. (ZGroupAdapter objects implement the ZGroupListener interface.) Each such listener object gets this ZGroupEvent when the event occurs.
ZGroupEvents now contains a method isModificationEvent() to distinguish a modification event from a true node addition or removal. A modification event is one in which a node changes position in a single scenegraph or between two different scenegraphs. A true addition or removal event is one in which a node is first added to or removed from a scenegraph. For example, the following bit of code checks to see if a given node has been deleted from its parent by checking to see if the event is a modification event.
public void nodeRemoved(ZGroupEvent e) {
if (e.getChild() == myNode &&
!e.isModificationEvent()) {
// myNode was *truly* deleted from the scenegraph
}
}
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
ZGroupAdapter, ZGroupListener, Serialized Form
| Field Summary | |
static int |
GROUP_FIRSTThe first number in the range of ids used for group events. |
static int |
GROUP_LASTThe last number in the range of ids used for group events. |
static int |
NODE_ADDEDThis event indicates that a node was added to the group. |
static int |
NODE_REMOVEDThis event indicates that a node was removed from the group. |
| Fields inherited from class java.awt.AWTEvent |
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK |
| Fields inherited from class java.util.EventObject |
source |
| Constructor Summary | |
|
ZGroupEvent(ZGroup source, int id, ZNode child, boolean modification)Deprecated. as of Jazz 1.1, use createNodeAddedEvent() or createNodeRemovedEvent() instead. |
protected |
ZGroupEvent(ZGroup source, int id, ZNode child, boolean modification, java.lang.Object dummy) |
| Method Summary | |
void |
consume()Consume this event. |
static ZGroupEvent |
createNodeAddedEvent(ZGroup source, ZNode child, boolean modification)Factory method to create a ZGroupEvent with a NODE_ADDED ID. |
static ZGroupEvent |
createNodeRemovedEvent(ZGroup source, ZNode child, boolean modification)Factory method to create a ZGroupEvent with a NODE_REMOVED ID. |
void |
dispatchTo(java.lang.Object listener)Calls appropriate method on the listener based on this events ID. |
ZNode |
getChild()Returns the ZNode that was affected by the event. |
ZGroup |
getGroup()Returns the originator of the event. |
java.lang.Class |
getListenerType()Returns the ZGroupLister class. |
boolean |
isConsumed()True if this event has been consumed. |
boolean |
isModificationEvent()True if this event is a modification. |
void |
setSource(java.lang.Object aSource)Set the souce of this event. |
| Methods inherited from class java.awt.AWTEvent |
getID, paramString, toString |
| 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 |
| Field Detail |
public static final int GROUP_FIRST
public static final int GROUP_LAST
public static final int NODE_ADDED
public static final int NODE_REMOVED
| Constructor Detail |
public ZGroupEvent(ZGroup source,
int id,
ZNode child,
boolean modification)
source - the ZGroup object that originated the eventid - an integer indicating the type of eventchild - the node that was added or removedmodification - is this event a modification?
protected ZGroupEvent(ZGroup source,
int id,
ZNode child,
boolean modification,
java.lang.Object dummy)
| Method Detail |
public static ZGroupEvent createNodeAddedEvent(ZGroup source,
ZNode child,
boolean modification)
source - the ZGroup object that originated the eventchild - the node that was added or removedmodification - is this event a modification?
public static ZGroupEvent createNodeRemovedEvent(ZGroup source,
ZNode child,
boolean modification)
source - the ZGroup object that originated the eventchild - the node that was added or removedmodification - is this event a modification?public ZGroup getGroup()
public ZNode getChild()
public boolean isModificationEvent()
public boolean isConsumed()
isConsumed in interface ZEvent
isConsumed in class java.awt.AWTEvent
public void consume()
consume in class java.awt.AWTEvent
public void dispatchTo(java.lang.Object listener)
dispatchTo in interface ZEvent
public java.lang.Class getListenerType()
getListenerType in interface ZEvent
public void setSource(java.lang.Object aSource)
setSource in interface ZEvent
setSource in class java.awt.AWTEvent
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||