Class AnimatableValue
java.lang.Object
org.apache.batik.anim.values.AnimatableValue
- Direct Known Subclasses:
AnimatableBooleanValue, AnimatableColorValue, AnimatableIntegerValue, AnimatableLengthListValue, AnimatableLengthValue, AnimatableMotionPointValue, AnimatableNumberListValue, AnimatableNumberOptionalNumberValue, AnimatableNumberValue, AnimatablePathDataValue, AnimatablePreserveAspectRatioValue, AnimatableRectValue, AnimatableStringValue, AnimatableTransformListValue
An abstract class for values in the animation engine.
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static DecimalFormatA formatting object to get CSS compatible float strings.protected booleanWhether this value has changed since the last call tohasChanged().protected AnimationTargetThe target of the animation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnimatableValue(AnimationTarget target) Creates a new AnimatableValue. -
Method Summary
Modifier and TypeMethodDescriptionabstract 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.Returns the CSS text representation of the value.abstract AnimatableValueReturns a zero value of this AnimatableValue's type.booleanReturns 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.toString()Returns a string representation of this object prefixed with its class name.Returns a string representation of this object.
-
Field Details
-
decimalFormat
A formatting object to get CSS compatible float strings. -
target
The target of the animation. -
hasChanged
protected boolean hasChangedWhether this value has changed since the last call tohasChanged(). This must be updated withininterpolate(AnimatableValue, AnimatableValue, float, AnimatableValue, int)in descendant classes.
-
-
Constructor Details
-
AnimatableValue
Creates a new AnimatableValue.
-
-
Method Details
-
formatNumber
Returns a CSS compatible string version of the specified float. -
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 createdto- the value this value should be interpolated towards, or null if no actual interpolation should be performedinterpolation- the interpolation distance, 0 <= interpolation <= 1accumulation- an accumulation to add to the interpolated valuemultiplier- an amount the accumulation values should be multiplied by before being added to the interpolated value
-
canPace
public abstract boolean canPace()Returns whether two values of this type can have their distance computed, as needed by paced animation. -
distanceTo
Returns the absolute distance between this value and the specified other value. -
getZeroValue
Returns a zero value of this AnimatableValue's type. -
getCssText
Returns the CSS text representation of the value. -
hasChanged
public boolean hasChanged()Returns whether the value in this AnimatableValue has been modified. -
toStringRep
Returns a string representation of this object. This should be overridden in classes that do not have a CSS representation. -
toString
-