com.lowagie.text.pdf.internal

Class PolylineShape

public class PolylineShape extends Object implements 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
protected intnp
The total number of points.
protected int[]x
All the X-values of the coordinates in the polyline.
protected int[]y
All the Y-values of the coordinates in the polyline.
Constructor Summary
PolylineShape(int[] x, int[] y, int nPoints)
Creates a PolylineShape.
Method Summary
booleancontains(double x, double y)
A polyline can't contain a point.
booleancontains(Point2D p)
A polyline can't contain a point.
booleancontains(double x, double y, double w, double h)
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.
int[]rect()
Calculates the origin (X, Y) and the width and height of a rectangle that contains all the segments of the polyline.

Field Detail

np

protected int np
The total number of points.

x

protected int[] x
All the X-values of the coordinates in the polyline.

y

protected int[] y
All the Y-values of the coordinates in the polyline.

Constructor Detail

PolylineShape

public PolylineShape(int[] x, int[] y, int nPoints)
Creates a PolylineShape.

Method Detail

contains

public boolean contains(double x, double y)
A polyline can't contain a point.

See Also: java.awt.Shape#contains(double, double)

contains

public boolean contains(Point2D p)
A polyline can't contain a point.

See Also: java.awt.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.

See Also: java.awt.Shape#contains(double, double, double, double)

contains

public boolean contains(Rectangle2D r)
A polyline can't contain a point.

See Also: java.awt.Shape#contains(java.awt.geom.Rectangle2D)

getBounds

public Rectangle getBounds()
Returns the bounding box of this polyline.

See Also: java.awt.Shape#getBounds()

getBounds2D

public Rectangle2D getBounds2D()
Returns the bounding box of this polyline.

Returns: a Rectangle2D that is the high-precision bounding box of this line.

See Also: java.awt.Shape#getBounds2D()

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Returns an iteration object that defines the boundary of the polyline.

Parameters: at the specified AffineTransform

Returns: a PathIterator that defines the boundary of this polyline.

See Also: java.awt.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.

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.

See Also: java.awt.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.

See Also: java.awt.Shape#intersects(java.awt.geom.Rectangle2D)

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.