Package com.lowagie.text.pdf.internal
Class PolylineShape
java.lang.Object
com.lowagie.text.pdf.internal.PolylineShape
- All Implemented Interfaces:
Shape
Class that defines a Polyline shape. This class was originally written by wil - amristar.com.au and integrated into
iText by Bruno.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double x, double y) A polyline can't contain a point.boolean
contains
(double x, double y, double w, double h) A polyline can't contain a point.boolean
A polyline can't contain a point.boolean
A polyline can't contain a point.Returns the bounding box of this polyline.Returns the bounding box of this polyline.Returns an iteration object that defines the boundary of the polyline.getPathIterator
(AffineTransform at, double flatness) There's no difference with getPathIterator(AffineTransform at); we just need this method to implement the Shape interface.boolean
intersects
(double x, double y, double w, double h) Checks if one of the lines in the polyline intersects with a given rectangle.boolean
Checks if one of the lines in the polyline intersects with a given rectangle.private int[]
rect()
Calculates the origin (X, Y) and the width and height of a rectangle that contains all the segments of the polyline.
-
Field Details
-
x
protected int[] xAll the X-values of the coordinates in the polyline. -
y
protected int[] yAll the Y-values of the coordinates in the polyline. -
np
protected int npThe total number of points.
-
-
Constructor Details
-
PolylineShape
public PolylineShape(int[] x, int[] y, int nPoints) Creates a PolylineShape.- Parameters:
x
- An int array containing all the X-values of the coordinates in the polyliney
- An int array containing all the Y-values of the coordinates in the polylinenPoints
- The total number of points
-
-
Method Details
-
getBounds2D
Returns the bounding box of this polyline.- Specified by:
getBounds2D
in interfaceShape
- Returns:
- a
Rectangle2D
that is the high-precision bounding box of this line. - See Also:
-
getBounds
Returns the bounding box of this polyline. -
rect
private int[] rect()Calculates the origin (X, Y) and the width and height of a rectangle that contains all the segments of the polyline. -
contains
public boolean contains(double x, double y) A polyline can't contain a point. -
contains
A polyline can't contain a point. -
contains
public boolean contains(double x, double y, double w, double h) A polyline can't contain a point. -
contains
A polyline can't contain a point. -
intersects
public boolean intersects(double x, double y, double w, double h) Checks if one of the lines in the polyline intersects with a given rectangle.- Specified by:
intersects
in interfaceShape
- See Also:
-
intersects
Checks if one of the lines in the polyline intersects with a given rectangle.- Specified by:
intersects
in interfaceShape
- See Also:
-
getPathIterator
Returns an iteration object that defines the boundary of the polyline.- Specified by:
getPathIterator
in interfaceShape
- Parameters:
at
- the specifiedAffineTransform
- Returns:
- a
PathIterator
that defines the boundary of this polyline. - See Also:
-
getPathIterator
There's no difference with getPathIterator(AffineTransform at); we just need this method to implement the Shape interface.- Specified by:
getPathIterator
in interfaceShape
-