|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractAnimation | +--DisplayChangeAnimation
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). |
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 | |
DisplayChangeAnimation(BSTTreeHead head,
int displayChange)
The constructor which initiates the status and sets the color Schemes to default. |
|
DisplayChangeAnimation(BSTTreeHead head,
int displayChange,
NodeSettings NodeOriginalScheme,
KeySettings KeyOriginalScheme,
java.lang.String startingCmd,
int stepTime)
The constructor which initiates the status and prepares the color schemes. |
Method Summary | |
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). |
int |
getDisplayChange()
Gets the displayChange for the display change animation. |
KeySettings |
getKeyOriginalScheme()
Gets the KeySettings for the original scheme of the key. |
MovingBSTTreeAnimation |
getMovingTreeNodes()
Gets the MovingBSTTreeAnimation for the tree whose display is changing. |
NodeSettings |
getNodeOriginalScheme()
Gets the NodeSettings for the original node scheme for the rotation. |
void |
setDisplayChange(int displayChange)
Sets the displayChange for the animation. |
void |
setKeyOriginalScheme(KeySettings scheme)
Sets the KeySettings for the original scheme of the key during rotation. |
void |
setMovingTreeNodes(MovingBSTTreeAnimation movingTreeNodes)
Sets the MovingBSTTreeAnimation for the tree whose display is changing. |
void |
setNodeOriginalScheme(NodeSettings scheme)
Sets the NodeSettings for the original 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
Constructor Detail |
public DisplayChangeAnimation(BSTTreeHead head, int displayChange)
head
- the BSTTreeHead head of the tree whose display is changing.displayChange
- the new kind of display, according to BSTTreeHead.SECT_DISPLAY or BSTTreeHead.BINARY_DISPLAYpublic DisplayChangeAnimation(BSTTreeHead head, int displayChange, NodeSettings NodeOriginalScheme, KeySettings KeyOriginalScheme, java.lang.String startingCmd, int stepTime)
head
- the BSTTreeHead head of the tree whose display is changing.displayChange
- the new kind of display, according to BSTTreeHead.SECT_DISPLAY or BSTTreeHead.BINARY_DISPLAYKeyOriginalScheme
- 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 int getDisplayChange()
public MovingBSTTreeAnimation getMovingTreeNodes()
public NodeSettings getNodeOriginalScheme()
public KeySettings getKeyOriginalScheme()
public void setDisplayChange(int displayChange)
displayChange
- the int defined within BSTTreeHead (SECT_DISPLAY or BINARY_DISPLAY).public void setMovingTreeNodes(MovingBSTTreeAnimation movingTreeNodes)
movingTreeNodes
- MovingBSTTreeAnimation for the entire tree display change.public void setNodeOriginalScheme(NodeSettings scheme)
scheme
- NodeSettings for the original scheme.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 animators
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |