Class SVGElement

All Implemented Interfaces:
Cloneable, EventListener, ContentHandlerFactory.ObjectBuiltListener

public class SVGElement extends SVGObj
Class representing the SVG root element for constructing an SVG document.
  • Constructor Details

    • SVGElement

      public SVGElement(FONode parent)
      Constructs an SVG object
      Parameters:
      parent - the parent formatting object
  • Method Details

    • getContentHandlerFactory

      public ContentHandlerFactory getContentHandlerFactory()
      This method is overridden by extension elements and allows the extension element to return a ContentHandlerFactory. This factory can create ContentHandler implementations that handle foreign XML content by either building up a specific DOM, a Java object or something else.
      Overrides:
      getContentHandlerFactory in class FONode
      Returns:
      the ContentHandlerFactory or null if not applicable
    • getDimension

      public Point2D getDimension(Point2D view)
      Get the dimensions of this XML document.
      Overrides:
      getDimension in class XMLObj
      Parameters:
      view - the viewport dimensions
      Returns:
      the dimensions of this SVG document
    • getSize

      public static Point2D getSize(int size, Element svgRoot, float ptmm)
      Get the size of the SVG root element.
      Parameters:
      size - the font size
      svgRoot - the svg root element
      ptmm - the pixel to millimeter conversion factor
      Returns:
      the size of the SVG document