|
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.pcl.PCLRenderer
public class PCLRenderer
Renderer for the PCL 5 printer language. It also uses HP GL/2 for certain graphic elements.
Field Summary | |
---|---|
protected PCLGenerator |
gen
The PCL generator |
static java.lang.String |
MIME_TYPE
The MIME type for PCL |
protected java.io.OutputStream |
out
The OutputStream to write the PCL stream to |
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, userAgent |
Fields inherited from interface org.apache.fop.render.Renderer |
---|
ROLE |
Constructor Summary | |
---|---|
PCLRenderer()
Create the PCL renderer |
Method Summary | |
---|---|
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 |
concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
Concatenates the current transformation matrix with the given one, therefore establishing a new coordinate system. |
protected RendererContext |
createRendererContext(int x,
int y,
int width,
int height,
java.util.Map foreignAttributes)
Creates a RendererContext for an image. |
protected void |
drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected void |
drawBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Draws borders. |
protected void |
drawFastBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Draws borders. |
protected void |
drawImage(java.lang.String uri,
java.awt.geom.Rectangle2D pos,
java.util.Map foreignAttributes)
Draw an image at the indicated location. |
protected void |
drawQualityBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
Draws borders. |
protected void |
endVParea()
Signals exit from a viewport area. |
protected void |
fillRect(float x,
float y,
float width,
float height)
Fill a rectangular area. |
org.apache.xmlgraphics.java2d.GraphicContext |
getGraphicContext()
|
Graphics2DAdapter |
getGraphics2DAdapter()
|
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
protected int |
getResolution()
|
protected void |
handleBlockTraits(Block block)
Handle block traits. |
protected void |
handleIOTrouble(java.io.IOException ioe)
Central exception handler for I/O exceptions. |
protected void |
handleRegionTraits(RegionViewport region)
Handle the traits for a region This is used to draw the traits for the given page region. |
boolean |
isPJLDisabled()
Indicates whether PJL generation is disabled. |
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 |
renderBlockViewport(BlockViewport bv,
java.util.List children)
Renders a block viewport. |
protected void |
renderFlow(NormalFlow flow)
Renders a flow reference area. |
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 |
renderInlineAreaBackAndBorders(InlineArea area)
Common method to render the background and borders for any inline 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 |
renderSpace(SpaceArea space)
Render the given SpaceArea. |
protected void |
renderText(TextArea text)
Render the given TextArea. |
void |
renderViewport(Viewport viewport)
Render an inline viewport. |
protected void |
renderWord(WordArea word)
Render the given WordArea. |
protected void |
restoreGraphicsState()
Restores the last graphics state from the stack. |
protected void |
saveGraphicsState()
Saves the current graphics state on the stack. |
void |
setAllTextAsBitmaps(boolean allTextAsBitmaps)
Controls whether all text should be generated as bitmaps or only text for which there's no native font. |
boolean |
setFont(java.lang.String name,
float size,
java.lang.String text)
Sets the current font (NOTE: Hard-coded font mappings ATM!) |
void |
setPJLDisabled(boolean disable)
Controls whether PJL commands shall be generated by the PCL renderer. |
void |
setQualityBeforeSpeed(boolean qualityBeforeSpeed)
Configures the renderer to trade speed for quality if desired. |
void |
setupFontInfo(FontInfo inFontInfo)
Set up the font info |
void |
startRenderer(java.io.OutputStream outputStream)
Initiates the rendering phase. |
protected void |
startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. |
protected void |
updateFillColor(java.awt.Color color)
Sets the new current fill color. |
Methods inherited from class org.apache.fop.render.PrintRenderer |
---|
addFontList, getFontFromArea, getFontResolver, getInternalFontNameForArea, lightenColor, renderDocument, setFontList |
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 java.io.OutputStream out
protected PCLGenerator gen
Constructor Detail |
---|
public PCLRenderer()
Method Detail |
---|
public void setQualityBeforeSpeed(boolean qualityBeforeSpeed)
qualityBeforeSpeed
- true if quality is more important than speedpublic void setPJLDisabled(boolean disable)
disable
- true to disable PJL commandspublic boolean isPJLDisabled()
public void setupFontInfo(FontInfo inFontInfo)
setupFontInfo
in interface Renderer
setupFontInfo
in class PrintRenderer
inFontInfo
- font info to set upprotected void handleIOTrouble(java.io.IOException ioe)
ioe
- IOException to handlepublic Graphics2DAdapter getGraphics2DAdapter()
getGraphics2DAdapter
in interface Renderer
getGraphics2DAdapter
in class AbstractRenderer
public org.apache.xmlgraphics.java2d.GraphicContext getGraphicContext()
protected int getResolution()
public boolean setFont(java.lang.String name, float size, java.lang.String text) throws java.io.IOException
name
- the font name (internal F* names for now)size
- the font sizetext
- the text to be rendered (used to determine if there are non-printable chars)
java.io.IOException
- if an I/O problem occurspublic void startRenderer(java.io.OutputStream outputStream) throws java.io.IOException
startRenderer
in interface Renderer
startRenderer
in class AbstractRenderer
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 AbstractRenderer
java.io.IOException
- If an I/O error occurspublic java.lang.String getMimeType()
getMimeType
in interface Renderer
getMimeType
in class AbstractRenderer
public 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 saveGraphicsState()
protected void restoreGraphicsState()
protected void clipRect(float x, float y, float width, float height)
x
- the x coordinatey
- the y coordinatewidth
- the width of the areaheight
- the height of the areaprotected void startVParea(CTM ctm, java.awt.geom.Rectangle2D clippingRect)
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 handleBlockTraits(Block block)
handleBlockTraits
in class AbstractRenderer
block
- the block to render the traitsprotected void handleRegionTraits(RegionViewport region)
handleRegionTraits
in class AbstractRenderer
region
- the RegionViewport whose region is to be drawnprotected void renderText(TextArea text)
renderText
in class AbstractRenderer
text
- the text to renderprotected void clip()
protected void closePath()
protected void lineTo(float x, float y)
x
- x coordinatey
- y coordinateprotected void moveTo(float x, float y)
x
- x coordinatey
- y coordinateprotected void fillRect(float x, float y, float width, float height)
x
- the x coordinate (in pt)y
- the y coordinate (in pt)width
- the width of the rectangleheight
- the height of the rectangleprotected void updateFillColor(java.awt.Color color)
color
- the colorprotected 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 renderpublic void renderViewport(Viewport viewport)
renderViewport
in class AbstractRenderer
viewport
- the viewport to handleprotected void renderBlockViewport(BlockViewport bv, java.util.List children)
renderBlockViewport
in class AbstractRenderer
bv
- The block viewportchildren
- The children to render within the block viewportprotected void renderReferenceArea(Block block)
renderReferenceArea
in class AbstractRenderer
block
- the block areaprotected void renderFlow(NormalFlow flow)
renderFlow
in class AbstractRenderer
flow
- The flow reference areaprotected void concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
at
- the transformation matrix to process (coordinates in points)protected RendererContext createRendererContext(int x, int y, int width, int height, java.util.Map foreignAttributes)
createRendererContext
in class PrintRenderer
x
- the x coordinate (in millipoints)y
- the y coordinate (in millipoints)width
- the width of the image (in millipoints)height
- the height of the image (in millipoints)foreignAttributes
- a Map or foreign attributes, may be null
public 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() protectedprotected void drawImage(java.lang.String uri, java.awt.geom.Rectangle2D pos, java.util.Map foreignAttributes)
uri
- the URI/URL of the imagepos
- the position of the imageforeignAttributes
- an optional Map with foreign attributes, may be nullpublic void renderForeignObject(ForeignObject fo, java.awt.geom.Rectangle2D pos)
renderForeignObject
in class AbstractRenderer
fo
- The foreign object areapos
- The target position of the foreign object
(todo) Make renderForeignObject() protectedprotected void renderInlineAreaBackAndBorders(InlineArea area)
renderInlineAreaBackAndBorders
in class AbstractRenderer
area
- the inline area for which the background, border and padding is to be
renderedprotected void drawBackAndBorders(Area area, float startx, float starty, float width, float height)
area
- the area whose traits are usedstartx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areaprotected void drawBorders(java.awt.geom.Rectangle2D.Float borderRect, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
borderRect
- the border rectanglebpsBefore
- the border specification on the before sidebpsAfter
- the border specification on the after sidebpsStart
- the border specification on the start sidebpsEnd
- the border specification on the end sideprotected void drawFastBorders(java.awt.geom.Rectangle2D.Float borderRect, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
borderRect
- the border rectanglebpsBefore
- the border specification on the before sidebpsAfter
- the border specification on the after sidebpsStart
- the border specification on the start sidebpsEnd
- the border specification on the end sideprotected void drawQualityBorders(java.awt.geom.Rectangle2D.Float borderRect, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
borderRect
- the border rectanglebpsBefore
- the border specification on the before sidebpsAfter
- the border specification on the after sidebpsStart
- the border specification on the start sidebpsEnd
- the border specification on the end sidepublic void setAllTextAsBitmaps(boolean allTextAsBitmaps)
allTextAsBitmaps
- true if all text should be painted as bitmaps
|
fop 0.95 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |