org.apache.batik.bridge

Class SVGAnimationEngine

public class SVGAnimationEngine extends AnimationEngine

An AnimationEngine for SVG documents.
Nested Class Summary
protected classSVGAnimationEngine.AnimatableAngleOrIdentFactory
Factory class for {@link AnimatableAngleOrIdentValue}s.
protected classSVGAnimationEngine.AnimatableAngleValueFactory
Factory class for {@link AnimatableAngleValue}s.
protected classSVGAnimationEngine.AnimatableBooleanValueFactory
Factory class for {@link AnimatableBooleanValue}s.
protected classSVGAnimationEngine.AnimatableColorValueFactory
Factory class for {@link AnimatableColorValue}s.
protected classSVGAnimationEngine.AnimatableIntegerValueFactory
Factory class for {@link AnimatableIntegerValue}s.
protected classSVGAnimationEngine.AnimatableLengthListValueFactory
Factory class for {@link AnimatableLengthListValue}s.
protected classSVGAnimationEngine.AnimatableLengthOrIdentFactory
Factory class for {@link AnimatableLengthOrIdentValue}s.
protected classSVGAnimationEngine.AnimatableLengthValueFactory
Factory class for {@link AnimatableLengthValue}s.
protected classSVGAnimationEngine.AnimatableNumberListValueFactory
Factory class for {@link AnimatableNumberListValue}s.
protected classSVGAnimationEngine.AnimatableNumberOrIdentFactory
Factory class for {@link AnimatableNumberOrIdentValue}s.
protected classSVGAnimationEngine.AnimatableNumberOrPercentageValueFactory
Factory class for {@link AnimatableNumberOrPercentageValue}s.
protected classSVGAnimationEngine.AnimatableNumberValueFactory
Factory class for {@link AnimatableNumberValue}s.
protected classSVGAnimationEngine.AnimatablePaintValueFactory
Factory class for {@link AnimatablePaintValue}s.
protected classSVGAnimationEngine.AnimatablePathDataFactory
Factory class for {@link AnimatablePathDataValue}s.
protected classSVGAnimationEngine.AnimatablePointListValueFactory
Factory class for {@link AnimatablePointListValue}s.
protected classSVGAnimationEngine.AnimatablePreserveAspectRatioValueFactory
Factory class for {@link AnimatablePreserveAspectRatioValue}s.
protected classSVGAnimationEngine.AnimatableStringValueFactory
Factory class for computed CSS {@link AnimatableStringValue}s.
protected classSVGAnimationEngine.AnimationRoot
A class for the root time container.
protected classSVGAnimationEngine.AnimationThread
The thread that ticks the animation.
protected static classSVGAnimationEngine.AnimationTickRunnable
Idle runnable to tick the animation.
protected abstract classSVGAnimationEngine.CSSValueFactory
Factory class for AnimatableValues for CSS properties.
protected static classSVGAnimationEngine.DebugAnimationTickRunnable
Idle runnable to tick the animation, that reads times from System.in.
protected interfaceSVGAnimationEngine.Factory
Interface for AnimatableValue factories.
protected classSVGAnimationEngine.UncomputedAnimatableStringValueFactory
Factory class for {@link AnimatableStringValue}s.
Field Summary
protected SVGAnimationEngine.AnimatableLengthOrIdentFactoryanimatableLengthOrIdentFactory
The factory for length-or-ident values.
protected SVGAnimationEngine.AnimatableNumberOrIdentFactoryanimatableNumberOrIdentFactory
The factory for number-or-ident values.
protected static SetanimationEventNames11
Set of SMIL animation event names for SVG 1.1.
protected static SetanimationEventNames12
Set of SMIL animation event names for SVG 1.2.
protected floatanimationLimitingAmount
The amount of animation limiting.
protected intanimationLimitingMode
The animation limiting mode.
protected SVGAnimationEngine.AnimationThreadanimationThread
The thread that ticks the animation engine.
protected SVGAnimationEngine.AnimationTickRunnableanimationTickRunnable
The Runnable that ticks the document.
protected CSSEnginecssEngine
The CSSEngine used for CSS value parsing.
protected BridgeContextctx
The BridgeContext to use for value parsing.
protected StyleMapdummyStyleMap
A StyleMap used by the {@link Factory}s when computing CSS values.
protected SVGAnimationEngine.Factory[]factories
Factories for {@link AnimatableValue} parsing.
protected LinkedListinitialBridges
List of bridges that will be initialized when the document is started.
protected booleanisSVG12
Whether the document is an SVG 1.2 document.
protected booleanstarted
Whether animation processing has started.
protected SVGAnimationEngine.UncomputedAnimatableStringValueFactoryuncomputedAnimatableStringValueFactory
The factory for unparsed string values.
Constructor Summary
SVGAnimationEngine(Document doc, BridgeContext ctx)
Creates a new SVGAnimationEngine.
Method Summary
voidaddInitialBridge(SVGAnimationElementBridge b)
Adds an animation element bridge to the list of bridges that require initializing when the document is started.
protected TimedDocumentRootcreateDocumentRoot()
Creates a new returns a new TimedDocumentRoot object for the document.
voiddispose()
Disposes this animation engine.
floatgetCurrentTime()
Returns the current document time.
AnimatableValuegetUnderlyingCSSValue(Element animElt, AnimationTarget target, String pn)
Returns an AnimatableValue for the underlying value of a CSS property.
booleanhasStarted()
Returns whether animation processing has begun.
AnimatableValueparseAnimatableValue(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.
voidsetAnimationLimitingNone()
Sets 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.

Field Detail

animatableLengthOrIdentFactory

protected SVGAnimationEngine.AnimatableLengthOrIdentFactory animatableLengthOrIdentFactory
The factory for length-or-ident values.

animatableNumberOrIdentFactory

protected SVGAnimationEngine.AnimatableNumberOrIdentFactory animatableNumberOrIdentFactory
The factory for number-or-ident values.

animationEventNames11

protected static final Set animationEventNames11
Set of SMIL animation event names for SVG 1.1.

animationEventNames12

protected static final Set animationEventNames12
Set of SMIL animation event names for SVG 1.2.

animationLimitingAmount

protected float animationLimitingAmount
The amount of animation limiting.

animationLimitingMode

protected int animationLimitingMode
The animation limiting mode.

animationThread

protected SVGAnimationEngine.AnimationThread animationThread
The thread that ticks the animation engine.

animationTickRunnable

protected SVGAnimationEngine.AnimationTickRunnable animationTickRunnable
The Runnable that ticks the document.

cssEngine

protected CSSEngine cssEngine
The CSSEngine used for CSS value parsing.

ctx

protected BridgeContext ctx
The BridgeContext to use for value parsing.

dummyStyleMap

protected StyleMap dummyStyleMap
A StyleMap used by the {@link Factory}s when computing CSS values.

factories

protected SVGAnimationEngine.Factory[] factories
Factories for {@link AnimatableValue} parsing.

initialBridges

protected LinkedList initialBridges
List of bridges that will be initialized when the document is started.

isSVG12

protected boolean isSVG12
Whether the document is an SVG 1.2 document.

started

protected boolean started
Whether animation processing has started. This affects whether animation element bridges add their animation on to the initial bridge list, or process them immediately.

uncomputedAnimatableStringValueFactory

protected SVGAnimationEngine.UncomputedAnimatableStringValueFactory uncomputedAnimatableStringValueFactory
The factory for unparsed string values.

Constructor Detail

SVGAnimationEngine

public SVGAnimationEngine(Document doc, BridgeContext ctx)
Creates a new SVGAnimationEngine.

Method Detail

addInitialBridge

public void addInitialBridge(SVGAnimationElementBridge b)
Adds an animation element bridge to the list of bridges that require initializing when the document is started.

createDocumentRoot

protected TimedDocumentRoot createDocumentRoot()
Creates a new returns a new TimedDocumentRoot object for the document.

dispose

public void dispose()
Disposes this animation engine.

getCurrentTime

public float getCurrentTime()
Returns the current document time.

getUnderlyingCSSValue

public AnimatableValue getUnderlyingCSSValue(Element animElt, AnimationTarget target, String pn)
Returns an AnimatableValue for the underlying value of a CSS property.

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.

pause

public void pause()
Pauses the animations.

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)

setAnimationLimitingNone

public void setAnimationLimitingNone()
Sets the animation limiting mode to "none".

setCurrentTime

public float setCurrentTime(float t)
Sets the current document time.

start

public void start(long documentStartTime)
Starts the animation engine.

unpause

public void unpause()
Pauses the animations.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.