edu.princeton.cs.algs4.growingtree.framework
Interface AnimatingTreeHead<P extends NodeProperties>

All Superinterfaces:
DrawingTreeHead<P>, Tree<P>, TreeHead<P>
All Known Implementing Classes:
GrowingTreeHead

public interface AnimatingTreeHead<P extends NodeProperties>
extends DrawingTreeHead<P>

The AnimatingTreeHead interface extends DrawingTreeHead.

The interface simply defines numerous methods which allow for the animating of the Tree onto a given Graphics2D. The interface also defines many mutator and accesor methods for information concerning the animating of the AnimatingTree

Version:
1.2 8/02/01
Author:
Corey Sanders
See Also:
DrawingTreeHead, TreeHead, Tree, AnimatingTree

Field Summary
 
Fields inherited from interface edu.princeton.cs.algs4.growingtree.framework.TreeHead
BALANCE_NODE, CHANGE_DISPLAY, FREEZE, INORDER_TRAVERSAL, INSERT_NODE, LEVELORDER_TRAVERSAL, PARTITION_NODE, POSTORDER_TRAVERSAL, PREORDER_TRAVERSAL, REMOVE_NODE, ROTATE_TO_TOP_NODE, ROTATE_UP, ROTATE_UP_DOUBLE, SEARCH, SELECT, SPLAY_NODE, SWAP, TRAVERSE
 
Method Summary
 void addTreeAnimator(Animation a)
          Adds the Animation to the list of Animations for the Head.
 void AnimateTree(java.awt.Graphics2D g2)
          Animates the entire AnimatingTree.
 int getTreeAnimationStepSize()
          Gets the step size of the Animations of the tree.
 Animation getTreeAnimator()
          Gets the first Animation in the list of Animations for the Head and null if no Animations are present.
 java.lang.String getTreeStatus()
          Gets the Tree's status, using the String status of Animation.
 java.lang.String getTreeStatusMessage()
          Makes a new tree message.
 boolean isJumpStep()
          Gets the JumpStep of the current tree.
 boolean isStepPause()
          Gets the StepPause of the current tree.
 boolean isTreeAnimating()
          Returns true if the current AnimatingTreeHead is animating (whether the animating list is empty.
 void pause()
          Sets the status of the entire AnimatingTree to pause.
 void play()
          Sets the status of the entire AnimatingTree to play.
 void removeTreeAnimation()
          Quickly removes all Animations within the Tree.
 void rewind()
          Sets the status of the entire AnimatingTree to rewind.
 void setJumpStep(boolean b)
          Sets the JumpStep of the current tree to the boolean value.
 void setStepPause(boolean b)
          Sets the StepPause of the current tree to the boolean value.
 void setTreeAnimationsStepSize(int t)
          Sets the step size of the Animations of the tree.
 void setTreeStatus(java.lang.String status)
          Sets the Tree's status, using the String status of Animation.
 void stop()
          Sets the status of the entire AnimatingTree to stop.
 
Methods inherited from interface edu.princeton.cs.algs4.growingtree.framework.DrawingTreeHead
DrawTree, findNode, getDrawingKeySettings, getDrawingNodeSettings, getNodeHeight, getNodeWidth, getScreenBounds, MakeTree, setScreenBounds, setTreeSettings
 
Methods inherited from interface edu.princeton.cs.algs4.growingtree.framework.TreeHead
addTreeMessageListener, balance, balanceTree, clear, fixLevel, getChild, getTreeLevel, insert, isTreeEmpty, partition, remove, remove, removeTreeMessageListener, resetTreeLevel, search, select, setChild, size, waitingAction
 
Methods inherited from interface edu.princeton.cs.algs4.growingtree.framework.Tree
getChildren, getKey, getLevel, getParentTree, getValue, isEmpty
 

Method Detail

addTreeAnimator

void addTreeAnimator(Animation a)
Adds the Animation to the list of Animations for the Head. The method does not add the tree as a listener to the Animation. That must be accomplished by the client.

Parameters:
a - Animation added to the Animation list.

getTreeAnimator

Animation getTreeAnimator()
Gets the first Animation in the list of Animations for the Head and null if no Animations are present.

Returns:
first Animation in the Animation list.

isTreeAnimating

boolean isTreeAnimating()
Returns true if the current AnimatingTreeHead is animating (whether the animating list is empty. This determines if the entire tree is animating.

Returns:
true if the current tree is animating and not empty.

AnimateTree

void AnimateTree(java.awt.Graphics2D g2)
Animates the entire AnimatingTree. The animation is drawn to the Graphics2D passed. This method is called repeatedly for each Animation within the list.

Parameters:
g2 - Graphics2D to which the Animations are drawn.

removeTreeAnimation

void removeTreeAnimation()
Quickly removes all Animations within the Tree. The method sets the Status of all the Animations to Animation.FINISH so that al listeners of the Animations will receive the AnimationEvent.


setJumpStep

void setJumpStep(boolean b)
Sets the JumpStep of the current tree to the boolean value. The jumpStep determines whether the Animation skips through an entire step at each AnimateTree call.

Parameters:
b - sets the jumpStep to the value b.

isJumpStep

boolean isJumpStep()
Gets the JumpStep of the current tree.

Returns:
true if the tree is jumpSteping.

setStepPause

void setStepPause(boolean b)
Sets the StepPause of the current tree to the boolean value. The stepPause determines whether the Animation pauses after each step of the Animation completes.

Parameters:
b - sets the stepPause to the value b.

isStepPause

boolean isStepPause()
Gets the StepPause of the current tree.

Returns:
true if the tree is pausing at the completion of each step.

play

void play()
Sets the status of the entire AnimatingTree to play.


stop

void stop()
Sets the status of the entire AnimatingTree to stop.


rewind

void rewind()
Sets the status of the entire AnimatingTree to rewind.


pause

void pause()
Sets the status of the entire AnimatingTree to pause.


setTreeAnimationsStepSize

void setTreeAnimationsStepSize(int t)
Sets the step size of the Animations of the tree. The integer value is passed to every Animation's setStepSize method.

Parameters:
t - integer step size setting.

getTreeAnimationStepSize

int getTreeAnimationStepSize()
Gets the step size of the Animations of the tree.

Returns:
integer step size of the tree.

getTreeStatus

java.lang.String getTreeStatus()
Gets the Tree's status, using the String status of Animation.

Returns:
String status of the Tree, representing the Animation status.

setTreeStatus

void setTreeStatus(java.lang.String status)
Sets the Tree's status, using the String status of Animation.

Parameters:
status - String status of the Tree, representing the Animation status.

getTreeStatusMessage

java.lang.String getTreeStatusMessage()
Makes a new tree message. The information presented usually includes :