Class SVGAnimationEngine


  • public class SVGAnimationEngine
    extends AnimationEngine
    An AnimationEngine for SVG documents.
    • Field Detail

      • 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.
      • initialStartTime

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

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

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

        protected int animationLimitingMode
        The animation limiting mode.
      • animationLimitingAmount

        protected float animationLimitingAmount
        The amount of animation limiting.
      • animationEventNames11

        protected static final java.util.Set animationEventNames11
        Set of SMIL animation event names for SVG 1.1.
      • animationEventNames12

        protected static final java.util.Set animationEventNames12
        Set of SMIL animation event names for SVG 1.2.
    • Constructor Detail

      • SVGAnimationEngine

        public SVGAnimationEngine​(org.w3c.dom.Document doc,
                                  BridgeContext ctx)
        Creates a new SVGAnimationEngine.
    • Method Detail

      • 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​(org.w3c.dom.Element animElt,
                                                    AnimationTarget target,
                                                    java.lang.String ns,
                                                    java.lang.String ln,
                                                    boolean isCSS,
                                                    java.lang.String s)
        Parses an AnimatableValue.
      • getUnderlyingCSSValue

        public AnimatableValue getUnderlyingCSSValue​(org.w3c.dom.Element animElt,
                                                     AnimationTarget target,
                                                     java.lang.String pn)
        Returns an AnimatableValue for the underlying value of a CSS property.
      • 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)