Package org.apache.batik.bridge
Class SVGAnimationEngine
java.lang.Object
org.apache.batik.anim.AnimationEngine
org.apache.batik.bridge.SVGAnimationEngine
An AnimationEngine for SVG documents.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Factory class forAnimatableAngleOrIdentValue
s.protected class
Factory class forAnimatableAngleValue
s.protected static class
Factory class forAnimatableBooleanValue
s.protected class
Factory class forAnimatableColorValue
s.protected static class
Factory class forAnimatableIntegerValue
s.protected static class
Factory class forAnimatableLengthListValue
s.protected class
Factory class forAnimatableLengthOrIdentValue
s.protected static class
Factory class forAnimatableLengthValue
s.protected static class
Factory class forAnimatableNumberListValue
s.protected class
Factory class forAnimatableNumberOrIdentValue
s.protected static class
Factory class forAnimatableNumberOrPercentageValue
s.protected static class
Factory class forAnimatableNumberValue
s.protected class
Factory class forAnimatablePaintValue
s.protected static class
Factory class forAnimatablePathDataValue
s.protected static class
Factory class forAnimatablePointListValue
s.protected static class
Factory class forAnimatablePreserveAspectRatioValue
s.protected static class
Factory class forAnimatableNumberListValue
s.protected class
Factory class for computed CSSAnimatableStringValue
s.protected class
A class for the root time container.protected class
The thread that ticks the animation.protected static class
Idle runnable to tick the animation.protected class
Factory class for AnimatableValues for CSS properties.protected static class
Idle runnable to tick the animation, that reads times from System.in.protected static interface
Interface for AnimatableValue factories.protected static class
Factory class forAnimatableStringValue
s.Nested classes/interfaces inherited from class org.apache.batik.anim.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 Set
Set of SMIL animation event names for SVG 1.1.protected static final Set
Set of SMIL animation event names for SVG 1.2.protected float
The amount of animation limiting.protected int
The animation limiting mode.protected SVGAnimationEngine.AnimationThread
The thread that ticks the animation engine.protected SVGAnimationEngine.AnimationTickRunnable
The Runnable that ticks the document.protected CSSEngine
The CSSEngine used for CSS value parsing.protected BridgeContext
The BridgeContext to use for value parsing.protected StyleMap
A StyleMap used by theSVGAnimationEngine.Factory
s when computing CSS values.protected SVGAnimationEngine.Factory[]
Factories forAnimatableValue
parsing.protected LinkedList
List of bridges that will be initialized when the document is started.protected float
The initial time that will be seeked to when the animation engine starts, as set bysetCurrentTime(float)
.protected boolean
Whether the document is an SVG 1.2 document.protected boolean
Whether animation processing has started.The factory for unparsed string values.Fields inherited from class org.apache.batik.anim.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 TypeMethodDescriptionvoid
Adds an animation element bridge to the list of bridges that require initializing when the document is started.protected TimedDocumentRoot
Creates a new returns a new TimedDocumentRoot object for the document.void
dispose()
Disposes this animation engine.float
Returns the current document time.getUnderlyingCSSValue
(Element animElt, AnimationTarget target, String pn) Returns an AnimatableValue for the underlying value of a CSS property.boolean
Returns whether animation processing has begun.parseAnimatableValue
(Element animElt, AnimationTarget target, String ns, String ln, boolean isCSS, String s) Parses an AnimatableValue.void
pause()
Pauses the animations.void
setAnimationLimitingCPU
(float pc) Sets the animation limiting mode to a percentage of CPU.void
setAnimationLimitingFPS
(float fps) Sets the animation limiting mode to a number of frames per second.void
Sets the animation limiting mode to "none".float
setCurrentTime
(float t) Sets the current document time.void
start
(long documentStartTime) Starts the animation engine.void
unpause()
Pauses the animations.Methods inherited from class org.apache.batik.anim.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 forAnimatableValue
parsing. -
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.Factory
s 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
public void dispose()Disposes this animation engine.- Overrides:
dispose
in classAnimationEngine
-
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
public void pause()Pauses the animations.- Overrides:
pause
in classAnimationEngine
-
unpause
public void unpause()Pauses the animations.- Overrides:
unpause
in classAnimationEngine
-
getCurrentTime
public float getCurrentTime()Returns the current document time.- Overrides:
getCurrentTime
in classAnimationEngine
-
setCurrentTime
public float setCurrentTime(float t) Sets the current document time.- Overrides:
setCurrentTime
in classAnimationEngine
-
createDocumentRoot
Creates a new returns a new TimedDocumentRoot object for the document.- Specified by:
createDocumentRoot
in 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)
-