|
fop 2.3 | |||||||||
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.AbstractXMLRenderer
org.apache.fop.render.xml.XMLRenderer
public class 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 Renderer |
mimic
If not null, the XMLRenderer will mimic another renderer by using its font setup. |
static java.lang.String |
VERSION
Area Tree (AT) version, used to express an @version attribute in the root element of the AT document, the initial value of which is set to '2.0' to signify that something preceded it (but didn't happen to be marked as such), and that this version is not necessarily backwards compatible with the unmarked (<2.0) version. |
static java.lang.String |
XML_MIME_TYPE
XML MIME type |
Fields inherited from class org.apache.fop.render.xml.AbstractXMLRenderer |
---|
atts, CDATA, context, EMPTY_ATTS, extensionAttachments, handler, NS, out |
Fields inherited from class org.apache.fop.render.PrintRenderer |
---|
embedFontInfoList, fontInfo |
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(FOUserAgent userAgent)
|
Method Summary | |
---|---|
protected void |
addAreaAttributes(Area area)
Adds the general Area attributes. |
protected void |
addTraitAttributes(Area area)
Adds attributes from traits of an Area. |
protected void |
endLayer()
Finish current optional content group layer. |
void |
endPageSequence()
Tells the renderer to finish the current PageSequence |
protected void |
endVParea()
Signals exit from a viewport area. |
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
protected void |
handleExtensionAttachments(java.util.List attachments)
Handles a list of extension attachments |
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. |
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. |
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 |
renderInlineViewport(InlineViewport viewport)
Render the given Viewport. |
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 |
renderReferenceArea(Block block)
Renders a block area that represents a reference area. |
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 |
renderWord(WordArea word)
Render the given WordArea. |
void |
setCompactFormat(boolean compact)
Controls whether to create a more compact format which omit certain attributes. |
void |
setupFontInfo(FontInfo inFontInfo)
Set up the given FontInfo. |
protected void |
startLayer(java.lang.String layer)
Establish new optional content group layer. |
void |
startPageSequence(PageSequence pageSequence)
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.Rectangle clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. |
Methods inherited from class org.apache.fop.render.xml.AbstractXMLRenderer |
---|
addAttribute, addAttribute, addAttribute, addAttribute, characters, comment, endElement, handleDocumentExtensionAttachments, handlePageExtensionAttachments, handleSAXException, setContentHandler, startElement, startElement |
Methods inherited from class org.apache.fop.render.PrintRenderer |
---|
addFontList, createRendererContext, getFontFromArea, getFontInfo, getFontList, getInternalFontNameForArea, instantiateRendererContext, renderDocument, setFontList |
Methods inherited from class org.apache.fop.render.AbstractRenderer |
---|
convertTitleToString, getCurrentPageViewport, getGraphics2DAdapter, getImageAdapter, getUserAgent, handleBlockTraits, handleRegionTraits, maybeEndLayer, maybeStartLayer, mptToPt, preparePage, ptToMpt, renderBlocks, renderBlockViewport, renderBodyRegion, renderPageAreas, renderRegion, renderXML, setDocumentLocale, 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 VERSION
public static final java.lang.String XML_MIME_TYPE
protected Renderer mimic
Constructor Detail |
---|
public XMLRenderer(FOUserAgent userAgent)
userAgent
- the user agent that contains configuration details. This cannot be null.Method Detail |
---|
public void mimicRenderer(Renderer renderer)
renderer
- the renderer to mimicpublic void setupFontInfo(FontInfo inFontInfo) throws FOPException
setupFontInfo
in interface Renderer
setupFontInfo
in class PrintRenderer
inFontInfo
- The font information
FOPException
- if an error occurs while setting up the font info objectpublic void setCompactFormat(boolean compact)
compact
- true to activate the compact formatprotected 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 Renderer
processOffDocumentItem
in class AbstractXMLRenderer
oDI
- The off-document item to be renderedprotected void renderBookmarkTree(BookmarkData bookmarkRoot)
renderBookmarkTree
in class AbstractXMLRenderer
bookmarkRoot
- the BookmarkData object representing the top of the treeprotected void renderDestination(DestinationData destination)
destination
- the destination objectpublic void startRenderer(java.io.OutputStream outputStream) throws java.io.IOException
startRenderer
in interface Renderer
startRenderer
in class AbstractXMLRenderer
outputStream
- The OutputStream to use for output
java.io.IOException
- If an I/O error occurspublic void stopRenderer() throws java.io.IOException
stopRenderer
in interface Renderer
stopRenderer
in class AbstractXMLRenderer
java.io.IOException
- If an I/O error occurspublic void renderPage(PageViewport page) throws java.io.IOException, FOPException
renderPage
in interface Renderer
renderPage
in class AbstractRenderer
page
- The page to be rendered
java.io.IOException
- if an I/O error occurs
FOPException
- if a FOP interal error occurs.protected void handleExtensionAttachments(java.util.List attachments)
handleExtensionAttachments
in class AbstractXMLRenderer
attachments
- a list of extension attachmentspublic void startPageSequence(PageSequence pageSequence)
startPageSequence
in interface Renderer
startPageSequence
in class AbstractRenderer
pageSequence
- the page sequencepublic 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 AbstractRenderer
port
- The region viewport to be renderedprotected void startVParea(CTM ctm, java.awt.Rectangle clippingRect)
AbstractRenderer
startVParea
in class AbstractRenderer
ctm
- 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 AbstractRenderer
protected void startLayer(java.lang.String layer)
startLayer
in class AbstractRenderer
layer
- name of layerprotected void endLayer()
endLayer
in class AbstractRenderer
protected void renderInlineAreaBackAndBorders(InlineArea area)
renderInlineAreaBackAndBorders
in class AbstractRenderer
area
- the inline area for which the background, border and padding is to be
renderedprotected void renderBeforeFloat(BeforeFloat bf)
renderBeforeFloat
in class AbstractRenderer
bf
- The before float areaprotected void renderFootnote(Footnote footnote)
renderFootnote
in class AbstractRenderer
footnote
- 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 AbstractRenderer
mr
- The main reference areaprotected void renderFlow(NormalFlow flow)
renderFlow
in class AbstractRenderer
flow
- The flow reference areaprotected void renderReferenceArea(Block block)
renderReferenceArea
in class AbstractRenderer
block
- the block areaprotected void renderBlock(Block block)
renderBlock
in class AbstractRenderer
block
- The block areaprotected void renderLineArea(LineArea line)
A line area may have grouped styling for its children such as underline, background.
renderLineArea
in class AbstractRenderer
line
- The line areaprotected void renderInlineArea(InlineArea inlineArea)
renderInlineArea
in class AbstractRenderer
inlineArea
- inline area text to renderprotected void renderInlineViewport(InlineViewport viewport)
renderInlineViewport
in class AbstractRenderer
viewport
- the viewport to renderpublic void renderImage(Image image, java.awt.geom.Rectangle2D pos)
renderImage
in class AbstractRenderer
image
- The imagepos
- The target position of the image
(todo) Make renderImage() protectedpublic void renderContainer(Container cont)
renderContainer
in class AbstractRenderer
cont
- The inline container areapublic void renderForeignObject(ForeignObject fo, java.awt.geom.Rectangle2D pos)
renderForeignObject
in class AbstractRenderer
fo
- the foreign objectpos
- the position of the foreign objectAbstractRenderer.renderForeignObject(ForeignObject, Rectangle2D)
protected void renderInlineSpace(Space space)
renderInlineSpace
in class AbstractRenderer
space
- the space to renderprotected void renderText(TextArea text)
renderText
in class AbstractRenderer
text
- the text to renderprotected void renderWord(WordArea word)
renderWord
in class AbstractRenderer
word
- the word to renderprotected void renderSpace(SpaceArea space)
renderSpace
in class AbstractRenderer
space
- the space to renderprotected void renderInlineParent(InlineParent ip)
renderInlineParent
in class AbstractRenderer
ip
- the inline parent to renderprotected void renderInlineBlockParent(InlineBlockParent ibp)
renderInlineBlockParent
in class AbstractRenderer
ibp
- the inline block parent to renderprotected void renderLeader(Leader area)
renderLeader
in class AbstractRenderer
area
- the leader to renderpublic java.lang.String getMimeType()
|
fop 2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |