|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractAnimation | +--SelectionBSTAnimation
The Animation object that defines a selection within a BSTTree.
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 | |
static float |
ENLARGE_SIZE
|
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 | |
SelectionBSTAnimation(int elementCount)
The constructor which initiates the status and sets the color schemes to null. |
|
SelectionBSTAnimation(int elementCount,
NodeSettings AnimationSchemeLeft,
NodeSettings AnimationSchemeRight,
NodeSettings AnimatorScheme,
KeySettings KeyAnimatorScheme,
java.lang.String startingCmd,
int stepTime)
The constructor which initiates the status and prepares the colorSchemes. |
Method Summary | |
void |
add(BSTTree node)
Add a step to the Search Animation. |
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 |
getAnimationSchemeLeft()
Gets the NodeSettings for the left animation scheme for the search. |
NodeSettings |
getAnimationSchemeRight()
Gets the NodeSettings for the right animation scheme for the search. |
NodeSettings |
getAnimatorScheme()
Gets the NodeSettings for the animator scheme for the search. |
int |
getElementCount()
Gets the element count (kth element being partition). |
KeySettings |
getKeyAnimatorScheme()
Sets the KeySettings for the animator scheme key for the search. |
void |
setAnimationSchemeLeft(NodeSettings scheme)
Sets the NodeSettings for the left animation scheme for the insertion. |
void |
setAnimationSchemeRight(NodeSettings scheme)
Sets the NodeSettings for the right animation scheme for the insertion. |
void |
setAnimatorScheme(NodeSettings scheme)
Sets the NodeSettings for the animator scheme for the insertion. |
void |
setElementCount(int elementCount)
Sets the element count (kth element being partition). |
void |
setKeyAnimatorScheme(KeySettings scheme)
Sets the KeySettings for the animator scheme key for the insertion. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final float ENLARGE_SIZE
Constructor Detail |
public SelectionBSTAnimation(int elementCount, NodeSettings AnimationSchemeLeft, NodeSettings AnimationSchemeRight, NodeSettings AnimatorScheme, KeySettings KeyAnimatorScheme, java.lang.String startingCmd, int stepTime)
elementCount
- the integer count of the kth element being partitioned.AnimationSchemeLeft
- the NodeSettings
associated with a color scheme according to NodeSettings for the left Animation.AnimationSchemeRight
- the NodeSettings
associated with a color scheme according to NodeSettings for the right Animation.KeyAnimatorScheme
- the KeySettings
associated with a color scheme according to KeySettings.startingCmd
- the Animation command that this should start.stepTime
- the time for each step of the Animation. Sets the initial value.public SelectionBSTAnimation(int elementCount)
elementCount
- the integer count of the kth element being partitioned.Method Detail |
public int getElementCount()
public NodeSettings getAnimationSchemeLeft()
public NodeSettings getAnimationSchemeRight()
public NodeSettings getAnimatorScheme()
public KeySettings getKeyAnimatorScheme()
public void setElementCount(int elementCount)
elementCount
- count of kth element being partitioned.public void setAnimationSchemeLeft(NodeSettings scheme)
scheme
- NodeSettings for the node after the animated node passes it to the left.public void setAnimationSchemeRight(NodeSettings scheme)
scheme
- NodeSettings for the node after the animated node passes it to the right.public void setAnimatorScheme(NodeSettings scheme)
scheme
- NodeSettings for the node animating.public void setKeyAnimatorScheme(KeySettings scheme)
scheme
- KeySettings for the key of the node animating.public void add(BSTTree node)
node
- the color scheme is changed when the step is completed.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 status used as the starting command of animation, if needed.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 |