- java.lang.Object
-
- com.lowagie.text.pdf.internal.PolylineShape
-
-
Constructor Summary
Constructors Constructor Description PolylineShape(int[] x, int[] y, int nPoints)Creates a PolylineShape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)A polyline can't contain a point.booleancontains(double x, double y, double w, double h)A polyline can't contain a point.booleancontains(Point2D p)A polyline can't contain a point.booleancontains(Rectangle2D r)A polyline can't contain a point.RectanglegetBounds()Returns the bounding box of this polyline.Rectangle2DgetBounds2D()Returns the bounding box of this polyline.PathIteratorgetPathIterator(AffineTransform at)Returns an iteration object that defines the boundary of the polyline.PathIteratorgetPathIterator(AffineTransform at, double flatness)There's no difference with getPathIterator(AffineTransform at); we just need this method to implement the Shape interface.booleanintersects(double x, double y, double w, double h)Checks if one of the lines in the polyline intersects with a given rectangle.booleanintersects(Rectangle2D r)Checks if one of the lines in the polyline intersects with a given rectangle.
-
-
-
Constructor Detail
-
PolylineShape
public PolylineShape(int[] x, int[] y, int nPoints)Creates a PolylineShape.- Parameters:
nPoints- The total number of pointsx- 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 polyline
-
-
Method Detail
-
getBounds2D
public Rectangle2D getBounds2D()
Returns the bounding box of this polyline.- Specified by:
getBounds2Din interfaceShape- Returns:
- a
Rectangle2Dthat is the high-precision bounding box of this line. - See Also:
Shape.getBounds2D()
-
getBounds
public Rectangle getBounds()
Returns the bounding box of this polyline.- Specified by:
getBoundsin interfaceShape- See Also:
Shape.getBounds()
-
contains
public boolean contains(double x, double y)A polyline can't contain a point.- Specified by:
containsin interfaceShape- See Also:
Shape.contains(double, double)
-
contains
public boolean contains(Point2D p)
A polyline can't contain a point.- Specified by:
containsin interfaceShape- See Also:
Shape.contains(java.awt.geom.Point2D)
-
contains
public boolean contains(double x, double y, double w, double h)A polyline can't contain a point.- Specified by:
containsin interfaceShape- See Also:
Shape.contains(double, double, double, double)
-
contains
public boolean contains(Rectangle2D r)
A polyline can't contain a point.- Specified by:
containsin interfaceShape- See Also:
Shape.contains(java.awt.geom.Rectangle2D)
-
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:
intersectsin interfaceShape- See Also:
Shape.intersects(double, double, double, double)
-
intersects
public boolean intersects(Rectangle2D r)
Checks if one of the lines in the polyline intersects with a given rectangle.- Specified by:
intersectsin interfaceShape- See Also:
Shape.intersects(java.awt.geom.Rectangle2D)
-
getPathIterator
public PathIterator getPathIterator(AffineTransform at)
Returns an iteration object that defines the boundary of the polyline.- Specified by:
getPathIteratorin interfaceShape- Parameters:
at- the specifiedAffineTransform- Returns:
- a
PathIteratorthat defines the boundary of this polyline. - See Also:
Shape.intersects(java.awt.geom.Rectangle2D)
-
getPathIterator
public PathIterator getPathIterator(AffineTransform at, double flatness)
There's no difference with getPathIterator(AffineTransform at); we just need this method to implement the Shape interface.- Specified by:
getPathIteratorin interfaceShape
-
-