Package com.itextpdf.awt.geom
Class GeneralPath
- java.lang.Object
-
- com.itextpdf.awt.geom.GeneralPath
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
GeneralPath.Iterator
-
Field Summary
Fields Modifier and Type Field Description private static int
BUFFER_CAPACITY
The buffers capacityprivate static int
BUFFER_SIZE
The buffers size(package private) float[]
points
The points buffer(package private) static int[]
pointShift
The space amount in points buffer for different segmenet's types(package private) int
pointSize
The points buffer size(package private) int
rule
The path rule(package private) byte[]
types
The point's types buffer(package private) int
typeSize
The point's type buffer sizestatic int
WIND_EVEN_ODD
static int
WIND_NON_ZERO
-
Constructor Summary
Constructors Constructor Description GeneralPath()
GeneralPath(int rule)
GeneralPath(int rule, int initialCapacity)
GeneralPath(Shape shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(PathIterator path, boolean connect)
void
append(Shape shape, boolean connect)
(package private) void
checkBuf(int pointCount, boolean checkMove)
Checks points and types buffer size to add pointCount points.java.lang.Object
clone()
void
closePath()
boolean
contains(double px, double py)
boolean
contains(double rx, double ry, double rw, double rh)
boolean
contains(Point2D p)
boolean
contains(Rectangle2D r)
Shape
createTransformedShape(AffineTransform t)
void
curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
Rectangle
getBounds()
Rectangle2D
getBounds2D()
Point2D
getCurrentPoint()
PathIterator
getPathIterator(AffineTransform t)
PathIterator
getPathIterator(AffineTransform t, double flatness)
int
getWindingRule()
boolean
intersects(double rx, double ry, double rw, double rh)
boolean
intersects(Rectangle2D r)
(package private) boolean
isInside(int cross)
Checks cross count according to path rule to define is it point inside shape or not.void
lineTo(float x, float y)
void
moveTo(float x, float y)
void
quadTo(float x1, float y1, float x2, float y2)
void
reset()
void
setWindingRule(int rule)
void
transform(AffineTransform t)
-
-
-
Field Detail
-
WIND_EVEN_ODD
public static final int WIND_EVEN_ODD
- See Also:
- Constant Field Values
-
WIND_NON_ZERO
public static final int WIND_NON_ZERO
- See Also:
- Constant Field Values
-
BUFFER_SIZE
private static final int BUFFER_SIZE
The buffers size- See Also:
- Constant Field Values
-
BUFFER_CAPACITY
private static final int BUFFER_CAPACITY
The buffers capacity- See Also:
- Constant Field Values
-
types
byte[] types
The point's types buffer
-
points
float[] points
The points buffer
-
typeSize
int typeSize
The point's type buffer size
-
pointSize
int pointSize
The points buffer size
-
rule
int rule
The path rule
-
pointShift
static int[] pointShift
The space amount in points buffer for different segmenet's types
-
-
Constructor Detail
-
GeneralPath
public GeneralPath()
-
GeneralPath
public GeneralPath(int rule)
-
GeneralPath
public GeneralPath(int rule, int initialCapacity)
-
GeneralPath
public GeneralPath(Shape shape)
-
-
Method Detail
-
setWindingRule
public void setWindingRule(int rule)
-
getWindingRule
public int getWindingRule()
-
checkBuf
void checkBuf(int pointCount, boolean checkMove)
Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.- Parameters:
pointCount
- - the point count to be added in buffer
-
moveTo
public void moveTo(float x, float y)
-
lineTo
public void lineTo(float x, float y)
-
quadTo
public void quadTo(float x1, float y1, float x2, float y2)
-
curveTo
public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
-
closePath
public void closePath()
-
append
public void append(Shape shape, boolean connect)
-
append
public void append(PathIterator path, boolean connect)
-
getCurrentPoint
public Point2D getCurrentPoint()
-
reset
public void reset()
-
transform
public void transform(AffineTransform t)
-
createTransformedShape
public Shape createTransformedShape(AffineTransform t)
-
getBounds2D
public Rectangle2D getBounds2D()
- Specified by:
getBounds2D
in interfaceShape
-
isInside
boolean isInside(int cross)
Checks cross count according to path rule to define is it point inside shape or not.- Parameters:
cross
- - the point cross count- Returns:
- true if point is inside path, or false otherwise
-
contains
public boolean contains(double rx, double ry, double rw, double rh)
-
intersects
public boolean intersects(double rx, double ry, double rw, double rh)
- Specified by:
intersects
in interfaceShape
-
contains
public boolean contains(Rectangle2D r)
-
intersects
public boolean intersects(Rectangle2D r)
- Specified by:
intersects
in interfaceShape
-
getPathIterator
public PathIterator getPathIterator(AffineTransform t)
- Specified by:
getPathIterator
in interfaceShape
-
getPathIterator
public PathIterator getPathIterator(AffineTransform t, double flatness)
- Specified by:
getPathIterator
in interfaceShape
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
-