|
fop 2.3 | |||||||||
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 | |
---|---|
protected static org.apache.xmlgraphics.util.QName |
FOX_TRANSFORM
Constant for the fox:transform extension attribute |
Fields inherited from class org.apache.fop.render.PrintRenderer |
---|
embedFontInfoList, fontInfo |
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(FOUserAgent userAgent)
|
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 void |
clipBackground(float startx,
float starty,
float width,
float height,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd)
TODO represent border related parameters in a class Clip the background to the inner border. |
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 abstract void |
concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
Concatenates the current transformation matrix with the given one, therefore establishing a new coordinate system. |
protected void |
drawBackAndBorders(Area backgroundArea,
Area borderArea,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected void |
drawBackAndBorders(Area area,
float startx,
float starty,
float width,
float height)
Draw the background and borders. |
protected void |
drawBackground(float startx,
float starty,
float width,
float height,
Trait.Background back,
BorderProps bpsTop,
BorderProps bpsBottom,
BorderProps bpsLeft,
BorderProps bpsRight)
Draw the background. |
protected void |
drawBackground(float startx,
float starty,
float width,
float height,
Trait.Background back,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd,
int level)
Draw the background. |
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(float startx,
float starty,
float width,
float height,
BorderProps bpsBefore,
BorderProps bpsAfter,
BorderProps bpsStart,
BorderProps bpsEnd,
int level,
java.awt.Color innerBackgroundColor)
Draw the borders. |
protected void |
drawBorders(java.awt.geom.Rectangle2D.Float borderRect,
BorderProps bpsTop,
BorderProps bpsBottom,
BorderProps bpsLeft,
BorderProps bpsRight,
java.awt.Color innerBackgroundColor)
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 void |
establishTransformationMatrix(java.awt.geom.AffineTransform at)
Establishes a new coordinate system with the given transformation matrix. |
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. |
protected void |
renderFlow(NormalFlow flow)
Renders a flow reference area. |
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. |
void |
renderInlineViewport(InlineViewport viewport)
Render an inline viewport. |
protected void |
renderReferenceArea(Block block)
Renders a block area that represents a reference area. |
protected void |
renderTextDecoration(FontMetrics fm,
int fontsize,
InlineArea inline,
int baseline,
int startx)
Paints the text decoration marks. |
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, getFontInfo, getFontList, getInternalFontNameForArea, instantiateRendererContext, renderDocument, setFontList, setupFontInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.fop.render.Renderer |
---|
getMimeType |
Field Detail |
---|
protected static final org.apache.xmlgraphics.util.QName FOX_TRANSFORM
Constructor Detail |
---|
public AbstractPathOrientedRenderer(FOUserAgent userAgent)
userAgent
- the user agent that contains configuration details. This cannot be null.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 drawBackAndBorders(Area backgroundArea, Area borderArea, float startx, float starty, float width, float height)
backgroundArea
- the area to get the background traits fromborderArea
- the area to get the border traits fromstartx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areaprotected void drawBackground(float startx, float starty, float width, float height, Trait.Background back, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd, int level)
startx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areaback
- the background traitsbpsBefore
- the border-before traitsbpsAfter
- the border-after traitsbpsStart
- the border-start traitsbpsEnd
- the border-end traitslevel
- of bidirectional embeddingprotected void drawBackground(float startx, float starty, float width, float height, Trait.Background back, BorderProps bpsTop, BorderProps bpsBottom, BorderProps bpsLeft, BorderProps bpsRight)
startx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areaback
- the background traitsbpsTop
- the border specification on the top edgebpsBottom
- the border traits associated with bottom edgebpsLeft
- the border specification on the left edgebpsRight
- the border specification on the right edgeprotected void clipBackground(float startx, float starty, float width, float height, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd)
startx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areabpsBefore
- the border-before traitsbpsAfter
- the border-after traitsbpsStart
- the border-start traitsbpsEnd
- the border-end traitsprotected void drawBorders(float startx, float starty, float width, float height, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd, int level, java.awt.Color innerBackgroundColor)
startx
- the start x positionstarty
- the start y positionwidth
- the width of the areaheight
- the height of the areabpsBefore
- the border traits associated with before edgebpsAfter
- the border traits associated with after edgebpsStart
- the border traits associated with start edgebpsEnd
- the border traits associated with end edgelevel
- of bidirectional embeddinginnerBackgroundColor
- the background color of the blockprotected void drawBorders(java.awt.geom.Rectangle2D.Float borderRect, BorderProps bpsTop, BorderProps bpsBottom, BorderProps bpsLeft, BorderProps bpsRight, java.awt.Color innerBackgroundColor)
borderRect
- the border rectanglebpsTop
- the border specification on the top edgebpsBottom
- the border traits associated with bottom edgebpsLeft
- the border specification on the left edgebpsRight
- the border specification on the right edgeinnerBackgroundColor
- the background color of the blockprotected 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)
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 abstract void concatenateTransformationMatrix(java.awt.geom.AffineTransform at)
at
- the transformation matrix to process (coordinates in points)public void renderInlineViewport(InlineViewport viewport)
renderInlineViewport
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 coordinate (in points)y
- the y coordinate (in points)width
- the width of the rectangle (in points)height
- the height of the rectangle (in points)protected 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)
renderForeignObject
in class AbstractRenderer
fo
- The foreign object areapos
- The target position of the foreign object
(todo) Make renderForeignObject() protectedprotected void establishTransformationMatrix(java.awt.geom.AffineTransform at)
at
- the transformation matrix
|
fop 2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |