org.apache.fop.render.xml
Class XMLRenderer

java.lang.Object
  extended byorg.apache.fop.render.xml.XMLRenderer
All Implemented Interfaces:
Renderer

public class XMLRenderer
extends java.lang.Object
implements Renderer

Renderer that renders areas to XML for debugging purposes. Modified by Mark Lillywhite mark-fop@inomial.com to use the new renderer interface. Not 100% certain that this is correct.


Field Summary
protected  IDReferences idReferences
           
protected  int indent
          indentation to use for pretty-printing the XML
protected  Logger log
           
protected  java.util.Map options
          options
protected  java.lang.String producer
          the application producing the XML
protected  java.io.PrintWriter writer
          the writer used to output the XML
 
Constructor Summary
XMLRenderer()
           
 
Method Summary
protected  void drawImageClipped(int x, int y, int clipX, int clipY, int clipW, int clipH, FopImage image, FontState fs)
          Renders an image, clipping it as specified.
protected  void drawImageScaled(int x, int y, int w, int h, FopImage image, FontState fs)
          Renders an image, scaling it to the given width and height.
 IDReferences getIDReferences()
           
 void render(Page page, java.io.OutputStream outputStream)
          render the given area tree to the given stream
 void renderAreaContainer(AreaContainer area)
          render an area container to XML
 void renderBlockArea(BlockArea area)
          render a block area to XML
 void renderBodyAreaContainer(BodyAreaContainer area)
          render a body area container to XML
 void renderDisplaySpace(DisplaySpace space)
          render a display space to XML
 void renderForeignObjectArea(ForeignObjectArea area)
          render a foreign object area
 void renderImageArea(ImageArea area)
          render an image area to XML
 void renderInlineArea(InlineArea area)
           
 void renderInlineSpace(InlineSpace space)
          render an inline space to XML
 void renderLeaderArea(LeaderArea area)
          render a leader area to XML
 void renderLineArea(LineArea area)
          render a line area to XML
 void renderPage(Page page)
          render a page to XML
 void renderRegionAreaContainer(AreaContainer area)
          render a region area container to XML
 void renderSpanArea(SpanArea area)
          render a span area to XML
 void renderSVGArea(SVGArea area)
          render an SVG area to XML
 void renderWordArea(WordArea area)
          render an inline area to XML
 void setLogger(Logger logger)
          Set the logger
 void setOptions(java.util.Map options)
          set up renderer options
 void setProducer(java.lang.String producer)
          set the document's producer
 void setupFontInfo(FontInfo fontInfo)
          set up the font info
 void startRenderer(java.io.OutputStream outputStream)
          Default start renderer method.
 void stopRenderer(java.io.OutputStream outputStream)
          Default stop renderer method.
protected  void writeElement(java.lang.String element)
          write out an element
protected  void writeEmptyElementTag(java.lang.String tag)
          write out an empty-element-tag
protected  void writeEndTag(java.lang.String tag)
          write out an end tag
protected  void writeIndent()
          write out spaces to make indent
protected  void writeStartTag(java.lang.String tag)
          write out a start tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Logger log

indent

protected int indent
indentation to use for pretty-printing the XML


producer

protected java.lang.String producer
the application producing the XML


writer

protected java.io.PrintWriter writer
the writer used to output the XML


options

protected java.util.Map options
options


idReferences

protected IDReferences idReferences
Constructor Detail

XMLRenderer

public XMLRenderer()
Method Detail

setLogger

public void setLogger(Logger logger)
Description copied from interface: Renderer
Set the logger

Specified by:
setLogger in interface Renderer

setOptions

public void setOptions(java.util.Map options)
set up renderer options

Specified by:
setOptions in interface Renderer

setProducer

public void setProducer(java.lang.String producer)
set the document's producer

Specified by:
setProducer in interface Renderer
Parameters:
producer - string indicating application producing the XML

render

public void render(Page page,
                   java.io.OutputStream outputStream)
            throws java.io.IOException
Description copied from interface: Renderer
render the given area tree to the given stream

Specified by:
render in interface Renderer
Throws:
java.io.IOException

writeIndent

protected void writeIndent()
write out spaces to make indent


writeElement

protected void writeElement(java.lang.String element)
write out an element

Parameters:
element - the full text of the element including tags

writeEmptyElementTag

protected void writeEmptyElementTag(java.lang.String tag)
write out an empty-element-tag

Parameters:
tag - the text of the tag

writeEndTag

protected void writeEndTag(java.lang.String tag)
write out an end tag

Parameters:
tag - the text of the tag

writeStartTag

protected void writeStartTag(java.lang.String tag)
write out a start tag

Parameters:
tag - the text of the tag

setupFontInfo

public void setupFontInfo(FontInfo fontInfo)
                   throws FOPException
set up the font info

Specified by:
setupFontInfo in interface Renderer
Parameters:
fontInfo - the font info object to set up
Throws:
FOPException

drawImageScaled

protected void drawImageScaled(int x,
                               int y,
                               int w,
                               int h,
                               FopImage image,
                               FontState fs)
Renders an image, scaling it to the given width and height. If the scaled width and height is the same intrinsic size of the image, the image is not scaled.

Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
image - the image to be rendered
fs - the font state to use when rendering text in non-bitmapped images.

drawImageClipped

protected void drawImageClipped(int x,
                                int y,
                                int clipX,
                                int clipY,
                                int clipW,
                                int clipH,
                                FopImage image,
                                FontState fs)
Renders an image, clipping it as specified.

Parameters:
x - the x position of left edge in millipoints.
y - the y position of top edge in millipoints.
clipX - the left edge of the clip in millipoints
clipY - the top edge of the clip in millipoints
clipW - the clip width in millipoints
clipH - the clip height in millipoints
fs - the font state to use when rendering text in non-bitmapped images.

renderAreaContainer

public void renderAreaContainer(AreaContainer area)
render an area container to XML

Specified by:
renderAreaContainer in interface Renderer
Parameters:
area - the area container to render

renderBodyAreaContainer

public void renderBodyAreaContainer(BodyAreaContainer area)
render a body area container to XML

Specified by:
renderBodyAreaContainer in interface Renderer
Parameters:
area - the body area container to render

renderRegionAreaContainer

public void renderRegionAreaContainer(AreaContainer area)
render a region area container to XML

Specified by:
renderRegionAreaContainer in interface Renderer
Parameters:
area - the region area container to render

renderSpanArea

public void renderSpanArea(SpanArea area)
render a span area to XML

Specified by:
renderSpanArea in interface Renderer
Parameters:
area - the span area to render

renderBlockArea

public void renderBlockArea(BlockArea area)
render a block area to XML

Specified by:
renderBlockArea in interface Renderer
Parameters:
area - the block area to render

renderInlineArea

public void renderInlineArea(InlineArea area)

renderDisplaySpace

public void renderDisplaySpace(DisplaySpace space)
render a display space to XML

Specified by:
renderDisplaySpace in interface Renderer
Parameters:
space - the space to render

renderForeignObjectArea

public void renderForeignObjectArea(ForeignObjectArea area)
render a foreign object area

Specified by:
renderForeignObjectArea in interface Renderer

renderSVGArea

public void renderSVGArea(SVGArea area)
render an SVG area to XML

Specified by:
renderSVGArea in interface Renderer
Parameters:
area - the area to render

renderImageArea

public void renderImageArea(ImageArea area)
render an image area to XML

Specified by:
renderImageArea in interface Renderer
Parameters:
area - the area to render

renderWordArea

public void renderWordArea(WordArea area)
render an inline area to XML

Specified by:
renderWordArea in interface Renderer
Parameters:
area - the area to render

renderInlineSpace

public void renderInlineSpace(InlineSpace space)
render an inline space to XML

Specified by:
renderInlineSpace in interface Renderer
Parameters:
space - the space to render

renderLineArea

public void renderLineArea(LineArea area)
render a line area to XML

Specified by:
renderLineArea in interface Renderer
Parameters:
area - the area to render

renderPage

public void renderPage(Page page)
render a page to XML

Specified by:
renderPage in interface Renderer
Parameters:
page - the page to render

renderLeaderArea

public void renderLeaderArea(LeaderArea area)
render a leader area to XML

Specified by:
renderLeaderArea in interface Renderer
Parameters:
area - the area to render

startRenderer

public void startRenderer(java.io.OutputStream outputStream)
                   throws java.io.IOException
Default start renderer method. This would normally be overridden. (mark-fop@inomial.com).

Specified by:
startRenderer in interface Renderer
Throws:
java.io.IOException

stopRenderer

public void stopRenderer(java.io.OutputStream outputStream)
                  throws java.io.IOException
Default stop renderer method. This would normally be overridden. (mark-fop@inomial.com).

Specified by:
stopRenderer in interface Renderer
Throws:
java.io.IOException

getIDReferences

public IDReferences getIDReferences()
Specified by:
getIDReferences in interface Renderer


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.