Package org.eclipse.draw2d
Class LayoutAnimator
java.lang.Object
org.eclipse.draw2d.Animator
org.eclipse.draw2d.LayoutAnimator
- All Implemented Interfaces:
LayoutListener
Animates the layout of a figure's children. The animator will capture the
effects of a layout manager, and then play back the placement of children
using linear interpolation for each child's start and end locations.
To use an animator, hook it as a layout listener for the figure whose layout
is to be animated, by calling
IFigure.addLayoutListener(LayoutListener)
. It is not necessary to
have an animator for every figure in a composition that is undergoing
animation. For example, if a figure without an animator moves during the
animation, it will continue to move and layout its children normally during
each step of the animation.
Animator must be used in conjunction with layouts. If figures are placed
manually using setBounds()
, the animator may not be able to
track and playback the changes that occur.
- Since:
- 3.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.draw2d.LayoutListener
LayoutListener.Stub
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
getCurrentState
(IFigure container) Returns an object encapsulating the placement of children in a container.static LayoutAnimator
Returns the default instance.final void
invalidate
(IFigure container) Hooks invalidation in case animation is in progress.final boolean
Hooks layout in case animation is in progress.protected boolean
Plays back the animated layout.final void
postLayout
(IFigure container) Hooks post layout in case animation is in progress.final void
This callback is unused.final void
setConstraint
(IFigure child, Object constraint) This callback is unused.Methods inherited from class org.eclipse.draw2d.Animator
capture, init, playbackStarting, recordFinalState, recordInitialState, tearDown
-
Constructor Details
-
LayoutAnimator
protected LayoutAnimator()Constructs a new Animator. The default instance (getDefault()
) can be used on all figures being animated.- Since:
- 3.2
-
-
Method Details
-
getCurrentState
Returns an object encapsulating the placement of children in a container. This method is called to capture both the initial and final states.- Specified by:
getCurrentState
in classAnimator
- Parameters:
container
- the container figure- Returns:
- the current state
- Since:
- 3.2
-
getDefault
Returns the default instance.- Returns:
- the default instance
- Since:
- 3.2
-
invalidate
Hooks invalidation in case animation is in progress.- Specified by:
invalidate
in interfaceLayoutListener
- Parameters:
container
- the invalidated Figure- See Also:
-
layout
Hooks layout in case animation is in progress.- Specified by:
layout
in interfaceLayoutListener
- Parameters:
container
- the figure incurring a layout- Returns:
true
if the layout has been intercepted by the listener- See Also:
-
playback
Plays back the animated layout. -
postLayout
Hooks post layout in case animation is in progress.- Specified by:
postLayout
in interfaceLayoutListener
- Parameters:
container
- the figure incurring a layout- See Also:
-
remove
This callback is unused. Reserved for possible future use.- Specified by:
remove
in interfaceLayoutListener
- Parameters:
child
- the child being removed- See Also:
-
setConstraint
This callback is unused. Reserved for possible future use.- Specified by:
setConstraint
in interfaceLayoutListener
- Parameters:
child
- the child being updatedconstraint
- the child's new constraint- See Also:
-