Package org.apache.fop.render.java2d
Class Java2DGraphicsPainter
java.lang.Object
org.apache.fop.render.java2d.Java2DGraphicsPainter
- All Implemented Interfaces:
GraphicsPainter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GeneralPath
(package private) static final org.apache.commons.logging.Log
logging instanceprivate final Java2DPainter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
arcTo
(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.void
clip()
Reduces the current clipping region to the current path.void
Closes the current path.void
drawBorderLine
(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color color) Draws a border line.void
Draws a line/rule.private Graphics2D
getG2D()
private Java2DGraphicsState
void
lineTo
(int x, int y) Draws a line from the current cursor position to the given coordinates.void
moveTo
(int x, int y) Moves the cursor to the given coordinate.void
Restore the last graphics state from the stack.void
rotateCoordinates
(double angle) Rotate the coordinate framevoid
Save the graphics state on the stack.void
scaleCoordinates
(float xScale, float yScale) Scale the coordinate framevoid
translateCoordinates
(int xTranslate, int yTranslate) Translate the coordinate frame
-
Field Details
-
log
static final org.apache.commons.logging.Log loglogging instance -
currentPath
-
painter
-
-
Constructor Details
-
Java2DGraphicsPainter
Java2DGraphicsPainter(Java2DPainter painter)
-
-
Method Details
-
getG2DState
-
getG2D
-
drawBorderLine
public void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color color) throws IOException Description copied from interface:GraphicsPainter
Draws a border line.- Specified by:
drawBorderLine
in 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:
IOException
- if an I/O error occurs
-
drawLine
public void drawLine(Point start, Point end, int width, Color color, RuleStyle style) throws IOException Description copied from interface:GraphicsPainter
Draws a line/rule.- Specified by:
drawLine
in 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:
IOException
- if an I/O error occurs
-
moveTo
Moves the cursor to the given coordinate.- Specified by:
moveTo
in interfaceGraphicsPainter
- Parameters:
x
- the X coordinate (in millipoints)y
- the Y coordinate (in millipoints)- Throws:
IOException
- if an I/O error occurs
-
lineTo
Draws a line from the current cursor position to the given coordinates.- Specified by:
lineTo
in interfaceGraphicsPainter
- Parameters:
x
- the X coordinate (in millipoints)y
- the Y coordinate (in millipoints)- Throws:
IOException
- if an I/O error occurs
-
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:
arcTo
in 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
-
rotateCoordinates
Rotate the coordinate frame- Specified by:
rotateCoordinates
in 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:
translateCoordinates
in 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:
scaleCoordinates
in interfaceGraphicsPainter
- Parameters:
xScale
- scale factor in the x directionyScale
- scale factor in the y direction- Throws:
IOException
- if an I/O error occurs
-
closePath
Closes the current path.- Specified by:
closePath
in interfaceGraphicsPainter
- Throws:
IOException
- if an I/O error occurs
-
clip
Reduces the current clipping region to the current path.- Specified by:
clip
in interfaceGraphicsPainter
- Throws:
IOException
- if an I/O error occurs
-
saveGraphicsState
Save the graphics state on the stack.- Specified by:
saveGraphicsState
in interfaceGraphicsPainter
- Throws:
IOException
- if an I/O error occurs
-
restoreGraphicsState
Restore the last graphics state from the stack.- Specified by:
restoreGraphicsState
in interfaceGraphicsPainter
- Throws:
IOException
- if an I/O error occurs
-