|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractAnimation | +--MovingBSTTreeAnimation
The Animation object that defines the Moving of a MovingBSTTree. Two constructors exist, one setting the animator and animation color Schemes. This animation is the core of many other animations that involve moving (Rotation).
The object restores all values changed in the given nodes, however, if the object is never allowed to finish, the restoring of values becomes impossible. On any exception occuring elsewhere, the object may not restore the conditions correctly.
Field Summary |
Fields inherited from class AbstractAnimation |
DEFAULT_CONVERSION, DEFAULT_STEP, listeners |
Fields inherited from interface Animation |
ANIMATION_MESSAGE, BEGIN, FINISH, PAUSE, PLAY, REDRAW, REWIND, STEP, STOP |
Constructor Summary | |
MovingBSTTreeAnimation()
The constructor which initiates the status as Animation.PLAY , default step size,
the default NodeAnimationScheme and KeyAnimationScheme. |
|
MovingBSTTreeAnimation(NodeSettings NodeAnimationScheme,
KeySettings KeyAnimationScheme)
The constructor which initiates the status as Animation.PLAY , default step size,
the given NodeAnimationScheme and KeyAnimationScheme. |
|
MovingBSTTreeAnimation(NodeSettings NodeAnimationScheme,
KeySettings KeyAnimationScheme,
java.lang.String startingCmd,
int stepTime)
The constructor which initiates the status and prepares the color Schemes. |
Method Summary | |
void |
add(MovingBSTTree movingNode,
BSTTree node)
Adds the movingBSTTree along with the BSTTree node as a pair. |
protected void |
animationAction(java.lang.String cmd,
java.lang.String description)
Calls all of the listeners of the current Animation and passed information regarding the progress and status of the current Animation. |
void |
drawAnimation(java.awt.Graphics2D g2,
java.lang.String startingStatus)
Draws the animation of the next step, using the status of the animation (Animation.PLAY, Animation.PAUSE and so forth). |
NodeSettings |
getAnimationScheme()
Gets the NodeSettings for the animation of the moving node. |
MovingBSTTree |
getFirstMovingNode()
Gets the first moving node in the list. |
KeySettings |
getKeyAnimationScheme()
Gets the KeySettings for the animation key for the moving node. |
MovingBSTTree |
getMovingNode(BSTTree node)
Gets the moving node within the Animation that imitates the passed BSTTree node. |
java.util.LinkedList |
getMovingNodes()
Gets the moving nodes used in the Animation . |
NodeSettings |
getNodeAnimationScheme()
Gets the node Animationg scheme for each moving node. |
java.util.LinkedList |
getNodes()
Gets the BSTTree nodes used in the Animation . |
boolean |
isEmpty()
Returns true if the moving node list is empty. |
void |
makeAnimation(java.awt.Graphics2D g2,
java.lang.String startingStatus)
Makes the animation of the next step, using the status of the animation (Animation.PLAY, Animation.PAUSE and so forth). |
void |
setAnimationScheme(NodeSettings nodeScheme,
KeySettings keyScheme)
Sets the animation scheme for each moving node. |
void |
setKeyAnimationScheme(KeySettings scheme)
Sets the KeySettings for the animation key for the moving node. |
void |
setNodeAnimationScheme(NodeSettings scheme)
Sets the NodeSettings for the animation of the moving node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MovingBSTTreeAnimation()
Animation.PLAY
, default step size,
the default NodeAnimationScheme and KeyAnimationScheme.
public MovingBSTTreeAnimation(NodeSettings NodeAnimationScheme, KeySettings KeyAnimationScheme)
Animation.PLAY
, default step size,
the given NodeAnimationScheme and KeyAnimationScheme.
NodeAnimationScheme
- the NodeSettings which the nodes uses during animation.KeyAnimationScheme
- the KeySettings which the key in each moving node is drawn.public MovingBSTTreeAnimation(NodeSettings NodeAnimationScheme, KeySettings KeyAnimationScheme, java.lang.String startingCmd, int stepTime)
NodeAnimationScheme
- the NodeSettings which the nodes uses during animation.KeyAnimationScheme
- the KeySettings which the key in each moving node is drawn.startingCmd
- the Animation command that this should start.stepTime
- the time for each step of the Animation. Sets the initial value.Method Detail |
public java.util.LinkedList getMovingNodes()
Animation
. The return is the clone
of the LinkedList used within the class. Cloning of a LinkedList
is a shallow
copy.
return LinkedList
representing the movingBSTTrees.
public NodeSettings getNodeAnimationScheme()
public java.util.LinkedList getNodes()
Animation
. The return is the clone
of the LinkedList used within the class. Cloning of a LinkedList
is a shallow
copy.
return LinkedList
representing the BSTTrees that the movingBSTTrees imitate.
public MovingBSTTree getMovingNode(BSTTree node)
node
- BSTTree node which the returning MovingBSTTree node imitates.
MovingBSTTree
which imitates the given node.public MovingBSTTree getFirstMovingNode()
MovingBSTTree
in the animation.public boolean isEmpty()
public NodeSettings getAnimationScheme()
public KeySettings getKeyAnimationScheme()
public void setAnimationScheme(NodeSettings nodeScheme, KeySettings keyScheme)
nodeScheme
- the NodeSettings for the animation of the moving node.keyScheme
- the KeySettings for the animationg of the key within the moving node.public void add(MovingBSTTree movingNode, BSTTree node)
movingNode
- MovingBSTTree that is added to the animation.node
- BSTTree that is added to the animation.public void setNodeAnimationScheme(NodeSettings scheme)
scheme
- NodeSettings for the node animating.public void setKeyAnimationScheme(KeySettings scheme)
scheme
- KeySettings for the key of the node animating.public void drawAnimation(java.awt.Graphics2D g2, java.lang.String startingStatus)
drawAnimation
in interface Animation
drawAnimation
in class AbstractAnimation
g2
- the graphics to which the animation step should be drawn.startingStatus
- the starting status used if necessary.public void makeAnimation(java.awt.Graphics2D g2, java.lang.String startingStatus)
g2
- the graphics to which the animation step should be drawn.startingStatus
- the starting status used if necessary.protected void animationAction(java.lang.String cmd, java.lang.String description)
animationEventPerformed
method is called.
animationAction
in class AbstractAnimation
cmd
- String Animation command passed instead of the current Status.description
- String description for messages.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |