Class SVGNode

  • All Implemented Interfaces:
    Peer

    public class SVGNode
    extends Element
    SVGNode is alot like GenericNode. It's a single class that represents many SVG elements.
    • Constructor Detail

      • SVGNode

        public SVGNode​(Element parent,
                       Node prevSibling)
    • Method Detail

      • getAttribute

        public Attribute getAttribute​(int eTag,
                                      boolean bPeek,
                                      boolean bValidate)
        Description copied from class: Element
        Gets this element's attribute whose attribute tag is given.

        To peek at an attribute, set the peek argument to true. If the attribute is present, it is returned; otherwise null is returned.

        To create an attribute, set the peek argument to false. If the attribute is absent, a default attribute is created and returned; for attributes with no default, null is returned.

        If validation argument is true, and the validation fails, this method throws.

        Overrides:
        getAttribute in class Element
        Parameters:
        eTag - the tag of the attribute.
        bPeek - whether to peek at the attribute or not.
        bValidate - whether to validate the attribute or not.
        Returns:
        the attribute.
      • getRegionGroup

        public SVGNode getRegionGroup​(boolean bCheckCaption)
        Find the SVG <gesc> element that corresponds to the caption region of the XFA box model. This node is identified by having a <desc> element with the text: "Caption"
        Parameters:
        bCheckCaption - if true get the caption node else get content
        Returns:
        the caption group. Null object if not found.
      • getMeasurement

        public UnitSpan getMeasurement​(int eTag)
        Convenience method for getting an attribute that's represented as a measurement value
        Parameters:
        eTag - - the attribute to get
        Returns:
        value - the value of the attribute
      • parseTransform

        public void parseTransform​(UnitSpan x,
                                   UnitSpan y,
                                   int r)
        Convenience method for getting the offset and rotation out of a transform attribute in the form of transform="translate(x y) rotate(r)". Note that this method does not handle any other transform operations.
        Parameters:
        x - the parsed X offset
        y - the parsed Y Offset
        r - the rotation angle
      • getSVGWidth

        public UnitSpan getSVGWidth()
        Get the width of this SVG fragment.
        Returns:
        the width attribute from the root element
      • getSVGHeight

        public UnitSpan getSVGHeight()
        Get the height of this SVG fragment.
        Returns:
        the hieght attribute from the root element
      • storeGlyphs

        public void storeGlyphs​(java.lang.Object oFontInstance,
                                int[] glyphs,
                                int nGlyphs)
        Store the Glyphs represented by this node. This method is used as an optimization. Once an external agent has gone to the trouble of parsing our content, we allow them to store the result. This method is appropriate only if the underlying node is an
        Parameters:
        oFontInstance - - the font we resolved to
        glyphs - - The array of glyphs
        nGlyphs - - the number of glyphs in the array
      • storeText

        public void storeText​(java.lang.Object oFontInstance,
                              java.lang.String text)
        Store the text represented by this node. This method is used as an optimization. Once an external agent has gone to the trouble of parsing our content, we allow them to store the result. This method is appropriate only if the underlying node is an
        Parameters:
        oFontInstance - - the font we resolved to
        text - - the text to store