public class

AnimationSet

extends Animation<T>
java.lang.Object
   ↳ com.shinobicontrols.charts.Animation<T>
     ↳ com.shinobicontrols.charts.AnimationSet<T>

Class Overview

Holds a set of Animation objects allowing them to all be updated together as one group. Being an Animation itself, an AnimationSet can be given to an AnimationRunner, for example, to progressively run over a set duration.

It is possible to add Animation objects of differing types to the same AnimationSet provided the AnimationSet is generically parametrized by a common super class. In certain cases this may simply be Object.

For example, where there are two animations required, one for animating an integer property, such as a color, and one for animating a float property, such as a Series' scaleY, the AnimationSet could be defined as:

 AnimationSet<Number> animationSet = new AnimationSet<>();
 

Summary

Public Constructors
AnimationSet()
Constructs an AnimationSet
Public Methods
void add(Animation<? extends T> animation)
Adds an Animation to this AnimationSet.
float getDuration()
This method is deprecated. as of version 1.9.1, duration is now set on the AnimationRunner during construction, see AnimationRunner#AnimationRunner(Animation, float, boolean)
void remove(Animation<? extends T> animation)
Removes the given Animation from this AnimationSet.
void setDuration(float duration)
This method is deprecated. as of version 1.9.1, duration is now set on the AnimationRunner during construction, see AnimationRunner#AnimationRunner(Animation, float, boolean)
void setProgress(float progress)
Sets the current progress of this Animation.
int size()
Returns the size of this AnimationSet, that is, the number of Animation objects it holds.
[Expand]
Inherited Methods
From class com.shinobicontrols.charts.Animation
From class java.lang.Object

Public Constructors

public AnimationSet ()

Constructs an AnimationSet

Public Methods

public void add (Animation<? extends T> animation)

Adds an Animation to this AnimationSet.

When its progress value is changed, all Animation objects it holds will have their progress value updated.

Adding a null Animation will result in an IllegalArgumentException.

Parameters
animation the Animation to add to this AnimationSet, must not be null

public float getDuration ()

This method is deprecated.
as of version 1.9.1, duration is now set on the AnimationRunner during construction, see AnimationRunner#AnimationRunner(Animation, float, boolean)

Returns the maximum duration of all the Animation objects given to this AnimationSet. If no Animation objects have been provided the duration will be zero.

Returns

public void remove (Animation<? extends T> animation)

Removes the given Animation from this AnimationSet.

Parameters
animation the Animation to remove from this AnimationSet

public void setDuration (float duration)

This method is deprecated.
as of version 1.9.1, duration is now set on the AnimationRunner during construction, see AnimationRunner#AnimationRunner(Animation, float, boolean)

Does nothing. The duration of this AnimationSet is determined by the Animation objects given to it.

Parameters
duration the duration to set, in seconds, ignored

public void setProgress (float progress)

Sets the current progress of this Animation. This is a measure of the current position in the Animation and is a value in the range of 0.0 to 1.0. A progress value of 0.0 represents the point at the beginning of the Animation's AnimationCurve. A progress value of 1.0 represents the point at the end of the Animation's AnimationCurve.

A progress value less than 0.0 will be coerced to 0.0. Similarly, a progress value greater than 1.0 will be coerced to 1.0.

When the progress value is updated each Animation.Listener held by this Animation is informed of the change via the onProgressChanged(Animation) method.

Parameters
progress the progress to set for this Animation

public int size ()

Returns the size of this AnimationSet, that is, the number of Animation objects it holds.

Returns