Package org.eclipse.draw2d
Class Animator
java.lang.Object
org.eclipse.draw2d.Animator
- Direct Known Subclasses:
LayoutAnimator
,RoutingAnimator
Animates some aspect of a figure. Each animator will capture some of the
effects of validation of the figures.
Animators must be hooked to figure in special ways. Refer to each implementation for the specific requirements. Animators are generally stateless, which allows them to be shared and prevents them from leaking memory.
- Since:
- 3.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Captures the final state of the given figure.protected abstract Object
getCurrentState
(IFigure figure) Returns an object encapsulating the current state of the figure.void
Sets up the animator for the given figure to be animated.protected boolean
Plays back the animation for the given figure and returnstrue
if successful.void
playbackStarting
(IFigure figure) Sent as playback is starting for a given figure.protected void
recordFinalState
(IFigure figure) Records the final state information for a figure.protected void
recordInitialState
(IFigure figure) Records initial state information for the given figure.void
Reverts any temporary changes made to the figure during animation.
-
Method Details
-
capture
Captures the final state of the given figure. This method is called once after the update manager has completed validation of all invalid figures.- Parameters:
figure
- the container- Since:
- 3.2
-
getCurrentState
Returns an object encapsulating the current state of the figure. This method is called to capture both the initial and final states.- Parameters:
figure
- the figure- Returns:
- the current state
- Since:
- 3.2
-
playback
Plays back the animation for the given figure and returnstrue
if successful. This method does nothing by default and returnfalse
.- Parameters:
figure
- the figure being animated- Returns:
true
if playback was successful- Since:
- 3.2
-
playbackStarting
Sent as playback is starting for a given figure.- Parameters:
figure
- the figure- Since:
- 3.2
-
recordFinalState
Records the final state information for a figure.- Parameters:
figure
- the figure- Since:
- 3.2
-
recordInitialState
Records initial state information for the given figure.- Parameters:
figure
- the container.- Since:
- 3.2
-
init
Sets up the animator for the given figure to be animated. This method is called exactly once time prior to any layouts happening. The animator can capture the figure's current state, and set any animation-time settings for the figure. Changes made to the figure should be reverted intearDown(IFigure)
.- Parameters:
figure
- the animated figure- Since:
- 3.2
-
tearDown
Reverts any temporary changes made to the figure during animation. This method is called exactly once after all animation has been completed. Subclasses should extend this method to revert any changes.- Parameters:
figure
- the animated figure- Since:
- 3.2
- See Also:
-