org.apache.batik.anim.values

Class AnimatableValue

public abstract class AnimatableValue extends Object

An abstract class for values in the animation engine.
Field Summary
protected static DecimalFormatdecimalFormat
A formatting object to get CSS compatible float strings.
protected booleanhasChanged
Whether this value has changed since the last call to hasChanged.
protected AnimationTargettarget
The target of the animation.
Constructor Summary
protected AnimatableValue(AnimationTarget target)
Creates a new AnimatableValue.
Method Summary
abstract booleancanPace()
Returns whether two values of this type can have their distance computed, as needed by paced animation.
abstract floatdistanceTo(AnimatableValue other)
Returns the absolute distance between this value and the specified other value.
static StringformatNumber(float f)
Returns a CSS compatible string version of the specified float.
StringgetCssText()
Returns the CSS text representation of the value.
abstract AnimatableValuegetZeroValue()
Returns a zero value of this AnimatableValue's type.
booleanhasChanged()
Returns whether the value in this AnimatableValue has been modified.
abstract AnimatableValueinterpolate(AnimatableValue result, AnimatableValue to, float interpolation, AnimatableValue accumulation, int multiplier)
Performs interpolation to the given value.
StringtoString()
Returns a string representation of this object prefixed with its class name.
StringtoStringRep()
Returns a string representation of this object.

Field Detail

decimalFormat

protected static DecimalFormat decimalFormat
A formatting object to get CSS compatible float strings.

hasChanged

protected boolean hasChanged
Whether this value has changed since the last call to hasChanged. This must be updated within AnimatableValue in descendant classes.

target

protected AnimationTarget target
The target of the animation.

Constructor Detail

AnimatableValue

protected AnimatableValue(AnimationTarget target)
Creates a new AnimatableValue.

Method Detail

canPace

public abstract boolean canPace()
Returns whether two values of this type can have their distance computed, as needed by paced animation.

distanceTo

public abstract float distanceTo(AnimatableValue other)
Returns the absolute distance between this value and the specified other value.

formatNumber

public static String formatNumber(float f)
Returns a CSS compatible string version of the specified float.

getCssText

public String getCssText()
Returns the CSS text representation of the value.

getZeroValue

public abstract AnimatableValue getZeroValue()
Returns a zero value of this AnimatableValue's type.

hasChanged

public boolean hasChanged()
Returns whether the value in this AnimatableValue has been modified.

interpolate

public abstract AnimatableValue interpolate(AnimatableValue result, AnimatableValue to, float interpolation, AnimatableValue accumulation, int multiplier)
Performs interpolation to the given value.

Parameters: result the object in which to store the result of the interpolation, or null if a new object should be created to the value this value should be interpolated towards, or null if no actual interpolation should be performed interpolation the interpolation distance, 0 <= interpolation <= 1 accumulation an accumulation to add to the interpolated value multiplier an amount the accumulation values should be multiplied by before being added to the interpolated value

toString

public String toString()
Returns a string representation of this object prefixed with its class name.

toStringRep

public String toStringRep()
Returns a string representation of this object. This should be overridden in classes that do not have a CSS representation.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.