org.jdesktop.animation.timing.interpolation
Class PropertyRange

java.lang.Object
  extended by org.jdesktop.animation.timing.interpolation.PropertyRange

public class PropertyRange
extends java.lang.Object

This class is used to hold a property name and a range of values that represent the values that the property can attain over time. The class is used primarily in creating instances of ObjectModifier, which is a TimingTarget implementation that varies the values of the property in the values range over time. Users of this class will either call one of the utility factory methods, to create a simple range whose values will be linearly interpolated between during the animation, or the more detailed constructor that uses KeyFrames for more control over the range. It is also possible to subclass PropertyRange to handle types that have no existing definition.


Constructor Summary
PropertyRange(java.lang.String propertyName, KeyFrames keyFrames)
          This constructor stores the propertyName and KeyFrames for this PropertyRange.
 
Method Summary
static PropertyRange createPropertyRangeColor(java.lang.String propertyName, java.awt.Color... values)
          Returns PropertyRange that defines a Color range.
static PropertyRange createPropertyRangeColor(java.lang.String propertyName, Spline interpolation, java.awt.Color from, java.awt.Color to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
static PropertyRange createPropertyRangeDimension(java.lang.String propertyName, java.awt.Dimension... values)
          Returns PropertyRange that defines a Dimension range.
static PropertyRange createPropertyRangeDimension(java.lang.String propertyName, Spline interpolation, java.awt.Dimension from, java.awt.Dimension to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
static PropertyRange createPropertyRangeDouble(java.lang.String propertyName, double... values)
          Returns PropertyRange that defines a float range.
static PropertyRange createPropertyRangeDouble(java.lang.String propertyName, Spline interpolation, double from, double to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
static PropertyRange createPropertyRangeFloat(java.lang.String propertyName, float... values)
          Returns PropertyRange that defines a float range.
static PropertyRange createPropertyRangeFloat(java.lang.String propertyName, Spline interpolation, float from, float to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
static PropertyRange createPropertyRangeInt(java.lang.String propertyName, int... values)
          Returns PropertyRange that defines an int range.
static PropertyRange createPropertyRangeInt(java.lang.String propertyName, Spline interpolation, int from, int to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
static PropertyRange createPropertyRangePoint(java.lang.String propertyName, java.awt.Point... values)
          Returns PropertyRange that defines a Point range.
static PropertyRange createPropertyRangePoint(java.lang.String propertyName, Spline interpolation, java.awt.Point from, java.awt.Point to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
static PropertyRange createPropertyRangeRectangle(java.lang.String propertyName, java.awt.Rectangle... values)
          Returns PropertyRange that defines a Rectangle range.
static PropertyRange createPropertyRangeRectangle(java.lang.String propertyName, Spline interpolation, java.awt.Rectangle from, java.awt.Rectangle to)
          Returns PropertyRange that defines a range that is interpolated over using the given Spline value.
 boolean isToAnimation()
          Utility method for determining whether this is a "to" animation (true if the first value is null).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyRange

public PropertyRange(java.lang.String propertyName,
                     KeyFrames keyFrames)
This constructor stores the propertyName and KeyFrames for this PropertyRange.

Method Detail

createPropertyRangeInt

public static PropertyRange createPropertyRangeInt(java.lang.String propertyName,
                                                   int... values)
Returns PropertyRange that defines an int range.


createPropertyRangeInt

public static PropertyRange createPropertyRangeInt(java.lang.String propertyName,
                                                   Spline interpolation,
                                                   int from,
                                                   int to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

createPropertyRangeFloat

public static PropertyRange createPropertyRangeFloat(java.lang.String propertyName,
                                                     float... values)
Returns PropertyRange that defines a float range.


createPropertyRangeFloat

public static PropertyRange createPropertyRangeFloat(java.lang.String propertyName,
                                                     Spline interpolation,
                                                     float from,
                                                     float to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

createPropertyRangeDouble

public static PropertyRange createPropertyRangeDouble(java.lang.String propertyName,
                                                      double... values)
Returns PropertyRange that defines a float range.


createPropertyRangeDouble

public static PropertyRange createPropertyRangeDouble(java.lang.String propertyName,
                                                      Spline interpolation,
                                                      double from,
                                                      double to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

createPropertyRangePoint

public static PropertyRange createPropertyRangePoint(java.lang.String propertyName,
                                                     java.awt.Point... values)
Returns PropertyRange that defines a Point range.


createPropertyRangePoint

public static PropertyRange createPropertyRangePoint(java.lang.String propertyName,
                                                     Spline interpolation,
                                                     java.awt.Point from,
                                                     java.awt.Point to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

createPropertyRangeDimension

public static PropertyRange createPropertyRangeDimension(java.lang.String propertyName,
                                                         java.awt.Dimension... values)
Returns PropertyRange that defines a Dimension range.


createPropertyRangeDimension

public static PropertyRange createPropertyRangeDimension(java.lang.String propertyName,
                                                         Spline interpolation,
                                                         java.awt.Dimension from,
                                                         java.awt.Dimension to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

createPropertyRangeRectangle

public static PropertyRange createPropertyRangeRectangle(java.lang.String propertyName,
                                                         java.awt.Rectangle... values)
Returns PropertyRange that defines a Rectangle range.


createPropertyRangeRectangle

public static PropertyRange createPropertyRangeRectangle(java.lang.String propertyName,
                                                         Spline interpolation,
                                                         java.awt.Rectangle from,
                                                         java.awt.Rectangle to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

createPropertyRangeColor

public static PropertyRange createPropertyRangeColor(java.lang.String propertyName,
                                                     java.awt.Color... values)
Returns PropertyRange that defines a Color range.


createPropertyRangeColor

public static PropertyRange createPropertyRangeColor(java.lang.String propertyName,
                                                     Spline interpolation,
                                                     java.awt.Color from,
                                                     java.awt.Color to)
Returns PropertyRange that defines a range that is interpolated over using the given Spline value.

Parameters:
propertyName - name of the property whose range this defines
interpolation - spline that defines how to interpolate between the from and to values
from - starting value
to - ending value

isToAnimation

public boolean isToAnimation()
Utility method for determining whether this is a "to" animation (true if the first value is null).