|
fop 0.95 | ||||||||||
| 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 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, fontResolver |
| 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. |
protected void |
endElement(java.lang.String tagName)
Ends an element. |
void |
endPageSequence()
Tells the renderer to finish the current PageSequence |
protected void |
endVParea()
Signals exit from a viewport area. Subclasses can restore transformation matrices valid before the viewport area was started. |
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). Note - not all renderers will process all off-document items. |
protected void |
renderBeforeFloat(BeforeFloat bf)
Renders a before float area. |
protected void |
renderBlock(Block block)
Renders a block area. |
protected void |
renderBookmarkTree(BookmarkData bookmarkRoot)
Renders a BookmarkTree object |
void |
renderContainer(Container cont)
Tells the renderer to render an inline container. |
protected void |
renderDestination(DestinationData destination)
Renders a DestinationData object (named destination) |
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 |
renderInlineArea(InlineArea inlineArea)
Render the given InlineArea. |
protected void |
renderInlineAreaBackAndBorders(InlineArea area)
Common method to render the background and borders for any inline area. The all borders and padding are drawn outside the specified area. org.apache.fop.area.inline.InlineArea) |
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. A line area may have grouped styling for its children such as underline, background. |
protected void |
renderMainReference(MainReference mr)
Renders the main reference area. The 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. |
void |
renderPage(PageViewport page)
Tells the renderer to render a particular page. A renderer typically reponds by packing up the current page and writing it immediately to the output device. |
protected void |
renderReferenceArea(Block block)
Renders a block area that represents a reference area. The reference area establishes a new coordinate system. |
protected void |
renderRegionViewport(RegionViewport port)
Renders a region viewport. The region may clip the area and it establishes a position from where the region is placed. |
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(PageSequence pageSequence)
Tells the renderer that a new page sequence starts. |
void |
startRenderer(java.io.OutputStream outputStream)
Initiates the rendering phase. This must only be called once for a rendering. If stopRenderer is called then this may be called again for a new document rendering. |
protected void |
startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. The renderer should reset to an initial state and dispose of any resources for the completed rendering. |
| Methods inherited from class org.apache.fop.render.PrintRenderer |
addFontList, createRendererContext, getFontFromArea, getFontResolver, getInternalFontNameForArea, lightenColor, renderDocument, setFontList |
| Methods inherited from class org.apache.fop.render.AbstractRenderer |
convertTitleToString, getCurrentPageViewport, getGraphics2DAdapter, getImageAdapter, getUserAgent, handleBlockTraits, handleRegionTraits, mptToPt, preparePage, ptToMpt, renderBlocks, renderBlockViewport, renderBodyRegion, renderCharacter, renderPageAreas, renderRegion, renderXML, startPageSequence, 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 setUserAgent(FOUserAgent agent)
setUserAgent in interface RenderersetUserAgent in class AbstractRendererpublic void mimicRenderer(Renderer renderer)
renderer - the renderer to mimicpublic void setupFontInfo(FontInfo inFontInfo)
setupFontInfo in interface RenderersetupFontInfo in class PrintRendererinFontInfo - font info to set uppublic 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)
processOffDocumentItem in interface RendererprocessOffDocumentItem in class AbstractRendererprotected void renderBookmarkTree(BookmarkData bookmarkRoot)
bookmarkRoot - the BookmarkData object representing the top of the treeprotected void renderDestination(DestinationData destination)
destination - the destination object
public void startRenderer(java.io.OutputStream outputStream)
throws java.io.IOException
startRenderer in interface RendererstartRenderer in class AbstractRendererjava.io.IOException
public void stopRenderer()
throws java.io.IOException
stopRenderer in interface RendererstopRenderer in class AbstractRendererjava.io.IOException
public void renderPage(PageViewport page)
throws java.io.IOException,
FOPException
renderPage in interface RendererrenderPage in class AbstractRendererjava.io.IOException
FOPExceptionpublic void startPageSequence(PageSequence pageSequence)
startPageSequence in interface RendererstartPageSequence in class AbstractRendererpublic void endPageSequence()
protected void renderRegionViewport(RegionViewport port)
The 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 rendered
protected void startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
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.protected void endVParea()
endVParea in class AbstractRendererprotected void renderInlineAreaBackAndBorders(InlineArea area)
renderInlineAreaBackAndBorders in class AbstractRendererarea - the inline area for which the background, border and padding is to be
renderedprotected void renderBeforeFloat(BeforeFloat bf)
renderBeforeFloat in class AbstractRendererbf - The before float areaprotected void renderFootnote(Footnote footnote)
renderFootnote in class AbstractRendererfootnote - The footnoteprotected void renderMainReference(MainReference mr)
The 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 areaprotected void renderFlow(NormalFlow flow)
renderFlow in class AbstractRendererflow - The flow reference areaprotected void renderReferenceArea(Block block)
renderReferenceArea in class AbstractRendererblock - the block areaprotected void renderBlock(Block block)
renderBlock in class AbstractRendererblock - The block areaprotected void renderLineArea(LineArea line)
A line area may have grouped styling for its children such as underline, background.
renderLineArea in class AbstractRendererline - The line areaprotected void renderInlineArea(InlineArea inlineArea)
renderInlineArea in class AbstractRendererinlineArea - inline area text to renderprotected void renderViewport(Viewport viewport)
renderViewport in class AbstractRendererviewport - the viewport to render
public void renderImage(Image image,
java.awt.geom.Rectangle2D pos)
renderImage in class AbstractRendererimage - The imagepos - The target position of the image
(todo) Make renderImage() protectedpublic void renderContainer(Container cont)
renderContainer in class AbstractRenderercont - The inline container area
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)
renderInlineSpace in class AbstractRendererspace - the space to renderprotected void renderText(TextArea text)
renderText in class AbstractRenderertext - the text to renderprotected void renderWord(WordArea word)
renderWord in class AbstractRendererword - the word to renderprotected void renderSpace(SpaceArea space)
renderSpace in class AbstractRendererspace - the space to renderprotected void renderInlineParent(InlineParent ip)
renderInlineParent in class AbstractRendererip - the inline parent to renderprotected void renderInlineBlockParent(InlineBlockParent ibp)
renderInlineBlockParent in class AbstractRendereribp - the inline block parent to renderprotected void renderLeader(Leader area)
renderLeader in class AbstractRendererarea - the leader to renderpublic java.lang.String getMimeType()
getMimeType in interface RenderergetMimeType in class AbstractRenderer
|
fop 0.95 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||