|
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.AbstractPathOrientedRenderer
public abstract class AbstractPathOrientedRenderer
Abstract base class for renderers like PDF and PostScript where many painting operations follow similar patterns which makes it possible to share some code.
Field Summary |
---|
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, log, userAgent |
Fields inherited from interface org.apache.fop.render.Renderer |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractPathOrientedRenderer()
|
Method Summary | |
---|---|
protected abstract void |
beginTextObject()
Indicates the beginning of a text object. |
protected abstract java.util.List |
breakOutOfStateStack()
Breaks out of the state stack to handle fixed block-containers. |
protected abstract void |
clip()
Clip using the current path. |
protected abstract void |
clipRect(float x,
float y,
float width,
float height)
Clip using a rectangular area. |
protected abstract 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 |
drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected abstract void |
drawBorderLine(float x1,
float y1,
float x2,
float y2,
boolean horz,
boolean startOrBefore,
int style,
java.awt.Color col)
Draw a border segment of an XSL-FO style border. |
protected void |
drawBorders(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)
Draw an image at the indicated location. |
protected abstract void |
drawImage(java.lang.String url,
java.awt.geom.Rectangle2D pos,
java.util.Map foreignAttributes)
Draw an image at the indicated location. |
protected abstract void |
endTextObject()
Indicates the end of a text object. |
protected abstract void |
fillRect(float x,
float y,
float width,
float height)
Fill a rectangular area. |
protected void |
handleBlockTraits(Block block)
Handle block traits. |
protected void |
handleRegionTraits(RegionViewport region)
Handle the traits for a region This is used to draw the traits for the given page region. |
protected abstract void |
lineTo(float x,
float y)
Appends a straight line segment from the current point to (x, y). |
protected abstract 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. |
void |
renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
Renders a foreign object area. |
protected void |
renderInlineAreaBackAndBorders(InlineArea area)
Common method to render the background and borders for any inline area. |
protected void |
renderTextDecoration(FontMetrics fm,
int fontsize,
InlineArea inline,
int baseline,
int startx)
Paints the text decoration marks. |
void |
renderViewport(Viewport viewport)
Render an inline viewport. |
protected abstract void |
restoreGraphicsState()
Restores the last graphics state of the rendering engine. |
protected abstract void |
restoreStateStackAfterBreakOut(java.util.List breakOutList)
Restores the state stack after a break out. |
protected abstract void |
saveGraphicsState()
Saves the graphics state of the rendering engine. |
protected abstract void |
updateColor(java.awt.Color col,
boolean fill)
Establishes a new foreground or fill color. |
Methods inherited from class org.apache.fop.render.PrintRenderer |
---|
addFontList, createRendererContext, getFontFromArea, getFontResolver, getInternalFontNameForArea, lightenColor, renderDocument, setFontList, setupFontInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPathOrientedRenderer()
Method Detail |
---|
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 drawBackAndBorders(Area area, float startx, float starty, float width, float height)
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 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 renderInlineAreaBackAndBorders(InlineArea area)
renderInlineAreaBackAndBorders
in class AbstractRenderer
area
- the inline area for which the background, border and padding is to be
renderedprotected 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 renderViewport(Viewport viewport)
renderViewport
in class AbstractRenderer
viewport
- the viewport to handleprotected abstract void restoreStateStackAfterBreakOut(java.util.List breakOutList)
breakOutList
- the state stack to restore.protected abstract java.util.List breakOutOfStateStack()
protected abstract void saveGraphicsState()
protected abstract void restoreGraphicsState()
protected abstract void beginTextObject()
protected abstract void endTextObject()
protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline, int baseline, int startx)
fm
- Current typefacefontsize
- Current font sizeinline
- inline area to paint the marks forbaseline
- position of the baselinestartx
- start IPDprotected abstract void clip()
protected abstract void clipRect(float x, float y, float width, float height)
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectangleprotected abstract void moveTo(float x, float y)
x
- x coordinatey
- y coordinateprotected abstract void lineTo(float x, float y)
x
- x coordinatey
- y coordinateprotected abstract void closePath()
protected abstract void fillRect(float x, float y, float width, float height)
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectangleprotected abstract void updateColor(java.awt.Color col, boolean fill)
col
- the color to apply (null skips this operation)fill
- true to set the fill color, false for the foreground colorprotected abstract 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 nullprotected final void drawImage(java.lang.String url, java.awt.geom.Rectangle2D pos)
url
- the URI/URL of the imagepos
- the position of the imageprotected abstract void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, java.awt.Color col)
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 segmentpublic 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)
|
fop 0.94 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |