edu.umd.cs.jazz.event
Class ZNodeEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--java.awt.AWTEvent
              |
              +--edu.umd.cs.jazz.event.ZNodeEvent
All Implemented Interfaces:
java.io.Serializable, ZEvent

public class ZNodeEvent
extends java.awt.AWTEvent
implements ZEvent, java.io.Serializable

ZNodeEvent is an event which indicates that a node has changed.

Node events are provided for notification purposes ONLY; Jazz will automatically handle changes to the node 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 ZNode when a node's bounds are changed. The event is passed to every ZNodeListener or ZNodeAdapter object which registered to receive such events using the Node's addNodeListener method. (ZNodeAdapter objects implement the ZNodeListener interface.) Each such listener object gets this ZNodeEvent when the event occurs.

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.

Author:
Ben Bederson
See Also:
ZNodeAdapter, ZNodeListener, Serialized Form

Field Summary
static int BOUNDS_CHANGED
          This event indicates that a node's bounds changed.
static int GLOBAL_BOUNDS_CHANGED
          This event indicates that a node's global bounds changed.
static int NODE_FIRST
          The first number in the range of ids used for node events.
static int NODE_LAST
          The last number in the range of ids used for node events.
 
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
  ZNodeEvent(ZNode source, int id)
          Deprecated. as of Jazz 1.1, use createBoundsChangedEvent() or createGlobalBoundsChanged() instead.
protected ZNodeEvent(ZNode source, int id, java.lang.Object dummy)
           
 
Method Summary
 void consume()
          Consume this event.
static ZNodeEvent createBoundsChangedEvent(ZNode aNode)
          Factory method to create a ZNodeEvent with a BOUNDS_CHANGED ID.
static ZNodeEvent createGlobalBoundsChangedEvent(ZNode aNode)
          Factory method to create a ZNodeEvent with a GLOBAL_BOUNDS_CHANGED ID.
 void dispatchTo(java.lang.Object listener)
          Calls appropriate method on the listener based on this events ID.
 java.lang.Class getListenerType()
          Returns the ZNodeLister class.
 ZNode getNode()
          Returns the node whose bounds has changed.
 boolean isConsumed()
          True if this event has been consumed.
 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

NODE_FIRST

public static final int NODE_FIRST
The first number in the range of ids used for node events.

See Also:
Constant Field Values

NODE_LAST

public static final int NODE_LAST
The last number in the range of ids used for node events.

See Also:
Constant Field Values

BOUNDS_CHANGED

public static final int BOUNDS_CHANGED
This event indicates that a node's bounds changed.

See Also:
Constant Field Values

GLOBAL_BOUNDS_CHANGED

public static final int GLOBAL_BOUNDS_CHANGED
This event indicates that a node's global bounds changed.

See Also:
Constant Field Values
Constructor Detail

ZNodeEvent

public ZNodeEvent(ZNode source,
                  int id)
Deprecated. as of Jazz 1.1, use createBoundsChangedEvent() or createGlobalBoundsChanged() instead.

Constructs a ZNodeEvent object.

Parameters:
source - the ZNode object that originated the event, and whose bounds have changed.
id - an integer indicating the type of event

ZNodeEvent

protected ZNodeEvent(ZNode source,
                     int id,
                     java.lang.Object dummy)
Method Detail

createBoundsChangedEvent

public static ZNodeEvent createBoundsChangedEvent(ZNode aNode)
Factory method to create a ZNodeEvent with a BOUNDS_CHANGED ID.


createGlobalBoundsChangedEvent

public static ZNodeEvent createGlobalBoundsChangedEvent(ZNode aNode)
Factory method to create a ZNodeEvent with a GLOBAL_BOUNDS_CHANGED ID.


getNode

public ZNode getNode()
Returns the node whose bounds has changed.

Returns:
the ZNode whose bounds has changed.

isConsumed

public boolean isConsumed()
True if this event has been consumed.

Specified by:
isConsumed in interface ZEvent
Overrides:
isConsumed in class java.awt.AWTEvent

consume

public void consume()
Consume this event.

Overrides:
consume in class java.awt.AWTEvent

dispatchTo

public void dispatchTo(java.lang.Object listener)
Calls appropriate method on the listener based on this events ID.

Specified by:
dispatchTo in interface ZEvent

getListenerType

public java.lang.Class getListenerType()
Returns the ZNodeLister class.

Specified by:
getListenerType in interface ZEvent

setSource

public void setSource(java.lang.Object aSource)
Set the souce of this event. As the event is fired up the tree the source of the event will keep changing to reflect the scenegraph object that is firing the event.

Specified by:
setSource in interface ZEvent
Overrides:
setSource in class java.awt.AWTEvent


Copyright 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.