Class SVGAnimationEngine

java.lang.Object
org.apache.batik.anim.AnimationEngine
org.apache.batik.bridge.SVGAnimationEngine

public class SVGAnimationEngine extends AnimationEngine
An AnimationEngine for SVG documents.
Version:
$Id: SVGAnimationEngine.java 1851346 2019-01-15 13:41:00Z ssteiner $
  • Field Details

    • ctx

      protected BridgeContext ctx
      The BridgeContext to use for value parsing.
    • cssEngine

      protected CSSEngine cssEngine
      The CSSEngine used for CSS value parsing.
    • 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.
    • animationTickRunnable

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

      protected float initialStartTime
      The initial time that will be seeked to when the animation engine starts, as set by setCurrentTime(float).
    • uncomputedAnimatableStringValueFactory

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

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

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

      protected SVGAnimationEngine.Factory[] factories
      Factories for AnimatableValue parsing.
    • isSVG12

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

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

      protected StyleMap dummyStyleMap
      A StyleMap used by the SVGAnimationEngine.Factorys when computing CSS values.
    • animationThread

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

      protected int animationLimitingMode
      The animation limiting mode.
    • animationLimitingAmount

      protected float animationLimitingAmount
      The amount of animation limiting.
    • 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.
  • Constructor Details

    • SVGAnimationEngine

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

    • dispose

      public void dispose()
      Disposes this animation engine.
      Overrides:
      dispose in class AnimationEngine
    • addInitialBridge

      public void addInitialBridge(SVGAnimationElementBridge b)
      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

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

      public void pause()
      Pauses the animations.
      Overrides:
      pause in class AnimationEngine
    • unpause

      public void unpause()
      Pauses the animations.
      Overrides:
      unpause in class AnimationEngine
    • getCurrentTime

      public float getCurrentTime()
      Returns the current document time.
      Overrides:
      getCurrentTime in class AnimationEngine
    • setCurrentTime

      public float setCurrentTime(float t)
      Sets the current document time.
      Overrides:
      setCurrentTime in class AnimationEngine
    • createDocumentRoot

      protected TimedDocumentRoot createDocumentRoot()
      Creates a new returns a new TimedDocumentRoot object for the document.
      Specified by:
      createDocumentRoot in class AnimationEngine
    • 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)