edu.umd.cs.jazz.event
Class ZTransformEvent

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

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

ZTransformEvent is an event which indicates that a transform group has changed.

Transform events are provided for notification purposes ONLY; Jazz will automatically handle changes to the transform 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 ZTransformGroup node when its transform is changed. The event is passed to every ZTransformListener or ZTransformAdapter object which registered to receive such events using the transform's addTransformListener method. (ZTransformAdapter objects implement the ZTransformListener interface.) Each such listener object gets this ZTransformEvent 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:
ZTransformAdapter, ZTransformListener, Serialized Form

Field Summary
 java.awt.geom.AffineTransform transform
          The value of the transform before the transform was changed for transform events (or null for other event types).
static int TRANSFORM_CHANGED
          This event indicates that the transform changed.
static int TRANSFORM_FIRST
          The first number in the range of ids used for transform events.
static int TRANSFORM_LAST
          The last number in the range of ids used for transform 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, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
  ZTransformEvent(ZTransformGroup source, int id, java.awt.geom.AffineTransform transform)
          Deprecated. as of Jazz 1.1, use createTransfomrChangedEvent() instead.
protected ZTransformEvent(ZTransformGroup source, int id, java.awt.geom.AffineTransform transform, java.lang.Object dummy)
           
 
Method Summary
static ZTransformEvent createTransformChangedEvent(ZTransformGroup source, java.awt.geom.AffineTransform transform)
          Factory method to create a ZTransformEvent with a TRANSFORM_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 ZTransformLister class.
 java.awt.geom.AffineTransform getOrigTransform()
          For transform change events, this returns the value of the transform before the transform was changed.
 ZTransformGroup getTransform()
          Returns the originator of the event.
 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
consume, finalize, getID, paramString, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSFORM_FIRST

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

TRANSFORM_LAST

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

TRANSFORM_CHANGED

public static final int TRANSFORM_CHANGED
This event indicates that the transform changed.

transform

public java.awt.geom.AffineTransform transform
The value of the transform before the transform was changed for transform events (or null for other event types).
Constructor Detail

ZTransformEvent

public ZTransformEvent(ZTransformGroup source,
                       int id,
                       java.awt.geom.AffineTransform transform)
Deprecated. as of Jazz 1.1, use createTransfomrChangedEvent() instead.

Constructs a ZTransformEvent object.
Parameters:
source - the ZTransform object that originated the event
id - an integer indicating the type of event
transform - The original transform (for transform events)

ZTransformEvent

protected ZTransformEvent(ZTransformGroup source,
                          int id,
                          java.awt.geom.AffineTransform transform,
                          java.lang.Object dummy)
Method Detail

createTransformChangedEvent

public static ZTransformEvent createTransformChangedEvent(ZTransformGroup source,
                                                          java.awt.geom.AffineTransform transform)
Factory method to create a ZTransformEvent with a TRANSFORM_CHANGED ID.
Parameters:
source - the ZTransform object that originated the event
transform - The original transform (for transform events)

getTransform

public ZTransformGroup getTransform()
Returns the originator of the event.
Returns:
the ZTransformGroup object that originated the event

getOrigTransform

public java.awt.geom.AffineTransform getOrigTransform()
For transform change events, this returns the value of the transform before the transform was changed.
Returns:
the original transform value.

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 ZTransformLister class.
Specified by:
getListenerType in interface ZEvent

isConsumed

public boolean isConsumed()
True if this event has been consumed.
Specified by:
isConsumed in interface ZEvent
Overrides:
isConsumed in class java.awt.AWTEvent

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


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