Package org.apache.batik.anim
Class InterpolatingAnimation
- java.lang.Object
-
- org.apache.batik.anim.AbstractAnimation
-
- org.apache.batik.anim.InterpolatingAnimation
-
- Direct Known Subclasses:
MotionAnimation,SimpleAnimation
public abstract class InterpolatingAnimation extends AbstractAnimation
An abstract animation class for those animations that interpolate values. Specifically, this is for animations that have the 'calcMode', 'keyTimes', 'keySplines', 'additive' and 'cumulative' attributes.- Version:
- $Id: InterpolatingAnimation.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanadditiveWhether this animation adds to ones below it in the animation sandwich or replaces them.protected intcalcModeThe interpolation mode of this animator.protected booleancumulativeWhether this animation accumulates from previous iterations.protected Cubic[]keySplineCubicsCubics built from the bezier control points inkeySplines.protected float[]keySplinesBezier control points that control the pacing of the animation.protected float[]keyTimesTime values to control the pacing of the animation.-
Fields inherited from class org.apache.batik.anim.AbstractAnimation
animatableElement, beginTime, CALC_MODE_DISCRETE, CALC_MODE_LINEAR, CALC_MODE_PACED, CALC_MODE_SPLINE, composedValue, higherAnimation, isActive, isDirty, isFrozen, lowerAnimation, timedElement, toAnimation, usesUnderlyingValue, value
-
-
Constructor Summary
Constructors Constructor Description InterpolatingAnimation(TimedElement timedElement, AnimatableElement animatableElement, int calcMode, float[] keyTimes, float[] keySplines, boolean additive, boolean cumulative)Creates a new InterpolatingAnimation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidsampledAt(float simpleTime, float simpleDur, int repeatIteration)Called when the element is sampled at the given time.protected abstract voidsampledAtUnitTime(float unitTime, int repeatIteration)Called when the element is sampled at the given unit time.protected voidsampledLastValue(int repeatIteration)Called when the element is sampled for its "last" value.protected booleanwillReplace()Returns whether this animation will replace values on animations lower in the sandwich.-
Methods inherited from class org.apache.batik.anim.AbstractAnimation
getComposedValue, getTimedElement, getValue, markDirty, toString, usesUnderlyingValue
-
-
-
-
Field Detail
-
calcMode
protected int calcMode
The interpolation mode of this animator. This should take one of the CALC_MODE_* constants defined inAbstractAnimation.
-
keyTimes
protected float[] keyTimes
Time values to control the pacing of the animation.
-
keySplines
protected float[] keySplines
Bezier control points that control the pacing of the animation.
-
keySplineCubics
protected Cubic[] keySplineCubics
Cubics built from the bezier control points inkeySplines.
-
additive
protected boolean additive
Whether this animation adds to ones below it in the animation sandwich or replaces them.
-
cumulative
protected boolean cumulative
Whether this animation accumulates from previous iterations.
-
-
Constructor Detail
-
InterpolatingAnimation
public InterpolatingAnimation(TimedElement timedElement, AnimatableElement animatableElement, int calcMode, float[] keyTimes, float[] keySplines, boolean additive, boolean cumulative)
Creates a new InterpolatingAnimation.
-
-
Method Detail
-
willReplace
protected boolean willReplace()
Returns whether this animation will replace values on animations lower in the sandwich.- Overrides:
willReplacein classAbstractAnimation
-
sampledLastValue
protected void sampledLastValue(int repeatIteration)
Called when the element is sampled for its "last" value.- Overrides:
sampledLastValuein classAbstractAnimation
-
sampledAt
protected void sampledAt(float simpleTime, float simpleDur, int repeatIteration)Called when the element is sampled at the given time.- Specified by:
sampledAtin classAbstractAnimation
-
sampledAtUnitTime
protected abstract void sampledAtUnitTime(float unitTime, int repeatIteration)Called when the element is sampled at the given unit time. This updates theAbstractAnimation.valueof the animation if active.
-
-