Class KeyValues<T>
- java.lang.Object
-
- org.pushingpixels.radiance.animation.api.interpolator.KeyValues<T>
-
- Type Parameters:
T- Value type
public class KeyValues<T> extends java.lang.ObjectStores a list of values that correspond to the times in aKeyTimesobject. These structures are then used to create aKeyFramesobject, which is then used to create aTimelinePropertyBuilder.PropertySetterfor the purposes of modifying an object's property over time.At each of the times in
KeyTimes, the property will take on the corresponding value in the KeyValues object. Between these times, the property will take on a value based on the interpolation information stored in the KeyFrames object and thePropertyInterpolatorfor the type of the values in KeyValues.This class has built-in support for various known types, as defined in
PropertyInterpolator.For a simple example using KeyValues to create a KeyFrames and PropertySetter object, see the class header comments in
TimelinePropertyBuilder.PropertySetter.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> KeyValues<T>create(PropertyInterpolator<T> interpolator, T[] params)Constructs a KeyValues object from a property interpolator and one or more values.static <T> KeyValues<T>create(T... params)Constructs a KeyValues object from one or more values.
-
-
-
Method Detail
-
create
@SafeVarargs public static <T> KeyValues<T> create(T... params)
Constructs a KeyValues object from one or more values. The internal Evaluator is automatically determined by the type of the parameters.- Type Parameters:
T- Value type- Parameters:
params- the values to interpolate between. If there is only one parameter, this is assumed to be a "to" animation where the first value is dynamically determined at runtime when the animation is started.- Returns:
- KeyValues object
- Throws:
java.lang.IllegalArgumentException- if anPropertyInterpolatorcannot be found that can interpolate between the value types supplied
-
create
public static <T> KeyValues<T> create(PropertyInterpolator<T> interpolator, T[] params)
Constructs a KeyValues object from a property interpolator and one or more values.- Type Parameters:
T- Value type- Parameters:
interpolator- Property interpolatorparams- the values to interpolate between. If there is only one parameter, this is assumed to be a "to" animation where the first value is dynamically determined at runtime when the animation is started.- Returns:
- KeyValues object
- Throws:
java.lang.IllegalArgumentException- if params does not have at least one value.
-
-