Eclipse Draw2d 3.3

## org.eclipse.draw2d
Class LayoutAnimator

    java.lang.Object
      org.eclipse.draw2d.Animator
          org.eclipse.draw2d.LayoutAnimator

All Implemented Interfaces:
  LayoutListener

public class LayoutAnimator
extends Animator
implements 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 inherited from class org.eclipse.draw2d.LayoutListener
`LayoutListener.Stub`

Constructor Summary
`protected` `LayoutAnimator()` Constructs a new Animator.

Method Summary
`protected Object` `getCurrentState(IFigure container)` Returns an object encapsulating the placement of children in a container.
`static LayoutAnimator` `getDefault()` Returns the default instance.
`void` `invalidate(IFigure container)` Hooks invalidation in case animation is in progress.
`boolean` `layout(IFigure container)` Hooks layout in case animation is in progress.
`protected boolean` `playback(IFigure container)` Plays back the animated layout.
`void` `postLayout(IFigure container)` Hooks post layout in case animation is in progress.
`void` `remove(IFigure child)` This callback is unused.
`void` `setConstraint(IFigure child, Object constraint)` This callback is unused.

Methods inherited from class org.eclipse.draw2d.Animator
`capture, init, playbackStarting, recordFinalState, recordInitialState, tearDown`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LayoutAnimator

    protected LayoutAnimator()

  Constructs a new Animator. The default instance (`getDefault()`) can be used on all figures being animated.

Since:
  3.2

Method Detail

### getCurrentState

    protected Object getCurrentState(IFigure container)

  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 class `Animator`
  Parameters:
    `container` - the container figure
  Returns:
    the current state
  Since:
    3.2

### getDefault

    public static LayoutAnimator getDefault()

  Returns the default instance.

  Returns:
    the default instance
  Since:
    3.2

### invalidate

    public final void invalidate(IFigure container)

  Hooks invalidation in case animation is in progress.

  Specified by:
    `invalidate` in interface `LayoutListener`
  Parameters:
    `container` - the invalidated Figure
  See Also:
    `LayoutListener.invalidate(IFigure)`

### layout

    public final boolean layout(IFigure container)

  Hooks layout in case animation is in progress.

  Specified by:
    `layout` in interface `LayoutListener`
  Parameters:
    `container` - the figure incurring a layout
  Returns:
    `true` if the layout has been intercepted by the listener
  See Also:
    `LayoutListener.layout(org.eclipse.draw2d.IFigure)`

### playback

    protected boolean playback(IFigure container)

  Plays back the animated layout.

  Overrides:
    `playback` in class `Animator`
  Parameters:
    `container` - the figure being animated
  Returns:
    `true` if playback was successful
  See Also:
    `Animator.playback(IFigure)`

### postLayout

    public final void postLayout(IFigure container)

  Hooks post layout in case animation is in progress.

  Specified by:
    `postLayout` in interface `LayoutListener`
  Parameters:
    `container` - the figure incurring a layout
  See Also:
    `LayoutListener.postLayout(IFigure)`

### remove

    public final void remove(IFigure child)

  This callback is unused. Reserved for possible future use.

  Specified by:
    `remove` in interface `LayoutListener`
  Parameters:
    `child` - the child being removed
  See Also:
    `LayoutListener.remove(IFigure)`

### setConstraint

    public final void setConstraint(IFigure child,
                                    Object constraint)

  This callback is unused. Reserved for possible future use.

  Specified by:
    `setConstraint` in interface `LayoutListener`
  Parameters:
    `child` - the child being updated
    `constraint` - the child's new constraint
  See Also:
    `LayoutListener.setConstraint(IFigure, Object)`

Eclipse Draw2d 3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.