org.apache.batik.anim

Class AbstractAnimation

public abstract class AbstractAnimation extends Object

An abstract base class for the different types of animation.
Field Summary
protected AnimatableElementanimatableElement
The AnimatableElement that gives access to underlying values in the document.
protected floatbeginTime
The time at which this animation became active.
protected AnimatableValuecomposedValue
The value of this animation composed with any others.
static shortCALC_MODE_DISCRETE
static shortCALC_MODE_LINEAR
static shortCALC_MODE_PACED
static shortCALC_MODE_SPLINE
protected AbstractAnimationhigherAnimation
The animation that is higher in the sandwich.
protected booleanisActive
Whether this animation is active.
protected booleanisDirty
Whether this animation needs recomputing.
protected booleanisFrozen
Whether this animation is frozen.
protected AbstractAnimationlowerAnimation
The animation that is lower in the sandwich.
protected TimedElementtimedElement
The TimedElement that controls the timing of this animation.
protected booleantoAnimation
Whether this animation is a 'to-animation'.
protected booleanusesUnderlyingValue
Whether this animation depends on the underlying value.
protected AnimatableValuevalue
The value of this animation.
Constructor Summary
protected AbstractAnimation(TimedElement timedElement, AnimatableElement animatableElement)
Creates a new Animation.
Method Summary
AnimatableValuegetComposedValue()
Returns the composed value of this animation, or null if it isn't active.
TimedElementgetTimedElement()
Returns the TimedElement for this animation.
AnimatableValuegetValue()
Returns the value of this animation, or null if it isn't active.
protected voidmarkDirty()
Marks this animation and any animation that depends on it as dirty.
protected abstract voidsampledAt(float simpleTime, float simpleDur, int repeatIteration)
Called when the element is sampled at the given time.
protected voidsampledLastValue(int repeatIteration)
Called when the element is sampled for its "last" value.
StringtoString()
Returns a string representation of this animation.
booleanusesUnderlyingValue()
Returns whether this animation depends on the underlying value.
protected booleanwillReplace()
Returns whether this animation will replace values on animations lower in the sandwich.

Field Detail

animatableElement

protected AnimatableElement animatableElement
The AnimatableElement that gives access to underlying values in the document.

beginTime

protected float beginTime
The time at which this animation became active. Used for ensuring the sandwich order is correct when multiple animations become active simultaneously.

composedValue

protected AnimatableValue composedValue
The value of this animation composed with any others.

CALC_MODE_DISCRETE

public static final short CALC_MODE_DISCRETE

CALC_MODE_LINEAR

public static final short CALC_MODE_LINEAR

CALC_MODE_PACED

public static final short CALC_MODE_PACED

CALC_MODE_SPLINE

public static final short CALC_MODE_SPLINE

higherAnimation

protected AbstractAnimation higherAnimation
The animation that is higher in the sandwich.

isActive

protected boolean isActive
Whether this animation is active.

isDirty

protected boolean isDirty
Whether this animation needs recomputing.

isFrozen

protected boolean isFrozen
Whether this animation is frozen.

lowerAnimation

protected AbstractAnimation lowerAnimation
The animation that is lower in the sandwich.

timedElement

protected TimedElement timedElement
The TimedElement that controls the timing of this animation.

toAnimation

protected boolean toAnimation
Whether this animation is a 'to-animation'.

usesUnderlyingValue

protected boolean usesUnderlyingValue
Whether this animation depends on the underlying value.

value

protected AnimatableValue value
The value of this animation.

Constructor Detail

AbstractAnimation

protected AbstractAnimation(TimedElement timedElement, AnimatableElement animatableElement)
Creates a new Animation.

Method Detail

getComposedValue

public AnimatableValue getComposedValue()
Returns the composed value of this animation, or null if it isn't active.

getTimedElement

public TimedElement getTimedElement()
Returns the TimedElement for this animation.

getValue

public AnimatableValue getValue()
Returns the value of this animation, or null if it isn't active.

markDirty

protected void markDirty()
Marks this animation and any animation that depends on it as dirty.

sampledAt

protected abstract void sampledAt(float simpleTime, float simpleDur, int repeatIteration)
Called when the element is sampled at the given time. This updates the value of the animation if active.

sampledLastValue

protected void sampledLastValue(int repeatIteration)
Called when the element is sampled for its "last" value.

toString

public String toString()
Returns a string representation of this animation.

usesUnderlyingValue

public boolean usesUnderlyingValue()
Returns whether this animation depends on the underlying value.

willReplace

protected boolean willReplace()
Returns whether this animation will replace values on animations lower in the sandwich.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.