|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.output.OutputTarget
org.foray.render.Renderer
org.foray.render.xml.XMLRenderer
public class XMLRenderer
Renderer that renders areas to XML for debugging purposes.
Field Summary | |
---|---|
static String |
DOUBLE_QUOTE
Constant used in string building. |
Fields inherited from class org.foray.render.Renderer |
---|
SHADING_WEIGHT_BLUE, SHADING_WEIGHT_GREEN, SHADING_WEIGHT_RED |
Constructor Summary | |
---|---|
XMLRenderer(org.apache.commons.logging.Log logger,
org.axsl.output.DocumentAreaConfiguration renderConfig)
Constructor. |
Method Summary | |
---|---|
protected void |
drawGraphic(org.axsl.galley.GraphicArea area,
org.axsl.graphic.Graphic image,
Rectangle contentRectangle,
Rectangle clipRectangle)
Renders a Graphic to a given contentRectangle, and clipping it to a given clip rectangle. |
protected void |
drawLine(int startX,
int startY,
int endX,
int endY,
int thickness,
org.axsl.common.value.RuleStyle ruleStyle,
Color strokeColor)
Draw a line in the output document. |
protected void |
drawRectangle(int x,
int y,
int w,
int h,
Color strokeColor,
Color fillColor)
Draw a rectangle in the output document. |
int[] |
getFontSources()
|
org.axsl.output.DocumentAreaConfiguration |
getOutputConfiguration()
Returns the output configuration for this renderer. |
protected void |
markBorder(org.axsl.galley.BorderPaddingArea area)
Marks the border, if any, for the given area. |
void |
outputAllRectangles(org.axsl.galley.Area area)
Writes information about all of an area's rectangles. |
void |
outputAttribute(StringBuilder buffer,
String attributeName,
CharSequence attributeValue)
Writes information about a specific attribute to a given buffer. |
void |
outputAttribute(StringBuilder buffer,
String attributeName,
long attributeValue)
Writes information about a specific integral attribute to a given buffer. |
void |
outputBorderRectangle(org.axsl.galley.Area area)
Writes information about an area's border rectangle to a given buffer. |
void |
outputColor(org.axsl.galley.GeneralInlineArea area,
StringBuilder buffer)
Writes information about an area's color to a given buffer. |
void |
outputContentRectangle(org.axsl.galley.Area area)
Writes information about an area's content rectangle to a given buffer. |
void |
outputPaddingRectangle(org.axsl.galley.Area area)
Writes information about an area's padding rectangle to a given buffer. |
void |
outputText(char[] chars,
StringBuilder buffer)
Writes text to a given buffer, converting it to well-formed XML as it goes. |
void |
render(org.axsl.galley.Area area)
|
void |
render(org.axsl.galley.AreaNode node)
|
void |
render(org.axsl.galley.BeforeFloatArea area)
|
void |
render(org.axsl.galley.BlockContainerArea area)
|
void |
render(org.axsl.galley.BookmarkTree area)
Render the bookmark tree for this document. |
void |
render(org.axsl.galley.ExternalGraphicArea area)
|
void |
render(org.axsl.galley.FootnoteArea area)
|
void |
render(org.axsl.galley.ForeignContentMath area)
Render the MathML content of a ForeignObjectArea . |
void |
render(org.axsl.galley.ForeignContentSvg area)
Render the SVG content of a ForeignObjectArea . |
void |
render(org.axsl.galley.ForeignObjectArea area)
|
void |
render(org.axsl.galley.InlineArea area)
|
void |
render(org.axsl.galley.LeaderArea area)
|
void |
render(org.axsl.galley.LineArea area)
|
void |
render(org.axsl.galley.MainReferenceArea area)
|
void |
render(org.axsl.galley.NormalBlockArea area)
|
void |
render(org.axsl.galley.Page page)
|
void |
render(org.axsl.galley.RegionArea area)
|
void |
render(org.axsl.galley.TableArea area)
|
void |
render(org.axsl.galley.TableCellArea area)
|
void |
render(org.axsl.galley.TextArea area)
|
protected void |
renderContent(CharSequence content)
Render the content part of an area. |
void |
renderInlineArea(org.axsl.galley.GeneralInlineArea area)
Renders an inline area not covered by a more specific method. |
void |
renderTextSegment(org.axsl.galley.TextArea area,
CharSequence text)
Renders an arbitrary text chunk with attributes from an arbitrary Area. |
void |
resetTextCursor()
Provides the Renderer with an opportunity to close any text objects that are in progress. |
void |
startOutput()
|
void |
stopOutput()
|
protected void |
writeCompleteElement(org.axsl.galley.Area area,
StringBuilder attributes,
String content)
Write the start tag, attributes, content, and end-tag for an element. |
protected void |
writeEmptyElement(org.axsl.galley.Area area,
StringBuilder attributes)
Write the start tag, attribues, and end-tag for an element. |
protected void |
writeEmptyElement(String elementName,
StringBuilder attributes)
Write the start tag, attribues, and end-tag for an element. |
protected void |
writeEndTag(org.axsl.galley.AreaNode node)
Write an end tag. |
protected void |
writeIndent()
Write out the spaces to make an indentation. |
protected void |
writeStartTag(org.axsl.galley.AreaNode node,
StringBuilder attributes)
Write the start tag, attribues, and end-tag for an element. |
Methods inherited from class org.foray.render.Renderer |
---|
colorToFloat, convertMillipointRectangle, getAreaTree, getPixelsPerInch, markBackground, renderChildren, renderDocumentNodes, renderRegions, setGalley, shadingPercent, toPoints |
Methods inherited from class org.foray.output.OutputTarget |
---|
getApplicationName, getApplicationNameShort, getApplicationVersion, getDeveloperURLShort, getFontConsumer, getLogger, getOutputStream, getStrokeSVGText, outputStreamRequired, setApplicationName, setApplicationNameShort, setApplicationVersion, setDeveloperUrlShort, setFontConsumer, setOutputStream, setStrokeText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.axsl.output.OutputTarget |
---|
outputStreamRequired, setApplicationName, setApplicationNameShort, setApplicationVersion, setDeveloperUrlShort, setFontConsumer, setOutputStream, setStrokeText |
Field Detail |
---|
public static final String DOUBLE_QUOTE
Constructor Detail |
---|
public XMLRenderer(org.apache.commons.logging.Log logger, org.axsl.output.DocumentAreaConfiguration renderConfig)
logger
- The logger.renderConfig
- The configuration for this renderer.Method Detail |
---|
public void render(org.axsl.galley.Page page) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.output.Renderer
render
in class Renderer
org.axsl.galley.GalleyVisitorException
protected void writeIndent()
protected void writeCompleteElement(org.axsl.galley.Area area, StringBuilder attributes, String content)
area
- The area for whom the element is written.attributes
- Text of the attributes to be written.content
- The element content.protected void writeEmptyElement(org.axsl.galley.Area area, StringBuilder attributes)
area
- The area for whom element is written.attributes
- Text of the attributes to be written.protected void writeEmptyElement(String elementName, StringBuilder attributes)
elementName
- The name of the element to be written.attributes
- Text of the attributes to be written.protected void writeStartTag(org.axsl.galley.AreaNode node, StringBuilder attributes)
node
- The area for whom element is written.attributes
- Text of the attributes to be written.protected void writeEndTag(org.axsl.galley.AreaNode node)
node
- The area whose end-tag should be written.protected void drawGraphic(org.axsl.galley.GraphicArea area, org.axsl.graphic.Graphic image, Rectangle contentRectangle, Rectangle clipRectangle)
Renderer
drawGraphic
in class Renderer
area
- The Area instance from which to obtain traits.image
- The graphic to be rendered.contentRectangle
- The rectangle to which the graphic should be
scaled during drawing.clipRectangle
- The rectangle to which the content should be clipped
after any scaling.Renderer.drawGraphic(GraphicArea, Graphic, Rectangle, Rectangle)
public void render(org.axsl.galley.BlockContainerArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.MainReferenceArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.RegionArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.FootnoteArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.BeforeFloatArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.NormalBlockArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void renderInlineArea(org.axsl.galley.GeneralInlineArea area) throws org.axsl.galley.GalleyVisitorException
area
- The Area to be rendered.
org.axsl.galley.GalleyVisitorException
- For errors during rendering.public void render(org.axsl.galley.ForeignObjectArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.ForeignContentSvg area)
Renderer
ForeignObjectArea
.
render
in class Renderer
area
- The SVG content to be rendered.public void render(org.axsl.galley.ForeignContentMath area)
Renderer
ForeignObjectArea
.
render
in class Renderer
area
- The MathML content to be rendered.public void render(org.axsl.galley.ExternalGraphicArea area)
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
public void renderTextSegment(org.axsl.galley.TextArea area, CharSequence text)
Renderer
renderTextSegment
in class Renderer
area
- An Area instance that contains the traits that should be
used to render the text.text
- The text content to be rendered.public void render(org.axsl.galley.LineArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.BookmarkTree area)
Renderer
render
in class Renderer
area
- The bookmark tree to be rendered.public void render(org.axsl.galley.LeaderArea area)
public void render(org.axsl.galley.TextArea area)
protected void renderContent(CharSequence content)
content
- The content to be rendered.public void render(org.axsl.galley.InlineArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.TableArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.TableCellArea area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.AreaNode node) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void render(org.axsl.galley.Area area) throws org.axsl.galley.GalleyVisitorException
render
in interface org.axsl.galley.RenderVisitor
render
in class Renderer
org.axsl.galley.GalleyVisitorException
public void startOutput()
public void stopOutput()
public int[] getFontSources()
protected void drawLine(int startX, int startY, int endX, int endY, int thickness, org.axsl.common.value.RuleStyle ruleStyle, Color strokeColor)
Renderer
drawLine
in class Renderer
startX
- The start x location in millipoints.startY
- The start y location in millipoints.endX
- The end x location in millipoints.endY
- The end y location in millipoints.thickness
- The thickness in millipoints.ruleStyle
- The rule style.strokeColor
- The stroke color.protected void drawRectangle(int x, int y, int w, int h, Color strokeColor, Color fillColor)
Renderer
drawRectangle
in class Renderer
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.strokeColor
- The color to be used for the stroke.
Stroked means a box will be drawn around the rectangle.
Set to null if the rectangle should not be stroked.fillColor
- The color to be used for the fill.
Set to null if the rectangle should not be filled.protected void markBorder(org.axsl.galley.BorderPaddingArea area)
Renderer
markBorder
in class Renderer
area
- The area whose border is to be drawn.public void resetTextCursor()
Renderer
resetTextCursor
in class Renderer
public void outputAllRectangles(org.axsl.galley.Area area)
area
- The area whose rectangles are to be written.public void outputBorderRectangle(org.axsl.galley.Area area)
area
- The area whose border rectangle information should be
written.public void outputPaddingRectangle(org.axsl.galley.Area area)
area
- The area whose padding rectangle information should be
written.public void outputContentRectangle(org.axsl.galley.Area area)
area
- The area whose content rectangle information should be
written.public void outputColor(org.axsl.galley.GeneralInlineArea area, StringBuilder buffer)
area
- The area whose color information should be written.buffer
- The buffer to which the attributes should be added.public void outputAttribute(StringBuilder buffer, String attributeName, CharSequence attributeValue)
buffer
- The buffer to which the attribute should be added.attributeName
- The name of the attribute.attributeValue
- The value of the attribute.public void outputAttribute(StringBuilder buffer, String attributeName, long attributeValue)
buffer
- The buffer to which the attribute should be added.attributeName
- The name of the attribute.attributeValue
- The value of the attribute.public void outputText(char[] chars, StringBuilder buffer)
chars
- The text to be written.buffer
- The buffer to which the text should be written.public org.axsl.output.DocumentAreaConfiguration getOutputConfiguration()
OutputTarget
getOutputConfiguration
in class OutputTarget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |