Package org.apache.fop.render.pdf
Class PDFGraphicsPainter
java.lang.Object
org.apache.fop.render.pdf.PDFGraphicsPainter
- All Implemented Interfaces:
BezierCurvePainter,GraphicsPainter
PDF-specific implementation of the
GraphicsPainter.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidarcTo(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.voidCloses the current path.voidcubicBezierTo(int p1x, int p1y, int p2x, int p2y, int p3x, int p3y) Draw a cubic bezier from current position to (p3x, p3y) using the control points (p1x, p1y) and (p2x, p2y)voiddrawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color col) Draws a border line.voidDraws 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.voidRestore the last graphics state from the stack.voidrotateCoordinates(double angle) Rotate the coordinate framevoidSave the graphics state on the stack.voidscaleCoordinates(float xScale, float yScale) Scale the coordinate framevoidtranslateCoordinates(int xTranslate, int yTranslate) Translate the coordinate frame
-
Constructor Details
-
PDFGraphicsPainter
-
-
Method Details
-
drawBorderLine
public void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color col) Draws 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 stylecol- the border color
-
drawLine
Draws 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
-
moveTo
public void moveTo(int x, int y) Moves the cursor to the given coordinate.- Specified by:
moveToin interfaceGraphicsPainter- Parameters:
x- the X coordinate (in millipoints)y- the Y coordinate (in millipoints)
-
lineTo
public void lineTo(int x, int y) Draws 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)
-
arcTo
public void arcTo(double startAngle, double endAngle, int cx, int cy, int width, int height) throws IOException 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. 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:
IOException- if an I/O error occurs
-
closePath
public void closePath()Closes the current path.- Specified by:
closePathin interfaceGraphicsPainter
-
clip
public void clip()Reduces the current clipping region to the current path.- Specified by:
clipin interfaceGraphicsPainter
-
saveGraphicsState
public void saveGraphicsState()Save the graphics state on the stack.- Specified by:
saveGraphicsStatein interfaceGraphicsPainter
-
restoreGraphicsState
public void restoreGraphicsState()Restore the last graphics state from the stack.- Specified by:
restoreGraphicsStatein interfaceGraphicsPainter
-
rotateCoordinates
Rotate the coordinate frame- Specified by:
rotateCoordinatesin interfaceGraphicsPainter- Parameters:
angle- angle in radians to rotate the coordinate frame- Throws:
IOException- if an I/O error occurs
-
translateCoordinates
Translate the coordinate frame- Specified by:
translateCoordinatesin interfaceGraphicsPainter- Parameters:
xTranslate- translation in the x directionyTranslate- translation in the y direction- Throws:
IOException- if an I/O error occurs
-
scaleCoordinates
Scale the coordinate frame- Specified by:
scaleCoordinatesin interfaceGraphicsPainter- Parameters:
xScale- scale factor in the x directionyScale- scale factor in the y direction- Throws:
IOException- if an I/O error occurs
-
cubicBezierTo
public void cubicBezierTo(int p1x, int p1y, int p2x, int p2y, int p3x, int p3y) Draw a cubic bezier from current position to (p3x, p3y) using the control points (p1x, p1y) and (p2x, p2y)- Specified by:
cubicBezierToin interfaceBezierCurvePainter- Parameters:
p1x- x coordinate of the first control pointp1y- y coordinate of the first control pointp2x- x coordinate of the second control pointp2y- y coordinate of the second control pointp3x- x coordinate of the end pointp3y- y coordinate of the end point
-