Class SVGAnimationEngine
java.lang.Object
org.apache.batik.anim.AnimationEngine
org.apache.batik.bridge.SVGAnimationEngine
An AnimationEngine for SVG documents.
- Version:
- $Id$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classFactory class forAnimatableAngleOrIdentValues.protected classFactory class forAnimatableAngleValues.protected static classFactory class forAnimatableBooleanValues.protected classFactory class forAnimatableColorValues.protected static classFactory class forAnimatableIntegerValues.protected static classFactory class forAnimatableLengthListValues.protected classFactory class forAnimatableLengthOrIdentValues.protected static classFactory class forAnimatableLengthValues.protected static classFactory class forAnimatableNumberListValues.protected classFactory class forAnimatableNumberOrIdentValues.protected static classFactory class forAnimatableNumberOrPercentageValues.protected static classFactory class forAnimatableNumberValues.protected classFactory class forAnimatablePaintValues.protected static classFactory class forAnimatablePathDataValues.protected static classFactory class forAnimatablePointListValues.protected static classFactory class forAnimatablePreserveAspectRatioValues.protected static classFactory class forAnimatableNumberListValues.protected classFactory class for computed CSSAnimatableStringValues.protected classA class for the root time container.protected classThe thread that ticks the animation.protected static classIdle runnable to tick the animation.protected classFactory class for AnimatableValues for CSS properties.protected static classIdle runnable to tick the animation, that reads times from System.in.protected static interfaceInterface for AnimatableValue factories.protected static classFactory class forAnimatableStringValues.Nested classes/interfaces inherited from class AnimationEngine
AnimationEngine.AnimationInfo, AnimationEngine.Listener, AnimationEngine.Sandwich, AnimationEngine.TargetInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionThe factory for length-or-ident values.The factory for number-or-ident values.protected static final SetSet of SMIL animation event names for SVG 1.1.protected static final SetSet of SMIL animation event names for SVG 1.2.protected floatThe amount of animation limiting.protected intThe animation limiting mode.protected SVGAnimationEngine.AnimationThreadThe thread that ticks the animation engine.protected SVGAnimationEngine.AnimationTickRunnableThe Runnable that ticks the document.protected CSSEngineThe CSSEngine used for CSS value parsing.protected BridgeContextThe BridgeContext to use for value parsing.protected StyleMapA StyleMap used by theSVGAnimationEngine.Factorys when computing CSS values.protected SVGAnimationEngine.Factory[]Factories forAnimatableValueparsing.protected LinkedListList of bridges that will be initialized when the document is started.protected floatThe initial time that will be seeked to when the animation engine starts, as set bysetCurrentTime(float).protected booleanWhether the document is an SVG 1.2 document.protected booleanWhether animation processing has started.The factory for unparsed string values.Fields inherited from class AnimationEngine
ANIM_TYPE_CSS, ANIM_TYPE_OTHER, ANIM_TYPE_XML, animations, document, MAP_ENTRY_ARRAY, pauseTime, targetListener, targets, timedDocumentRoot -
Constructor Summary
ConstructorsConstructorDescriptionSVGAnimationEngine(Document doc, BridgeContext ctx) Creates a new SVGAnimationEngine. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an animation element bridge to the list of bridges that require initializing when the document is started.protected TimedDocumentRootCreates a new returns a new TimedDocumentRoot object for the document.voiddispose()Disposes this animation engine.floatReturns the current document time.getUnderlyingCSSValue(Element animElt, AnimationTarget target, String pn) Returns an AnimatableValue for the underlying value of a CSS property.booleanReturns whether animation processing has begun.parseAnimatableValue(Element animElt, AnimationTarget target, String ns, String ln, boolean isCSS, String s) Parses an AnimatableValue.voidpause()Pauses the animations.voidsetAnimationLimitingCPU(float pc) Sets the animation limiting mode to a percentage of CPU.voidsetAnimationLimitingFPS(float fps) Sets the animation limiting mode to a number of frames per second.voidSets the animation limiting mode to "none".floatsetCurrentTime(float t) Sets the current document time.voidstart(long documentStartTime) Starts the animation engine.voidunpause()Pauses the animations.Methods inherited from class AnimationEngine
addAnimation, addTimegraphListener, getAnimationInfo, getSandwich, getTargetInfo, isPaused, moveToBottom, moveToTop, pushDown, removeAnimation, removeFill, removeTimegraphListener, sampledAt, sampledLastValue, tick, toActive, toInactive
-
Field Details
-
ctx
The BridgeContext to use for value parsing. -
cssEngine
The CSSEngine used for CSS value parsing. -
started
protected boolean startedWhether animation processing has started. This affects whether animation element bridges add their animation on to the initial bridge list, or process them immediately. -
animationTickRunnable
The Runnable that ticks the document. -
initialStartTime
protected float initialStartTimeThe initial time that will be seeked to when the animation engine starts, as set bysetCurrentTime(float). -
uncomputedAnimatableStringValueFactory
protected SVGAnimationEngine.UncomputedAnimatableStringValueFactory uncomputedAnimatableStringValueFactoryThe factory for unparsed string values. -
animatableLengthOrIdentFactory
The factory for length-or-ident values. -
animatableNumberOrIdentFactory
The factory for number-or-ident values. -
factories
Factories forAnimatableValueparsing. -
isSVG12
protected boolean isSVG12Whether the document is an SVG 1.2 document. -
initialBridges
List of bridges that will be initialized when the document is started. -
dummyStyleMap
A StyleMap used by theSVGAnimationEngine.Factorys when computing CSS values. -
animationThread
The thread that ticks the animation engine. -
animationLimitingMode
protected int animationLimitingModeThe animation limiting mode. -
animationLimitingAmount
protected float animationLimitingAmountThe amount of animation limiting. -
animationEventNames11
Set of SMIL animation event names for SVG 1.1. -
animationEventNames12
Set of SMIL animation event names for SVG 1.2.
-
-
Constructor Details
-
SVGAnimationEngine
Creates a new SVGAnimationEngine.
-
-
Method Details
-
dispose
-
addInitialBridge
Adds an animation element bridge to the list of bridges that require initializing when the document is started. -
hasStarted
public boolean hasStarted()Returns whether animation processing has begun. -
parseAnimatableValue
public AnimatableValue parseAnimatableValue(Element animElt, AnimationTarget target, String ns, String ln, boolean isCSS, String s) Parses an AnimatableValue. -
getUnderlyingCSSValue
Returns an AnimatableValue for the underlying value of a CSS property. -
pause
-
unpause
-
getCurrentTime
public float getCurrentTime()Returns the current document time.- Overrides:
getCurrentTimein classAnimationEngine
-
setCurrentTime
public float setCurrentTime(float t) Sets the current document time.- Overrides:
setCurrentTimein classAnimationEngine
-
createDocumentRoot
Creates a new returns a new TimedDocumentRoot object for the document.- Specified by:
createDocumentRootin classAnimationEngine
-
start
public void start(long documentStartTime) Starts the animation engine. -
setAnimationLimitingNone
public void setAnimationLimitingNone()Sets the animation limiting mode to "none". -
setAnimationLimitingCPU
public void setAnimationLimitingCPU(float pc) Sets the animation limiting mode to a percentage of CPU.- Parameters:
pc- the maximum percentage of CPU to use (0 < pc ≤ 1)
-
setAnimationLimitingFPS
public void setAnimationLimitingFPS(float fps) Sets the animation limiting mode to a number of frames per second.- Parameters:
fps- the maximum number of frames per second (fps > 0)
-