edu.princeton.cs.algs4.growingtree.framework
Class AnimationEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.awt.AWTEvent
          extended by edu.princeton.cs.algs4.growingtree.framework.AnimationEvent
All Implemented Interfaces:
java.io.Serializable

public class AnimationEvent
extends java.awt.AWTEvent

A semantic event which indicates that an Animation-defined action occured. This high-level event is generated by an Animation Object when an action occurs (such as a change in progress). The event is passed to every AnimationListener object that registered to receive such events using the Animation's addAnimationListener method.

The object that implements the AnimationListener interface gets this AnimationEvent when the event occurs. The listener is therefore spared the details of processing individual selection, and can instead process a "meaningful" (semantic) event.

Version:
1.3 9/02/01
Author:
Corey Sanders
See Also:
AnimationListener, Animation, Serialized Form

Field Summary
static int ABSTRACT_ANIMATION
          ID for the AbstractAnimation event.
static int BALANCE_BST_ANIMATION
          ID for the BalanceBSTAnimation event.
static int DELETE_BST_ANIMATION
          ID for the DeleteBSTAnimation event.
static int DELETE_RED_BLACK_ANIMATION
          ID for the DeleteRedBlackAnimation event.
static int DISPLAY_CHANGE_ANIMATION
          ID for the DisplayChangeAnimation event.
static int INSERT_BST_ANIMATION
          ID for the InsertBSTAnimation event.
static int INSERT_RED_BLACK_ANIMATION
          ID for the InsertRedBlackAnimation event.
static int MOVING_NODES_ANIMATION
          ID for the MovingBSTAnimation event.
static int PARTITION_BST_ANIMATION
          ID for the PartitionBSTAnimation event.
static int ROTATION_BST_ANIMATION
          ID for the RotateBSTAnimation event.
static int ROTATION_DOUBLE_BST_ANIMATION
          ID for the RotateDoubleBSTAnimation event.
static int SEARCH_BST_ANIMATION
          ID for the SearchBSTAnimation event.
static int SELECTION_BST_ANIMATION
          ID for the SelectionBSTAnimation event.
static int TRAVERSE_BST_ANIMATION
          ID for the TraverseBSTAnimation event.
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, 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
 
Constructor Summary
AnimationEvent(java.lang.Object source, int id)
          Constructs an AnimationEvent object.
AnimationEvent(java.lang.Object source, int id, double progress)
          Constructs an AnimationEvent object.
AnimationEvent(java.lang.Object source, int id, java.lang.String status)
          Constructs an AnimationEvent object.
AnimationEvent(java.lang.Object source, int id, java.lang.String status, double progress)
          Constructs an AnimationEvent object with the command and progress.
AnimationEvent(java.lang.Object source, int id, java.lang.String status, java.lang.String animationDescription)
          Constructs an AnimationEvent object.
AnimationEvent(java.lang.Object source, int id, java.lang.String status, java.lang.String animationDescription, double progress)
          Constructs an AnimationEvent object with the command and progress.
 
Method Summary
 java.lang.String getAnimationDescription()
          Returns the description String associated with this AnimationEvent.
 double getProgress()
          Returns the double progress associated with this AnimationEvent.
 java.lang.String getStatus()
          Returns the status String associated with this AnimationEvent.
 
Methods inherited from class java.awt.AWTEvent
getID, paramString, setSource, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ABSTRACT_ANIMATION

public static final int ABSTRACT_ANIMATION
ID for the AbstractAnimation event.

See Also:
Constant Field Values

INSERT_BST_ANIMATION

public static final int INSERT_BST_ANIMATION
ID for the InsertBSTAnimation event.

See Also:
Constant Field Values

INSERT_RED_BLACK_ANIMATION

public static final int INSERT_RED_BLACK_ANIMATION
ID for the InsertRedBlackAnimation event.

See Also:
Constant Field Values

DELETE_BST_ANIMATION

public static final int DELETE_BST_ANIMATION
ID for the DeleteBSTAnimation event.

See Also:
Constant Field Values

DELETE_RED_BLACK_ANIMATION

public static final int DELETE_RED_BLACK_ANIMATION
ID for the DeleteRedBlackAnimation event.

See Also:
Constant Field Values

ROTATION_BST_ANIMATION

public static final int ROTATION_BST_ANIMATION
ID for the RotateBSTAnimation event.

See Also:
Constant Field Values

ROTATION_DOUBLE_BST_ANIMATION

public static final int ROTATION_DOUBLE_BST_ANIMATION
ID for the RotateDoubleBSTAnimation event.

See Also:
Constant Field Values

MOVING_NODES_ANIMATION

public static final int MOVING_NODES_ANIMATION
ID for the MovingBSTAnimation event.

See Also:
Constant Field Values

SEARCH_BST_ANIMATION

public static final int SEARCH_BST_ANIMATION
ID for the SearchBSTAnimation event.

See Also:
Constant Field Values

SELECTION_BST_ANIMATION

public static final int SELECTION_BST_ANIMATION
ID for the SelectionBSTAnimation event.

See Also:
Constant Field Values

PARTITION_BST_ANIMATION

public static final int PARTITION_BST_ANIMATION
ID for the PartitionBSTAnimation event.

See Also:
Constant Field Values

BALANCE_BST_ANIMATION

public static final int BALANCE_BST_ANIMATION
ID for the BalanceBSTAnimation event.

See Also:
Constant Field Values

TRAVERSE_BST_ANIMATION

public static final int TRAVERSE_BST_ANIMATION
ID for the TraverseBSTAnimation event.

See Also:
Constant Field Values

DISPLAY_CHANGE_ANIMATION

public static final int DISPLAY_CHANGE_ANIMATION
ID for the DisplayChangeAnimation event.

See Also:
Constant Field Values
Constructor Detail

AnimationEvent

public AnimationEvent(java.lang.Object source,
                      int id)
Constructs an AnimationEvent object.

Parameters:
source - the object that originated the event
id - an integer that identifies the event

AnimationEvent

public AnimationEvent(java.lang.Object source,
                      int id,
                      double progress)
Constructs an AnimationEvent object.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
progress - double to indicate the progress that the animation starts on.

AnimationEvent

public AnimationEvent(java.lang.Object source,
                      int id,
                      java.lang.String status)
Constructs an AnimationEvent object.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
status - a string describing the status of teh current AnimationEvent.

AnimationEvent

public AnimationEvent(java.lang.Object source,
                      int id,
                      java.lang.String status,
                      java.lang.String animationDescription)
Constructs an AnimationEvent object.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
status - a string describing the status of teh current AnimationEvent.
animationDescription - a string that may specify a description (possibly one of several) associated with the event

AnimationEvent

public AnimationEvent(java.lang.Object source,
                      int id,
                      java.lang.String status,
                      double progress)
Constructs an AnimationEvent object with the command and progress.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
status - a string describing the status of teh current AnimationEvent.
progress - double to indicate the progress that the animation starts on.

AnimationEvent

public AnimationEvent(java.lang.Object source,
                      int id,
                      java.lang.String status,
                      java.lang.String animationDescription,
                      double progress)
Constructs an AnimationEvent object with the command and progress.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
status - a string describing the status of teh current AnimationEvent.
animationDescription - a string that may specify a description (possibly one of several) associated with the event
progress - double to indicate the progress that the animation starts on.
Method Detail

getAnimationDescription

public java.lang.String getAnimationDescription()
Returns the description String associated with this AnimationEvent.

Returns:
the string identifying the description for this event

getStatus

public java.lang.String getStatus()
Returns the status String associated with this AnimationEvent.

Returns:
the string identifying the status for this event

getProgress

public double getProgress()
Returns the double progress associated with this AnimationEvent.

Returns:
the double proegress for this event