|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.fop.svg.SVGDriver
Primary class that drives overall FOP process.
Once this class is instantiated, methods are called to set the Renderer to use, the (possibly multiple) ElementMapping(s) to use and the PrintWriter to use to output the results of the rendering (where applicable). In the case of the Renderer and ElementMapping(s), the Driver may be supplied either with the object itself, or the name of the class, in which case Driver will instantiate the class itself. The advantage of the latter is it enables runtime determination of Renderer and ElementMapping(s).
Once the Driver is set up, the buildFOTree method is called. Depending on whether DOM or SAX is being used, the invocation of the method is either buildFOTree(Document) or buildFOTree(Parser, InputSource) respectively.
A third possibility may be used to build the FO Tree, namely calling getDocumentHandler() and firing the SAX events yourself.
Once the FO Tree is built, the format() and render() methods may be called in that order.
Here is an example use of Driver from CommandLine.java:
Driver driver = new Driver(); driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version); driver.addElementMapping("org.apache.fop.fo.StandardElementMapping"); driver.addElementMapping("org.apache.fop.svg.SVGElementMapping"); driver.setWriter(new PrintWriter(new FileWriter(args[1]))); driver.buildFOTree(parser, fileInputSource(args[0])); driver.format(); driver.render();
Field Summary | |
protected SVGTreeBuilder |
treeBuilder
the FO tree builder |
protected java.io.PrintWriter |
writer
the PrintWriter to use to output the results of the renderer |
Constructor Summary | |
SVGDriver()
create a new Driver |
Method Summary | |
void |
addElementMapping(ElementMapping mapping)
add the given element mapping. |
void |
addElementMapping(java.lang.String mappingClassName)
add the element mapping with the given class name |
void |
addPropertyList(java.lang.String listClassName)
add the element mapping with the given class name |
void |
buildSVGTree(org.w3c.dom.Document document)
build the formatting object tree using the given DOM Document |
void |
buildSVGTree(org.xml.sax.XMLReader parser,
org.xml.sax.InputSource source)
build the formatting object tree using the given SAX Parser and SAX InputSource |
protected ElementMapping |
createElementMapping(java.lang.String mappingClassName)
protected method used by addElementMapping(String) to instantiate element mapping class |
protected PropertyListMapping |
createPropertyList(java.lang.String listClassName)
protected method used by addPropertyList(String) to instantiate list mapping class |
void |
format()
format the formatting object tree into an area tree |
org.xml.sax.ContentHandler |
getContentHandler()
return the tree builder (a SAX DocumentHandler). |
org.w3c.dom.svg.SVGDocument |
getSVGDocument()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected SVGTreeBuilder treeBuilder
protected java.io.PrintWriter writer
Constructor Detail |
public SVGDriver()
Method Detail |
public void addElementMapping(ElementMapping mapping)
public void addElementMapping(java.lang.String mappingClassName)
protected ElementMapping createElementMapping(java.lang.String mappingClassName)
public void addPropertyList(java.lang.String listClassName)
protected PropertyListMapping createPropertyList(java.lang.String listClassName)
public org.xml.sax.ContentHandler getContentHandler()
public void buildSVGTree(org.xml.sax.XMLReader parser, org.xml.sax.InputSource source) throws FOPException
public void buildSVGTree(org.w3c.dom.Document document) throws FOPException
public org.w3c.dom.svg.SVGDocument getSVGDocument()
public void format() throws FOPException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |