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

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

public class TreeMessageEvent
extends java.awt.AWTEvent

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

The object that implements the TreeMessageListener interface gets this TreeMessageEvent 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/15/01
Author:
Corey Sanders
See Also:
Serialized Form

Field Summary
static int ANIMATION
          ID for the Animation event.
static java.lang.String ANIMATION_CHANGE
          command passed for animation change.
static java.lang.String ANIMATION_STEP_CHANGE
          command passed for animation step change.
static java.lang.String COLOR_CHANGE
          command passed for a change in color choice.
static java.lang.String COLOR_PANEL
          command passed for color panel request.
static java.lang.String ERROR_MESSAGE
          command passed for an error message.
static java.lang.String KEY_TYPE_CHANGE
          command passed for change of key type.
static int PANEL
          ID for the Panel event.
static java.lang.String SET_INPUT_OPTIONS
          command passed for set input options request.
static java.lang.String SET_PRESET_COLOR_OPTIONS
          command passed for set color settings request.
static java.lang.String STATUS_MESSAGE
          command passed for status message.
static int TREE
          ID for the Tree 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
TreeMessageEvent(java.lang.Object source, int id, java.lang.String msg)
          Constructs a TreeMessageEvent object.
TreeMessageEvent(java.lang.Object source, int id, java.lang.String msg, java.lang.Object msgObject)
          Constructs a TreeMessageEvent object with a message object.
 
Method Summary
 java.lang.String getMessage()
          Returns the description String associated with this AnimationEvent.
 java.lang.Object getMessageObject()
          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

TREE

public static final int TREE
ID for the Tree event.

See Also:
Constant Field Values

PANEL

public static final int PANEL
ID for the Panel event.

See Also:
Constant Field Values

ANIMATION

public static final int ANIMATION
ID for the Animation event.

See Also:
Constant Field Values

KEY_TYPE_CHANGE

public static final java.lang.String KEY_TYPE_CHANGE
command passed for change of key type.

See Also:
Constant Field Values

ERROR_MESSAGE

public static final java.lang.String ERROR_MESSAGE
command passed for an error message.

See Also:
Constant Field Values

COLOR_PANEL

public static final java.lang.String COLOR_PANEL
command passed for color panel request.

See Also:
Constant Field Values

ANIMATION_CHANGE

public static final java.lang.String ANIMATION_CHANGE
command passed for animation change.

See Also:
Constant Field Values

ANIMATION_STEP_CHANGE

public static final java.lang.String ANIMATION_STEP_CHANGE
command passed for animation step change.

See Also:
Constant Field Values

STATUS_MESSAGE

public static final java.lang.String STATUS_MESSAGE
command passed for status message.

See Also:
Constant Field Values

SET_INPUT_OPTIONS

public static final java.lang.String SET_INPUT_OPTIONS
command passed for set input options request.

See Also:
Constant Field Values

SET_PRESET_COLOR_OPTIONS

public static final java.lang.String SET_PRESET_COLOR_OPTIONS
command passed for set color settings request.

See Also:
Constant Field Values

COLOR_CHANGE

public static final java.lang.String COLOR_CHANGE
command passed for a change in color choice.

See Also:
Constant Field Values
Constructor Detail

TreeMessageEvent

public TreeMessageEvent(java.lang.Object source,
                        int id,
                        java.lang.String msg)
Constructs a TreeMessageEvent object.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
msg - String message.

TreeMessageEvent

public TreeMessageEvent(java.lang.Object source,
                        int id,
                        java.lang.String msg,
                        java.lang.Object msgObject)
Constructs a TreeMessageEvent object with a message object.

Parameters:
source - the object that originated the event
id - an integer that identifies the event
msg - String message.
msgObject - object that refers to the String message.
Method Detail

getMessage

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

Returns:
the string identifying the description for this event

getMessageObject

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

Returns:
the string identifying the status for this event