|
fop 0.94 | |||||||||
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()
|
protected void |
clipRect(float x,
float y,
float width,
float height)
Clip an area. |
protected void |
closePath()
|
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 url,
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 |
lineTo(float x,
float y)
|
protected void |
moveTo(float x,
float y)
|
protected void |
renderBlockViewport(BlockViewport bv,
java.util.List children)
Renders a block viewport. |
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 |
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)
|
boolean |
setFont(java.lang.String name,
float size,
java.lang.String text)
Sets the current font (NOTE: Hard-coded font mappings ATM!) |
void |
setQualityBeforeSpeed(boolean qualityBeforeSpeed)
|
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, createRendererContext, 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)
public void setupFontInfo(FontInfo inFontInfo)
PrintRenderer
setupFontInfo
in interface Renderer
setupFontInfo
in class PrintRenderer
inFontInfo
- font info to set upRenderer.setupFontInfo(org.apache.fop.fonts.FontInfo)
protected void handleIOTrouble(java.io.IOException ioe)
ioe
- IOException to handlepublic Graphics2DAdapter getGraphics2DAdapter()
getGraphics2DAdapter
in interface Renderer
getGraphics2DAdapter
in class AbstractRenderer
Renderer.getGraphics2DAdapter()
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
Renderer
startRenderer
in interface Renderer
startRenderer
in class AbstractRenderer
outputStream
- The OutputStream to use for output
java.io.IOException
- If an I/O error occursRenderer.startRenderer(java.io.OutputStream)
public void stopRenderer() throws java.io.IOException
Renderer
stopRenderer
in interface Renderer
stopRenderer
in class AbstractRenderer
java.io.IOException
- If an I/O error occursRenderer.stopRenderer()
public java.lang.String getMimeType()
AbstractRenderer
getMimeType
in interface Renderer
getMimeType
in class AbstractRenderer
AbstractRenderer
public void renderPage(PageViewport page) throws java.io.IOException, FOPException
Renderer
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.AbstractRenderer.renderPage(org.apache.fop.area.PageViewport)
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)
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.AbstractRenderer.startVParea(CTM, Rectangle2D)
protected void endVParea()
AbstractRenderer
endVParea
in class AbstractRenderer
AbstractRenderer.endVParea()
protected void handleBlockTraits(Block block)
handleBlockTraits
in class AbstractRenderer
block
- the block to render the traitsprotected void renderText(TextArea text)
AbstractRenderer
renderText
in class AbstractRenderer
text
- the text to renderAbstractRenderer.renderText(TextArea)
protected void clip()
AbstractPathOrientedRenderer.clip()
protected void closePath()
AbstractPathOrientedRenderer.closePath()
protected void lineTo(float x, float y)
AbstractPathOrientedRenderer.lineTo(float, float)
protected void moveTo(float x, float y)
AbstractPathOrientedRenderer.moveTo(float, float)
protected 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)
AbstractRenderer
renderWord
in class AbstractRenderer
word
- the word to renderAbstractRenderer.renderWord(org.apache.fop.area.inline.WordArea)
protected void renderSpace(SpaceArea space)
AbstractRenderer
renderSpace
in class AbstractRenderer
space
- the space to renderAbstractRenderer.renderSpace(org.apache.fop.area.inline.SpaceArea)
public void renderViewport(Viewport viewport)
renderViewport
in class AbstractRenderer
viewport
- the viewport to handleprotected void renderBlockViewport(BlockViewport bv, java.util.List children)
AbstractRenderer
renderBlockViewport
in class AbstractRenderer
bv
- The block viewportchildren
- The children to render within the block viewportAbstractRenderer.renderBlockViewport(BlockViewport, List)
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)
protected void drawImage(java.lang.String url, java.awt.geom.Rectangle2D pos, java.util.Map foreignAttributes)
url
- 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)
AbstractRenderer
renderForeignObject
in class AbstractRenderer
fo
- The foreign object areapos
- The target position of the foreign object
(todo) Make renderForeignObject() protectedAbstractRenderer.renderForeignObject(ForeignObject, Rectangle2D)
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 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)
|
fop 0.94 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |