|
||||||||||
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.svg.SVGRenderer
public class SVGRenderer
A Renderer
implementation that writes the document as SVG.
Field Summary |
---|
Fields inherited from class org.foray.render.Renderer |
---|
SHADING_WEIGHT_BLUE, SHADING_WEIGHT_GREEN, SHADING_WEIGHT_RED |
Constructor Summary | |
---|---|
SVGRenderer(org.apache.commons.logging.Log logger,
org.axsl.output.DocumentConfiguration renderConfig,
org.axsl.graphic.GraphicServer graphicServer)
Constructor. |
Method Summary | |
---|---|
protected void |
addFilledRect(int x,
int y,
int w,
int h,
Color col)
Add a filled rectangle. |
protected void |
addRect(int x,
int y,
int w,
int h,
boolean drawAsOutline)
Draw a filled rectangle in the current color. |
protected void |
addRect(int x,
int y,
int w,
int h,
float r,
float g,
float b)
Draw a rectangle. |
protected void |
addRect(int x,
int y,
int w,
int h,
float r,
float g,
float b,
float fr,
float fg,
float fb)
Draw a filled rectangle. |
protected void |
drawFrame()
Draws a frame around the current page. |
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 x1,
int y1,
int x2,
int y2,
int th,
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. |
protected Rectangle2D |
getBounds(org.axsl.galley.Area area)
Returns the bounds for a given area. |
int[] |
getFontSources()
|
org.axsl.output.DocumentConfiguration |
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 |
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.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.LeaderArea area)
|
void |
render(org.axsl.galley.Page page)
|
void |
render(org.axsl.galley.TextArea area)
|
protected void |
renderSVGDocument(org.axsl.graphic.SvgGraphic svgGraphic,
float x,
float y)
Renders an SVG Document. |
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()
|
Methods inherited from class org.foray.render.Renderer |
---|
colorToFloat, convertMillipointRectangle, getAreaTree, getPixelsPerInch, markBackground, render, render, render, render, render, render, render, render, render, render, render, render, render, 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 |
Constructor Detail |
---|
public SVGRenderer(org.apache.commons.logging.Log logger, org.axsl.output.DocumentConfiguration renderConfig, org.axsl.graphic.GraphicServer graphicServer)
logger
- The logger.renderConfig
- The configuration for this renderer.graphicServer
- The Graphic Server to use for creation and handling
of the SVG document.Method Detail |
---|
protected void drawLine(int x1, int y1, int x2, int y2, int th, org.axsl.common.value.RuleStyle ruleStyle, Color strokeColor)
Renderer
drawLine
in class Renderer
x1
- The start x location in millipoints.y1
- The start y location in millipoints.x2
- The end x location in millipoints.y2
- The end y location in millipoints.th
- 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 addRect(int x, int y, int w, int h, float r, float g, float b)
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.r
- The red component.g
- The green component.b
- The blue component.protected void addRect(int x, int y, int w, int h, float r, float g, float b, float fr, float fg, float fb)
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.r
- The red component of edges.g
- The green component of edges.b
- The blue component of edges.fr
- The red component of the fill.fg
- The green component of the fill.fb
- The blue component of the fill.protected void addRect(int x, int y, int w, int h, boolean drawAsOutline)
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.drawAsOutline
- true for draw, false for fill.protected void addFilledRect(int x, int y, int w, int h, Color col)
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.col
- The fill color.protected void drawFrame()
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
public void render(org.axsl.galley.BookmarkTree area)
Renderer
render
in class Renderer
area
- The bookmark tree to be rendered.protected void markBorder(org.axsl.galley.BorderPaddingArea area)
Renderer
markBorder
in class Renderer
area
- The area whose border is to be drawn.protected Rectangle2D getBounds(org.axsl.galley.Area area)
area
- The area whose bounds are needed.
area
.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.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.LeaderArea area)
public void render(org.axsl.galley.TextArea area)
public void render(org.axsl.galley.ForeignContentSvg area)
Renderer
ForeignObjectArea
.
render
in class Renderer
area
- The SVG content to be rendered.protected void renderSVGDocument(org.axsl.graphic.SvgGraphic svgGraphic, float x, float y)
svgGraphic
- The document to be rendered.x
- The x coordinate at which the document should be rendered,
in points (??).y
- The y coordindate at which the document should be rendered,
in points (??).public void render(org.axsl.galley.ForeignContentMath area)
Renderer
ForeignObjectArea
.
render
in class Renderer
area
- The MathML content to be rendered.public void startOutput() throws org.axsl.output.OutputException
org.axsl.output.OutputException
public void stopOutput() throws org.axsl.output.OutputException
org.axsl.output.OutputException
public int[] getFontSources()
public void resetTextCursor()
Renderer
resetTextCursor
in class Renderer
public org.axsl.output.DocumentConfiguration getOutputConfiguration()
OutputTarget
getOutputConfiguration
in class OutputTarget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |