java.awt
Class Polygon

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Polygon
All Implemented Interfaces:
Shape sample code for java.awt.Shape definition code for java.awt.Shape , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class Polygon
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Shape sample code for java.awt.Shape definition code for java.awt.Shape , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

The Polygon class encapsulates a description of a closed, two-dimensional region within a coordinate space. This region is bounded by an arbitrary number of line segments, each of which is one side of the polygon. Internally, a polygon comprises of a list of (xy) coordinate pairs, where each pair defines a vertex of the polygon, and two successive pairs are the endpoints of a line that is a side of the polygon. The first and final pairs of (xy) points are joined by a line segment that closes the polygon. This Polygon is defined with an even-odd winding rule. See WIND_EVEN_ODD sample code for java.awt.geom.PathIterator.WIND_EVEN_ODD definition code for java.awt.geom.PathIterator.WIND_EVEN_ODD for a definition of the even-odd winding rule. This class's hit-testing methods, which include the contains, intersects and inside methods, use the insideness definition described in the Shape sample code for java.awt.Shape definition code for java.awt.Shape class comments.

Since:
JDK1.0
See Also:
Shape sample code for java.awt.Shape definition code for java.awt.Shape , Serialized Form

Field Summary
protected  Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle bounds sample code for java.awt.Polygon.bounds definition code for java.awt.Polygon.bounds
          Bounds of the polygon.
 int npoints sample code for java.awt.Polygon.npoints definition code for java.awt.Polygon.npoints
          The total number of points.
 int[] xpoints sample code for java.awt.Polygon.xpoints definition code for java.awt.Polygon.xpoints
          The array of x coordinates.
 int[] ypoints sample code for java.awt.Polygon.ypoints definition code for java.awt.Polygon.ypoints
          The array of y coordinates.
 
Constructor Summary
Polygon sample code for java.awt.Polygon.Polygon() definition code for java.awt.Polygon.Polygon() ()
          Creates an empty polygon.
Polygon sample code for java.awt.Polygon.Polygon(int[], int[], int) definition code for java.awt.Polygon.Polygon(int[], int[], int) (int[] xpoints, int[] ypoints, int npoints)
          Constructs and initializes a Polygon from the specified parameters.
 
Method Summary
 void addPoint sample code for java.awt.Polygon.addPoint(int, int) definition code for java.awt.Polygon.addPoint(int, int) (int x, int y)
          Appends the specified coordinates to this Polygon.
 boolean contains sample code for java.awt.Polygon.contains(double, double) definition code for java.awt.Polygon.contains(double, double) (double x, double y)
          Determines if the specified coordinates are inside this Polygon.
 boolean contains sample code for java.awt.Polygon.contains(double, double, double, double) definition code for java.awt.Polygon.contains(double, double, double, double) (double x, double y, double w, double h)
          Tests if the interior of this Polygon entirely contains the specified set of rectangular coordinates.
 boolean contains sample code for java.awt.Polygon.contains(int, int) definition code for java.awt.Polygon.contains(int, int) (int x, int y)
          Determines whether the specified coordinates are inside this Polygon.
 boolean contains sample code for java.awt.Polygon.contains(java.awt.Point) definition code for java.awt.Polygon.contains(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.Point  p)
          Determines whether the specified Point sample code for java.awt.Point definition code for java.awt.Point is inside this Polygon.
 boolean contains sample code for java.awt.Polygon.contains(java.awt.geom.Point2D) definition code for java.awt.Polygon.contains(java.awt.geom.Point2D) (Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p)
          Tests if a specified Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D is inside the boundary of this Polygon.
 boolean contains sample code for java.awt.Polygon.contains(java.awt.geom.Rectangle2D) definition code for java.awt.Polygon.contains(java.awt.geom.Rectangle2D) (Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
          Tests if the interior of this Polygon entirely contains the specified Rectangle2D.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getBoundingBox sample code for java.awt.Polygon.getBoundingBox() definition code for java.awt.Polygon.getBoundingBox() ()
          Deprecated. As of JDK version 1.1, replaced by getBounds().
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getBounds sample code for java.awt.Polygon.getBounds() definition code for java.awt.Polygon.getBounds() ()
          Gets the bounding box of this Polygon.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getBounds2D sample code for java.awt.Polygon.getBounds2D() definition code for java.awt.Polygon.getBounds2D() ()
          Returns the high precision bounding box of the Shape sample code for java.awt.Shape definition code for java.awt.Shape .
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
          Returns an iterator object that iterates along the boundary of this Polygon and provides access to the geometry of the outline of this Polygon.
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform, double) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at, double flatness)
          Returns an iterator object that iterates along the boundary of the Shape and provides access to the geometry of the outline of the Shape.
 boolean inside sample code for java.awt.Polygon.inside(int, int) definition code for java.awt.Polygon.inside(int, int) (int x, int y)
          Deprecated. As of JDK version 1.1, replaced by contains(int, int).
 boolean intersects sample code for java.awt.Polygon.intersects(double, double, double, double) definition code for java.awt.Polygon.intersects(double, double, double, double) (double x, double y, double w, double h)
          Tests if the interior of this Polygon intersects the interior of a specified set of rectangular coordinates.
 boolean intersects sample code for java.awt.Polygon.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.Polygon.intersects(java.awt.geom.Rectangle2D) (Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
          Tests if the interior of this Polygon intersects the interior of a specified Rectangle2D.
 void invalidate sample code for java.awt.Polygon.invalidate() definition code for java.awt.Polygon.invalidate() ()
          Invalidates or flushes any internally-cached data that depends on the vertex coordinates of this Polygon.
 void reset sample code for java.awt.Polygon.reset() definition code for java.awt.Polygon.reset() ()
          Resets this Polygon object to an empty polygon.
 void translate sample code for java.awt.Polygon.translate(int, int) definition code for java.awt.Polygon.translate(int, int) (int deltaX, int deltaY)
          Translates the vertices of the Polygon by deltaX along the x axis and by deltaY along the y axis.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

npoints sample code for java.awt.Polygon.npoints

public int npoints
The total number of points. The value of npoints represents the number of valid points in this Polygon and might be less than the number of elements in xpoints sample code for java.awt.Polygon.xpoints definition code for java.awt.Polygon.xpoints or ypoints sample code for java.awt.Polygon.ypoints definition code for java.awt.Polygon.ypoints . This value can be NULL.

See Also:
addPoint(int, int) sample code for java.awt.Polygon.addPoint(int, int) definition code for java.awt.Polygon.addPoint(int, int)

xpoints sample code for java.awt.Polygon.xpoints

public int[] xpoints
The array of x coordinates. The number of elements in this array might be more than the number of x coordinates in this Polygon. The extra elements allow new points to be added to this Polygon without re-creating this array. The value of npoints sample code for java.awt.Polygon.npoints definition code for java.awt.Polygon.npoints is equal to the number of valid points in this Polygon.

See Also:
addPoint(int, int) sample code for java.awt.Polygon.addPoint(int, int) definition code for java.awt.Polygon.addPoint(int, int)

ypoints sample code for java.awt.Polygon.ypoints

public int[] ypoints
The array of y coordinates. The number of elements in this array might be more than the number of y coordinates in this Polygon. The extra elements allow new points to be added to this Polygon without re-creating this array. The value of npoints is equal to the number of valid points in this Polygon.

See Also:
addPoint(int, int) sample code for java.awt.Polygon.addPoint(int, int) definition code for java.awt.Polygon.addPoint(int, int)

bounds sample code for java.awt.Polygon.bounds

protected Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  bounds
Bounds of the polygon. This value can be NULL. Please see the javadoc comments getBounds().

See Also:
getBoundingBox() sample code for java.awt.Polygon.getBoundingBox() definition code for java.awt.Polygon.getBoundingBox() , getBounds() sample code for java.awt.Polygon.getBounds() definition code for java.awt.Polygon.getBounds()
Constructor Detail

Polygon sample code for java.awt.Polygon() definition code for java.awt.Polygon()

public Polygon()
Creates an empty polygon.


Polygon sample code for java.awt.Polygon(int[], int[], int) definition code for java.awt.Polygon(int[], int[], int)

public Polygon(int[] xpoints,
               int[] ypoints,
               int npoints)
Constructs and initializes a Polygon from the specified parameters.

Parameters:
xpoints - an array of x coordinates
ypoints - an array of y coordinates
npoints - the total number of points in the Polygon
Throws:
NegativeArraySizeException sample code for java.lang.NegativeArraySizeException definition code for java.lang.NegativeArraySizeException - if the value of npoints is negative.
IndexOutOfBoundsException sample code for java.lang.IndexOutOfBoundsException definition code for java.lang.IndexOutOfBoundsException - if npoints is greater than the length of xpoints or the length of ypoints.
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if xpoints or ypoints is null.
Method Detail

reset sample code for java.awt.Polygon.reset() definition code for java.awt.Polygon.reset()

public void reset()
Resets this Polygon object to an empty polygon. The coordinate arrays and the data in them are left untouched but the number of points is reset to zero to mark the old vertex data as invalid and to start accumulating new vertex data at the beginning. All internally-cached data relating to the old vertices are discarded. Note that since the coordinate arrays from before the reset are reused, creating a new empty Polygon might be more memory efficient than resetting the current one if the number of vertices in the new polygon data is significantly smaller than the number of vertices in the data from before the reset.

Since:
1.4
See Also:
invalidate() sample code for java.awt.Polygon.invalidate() definition code for java.awt.Polygon.invalidate()

invalidate sample code for java.awt.Polygon.invalidate() definition code for java.awt.Polygon.invalidate()

public void invalidate()
Invalidates or flushes any internally-cached data that depends on the vertex coordinates of this Polygon. This method should be called after any direct manipulation of the coordinates in the xpoints or ypoints arrays to avoid inconsistent results from methods such as getBounds or contains that might cache data from earlier computations relating to the vertex coordinates.

Since:
1.4
See Also:
getBounds() sample code for java.awt.Polygon.getBounds() definition code for java.awt.Polygon.getBounds()

translate sample code for java.awt.Polygon.translate(int, int) definition code for java.awt.Polygon.translate(int, int)

public void translate(int deltaX,
                      int deltaY)
Translates the vertices of the Polygon by deltaX along the x axis and by deltaY along the y axis.

Parameters:
deltaX - the amount to translate along the x axis
deltaY - the amount to translate along the y axis
Since:
JDK1.1

addPoint sample code for java.awt.Polygon.addPoint(int, int) definition code for java.awt.Polygon.addPoint(int, int)

public void addPoint(int x,
                     int y)
Appends the specified coordinates to this Polygon.

If an operation that calculates the bounding box of this Polygon has already been performed, such as getBounds or contains, then this method updates the bounding box.

Parameters:
x - the specified x coordinate
y - the specified y coordinate
See Also:
getBounds() sample code for java.awt.Polygon.getBounds() definition code for java.awt.Polygon.getBounds() , contains(java.awt.Point) sample code for java.awt.Polygon.contains(java.awt.Point) definition code for java.awt.Polygon.contains(java.awt.Point)

getBounds sample code for java.awt.Polygon.getBounds() definition code for java.awt.Polygon.getBounds()

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getBounds()
Gets the bounding box of this Polygon. The bounding box is the smallest Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle whose sides are parallel to the x and y axes of the coordinate space, and can completely contain the Polygon.

Specified by:
getBounds sample code for java.awt.Shape.getBounds() definition code for java.awt.Shape.getBounds() in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Returns:
a Rectangle that defines the bounds of this Polygon.
Since:
JDK1.1
See Also:
Shape.getBounds2D() sample code for java.awt.Shape.getBounds2D() definition code for java.awt.Shape.getBounds2D()

getBoundingBox sample code for java.awt.Polygon.getBoundingBox() definition code for java.awt.Polygon.getBoundingBox()

@Deprecated
public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getBoundingBox()
Deprecated. As of JDK version 1.1, replaced by getBounds().

Returns the bounds of this Polygon.

Returns:
the bounds of this Polygon.

contains sample code for java.awt.Polygon.contains(java.awt.Point) definition code for java.awt.Polygon.contains(java.awt.Point)

public boolean contains(Point sample code for java.awt.Point definition code for java.awt.Point  p)
Determines whether the specified Point sample code for java.awt.Point definition code for java.awt.Point is inside this Polygon.

Parameters:
p - the specified Point to be tested
Returns:
true if the Polygon contains the Point; false otherwise.
See Also:
contains(double, double) sample code for java.awt.Polygon.contains(double, double) definition code for java.awt.Polygon.contains(double, double)

contains sample code for java.awt.Polygon.contains(int, int) definition code for java.awt.Polygon.contains(int, int)

public boolean contains(int x,
                        int y)
Determines whether the specified coordinates are inside this Polygon.

Parameters:
x - the specified x coordinate to be tested
y - the specified y coordinate to be tested
Returns:
true if this Polygon contains the specified coordinates, (xy); false otherwise.
Since:
JDK1.1
See Also:
contains(double, double) sample code for java.awt.Polygon.contains(double, double) definition code for java.awt.Polygon.contains(double, double)

inside sample code for java.awt.Polygon.inside(int, int) definition code for java.awt.Polygon.inside(int, int)

@Deprecated
public boolean inside(int x,
                                 int y)
Deprecated. As of JDK version 1.1, replaced by contains(int, int).

Determines whether the specified coordinates are contained in this Polygon.

Parameters:
x - the specified x coordinate to be tested
y - the specified y coordinate to be tested
Returns:
true if this Polygon contains the specified coordinates, (xy); false otherwise.
See Also:
contains(double, double) sample code for java.awt.Polygon.contains(double, double) definition code for java.awt.Polygon.contains(double, double)

getBounds2D sample code for java.awt.Polygon.getBounds2D() definition code for java.awt.Polygon.getBounds2D()

public Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  getBounds2D()
Returns the high precision bounding box of the Shape sample code for java.awt.Shape definition code for java.awt.Shape .

Specified by:
getBounds2D sample code for java.awt.Shape.getBounds2D() definition code for java.awt.Shape.getBounds2D() in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Returns:
a Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D that precisely bounds the Shape.
See Also:
Shape.getBounds() sample code for java.awt.Shape.getBounds() definition code for java.awt.Shape.getBounds()

contains sample code for java.awt.Polygon.contains(double, double) definition code for java.awt.Polygon.contains(double, double)

public boolean contains(double x,
                        double y)
Determines if the specified coordinates are inside this Polygon. For the definition of insideness, see the class comments of Shape sample code for java.awt.Shape definition code for java.awt.Shape .

Specified by:
contains sample code for java.awt.Shape.contains(double, double) definition code for java.awt.Shape.contains(double, double) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
x - the specified x coordinate
y - the specified y coordinate
Returns:
true if the Polygon contains the specified coordinates; false otherwise.

contains sample code for java.awt.Polygon.contains(java.awt.geom.Point2D) definition code for java.awt.Polygon.contains(java.awt.geom.Point2D)

public boolean contains(Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p)
Tests if a specified Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D is inside the boundary of this Polygon.

Specified by:
contains sample code for java.awt.Shape.contains(java.awt.geom.Point2D) definition code for java.awt.Shape.contains(java.awt.geom.Point2D) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
p - a specified Point2D
Returns:
true if this Polygon contains the specified Point2D; false otherwise.
See Also:
contains(double, double) sample code for java.awt.Polygon.contains(double, double) definition code for java.awt.Polygon.contains(double, double)

intersects sample code for java.awt.Polygon.intersects(double, double, double, double) definition code for java.awt.Polygon.intersects(double, double, double, double)

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Tests if the interior of this Polygon intersects the interior of a specified set of rectangular coordinates.

Specified by:
intersects sample code for java.awt.Shape.intersects(double, double, double, double) definition code for java.awt.Shape.intersects(double, double, double, double) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
x - the x coordinate of the specified rectangular shape's top-left corner
y - the y coordinate of the specified rectangular shape's top-left corner
w - the width of the specified rectangular shape
h - the height of the specified rectangular shape
Returns:
true if the interior of this Polygon and the interior of the specified set of rectangular coordinates intersect each other; false otherwise
Since:
1.2
See Also:
Area sample code for java.awt.geom.Area definition code for java.awt.geom.Area

intersects sample code for java.awt.Polygon.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.Polygon.intersects(java.awt.geom.Rectangle2D)

public boolean intersects(Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
Tests if the interior of this Polygon intersects the interior of a specified Rectangle2D.

Specified by:
intersects sample code for java.awt.Shape.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.Shape.intersects(java.awt.geom.Rectangle2D) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
r - a specified Rectangle2D
Returns:
true if this Polygon and the interior of the specified Rectangle2D intersect each other; false otherwise.
See Also:
Shape.intersects(double, double, double, double) sample code for java.awt.Shape.intersects(double, double, double, double) definition code for java.awt.Shape.intersects(double, double, double, double)

contains sample code for java.awt.Polygon.contains(double, double, double, double) definition code for java.awt.Polygon.contains(double, double, double, double)

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Tests if the interior of this Polygon entirely contains the specified set of rectangular coordinates.

Specified by:
contains sample code for java.awt.Shape.contains(double, double, double, double) definition code for java.awt.Shape.contains(double, double, double, double) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
x - the x coordinate of the top-left corner of the specified set of rectangular coordinates
y - the y coordinate of the top-left corner of the specified set of rectangular coordinates
w - the width of the set of rectangular coordinates
h - the height of the set of rectangular coordinates
Returns:
true if this Polygon entirely contains the specified set of rectangular coordinates; false otherwise
Since:
1.2
See Also:
Area sample code for java.awt.geom.Area definition code for java.awt.geom.Area , Shape.intersects(double, double, double, double) sample code for java.awt.Shape.intersects(double, double, double, double) definition code for java.awt.Shape.intersects(double, double, double, double)

contains sample code for java.awt.Polygon.contains(java.awt.geom.Rectangle2D) definition code for java.awt.Polygon.contains(java.awt.geom.Rectangle2D)

public boolean contains(Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
Tests if the interior of this Polygon entirely contains the specified Rectangle2D.

Specified by:
contains sample code for java.awt.Shape.contains(java.awt.geom.Rectangle2D) definition code for java.awt.Shape.contains(java.awt.geom.Rectangle2D) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
r - the specified Rectangle2D
Returns:
true if this Polygon entirely contains the specified Rectangle2D; false otherwise.
See Also:
contains(double, double, double, double) sample code for java.awt.Polygon.contains(double, double, double, double) definition code for java.awt.Polygon.contains(double, double, double, double)

getPathIterator sample code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform)

public PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator  getPathIterator(AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
Returns an iterator object that iterates along the boundary of this Polygon and provides access to the geometry of the outline of this Polygon. An optional AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform can be specified so that the coordinates returned in the iteration are transformed accordingly.

Specified by:
getPathIterator sample code for java.awt.Shape.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.Shape.getPathIterator(java.awt.geom.AffineTransform) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
Returns:
a PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator object that provides access to the geometry of this Polygon.

getPathIterator sample code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.Polygon.getPathIterator(java.awt.geom.AffineTransform, double)

public PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator  getPathIterator(AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at,
                                    double flatness)
Returns an iterator object that iterates along the boundary of the Shape and provides access to the geometry of the outline of the Shape. Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are returned by the iterator. Since polygons are already flat, the flatness parameter is ignored. An optional AffineTransform can be specified in which case the coordinates returned in the iteration are transformed accordingly.

Specified by:
getPathIterator sample code for java.awt.Shape.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.Shape.getPathIterator(java.awt.geom.AffineTransform, double) in interface Shape sample code for java.awt.Shape definition code for java.awt.Shape
Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
flatness - the maximum amount that the control points for a given curve can vary from colinear before a subdivided curve is replaced by a straight line connecting the endpoints. Since polygons are already flat the flatness parameter is ignored.
Returns:
a PathIterator object that provides access to the Shape object's geometry.