Package org.apache.fop.render.afp
Class AFPPainter.AFPGraphicsPainter
- java.lang.Object
-
- org.apache.fop.render.afp.AFPPainter.AFPGraphicsPainter
-
- All Implemented Interfaces:
GraphicsPainter
- Enclosing class:
- AFPPainter
private static final class AFPPainter.AFPGraphicsPainter extends java.lang.Object implements GraphicsPainter
-
-
Field Summary
Fields Modifier and Type Field Description private AFPBorderPaintergraphicsPainter
-
Constructor Summary
Constructors Modifier Constructor Description privateAFPGraphicsPainter(AFPBorderPainter delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarcTo(double startAngle, double endAngle, int cx, int cy, int width, int height)Draws an arc on the ellipse centered at (cx, cy) with width width and height height from start angle startAngle (with respect to the x-axis counter-clockwise) to the end angle endAngle.voidclip()Reduces the current clipping region to the current path.voidclosePath()Closes the current path.voiddrawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, java.awt.Color color)Draws a border line.voiddrawLine(java.awt.Point start, java.awt.Point end, int width, java.awt.Color color, RuleStyle style)Draws a line/rule.voidlineTo(int x, int y)Draws a line from the current cursor position to the given coordinates.voidmoveTo(int x, int y)Moves the cursor to the given coordinate.voidrestoreGraphicsState()Restore the last graphics state from the stack.voidrotateCoordinates(double angle)Rotate the coordinate framevoidsaveGraphicsState()Save the graphics state on the stack.voidscaleCoordinates(float xScale, float yScale)Scale the coordinate frameprivate floattoPoints(int mpt)voidtranslateCoordinates(int xTranslate, int yTranslate)Translate the coordinate frame
-
-
-
Field Detail
-
graphicsPainter
private final AFPBorderPainter graphicsPainter
-
-
Constructor Detail
-
AFPGraphicsPainter
private AFPGraphicsPainter(AFPBorderPainter delegate)
-
-
Method Detail
-
drawBorderLine
public void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, java.awt.Color color) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterDraws a border line.- Specified by:
drawBorderLinein interfaceGraphicsPainter- Parameters:
x1- X coordinate of the upper left corner of the line's bounding rectangle (in millipoints)y1- start Y coordinate of the upper left corner of the line's bounding rectangle (in millipoints)x2- end X coordinate of the lower right corner of the line's bounding rectangle (in millipoints)y2- end y coordinate of the lower right corner of the line's bounding rectangle (in millipoints)horz- true if it is a horizontal linestartOrBefore- true if the line is the start or end edge of a border boxstyle- the border stylecolor- the border color- Throws:
java.io.IOException- if an I/O error occurs
-
toPoints
private float toPoints(int mpt)
-
drawLine
public void drawLine(java.awt.Point start, java.awt.Point end, int width, java.awt.Color color, RuleStyle style) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterDraws a line/rule.- Specified by:
drawLinein interfaceGraphicsPainter- Parameters:
start- start point (coordinates in millipoints)end- end point (coordinates in millipoints)width- width of the linecolor- the line colorstyle- the rule style- Throws:
java.io.IOException- if an I/O error occurs
-
moveTo
public void moveTo(int x, int y) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterMoves the cursor to the given coordinate.- Specified by:
moveToin interfaceGraphicsPainter- Parameters:
x- the X coordinate (in millipoints)y- the Y coordinate (in millipoints)- Throws:
java.io.IOException- if an I/O error occurs
-
lineTo
public void lineTo(int x, int y) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterDraws a line from the current cursor position to the given coordinates.- Specified by:
lineToin interfaceGraphicsPainter- Parameters:
x- the X coordinate (in millipoints)y- the Y coordinate (in millipoints)- Throws:
java.io.IOException- if an I/O error occurs
-
arcTo
public void arcTo(double startAngle, double endAngle, int cx, int cy, int width, int height) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterDraws an arc on the ellipse centered at (cx, cy) with width width and height height from start angle startAngle (with respect to the x-axis counter-clockwise) to the end angle endAngle. The ellipses major axis are assumed to coincide with the coordinate axis. The current position MUST coincide with the starting position on the ellipse.- Specified by:
arcToin interfaceGraphicsPainter- Parameters:
startAngle- the start angleendAngle- the end anglecx- the x coordinate of the ellipse centercy- the y coordinate of the ellipse centerwidth- the extent of the ellipse in the x directionheight- the extent of the ellipse in the y direction- Throws:
java.io.IOException- if an I/O error occurs
-
rotateCoordinates
public void rotateCoordinates(double angle) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterRotate the coordinate frame- Specified by:
rotateCoordinatesin interfaceGraphicsPainter- Parameters:
angle- angle in radians to rotate the coordinate frame- Throws:
java.io.IOException- if an I/O error occurs
-
translateCoordinates
public void translateCoordinates(int xTranslate, int yTranslate) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterTranslate the coordinate frame- Specified by:
translateCoordinatesin interfaceGraphicsPainter- Parameters:
xTranslate- translation in the x directionyTranslate- translation in the y direction- Throws:
java.io.IOException- if an I/O error occurs
-
scaleCoordinates
public void scaleCoordinates(float xScale, float yScale) throws java.io.IOExceptionDescription copied from interface:GraphicsPainterScale the coordinate frame- Specified by:
scaleCoordinatesin interfaceGraphicsPainter- Parameters:
xScale- scale factor in the x directionyScale- scale factor in the y direction- Throws:
java.io.IOException- if an I/O error occurs
-
closePath
public void closePath() throws java.io.IOExceptionDescription copied from interface:GraphicsPainterCloses the current path.- Specified by:
closePathin interfaceGraphicsPainter- Throws:
java.io.IOException- if an I/O error occurs
-
clip
public void clip() throws java.io.IOExceptionDescription copied from interface:GraphicsPainterReduces the current clipping region to the current path.- Specified by:
clipin interfaceGraphicsPainter- Throws:
java.io.IOException- if an I/O error occurs
-
saveGraphicsState
public void saveGraphicsState() throws java.io.IOExceptionDescription copied from interface:GraphicsPainterSave the graphics state on the stack.- Specified by:
saveGraphicsStatein interfaceGraphicsPainter- Throws:
java.io.IOException- if an I/O error occurs
-
restoreGraphicsState
public void restoreGraphicsState() throws java.io.IOExceptionDescription copied from interface:GraphicsPainterRestore the last graphics state from the stack.- Specified by:
restoreGraphicsStatein interfaceGraphicsPainter- Throws:
java.io.IOException- if an I/O error occurs
-
-