Class Animation
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.
- Since:
- 3.2
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
getFinalState
(Animator animator, IFigure figure) Returns the final animation state for the given figure.static Object
getInitialState
(Animator animator, IFigure figure) Returns the initial animation state for the given animator and figure.static float
Returns the animation progress, where 0.0 < progress ≤ 1.0.static boolean
Returnstrue
if animation is in progress.static boolean
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.
-
Constructor Details
-
Animation
public Animation()
-
-
Method Details
-
getFinalState
Returns the final animation state for the given figure.- Parameters:
animator
- the animator for the figurefigure
- the figure being animated- Returns:
- the final state
- Since:
- 3.2
-
getInitialState
Returns the initial animation state for the given animator and figure. If no state was recorded,null
is returned.- Parameters:
animator
- the animator for the figurefigure
- the figure being animated- Returns:
- the initial state
- Since:
- 3.2
-
getProgress
public static float getProgress()Returns the animation progress, where 0.0 < progress ≤ 1.0.- Returns:
- the progress of the animation
- Since:
- 3.2
-
isAnimating
public static boolean isAnimating()Returnstrue
if animation is in progress.- Returns:
true
when animating- Since:
- 3.2
-
markBegin
public static boolean markBegin()Marks the beginning of the animation process. If the beginning has already been marked, this has no effect.- Returns:
- returns
true
if beginning was not previously marked - Since:
- 3.2
-
run
public static void run()Runs animation using the recommended duration: 250 milliseconds.- Since:
- 3.2
- See Also:
-
run
public static void run(int duration) Captures the final states for the animation and then plays the animation.- Parameters:
duration
- the length of animation in milliseconds- Since:
- 3.2
-