|
fop 0.93 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.fop.render.AbstractRenderer
org.apache.fop.render.PrintRenderer
org.apache.fop.render.xml.XMLRenderer
Renderer that renders areas to XML for debugging purposes. This creates an xml that contains the information of the area tree. It does not output any state or derived information. The output can be used to build a new area tree (@see AreaTreeBuilder) which can be rendered to any renderer.
| Field Summary | |
protected org.xml.sax.helpers.AttributesImpl |
atts
AttributesImpl instance that can be used during XML generation. |
static java.lang.String |
CDATA
CDATA type |
static org.xml.sax.Attributes |
EMPTY_ATTS
An empty Attributes object used when no attributes are needed. |
protected java.util.List |
extensionAttachments
A list of ExtensionAttachements received through processOffDocumentItem() |
protected org.xml.sax.ContentHandler |
handler
ContentHandler that the generated XML is written to |
protected Renderer |
mimic
If not null, the XMLRenderer will mimic another renderer by using its font setup. |
static java.lang.String |
NS
Main namespace in use. |
protected java.io.OutputStream |
out
The OutputStream to write the generated XML to. |
static java.lang.String |
XML_MIME_TYPE
XML MIME type |
| Fields inherited from class org.apache.fop.render.PrintRenderer |
fontInfo, fontList |
| Fields inherited from class org.apache.fop.render.AbstractRenderer |
containingBPPosition, containingIPPosition, currentBPPosition, currentIPPosition, currentPageViewport, log, userAgent |
| Fields inherited from interface org.apache.fop.render.Renderer |
ROLE |
| Constructor Summary | |
XMLRenderer()
Creates a new XML renderer. |
|
| Method Summary | |
protected void |
addAreaAttributes(Area area)
Adds the general Area attributes. |
protected void |
addAttribute(QName name,
java.lang.String value)
Adds a new attribute to the protected member variable "atts". |
protected void |
addAttribute(java.lang.String name,
int value)
Adds a new attribute to the protected member variable "atts". |
protected void |
addAttribute(java.lang.String name,
java.awt.geom.Rectangle2D rect)
Adds a new attribute to the protected member variable "atts". |
protected void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds a new attribute to the protected member variable "atts". |
protected void |
addTraitAttributes(Area area)
Adds attributes from traits of an Area. |
protected void |
characters(java.lang.String text)
Sends plain text to the XML |
protected void |
comment(java.lang.String comment)
Writes a comment to the generated XML. |
void |
configure(org.apache.avalon.framework.configuration.Configuration cfg)
Configure the XML renderer. |
protected void |
endElement(java.lang.String tagName)
Ends an element. |
protected void |
endVParea()
Signals exit from a viewport area. |
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
protected void |
handleSAXException(org.xml.sax.SAXException saxe)
Handles SAXExceptions. |
void |
mimicRenderer(Renderer renderer)
Call this method to make the XMLRenderer mimic a different renderer by using its font setup. |
void |
processOffDocumentItem(OffDocumentItem oDI)
Tells the renderer to process an item not explicitly placed on the document (e.g., PDF bookmarks). |
protected void |
renderBeforeFloat(BeforeFloat bf)
Renders a before float area. |
protected void |
renderBlock(Block block)
Renders a block area. |
void |
renderContainer(Container cont)
Tells the renderer to render an inline container. |
protected void |
renderFlow(NormalFlow flow)
Renders a flow reference area. |
protected void |
renderFootnote(Footnote footnote)
Renders a footnote |
void |
renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
Renders an fo:foreing-object. |
void |
renderImage(Image image,
java.awt.geom.Rectangle2D pos)
Renders an image area. |
protected void |
renderInlineAreaBackAndBorders(InlineArea area)
Common method to render the background and borders for any inline area. |
protected void |
renderInlineBlockParent(InlineBlockParent ibp)
Render the given InlineBlockParent. |
protected void |
renderInlineParent(InlineParent ip)
Render the given InlineParent. |
protected void |
renderInlineSpace(Space space)
Render the given Space. |
protected void |
renderLeader(Leader area)
Render the given Leader. |
protected void |
renderLineArea(LineArea line)
Renders a line area. |
protected void |
renderMainReference(MainReference mr)
Renders the main reference area. |
void |
renderPage(PageViewport page)
Tells the renderer to render a particular page. |
protected void |
renderRegionViewport(RegionViewport port)
Renders a region viewport. |
protected void |
renderSpace(SpaceArea space)
Render the given SpaceArea. |
protected void |
renderText(TextArea text)
Render the given TextArea. |
protected void |
renderViewport(Viewport viewport)
Render the given Viewport. |
protected void |
renderWord(WordArea word)
Render the given WordArea. |
void |
setCompactFormat(boolean compact)
|
void |
setContentHandler(org.xml.sax.ContentHandler handler)
Sets an outside TransformerHandler to use instead of the default one create in this class in startRenderer(). |
void |
setupFontInfo(FontInfo inFontInfo)
Set up the font info |
void |
setUserAgent(FOUserAgent agent)
Set the User Agent. |
protected void |
startElement(java.lang.String tagName)
Starts a new element (without attributes). |
protected void |
startElement(java.lang.String tagName,
org.xml.sax.Attributes atts)
Starts a new element. |
void |
startPageSequence(LineArea seqTitle)
Tells the renderer that a new page sequence starts. |
void |
startRenderer(java.io.OutputStream outputStream)
Initiates the rendering phase. |
protected void |
startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. |
| Methods inherited from class org.apache.fop.render.PrintRenderer |
createRendererContext, getFontFromArea, getInternalFontNameForArea, lightenColor, renderDocument |
| Methods inherited from class org.apache.fop.render.AbstractRenderer |
convertTitleToString, getCurrentPageViewport, getGraphics2DAdapter, getHandlerConfig, getImageAdapter, handleBlockTraits, handleRegionTraits, preparePage, renderBlocks, renderBlockViewport, renderBodyRegion, renderCharacter, renderInlineArea, renderPageAreas, renderRegion, renderXML, supportsOutOfOrder |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String XML_MIME_TYPE
public static final java.lang.String NS
public static final java.lang.String CDATA
public static final org.xml.sax.Attributes EMPTY_ATTS
protected Renderer mimic
protected org.xml.sax.ContentHandler handler
protected org.xml.sax.helpers.AttributesImpl atts
protected java.io.OutputStream out
protected java.util.List extensionAttachments
| Constructor Detail |
public XMLRenderer()
| Method Detail |
public void configure(org.apache.avalon.framework.configuration.Configuration cfg)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfigure in class AbstractRendererorg.apache.avalon.framework.configuration.ConfigurationExceptionConfigurable.configure(Configuration)public void setUserAgent(FOUserAgent agent)
Renderer
setUserAgent in interface RenderersetUserAgent in class AbstractRendererRenderer.setUserAgent(FOUserAgent)public void mimicRenderer(Renderer renderer)
renderer - the renderer to mimicpublic void setupFontInfo(FontInfo inFontInfo)
PrintRenderer
setupFontInfo in interface RenderersetupFontInfo in class PrintRendererinFontInfo - font info to set upPrintRenderer.setupFontInfo(org.apache.fop.fonts.FontInfo)public void setContentHandler(org.xml.sax.ContentHandler handler)
handler - Overriding TransformerHandlerpublic void setCompactFormat(boolean compact)
protected void handleSAXException(org.xml.sax.SAXException saxe)
saxe - the SAXException to handleprotected void comment(java.lang.String comment)
comment - the commentprotected void startElement(java.lang.String tagName)
tagName - tag name of the element
protected void startElement(java.lang.String tagName,
org.xml.sax.Attributes atts)
tagName - tag name of the elementatts - attributes to addprotected void endElement(java.lang.String tagName)
tagName - tag name of the elementprotected void characters(java.lang.String text)
text - the text
protected void addAttribute(java.lang.String name,
java.lang.String value)
name - name of the attributevalue - value of the attribute
protected void addAttribute(QName name,
java.lang.String value)
name - name of the attributevalue - value of the attribute
protected void addAttribute(java.lang.String name,
int value)
name - name of the attributevalue - value of the attribute
protected void addAttribute(java.lang.String name,
java.awt.geom.Rectangle2D rect)
name - name of the attributerect - a Rectangle2D to format and use as attribute valueprotected void addAreaAttributes(Area area)
area - Area to extract attributes fromprotected void addTraitAttributes(Area area)
area - Area to extract traits frompublic void processOffDocumentItem(OffDocumentItem oDI)
Renderer
processOffDocumentItem in interface RendererprocessOffDocumentItem in class AbstractRendererAbstractRenderer.processOffDocumentItem(OffDocumentItem)
public void startRenderer(java.io.OutputStream outputStream)
throws java.io.IOException
Renderer
startRenderer in interface RendererstartRenderer in class AbstractRendererjava.io.IOExceptionRenderer.startRenderer(OutputStream)
public void stopRenderer()
throws java.io.IOException
Renderer
stopRenderer in interface RendererstopRenderer in class AbstractRendererjava.io.IOExceptionRenderer.stopRenderer()
public void renderPage(PageViewport page)
throws java.io.IOException,
FOPException
Renderer
renderPage in interface RendererrenderPage in class AbstractRendererjava.io.IOException
FOPExceptionRenderer.renderPage(PageViewport)public void startPageSequence(LineArea seqTitle)
Renderer
startPageSequence in interface RendererstartPageSequence in class AbstractRendererRenderer.startPageSequence(LineArea)protected void renderRegionViewport(RegionViewport port)
AbstractRendererThe region may clip the area and it establishes a position from where the region is placed.
renderRegionViewport in class AbstractRendererport - The region viewport to be renderedAbstractRenderer.renderRegionViewport(RegionViewport)
protected void startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
AbstractRenderer
startVParea in class AbstractRendererctm - the coordinate transformation matrix to useclippingRect - the clipping rectangle if the viewport should be clipping,
null if no clipping is performed.AbstractRendererprotected void endVParea()
AbstractRenderer
endVParea in class AbstractRendererAbstractRenderer.endVParea()protected void renderInlineAreaBackAndBorders(InlineArea area)
AbstractRenderer
renderInlineAreaBackAndBorders in class AbstractRendererarea - the inline area for which the background, border and padding is to be
renderedAbstractRenderer.renderInlineAreaBackAndBorders(
org.apache.fop.area.inline.InlineArea)protected void renderBeforeFloat(BeforeFloat bf)
AbstractRenderer
renderBeforeFloat in class AbstractRendererbf - The before float areaAbstractRenderer.renderBeforeFloat(BeforeFloat)protected void renderFootnote(Footnote footnote)
AbstractRenderer
renderFootnote in class AbstractRendererfootnote - The footnoteAbstractRenderer.renderFootnote(Footnote)protected void renderMainReference(MainReference mr)
AbstractRendererThe main reference area contains a list of spans that are stacked on the page. The spans contain a list of normal flow reference areas that are positioned into columns.
renderMainReference in class AbstractRenderermr - The main reference areaAbstractRenderer.renderMainReference(MainReference)protected void renderFlow(NormalFlow flow)
AbstractRenderer
renderFlow in class AbstractRendererflow - The flow reference areaAbstractRenderer.renderFlow(NormalFlow)protected void renderBlock(Block block)
AbstractRenderer
renderBlock in class AbstractRendererblock - The block areaAbstractRenderer.renderBlock(Block)protected void renderLineArea(LineArea line)
AbstractRendererA line area may have grouped styling for its children such as underline, background.
renderLineArea in class AbstractRendererline - The line areaAbstractRenderer.renderLineArea(LineArea)protected void renderViewport(Viewport viewport)
AbstractRenderer
renderViewport in class AbstractRendererviewport - the viewport to renderAbstractRenderer.renderViewport(Viewport)
public void renderImage(Image image,
java.awt.geom.Rectangle2D pos)
AbstractRenderer
renderImage in class AbstractRendererimage - The imagepos - The target position of the image
(todo) Make renderImage() protectedAbstractRendererpublic void renderContainer(Container cont)
AbstractRenderer
renderContainer in class AbstractRenderercont - The inline container areaAbstractRenderer.renderContainer(Container)
public void renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
renderForeignObject in class AbstractRendererfo - the foreign objectpos - the position of the foreign objectAbstractRenderer.renderForeignObject(ForeignObject, Rectangle2D)protected void renderInlineSpace(Space space)
AbstractRenderer
renderInlineSpace in class AbstractRendererspace - the space to renderAbstractRenderer.renderInlineSpace(Space)protected void renderText(TextArea text)
AbstractRenderer
renderText in class AbstractRenderertext - the text to renderAbstractRenderer.renderText(TextArea)protected void renderWord(WordArea word)
AbstractRenderer
renderWord in class AbstractRendererword - the word to renderAbstractRenderer.renderWord(WordArea)protected void renderSpace(SpaceArea space)
AbstractRenderer
renderSpace in class AbstractRendererspace - the space to renderAbstractRenderer.renderSpace(SpaceArea)protected void renderInlineParent(InlineParent ip)
AbstractRenderer
renderInlineParent in class AbstractRendererip - the inline parent to renderAbstractRenderer.renderInlineParent(InlineParent)protected void renderInlineBlockParent(InlineBlockParent ibp)
AbstractRenderer
renderInlineBlockParent in class AbstractRendereribp - the inline block parent to renderAbstractRenderer.renderInlineBlockParent(InlineBlockParent)protected void renderLeader(Leader area)
AbstractRenderer
renderLeader in class AbstractRendererarea - the leader to renderAbstractRenderer.renderLeader(Leader)public java.lang.String getMimeType()
AbstractRenderer
getMimeType in interface RenderergetMimeType in class AbstractRendererAbstractRenderer.getMimeType()
|
fop 0.93 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||