This class controls animations. Its constructors and various set methods control the parameters under which animations are run, and the other methods support starting and stopping the animation. The parameters of this class use the concepts of a "cycle" (the base animation) and an "envelope" that controls how the cycle is started, ended, and repeated.
Most of the methods here are simle getters/setters for the properties used by Animator. Typical animations will simply use one of the two constructors (depending on whether you are constructing a repeating animation), optionally call any of the set*
methods to alter any of the other parameters, and then call start() to run the animation. For example, this animation will run for 1 second, calling your {@link TimingTarget} with timing events when the animation is started,running, and stopped:
Animator animator = new Animator(1000, myTarget); animator.start();
The following variation will run a half-second animation 4 times, reversing direction each time:
Animator animator = new Animator(500, 4, RepeatBehavior.REVERSE, myTarget); animator.start();
More complex animations can be created through using the properties in Animator, such as {@link Animator#setAcceleration acceleration} and {@link Animator#setDeceleration}. More automated animations can be created and run using the {@link org.jdesktop.animation.timing.triggers triggers}package to control animations through events and {@link org.jdesktop.animation.timing.interpolation.PropertySetter} to handle animating object properties.