|
fop 0.90alpha1 | ||||||||||
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.AbstractPathOrientedRenderer
org.apache.fop.render.ps.PSRenderer
Renderer that renders to PostScript.
This class currently generates PostScript Level 2 code. The only exception
is the FlateEncode filter which is a Level 3 feature. The filters in use
are hardcoded at the moment.
This class follows the Document Structuring Conventions (DSC) version 3.0.
If anyone modifies this renderer please make
sure to also follow the DSC to make it simpler to programmatically modify
the generated Postscript files (ex. extract pages etc.).
This renderer inserts FOP-specific comments into the PostScript stream which
may help certain users to do certain types of post-processing of the output.
These comments all start with "%FOP".
Field Summary | |
protected PSGenerator |
gen
The PostScript generator used to output the PostScript |
static java.lang.String |
MIME_TYPE
The MIME type for PostScript |
Fields inherited from class org.apache.fop.render.PrintRenderer |
fontInfo, fontList |
Fields inherited from class org.apache.fop.render.AbstractRenderer |
containingBPPosition, containingIPPosition, currentBPPosition, currentIPPosition, log, userAgent |
Fields inherited from interface org.apache.fop.render.Renderer |
ROLE |
Constructor Summary | |
PSRenderer()
|
Method Summary | |
protected void |
beginTextObject()
Indicates the beginning of a text object. |
protected java.util.List |
breakOutOfStateStack()
Breaks out of the state stack to handle fixed block-containers. |
protected void |
clip()
Clip using the current path. |
protected void |
clipRect(float x,
float y,
float width,
float height)
Clip an area. |
protected void |
closePath()
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath. |
protected void |
comment(java.lang.String comment)
Write out a comment |
protected void |
concatMatrix(double[] matrix)
Concats the transformations matrix. |
protected void |
concatMatrix(double a,
double b,
double c,
double d,
double e,
double f)
Concats the transformation matrix. |
void |
configure(org.apache.avalon.framework.configuration.Configuration cfg)
|
protected void |
drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected void |
drawBorderLine(float x1,
float y1,
float x2,
float y2,
boolean horz,
boolean startOrBefore,
int style,
ColorType col)
Draw a border segment of an XSL-FO style border. |
protected void |
drawImage(java.lang.String url,
java.awt.geom.Rectangle2D pos)
Draw an image at the indicated location. |
protected void |
endTextObject()
Indicates the end of a text object. |
protected void |
endVParea()
(todo) Description of the Method |
protected void |
fillRect(float x,
float y,
float width,
float height)
Fill a rectangular area. |
Graphics2DAdapter |
getGraphics2DAdapter()
|
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
protected void |
handleIOTrouble(java.io.IOException ioe)
Central exception handler for I/O exceptions. |
protected void |
lineTo(float x,
float y)
Appends a straight line segment from the current point to (x, y). |
protected void |
moveTo(float x,
float y)
Moves the current point to (x, y), omitting any connecting line segment. |
protected void |
movetoCurrPosition()
Make sure the cursor is in the right place. |
void |
processOffDocumentItem(OffDocumentItem oDI)
Tells the renderer to process an item not explicitly placed on the document (e.g., PDF bookmarks). |
protected void |
renderBlockViewport(BlockViewport bv,
java.util.List children)
Renders a block viewport. |
void |
renderCharacter(Character ch)
Render the given Character. |
void |
renderDocument(org.w3c.dom.Document doc,
java.lang.String ns,
java.awt.geom.Rectangle2D pos)
Renders an XML document (SVG for example). |
void |
renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
Renders a foreign object area. |
void |
renderImage(Image image,
java.awt.geom.Rectangle2D pos)
Renders an image area. |
protected void |
renderInlineParent(InlineParent ip)
Render the given InlineParent. |
void |
renderPage(PageViewport page)
Tells the renderer to render a particular page. |
protected void |
renderRegionViewport(RegionViewport port)
Renders a region viewport. |
void |
renderText(TextArea area)
Render the given TextArea. |
void |
restoreGraphicsState()
Restores the last graphics state of the rendering engine. |
protected void |
restoreStateStackAfterBreakOut(java.util.List breakOutList)
Restores the state stack after a break out. |
void |
saveGraphicsState()
Saves the graphics state of the rendering engine. |
void |
setUserAgent(FOUserAgent agent)
Set the User Agent. |
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)
(todo) Description of the Method |
void |
stopRenderer()
Signals the end of the rendering phase. |
protected void |
updateColor(ColorType col,
boolean fill)
Establishes a new foreground or fill color. |
void |
useFont(java.lang.String name,
int size)
Changes the currently used font. |
protected void |
writeln(java.lang.String cmd)
Write out a command |
Methods inherited from class org.apache.fop.render.AbstractPathOrientedRenderer |
handleBlockTraits, handleRegionTraits, renderInlineAreaBackAndBorders, renderInlineBlockParent, renderInlineSpace, renderTextDecoration, renderViewport, toColor |
Methods inherited from class org.apache.fop.render.PrintRenderer |
lightenColor, setupFontInfo |
Methods inherited from class org.apache.fop.render.AbstractRenderer |
convertTitleToString, preparePage, renderBeforeFloat, renderBlock, renderBlocks, renderBodyRegion, renderContainer, renderFlow, renderFootnote, renderInlineArea, renderLeader, renderLineArea, renderMainReference, renderPageAreas, renderRegion, renderSpace, renderWord, 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 MIME_TYPE
protected PSGenerator gen
Constructor Detail |
public PSRenderer()
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.Configurable
configure
in class AbstractRenderer
org.apache.avalon.framework.configuration.ConfigurationException
Configurable.configure(Configuration)
public void setUserAgent(FOUserAgent agent)
Renderer
setUserAgent
in interface Renderer
setUserAgent
in class AbstractRenderer
Renderer.setUserAgent(FOUserAgent)
public Graphics2DAdapter getGraphics2DAdapter()
getGraphics2DAdapter
in interface Renderer
getGraphics2DAdapter
in class AbstractRenderer
Renderer.getGraphics2DAdapter()
protected void writeln(java.lang.String cmd)
cmd
- PostScript commandprotected void handleIOTrouble(java.io.IOException ioe)
ioe
- IOException to handleprotected void comment(java.lang.String comment)
comment
- Comment to writeprotected void movetoCurrPosition()
protected void clip()
AbstractPathOrientedRenderer
clip
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer.clip()
protected void clipRect(float x, float y, float width, float height)
clipRect
in class AbstractPathOrientedRenderer
x
- the x coordinatey
- the y coordinatewidth
- the width of the areaheight
- the height of the areaprotected void moveTo(float x, float y)
AbstractPathOrientedRenderer
moveTo
in class AbstractPathOrientedRenderer
x
- x coordinatey
- y coordinateAbstractPathOrientedRenderer.moveTo(float, float)
protected void lineTo(float x, float y)
AbstractPathOrientedRenderer
lineTo
in class AbstractPathOrientedRenderer
x
- x coordinatey
- y coordinateAbstractPathOrientedRenderer.lineTo(float, float)
protected void closePath()
AbstractPathOrientedRenderer
closePath
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer.closePath()
protected void fillRect(float x, float y, float width, float height)
AbstractPathOrientedRenderer
fillRect
in class AbstractPathOrientedRenderer
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectangleAbstractPathOrientedRenderer
protected void updateColor(ColorType col, boolean fill)
AbstractPathOrientedRenderer
updateColor
in class AbstractPathOrientedRenderer
col
- the color to apply (null skips this operation)fill
- true to set the fill color, false for the foreground colorAbstractPathOrientedRenderer
protected void drawImage(java.lang.String url, java.awt.geom.Rectangle2D pos)
AbstractPathOrientedRenderer
drawImage
in class AbstractPathOrientedRenderer
url
- the URI/URL of the imagepos
- the position of the imageAbstractPathOrientedRenderer
public void saveGraphicsState()
saveGraphicsState
in class AbstractPathOrientedRenderer
public void restoreGraphicsState()
restoreGraphicsState
in class AbstractPathOrientedRenderer
protected void concatMatrix(double a, double b, double c, double d, double e, double f)
a
- A partb
- B partc
- C partd
- D parte
- E partf
- F partprotected void concatMatrix(double[] matrix)
matrix
- Matrix to usepublic void useFont(java.lang.String name, int size)
name
- name of the fontsize
- font sizeprotected void drawBackAndBorders(Area area, float startx, float starty, float width, float height)
AbstractPathOrientedRenderer
drawBackAndBorders
in class AbstractPathOrientedRenderer
area
- the area to get the traits fromstartx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areaAbstractPathOrientedRenderer.drawBackAndBorders(
Area, float, float, float, float)
protected void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, ColorType col)
AbstractPathOrientedRenderer
drawBorderLine
in class AbstractPathOrientedRenderer
x1
- starting x coordinatey1
- starting y coordinatex2
- ending x coordinatey2
- ending y coordinatehorz
- true for horizontal border segments, false for vertical border segmentsstartOrBefore
- true for border segments on the start or before edge,
false for end or after.style
- the border style (one of Constants.EN_DASHED etc.)col
- the color for the border segmentAbstractPathOrientedRenderer
public void startRenderer(java.io.OutputStream outputStream) throws java.io.IOException
Renderer
startRenderer
in interface Renderer
startRenderer
in class AbstractRenderer
java.io.IOException
Renderer.startRenderer(OutputStream)
public void stopRenderer() throws java.io.IOException
Renderer
stopRenderer
in interface Renderer
stopRenderer
in class AbstractRenderer
java.io.IOException
Renderer.stopRenderer()
public void processOffDocumentItem(OffDocumentItem oDI)
Renderer
processOffDocumentItem
in interface Renderer
processOffDocumentItem
in class AbstractRenderer
Renderer
public void startPageSequence(LineArea seqTitle)
Renderer
startPageSequence
in interface Renderer
startPageSequence
in class AbstractRenderer
Renderer.startPageSequence(org.apache.fop.area.LineArea)
public void renderPage(PageViewport page) throws java.io.IOException, FOPException
Renderer
renderPage
in interface Renderer
renderPage
in class AbstractRenderer
java.io.IOException
FOPException
Renderer.renderPage(PageViewport)
protected void renderRegionViewport(RegionViewport port)
AbstractRenderer
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 renderedAbstractRenderer
protected void beginTextObject()
beginTextObject
in class AbstractPathOrientedRenderer
protected void endTextObject()
endTextObject
in class AbstractPathOrientedRenderer
public void renderCharacter(Character ch)
AbstractRenderer
renderCharacter
in class AbstractRenderer
ch
- the character to renderAbstractRenderer.renderCharacter(Character)
public void renderText(TextArea area)
AbstractRenderer
renderText
in class AbstractRenderer
area
- the text to renderAbstractRenderer.renderText(TextArea)
protected java.util.List breakOutOfStateStack()
AbstractPathOrientedRenderer
breakOutOfStateStack
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer.breakOutOfStateStack()
protected void restoreStateStackAfterBreakOut(java.util.List breakOutList)
AbstractPathOrientedRenderer
restoreStateStackAfterBreakOut
in class AbstractPathOrientedRenderer
breakOutList
- the state stack to restore.AbstractPathOrientedRenderer
protected void startVParea(CTM ctm)
AbstractRenderer
startVParea
in class AbstractRenderer
ctm
- The coordinate transformation matrix to useAbstractRenderer.startVParea(CTM)
protected void endVParea()
AbstractRenderer
endVParea
in class AbstractRenderer
AbstractRenderer.endVParea()
protected void renderBlockViewport(BlockViewport bv, java.util.List children)
AbstractRenderer
renderBlockViewport
in class AbstractPathOrientedRenderer
AbstractRenderer
protected void renderInlineParent(InlineParent ip)
AbstractRenderer
renderInlineParent
in class AbstractPathOrientedRenderer
AbstractRenderer
public void renderImage(Image image, java.awt.geom.Rectangle2D pos)
AbstractRenderer
renderImage
in class AbstractRenderer
image
- The imagepos
- The target position of the image
(todo) Make renderImage() protectedAbstractRenderer.renderImage(Image, Rectangle2D)
public void renderForeignObject(ForeignObject fo, java.awt.geom.Rectangle2D pos)
AbstractRenderer
renderForeignObject
in class AbstractRenderer
fo
- The foreign object areapos
- The target position of the foreign object
(todo) Make renderForeignObject() protectedAbstractRenderer.renderForeignObject(ForeignObject, Rectangle2D)
public void renderDocument(org.w3c.dom.Document doc, java.lang.String ns, java.awt.geom.Rectangle2D pos)
doc
- DOM Document containing the XML document to be renderedns
- Namespace for the XML documentpos
- Position for the generated graphic/imagepublic java.lang.String getMimeType()
AbstractRenderer
getMimeType
in interface Renderer
getMimeType
in class AbstractRenderer
AbstractRenderer
|
fop 0.90alpha1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |