edu.umd.cs.jazz.event
Class ZCameraEvent

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

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

ZCameraEvent is an event which indicates that a camera has changed.

Camera events are provided for notification purposes ONLY; Jazz will automatically handle changes to the camera 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 ZCamera visual component when a camera's view is changed. The event is passed to every ZCameraListener or ZCameraAdapter object which registered to receive such events using the camera's addCameraListener method. (ZCameraAdapter objects implement the ZCameraListener interface.) Each such listener object gets this ZCameraEvent 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:
ZCameraAdapter, ZCameraListener, Serialized Form

Field Summary
static int CAMERA_FIRST
          The first number in the range of ids used for camera events.
static int CAMERA_LAST
          The last number in the range of ids used for camera events.
static int CAMERA_VIEW_CHANGED
          This event indicates that the camera's view transform changed.
 java.awt.geom.AffineTransform viewTransform
          The value of the view transform before the view transform was changed for view transform events (or null for other event types).
 
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
  ZCameraEvent(ZCamera source, int id, java.awt.geom.AffineTransform viewTransform)
          Deprecated. as of Jazz 1.1, use createViewChangedEvent() instead.
protected ZCameraEvent(ZCamera source, int id, java.awt.geom.AffineTransform viewTransform, java.lang.Object dummy)
           
 
Method Summary
static ZCameraEvent createViewChangedEvent(ZCamera source, java.awt.geom.AffineTransform viewTransform)
          Factory method to create a ZCameraEvent with a CAMERA_VIEW_CHANGED ID.
 void dispatchTo(java.lang.Object listener)
          Calls appropriate method on the listener based on this events ID.
 ZCamera getCamera()
          Returns the originator of the event.
 java.lang.Class getListenerType()
          Returns the ZCameraLister class.
 java.awt.geom.AffineTransform getOrigViewTransform()
          For view change events, this returns the value of the view transform before the view transform was changed.
 boolean isConsumed()
          Returns true if this event has previously been consumed.
 void setSource(java.lang.Object aSource)
          Set the souce of this event.
 
Methods inherited from class java.awt.AWTEvent
consume, 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

CAMERA_FIRST

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

See Also:
Constant Field Values

CAMERA_LAST

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

See Also:
Constant Field Values

CAMERA_VIEW_CHANGED

public static final int CAMERA_VIEW_CHANGED
This event indicates that the camera's view transform changed.

See Also:
Constant Field Values

viewTransform

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

Constructor Detail

ZCameraEvent

public ZCameraEvent(ZCamera source,
                    int id,
                    java.awt.geom.AffineTransform viewTransform)
Deprecated. as of Jazz 1.1, use createViewChangedEvent() instead.

Constructs a ZCameraEvent object.

Parameters:
source - the ZCamera object that originated the event
id - an integer indicating the type of event
viewTransform - The original transform of the camera (for transform events)

ZCameraEvent

protected ZCameraEvent(ZCamera source,
                       int id,
                       java.awt.geom.AffineTransform viewTransform,
                       java.lang.Object dummy)
Method Detail

createViewChangedEvent

public static ZCameraEvent createViewChangedEvent(ZCamera source,
                                                  java.awt.geom.AffineTransform viewTransform)
Factory method to create a ZCameraEvent with a CAMERA_VIEW_CHANGED ID.

Parameters:
source - the ZCamera object that originated the event
viewTransform - The original transform of the camera (for transform events)

getCamera

public ZCamera getCamera()
Returns the originator of the event.

Returns:
the ZCamera object that originated the event

getOrigViewTransform

public java.awt.geom.AffineTransform getOrigViewTransform()
For view change events, this returns the value of the view transform before the view transform was changed.

Returns:
a clone of the original view 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 ZCameraLister class.

Specified by:
getListenerType in interface ZEvent

isConsumed

public boolean isConsumed()
Returns true if this event has previously 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
Overrides:
setSource in class java.awt.AWTEvent


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