public class SwingShape extends Object implements Serializable, PdfShape
defines the current shape which is created by command stream
This class is NOT part of the API
. Shapes can be drawn onto pdf or used as a clip on other image/shape/text. Shape is built up by storing commands and then turning these commands into a shape. Has to be done this way as Winding rule is not necessarily declared at start.| Constructor and Description |
|---|
SwingShape() |
SwingShape(Shape currentShape) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBezierCurveC(float x,
float y,
float x2,
float y2,
float x3,
float y3)
add a curve to the shape
|
void |
addBezierCurveV(float x2,
float y2,
float x3,
float y3)
add a curve to the shape
|
void |
addBezierCurveY(float x,
float y,
float x3,
float y3)
add a curve to the shape
|
void |
appendRectangle(float x,
float y,
float w,
float h)
add a rectangle to set of shapes
|
void |
closeShape()
end a shape, storing info for later
|
Shape |
generateShapeFromPath(float[][] CTM,
float thickness,
int cmd)
turn shape commands into a Shape object, storing info for later.
|
int |
getComplexClipCount() |
ShapeMetrics |
getMetrics() |
Object |
getPath() |
int |
getSegmentCount()
number of segments in current shape (0 if no shape or none)
|
Shape |
getShape() |
boolean |
isClip() |
boolean |
isClosed() |
void |
lineTo(float x,
float y)
add a line to the shape
|
void |
moveTo(float x,
float y)
start a shape by creating a shape object
|
void |
resetPath()
reset path to empty
|
void |
setClip(boolean b) |
void |
setEVENODDWindingRule()
set winding rule - even odd
|
void |
setNONZEROWindingRule()
set winding rule - non zero
|
void |
setShape(Shape currentShape) |
public SwingShape(Shape currentShape)
public SwingShape()
public final void closeShape()
closeShape in interface PdfShapepublic final void addBezierCurveC(float x,
float y,
float x2,
float y2,
float x3,
float y3)
addBezierCurveC in interface PdfShapepublic final void setNONZEROWindingRule()
setNONZEROWindingRule in interface PdfShapepublic final void lineTo(float x,
float y)
public final void addBezierCurveV(float x2,
float y2,
float x3,
float y3)
addBezierCurveV in interface PdfShapepublic final Shape generateShapeFromPath(float[][] CTM, float thickness, int cmd)
generateShapeFromPath in interface PdfShapepublic final void appendRectangle(float x,
float y,
float w,
float h)
appendRectangle in interface PdfShapepublic final void moveTo(float x,
float y)
public final void addBezierCurveY(float x,
float y,
float x3,
float y3)
addBezierCurveY in interface PdfShapepublic final void resetPath()
public final void setEVENODDWindingRule()
setEVENODDWindingRule in interface PdfShapepublic int getSegmentCount()
getSegmentCount in interface PdfShapepublic int getComplexClipCount()
getComplexClipCount in interface PdfShapepublic ShapeMetrics getMetrics()
Copyright © 2017. All rights reserved.