public class SVGAnimationEngine extends AnimationEngine
AnimationEngine.AnimationInfo, AnimationEngine.Listener, AnimationEngine.Sandwich, AnimationEngine.TargetInfo
Modifier and Type | Field and Description |
---|---|
protected SVGAnimationEngine.AnimatableLengthOrIdentFactory |
animatableLengthOrIdentFactory
The factory for length-or-ident values.
|
protected SVGAnimationEngine.AnimatableNumberOrIdentFactory |
animatableNumberOrIdentFactory
The factory for number-or-ident values.
|
protected static java.util.Set |
animationEventNames11
Set of SMIL animation event names for SVG 1.1.
|
protected static java.util.Set |
animationEventNames12
Set of SMIL animation event names for SVG 1.2.
|
protected float |
animationLimitingAmount
The amount of animation limiting.
|
protected int |
animationLimitingMode
The animation limiting mode.
|
protected SVGAnimationEngine.AnimationThread |
animationThread
The thread that ticks the animation engine.
|
protected SVGAnimationEngine.AnimationTickRunnable |
animationTickRunnable
The Runnable that ticks the document.
|
protected CSSEngine |
cssEngine
The CSSEngine used for CSS value parsing.
|
protected BridgeContext |
ctx
The BridgeContext to use for value parsing.
|
protected StyleMap |
dummyStyleMap
A StyleMap used by the
SVGAnimationEngine.Factory s when computing CSS values. |
protected SVGAnimationEngine.Factory[] |
factories
Factories for
AnimatableValue parsing. |
protected java.util.LinkedList |
initialBridges
List of bridges that will be initialized when the document is started.
|
protected float |
initialStartTime
The initial time that will be seeked to when the animation engine starts,
as set by
setCurrentTime(float) . |
protected boolean |
isSVG12
Whether the document is an SVG 1.2 document.
|
protected boolean |
started
Whether animation processing has started.
|
protected SVGAnimationEngine.UncomputedAnimatableStringValueFactory |
uncomputedAnimatableStringValueFactory
The factory for unparsed string values.
|
ANIM_TYPE_CSS, ANIM_TYPE_OTHER, ANIM_TYPE_XML, animations, document, MAP_ENTRY_ARRAY, pauseTime, targetListener, targets, timedDocumentRoot
Constructor and Description |
---|
SVGAnimationEngine(Document doc,
BridgeContext ctx)
Creates a new SVGAnimationEngine.
|
Modifier and Type | Method and Description |
---|---|
void |
addInitialBridge(SVGAnimationElementBridge b)
Adds an animation element bridge to the list of bridges that
require initializing when the document is started.
|
protected TimedDocumentRoot |
createDocumentRoot()
Creates a new returns a new TimedDocumentRoot object for the document.
|
void |
dispose()
Disposes this animation engine.
|
float |
getCurrentTime()
Returns the current document time.
|
AnimatableValue |
getUnderlyingCSSValue(Element animElt,
AnimationTarget target,
java.lang.String pn)
Returns an AnimatableValue for the underlying value of a CSS property.
|
boolean |
hasStarted()
Returns whether animation processing has begun.
|
AnimatableValue |
parseAnimatableValue(Element animElt,
AnimationTarget target,
java.lang.String ns,
java.lang.String ln,
boolean isCSS,
java.lang.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 |
setAnimationLimitingNone()
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.
|
addAnimation, addTimegraphListener, getAnimationInfo, getSandwich, getTargetInfo, isPaused, moveToBottom, moveToTop, pushDown, removeAnimation, removeFill, removeTimegraphListener, sampledAt, sampledLastValue, tick, toActive, toInactive
protected BridgeContext ctx
protected CSSEngine cssEngine
protected boolean started
protected SVGAnimationEngine.AnimationTickRunnable animationTickRunnable
protected float initialStartTime
setCurrentTime(float)
.protected SVGAnimationEngine.UncomputedAnimatableStringValueFactory uncomputedAnimatableStringValueFactory
protected SVGAnimationEngine.AnimatableLengthOrIdentFactory animatableLengthOrIdentFactory
protected SVGAnimationEngine.AnimatableNumberOrIdentFactory animatableNumberOrIdentFactory
protected SVGAnimationEngine.Factory[] factories
AnimatableValue
parsing.protected boolean isSVG12
protected java.util.LinkedList initialBridges
protected StyleMap dummyStyleMap
SVGAnimationEngine.Factory
s when computing CSS values.protected SVGAnimationEngine.AnimationThread animationThread
protected int animationLimitingMode
protected float animationLimitingAmount
protected static final java.util.Set animationEventNames11
protected static final java.util.Set animationEventNames12
public SVGAnimationEngine(Document doc, BridgeContext ctx)
public void dispose()
dispose
in class AnimationEngine
public void addInitialBridge(SVGAnimationElementBridge b)
public boolean hasStarted()
public AnimatableValue parseAnimatableValue(Element animElt, AnimationTarget target, java.lang.String ns, java.lang.String ln, boolean isCSS, java.lang.String s)
public AnimatableValue getUnderlyingCSSValue(Element animElt, AnimationTarget target, java.lang.String pn)
public void pause()
pause
in class AnimationEngine
public void unpause()
unpause
in class AnimationEngine
public float getCurrentTime()
getCurrentTime
in class AnimationEngine
public float setCurrentTime(float t)
setCurrentTime
in class AnimationEngine
protected TimedDocumentRoot createDocumentRoot()
createDocumentRoot
in class AnimationEngine
public void start(long documentStartTime)
public void setAnimationLimitingNone()
public void setAnimationLimitingCPU(float pc)
pc
- the maximum percentage of CPU to use (0 < pc ≤ 1)public void setAnimationLimitingFPS(float fps)
fps
- the maximum number of frames per second (fps > 0)Copyright © 2022 Apache Software Foundation. All Rights Reserved.