|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractAnimation | +--RotationBSTAnimation
The Animation object that defines the Rotation of a BSTTree. Two constructors exist, one setting the animator and animation color Schemes, one setting those to defaults.
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 int |
DEFAULT_STEP
The Default step size used in the animation (16). |
static int |
LEFT_ROTATION
Defines a left rotation. |
static int |
RIGHT_ROTATION
Defines a right rotation. |
Fields inherited from class AbstractAnimation |
DEFAULT_CONVERSION, listeners |
Fields inherited from interface Animation |
ANIMATION_MESSAGE, BEGIN, FINISH, PAUSE, PLAY, REDRAW, REWIND, STEP, STOP |
Constructor Summary | |
RotationBSTAnimation(BSTTree head,
BSTTree child,
int rotationOrientation)
The constructor which initiates the status and sets the color Schemes to default. |
|
RotationBSTAnimation(BSTTree head,
BSTTree child,
int rotationOrientation,
NodeSettings RootAnimationScheme,
NodeSettings ChildAnimationScheme,
NodeSettings DescendantAnimationScheme,
NodeSettings NodeOriginalScheme,
KeySettings KeyAnimationScheme,
KeySettings KeyOriginalScheme,
java.lang.String startingCmd,
int stepTime)
The constructor which initiates the status and prepares the color schemes. |
Method Summary | |
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)
Draws the animation of the next step, using the status of the animation (Animation.PLAY, Animation.PAUSE and so forth). |
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 |
getChildAnimationScheme()
Gets the NodeSettings for the child animation scheme for the rotation. |
NodeSettings |
getDescendantAnimationScheme()
Gets the NodeSettings for the descendant animation scheme for the rotation. |
KeySettings |
getKeyAnimationScheme()
Gets the KeySettings for the animation scheme for the key during rotation. |
KeySettings |
getKeyOriginalScheme()
Gets the KeySettings for the original scheme of the key. |
NodeSettings |
getNodeOriginalScheme()
Gets the NodeSettings for the original node scheme for the rotation. |
NodeSettings |
getRootAnimationScheme()
Gets the NodeSettings for the root animation scheme for the rotation. |
void |
setChildAnimationScheme(NodeSettings scheme)
Sets the NodeSettings for the child animation scheme for the rotation. |
void |
setDescendantAnimationScheme(NodeSettings scheme)
Sets the NodeSettings for the descendant animation scheme for the rotation. |
void |
setKeyAnimationScheme(KeySettings scheme)
Sets the KeySettings for the animation scheme for the key during rotation. |
void |
setKeyOriginalScheme(KeySettings scheme)
Sets the KeySettings for the original scheme of the key during rotation. |
void |
setNodeOriginalScheme(NodeSettings scheme)
Sets the NodeSettings for the original scheme for the rotation. |
void |
setRootAnimationScheme(NodeSettings scheme)
Sets the NodeSettings for the root animation scheme for the rotation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_STEP
public static final int RIGHT_ROTATION
public static final int LEFT_ROTATION
Constructor Detail |
public RotationBSTAnimation(BSTTree head, BSTTree child, int rotationOrientation)
head
- the BSTTree head of the rotation animation.child
- the BSTTree child of the rotation animation.rotationOrientation
- the rotation orientation defined (LEFT_ROTATION or RIGHT_ROTATION).public RotationBSTAnimation(BSTTree head, BSTTree child, int rotationOrientation, NodeSettings RootAnimationScheme, NodeSettings ChildAnimationScheme, NodeSettings DescendantAnimationScheme, NodeSettings NodeOriginalScheme, KeySettings KeyAnimationScheme, KeySettings KeyOriginalScheme, java.lang.String startingCmd, int stepTime)
head
- the BSTTree head of the rotation animation.child
- the BSTTree child of the rotation animation.rotationOrientation
- the rotation orientation defined (LEFT_ROTATION or RIGHT_ROTATION).RootAnimationScheme
- animation scheme for the root.ChildAnimationScheme
- animation scheme for the child.DescendantAnimationScheme
- animation scheme for the descendant.KeyAnimationScheme
- animation scheme for the key.KeyOriginalScheme
- original scheme for the key.startingCmd
- the Animation command that should start.stepTime
- the time for each step of the Animation. Sets the initial value.Method Detail |
public NodeSettings getRootAnimationScheme()
public NodeSettings getChildAnimationScheme()
public NodeSettings getDescendantAnimationScheme()
public NodeSettings getNodeOriginalScheme()
public KeySettings getKeyAnimationScheme()
public KeySettings getKeyOriginalScheme()
public void setRootAnimationScheme(NodeSettings scheme)
scheme
- NodeSettings for the root node.public void setChildAnimationScheme(NodeSettings scheme)
scheme
- NodeSettings for the child node.public void setDescendantAnimationScheme(NodeSettings scheme)
scheme
- NodeSettings for the descendant node.public void setNodeOriginalScheme(NodeSettings scheme)
scheme
- NodeSettings for the original scheme.public void setKeyAnimationScheme(KeySettings scheme)
scheme
- KeySettings for the animation of the key.public void setKeyOriginalScheme(KeySettings scheme)
scheme
- KeySettings for the original of the key.public void drawAnimation(java.awt.Graphics2D g2)
AnimationEvent
to all its listeners, indicating
any information that the listerners may wish to use. The starting status used for the animation is the one previously defined.
drawAnimation
in interface Animation
drawAnimation
in class AbstractAnimation
g2
- Graphics2D to which the graphics are drawn.public void drawAnimation(java.awt.Graphics2D g2, java.lang.String startingStatus)
rotateUpTreeType
- called when animation does completes
drawAnimation
in interface Animation
drawAnimation
in class AbstractAnimation
g2
- the graphics to which the animation step should be drawn.startingStatus
- sent to the animatorsprotected 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 |