edu.princeton.cs.algs4.growingtree.framework
Class SwapNodesBSTAnimation<P extends NodeProperties>
java.lang.Object
edu.princeton.cs.algs4.growingtree.framework.AbstractAnimation
edu.princeton.cs.algs4.growingtree.framework.SelectionBSTAnimation<P>
edu.princeton.cs.algs4.growingtree.framework.SwapNodesBSTAnimation<P>
- All Implemented Interfaces:
- Animation
public class SwapNodesBSTAnimation<P extends NodeProperties>
- extends SelectionBSTAnimation<P>
Method Summary |
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). |
Methods inherited from class edu.princeton.cs.algs4.growingtree.framework.SelectionBSTAnimation |
add, getAnimationSchemeLeft, getAnimationSchemeRight, getAnimatorScheme, getElementCount, getKeyAnimatorScheme, setAnimationSchemeLeft, setAnimationSchemeRight, setAnimatorScheme, setElementCount, setKeyAnimatorScheme |
Methods inherited from class edu.princeton.cs.algs4.growingtree.framework.AbstractAnimation |
addAnimationListener, addDescription, drawAnimation, getDescription, getListeners, getStatus, getStep, getStepTime, removeAnimationListener, setStatus, setStep, setStepTime |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SwapNodesBSTAnimation
public SwapNodesBSTAnimation(int elementCount,
NodeSettings AnimationSchemeLeft,
NodeSettings AnimationSchemeRight,
NodeSettings AnimatorScheme,
KeySettings KeyAnimatorScheme,
java.lang.String startingCmd,
int stepTime)
SwapNodesBSTAnimation
public SwapNodesBSTAnimation(int elementCount)
drawAnimation
public void drawAnimation(java.awt.Graphics2D g2,
java.lang.String startingStatus)
- Description copied from class:
SelectionBSTAnimation
- Draws the animation of the next step, using the status of the animation (Animation.PLAY, Animation.PAUSE and so forth).
After completing the drawing, the Animation sends an AnimationEvent to all its listeners, indicating
any information that the listerners may wish to use.
- Specified by:
drawAnimation
in interface Animation
- Overrides:
drawAnimation
in class SelectionBSTAnimation<P extends NodeProperties>
- Parameters:
g2
- the graphics to which the animation step should be drawn.startingStatus
- the status used as the starting command of animation, if needed.