org.apache.fop.fo.extensions.svg
Class SVGElement
java.lang.Object
org.apache.fop.fo.FONode
org.apache.fop.fo.XMLObj
org.apache.fop.fo.extensions.svg.SVGObj
org.apache.fop.fo.extensions.svg.SVGElement
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.EventListener, ContentHandlerFactory.ObjectBuiltListener
public class SVGElement
- extends SVGObj
class representing the SVG root element
for constructing an svg document.
Method Summary |
ContentHandlerFactory |
getContentHandlerFactory()
This method is overridden by extension elements and allows the extension element to return
a ContentHandlerFactory. |
java.awt.geom.Point2D |
getDimension(java.awt.geom.Point2D view)
Get the dimensions of this XML document. |
static java.awt.geom.Point2D |
getSize(int size,
org.w3c.dom.Element svgRoot,
float ptmm)
Get the size of the SVG root element. |
void |
processNode(java.lang.String elementName,
org.xml.sax.Locator locator,
org.xml.sax.Attributes attlist,
PropertyList propertyList)
Initialize the node with its name, location information, and attributes
The attributes must be used immediately as the sax attributes
will be altered for the next element. |
Methods inherited from class org.apache.fop.fo.FONode |
attachSiblings, attributeError, attributeWarning, bind, canHaveMarkers, charIterator, clone, clone, createPropertyList, decorateWithContextInfo, endOfNode, errorText, gatherContextInfo, getChildNodes, getChildNodes, getContextInfo, getExtensionAttachment, getFOEventHandler, getLocator, getLocatorString, getLogger, getName, getName, getNameId, getNodeString, getParent, getRoot, getUserAgent, inMarker, invalidChildError, invalidChildError, missingChildElementError, missingPropertyError, nodesOutOfOrderError, removeChild, setLocator, startOfNode, tooManyNodesError, tooManyNodesError, validateChildNode, warningText |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SVGElement
public SVGElement(FONode parent)
- Constructs an SVG object
- Parameters:
parent
- the parent formatting object
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
processNode
public void processNode(java.lang.String elementName,
org.xml.sax.Locator locator,
org.xml.sax.Attributes attlist,
PropertyList propertyList)
throws FOPException
- Initialize the node with its name, location information, and attributes
The attributes must be used immediately as the sax attributes
will be altered for the next element.
- Overrides:
processNode
in class XMLObj
- Parameters:
elementName
- element name (e.g., "fo:block")locator
- Locator object (ignored by default)attlist
- Collection of attributes passed to us from the parser.propertyList
- the property list of the parent node
- Throws:
FOPException
- for errors or inconsistencies in the attributes
getDimension
public java.awt.geom.Point2D getDimension(java.awt.geom.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 java.awt.geom.Point2D getSize(int size,
org.w3c.dom.Element svgRoot,
float ptmm)
- Get the size of the SVG root element.
- Parameters:
size
- the font sizesvgRoot
- the svg root elementptmm
- the pixel to millimeter conversion factor
- Returns:
- the size of the SVG document
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.