public class Animation
extends java.lang.Object
An animator is usually stateless and represents an specific technique. Any state information is stored by the Animation utility. Therefore, one instance can be used with multiple figures. Animators hook into the validation mechanism for figures and connections. These hooks are used to capture the states, and to intercept the typical layout process to insert the interpolated state.
To indicate that animation is desired, clients must call markBegin()
prior to invalidating any figures that are to be included in the animation.
After this method is called, changes are made, and run()
is invoked.
The run method will force a validation pass to capture the final states, and
then commence the animation. The animation is synchronous and the method does
not return until the animation has completed.
LayoutAnimator
Constructor and Description |
---|
Animation() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
getFinalState(Animator animator,
IFigure figure)
Returns the final animation state for the given figure.
|
static java.lang.Object |
getInitialState(Animator animator,
IFigure figure)
Returns the initial animation state for the given animator and figure.
|
static float |
getProgress()
Returns the animation progress, where 0.0 < progress ≤ 1.0.
|
static boolean |
isAnimating()
Returns
true if animation is in progress. |
static boolean |
markBegin()
Marks the beginning of the animation process.
|
static void |
run()
Runs animation using the recommended duration: 250 milliseconds.
|
static void |
run(int duration)
Captures the final states for the animation and then plays the animation.
|
public static java.lang.Object getFinalState(Animator animator, IFigure figure)
animator
- the animator for the figurefigure
- the figure being animatedpublic static java.lang.Object getInitialState(Animator animator, IFigure figure)
null
is returned.animator
- the animator for the figurefigure
- the figure being animatedpublic static float getProgress()
public static boolean isAnimating()
true
if animation is in progress.true
when animatingpublic static boolean markBegin()
true
if beginning was not previously markedpublic static void run()
run(int)
public static void run(int duration)
duration
- the length of animation in millisecondsCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.