Class SVGAnimationElementBridge

    • Field Detail

      • element

        protected SVGOMElement element
        The animation element.
      • eng

        protected SVGAnimationEngine eng
        The AnimationEngine that manages all of the animations in the document.
      • timedElement

        protected TimedElement timedElement
        The TimedElement object that provides the timing for the animation.
      • animation

        protected AbstractAnimation animation
        The animation object that provides the values for the animation.
      • attributeNamespaceURI

        protected java.lang.String attributeNamespaceURI
        The namespace URI of the attribute being animated.
      • attributeLocalName

        protected java.lang.String attributeLocalName
        The local name of the attribute or the name of the property being animated.
      • animationType

        protected short animationType
        The animation type. Must be one of the ANIM_TYPE_* constants defined in AnimationEngine.
      • targetElement

        protected SVGOMElement targetElement
        The target element of the animation.
      • animationTarget

        protected AnimationTarget animationTarget
        The AnimationTarget the provides a context to the animation engine.
    • Constructor Detail

      • SVGAnimationElementBridge

        public SVGAnimationElementBridge()
    • Method Detail

      • getTimedElement

        public TimedElement getTimedElement()
        Returns the TimedElement for the animation.
      • getUnderlyingValue

        public AnimatableValue getUnderlyingValue()
        Returns the underlying value of the animated attribute. Used for composition of additive animations. This should be overridden in descendant classes that are for 'other' animations.
        Specified by:
        getUnderlyingValue in interface AnimatableElement
      • handleElement

        public void handleElement​(BridgeContext ctx,
                                  org.w3c.dom.Element e)
        Handles this animation element.
        Specified by:
        handleElement in interface GenericBridge
        Parameters:
        ctx - the bridge context to use
        e - the element being handled
      • initializeAnimation

        protected void initializeAnimation()
        Parses the animation element's target attributes and adds it to the document's AnimationEngine.
      • canAnimateType

        protected abstract boolean canAnimateType​(int type)
        Returns whether the animation element being handled by this bridge can animate attributes of the specified type.
        Parameters:
        type - one of the TYPE_ constants defined in SVGTypes.
      • checkValueType

        protected boolean checkValueType​(AnimatableValue v)
        Returns whether the specified AnimatableValue is of a type allowed by this animation.
      • initializeTimedElement

        protected void initializeTimedElement()
        Parses the animation element's timing attributes and initializes the TimedElement object.
      • createTimedElement

        protected TimedElement createTimedElement()
        Creates a TimedElement for the animation element.
      • parseAnimatableValue

        protected AnimatableValue parseAnimatableValue​(java.lang.String an)
        Parses an attribute as an AnimatableValue.
      • initializeTimedElement

        protected void initializeTimedElement​(TimedElement timedElement)
        Initializes the timing attributes of the timed element.
      • handleDOMAttrModifiedEvent

        public void handleDOMAttrModifiedEvent​(org.w3c.dom.events.MutationEvent evt)
        Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
        Specified by:
        handleDOMAttrModifiedEvent in interface BridgeUpdateHandler
      • handleDOMNodeInsertedEvent

        public void handleDOMNodeInsertedEvent​(org.w3c.dom.events.MutationEvent evt)
        Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.
        Specified by:
        handleDOMNodeInsertedEvent in interface BridgeUpdateHandler
      • handleDOMNodeRemovedEvent

        public void handleDOMNodeRemovedEvent​(org.w3c.dom.events.MutationEvent evt)
        Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
        Specified by:
        handleDOMNodeRemovedEvent in interface BridgeUpdateHandler
      • handleDOMCharacterDataModified

        public void handleDOMCharacterDataModified​(org.w3c.dom.events.MutationEvent evt)
        Invoked when an MutationEvent of type 'DOMCharacterDataModified' is fired.
        Specified by:
        handleDOMCharacterDataModified in interface BridgeUpdateHandler
      • dispose

        public void dispose()
        Disposes this BridgeUpdateHandler and releases all resources.
        Specified by:
        dispose in interface BridgeUpdateHandler
      • getPixelUnitToMillimeter

        public float getPixelUnitToMillimeter()
        Returns the size of a px CSS unit in millimeters.
        Specified by:
        getPixelUnitToMillimeter in interface SVGContext
      • getBBox

        public java.awt.geom.Rectangle2D getBBox()
        Description copied from interface: SVGContext
        Returns the tight bounding box in current user space (i.e., after application of the transform attribute, if any) on the geometry of all contained graphics elements, exclusive of stroke-width and filter effects).
        Specified by:
        getBBox in interface SVGContext
      • getScreenTransform

        public java.awt.geom.AffineTransform getScreenTransform()
        Description copied from interface: SVGContext
        Returns the transform from the global transform space to pixels.
        Specified by:
        getScreenTransform in interface SVGContext
      • setScreenTransform

        public void setScreenTransform​(java.awt.geom.AffineTransform at)
        Description copied from interface: SVGContext
        Sets the transform to be used from the global transform space to pixels.
        Specified by:
        setScreenTransform in interface SVGContext
      • getCTM

        public java.awt.geom.AffineTransform getCTM()
        Description copied from interface: SVGContext
        Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the viewport coordinate system for the nearestViewportElement.
        Specified by:
        getCTM in interface SVGContext
      • getGlobalTransform

        public java.awt.geom.AffineTransform getGlobalTransform()
        Description copied from interface: SVGContext
        Returns the global transformation matrix from the current element to the root.
        Specified by:
        getGlobalTransform in interface SVGContext
      • getViewportWidth

        public float getViewportWidth()
        Description copied from interface: SVGContext
        Returns the width of the viewport which directly contains the associated element.
        Specified by:
        getViewportWidth in interface SVGContext
      • getViewportHeight

        public float getViewportHeight()
        Description copied from interface: SVGContext
        Returns the height of the viewport which directly contains the associated element.
        Specified by:
        getViewportHeight in interface SVGContext
      • getFontSize

        public float getFontSize()
        Description copied from interface: SVGContext
        Returns the font-size on the associated element.
        Specified by:
        getFontSize in interface SVGContext
      • svgToUserSpace

        public float svgToUserSpace​(float v,
                                    int type,
                                    int pcInterp)
      • addTargetListener

        public void addTargetListener​(java.lang.String pn,
                                      AnimationTargetListener l)
        Adds a listener for changes to the given attribute value.
      • removeTargetListener

        public void removeTargetListener​(java.lang.String pn,
                                         AnimationTargetListener l)
        Removes a listener for changes to the given attribute value.
      • getTargetElement

        public org.w3c.dom.svg.SVGElement getTargetElement()
        DOM: Implements SVGAnimationElement.getTargetElement().
        Specified by:
        getTargetElement in interface SVGAnimationContext
      • getStartTime

        public float getStartTime()
        DOM: Implements SVGAnimationElement.getStartTime().
        Specified by:
        getStartTime in interface SVGAnimationContext
      • getCurrentTime

        public float getCurrentTime()
        DOM: Implements SVGAnimationElement.getCurrentTime().
        Specified by:
        getCurrentTime in interface SVGAnimationContext
      • getSimpleDuration

        public float getSimpleDuration()
        DOM: Implements SVGAnimationElement.getSimpleDuration(). With the difference that an indefinite simple duration is returned as TimedElement.INDEFINITE, rather than throwing an exception.
        Specified by:
        getSimpleDuration in interface SVGAnimationContext
      • getHyperlinkBeginTime

        public float getHyperlinkBeginTime()
        Returns the time that the document would seek to if this animation element were hyperlinked to, or NaN if there is no such begin time.
        Specified by:
        getHyperlinkBeginTime in interface SVGAnimationContext
      • beginElement

        public boolean beginElement()
                             throws org.w3c.dom.DOMException
        DOM: Implements ElementTimeControl.beginElement().
        Specified by:
        beginElement in interface org.w3c.dom.smil.ElementTimeControl
        Throws:
        org.w3c.dom.DOMException
      • beginElementAt

        public boolean beginElementAt​(float offset)
                               throws org.w3c.dom.DOMException
        DOM: Implements ElementTimeControl.beginElementAt(float).
        Specified by:
        beginElementAt in interface org.w3c.dom.smil.ElementTimeControl
        Throws:
        org.w3c.dom.DOMException
      • endElement

        public boolean endElement()
                           throws org.w3c.dom.DOMException
        DOM: Implements ElementTimeControl.endElement().
        Specified by:
        endElement in interface org.w3c.dom.smil.ElementTimeControl
        Throws:
        org.w3c.dom.DOMException
      • endElementAt

        public boolean endElementAt​(float offset)
                             throws org.w3c.dom.DOMException
        DOM: Implements ElementTimeControl.endElementAt(float).
        Specified by:
        endElementAt in interface org.w3c.dom.smil.ElementTimeControl
        Throws:
        org.w3c.dom.DOMException
      • isConstantAnimation

        protected boolean isConstantAnimation()
        Returns whether this is a constant animation (i.e., a 'set' animation).