java.awt.geom
Class GeneralPath

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.geom.GeneralPath
All Implemented Interfaces:
Shape sample code for java.awt.Shape definition code for java.awt.Shape , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public final class GeneralPath
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 , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

The GeneralPath class represents a geometric path constructed from straight lines, and quadratic and cubic (Bézier) curves. It can contain multiple subpaths.

The winding rule specifies how the interior of a path is determined. There are two types of winding rules: EVEN_ODD and NON_ZERO.

An EVEN_ODD winding rule means that enclosed regions of the path alternate between interior and exterior areas as traversed from the outside of the path towards a point inside the region.

A NON_ZERO winding rule means that if a ray is drawn in any direction from a given point to infinity and the places where the path intersects the ray are examined, the point is inside of the path if and only if the number of times that the path crosses the ray from left to right does not equal the number of times that the path crosses the ray from right to left.


Field Summary
static int WIND_EVEN_ODD sample code for java.awt.geom.GeneralPath.WIND_EVEN_ODD definition code for java.awt.geom.GeneralPath.WIND_EVEN_ODD
          An even-odd winding rule for determining the interior of a path.
static int WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO definition code for java.awt.geom.GeneralPath.WIND_NON_ZERO
          A non-zero winding rule for determining the interior of a path.
 
Constructor Summary
GeneralPath sample code for java.awt.geom.GeneralPath.GeneralPath() definition code for java.awt.geom.GeneralPath.GeneralPath() ()
          Constructs a new GeneralPath object.
GeneralPath sample code for java.awt.geom.GeneralPath.GeneralPath(int) definition code for java.awt.geom.GeneralPath.GeneralPath(int) (int rule)
          Constructs a new GeneralPath object with the specified winding rule to control operations that require the interior of the path to be defined.
GeneralPath sample code for java.awt.geom.GeneralPath.GeneralPath(int, int) definition code for java.awt.geom.GeneralPath.GeneralPath(int, int) (int rule, int initialCapacity)
          Constructs a new GeneralPath object with the specified winding rule and the specified initial capacity to store path coordinates.
GeneralPath sample code for java.awt.geom.GeneralPath.GeneralPath(java.awt.Shape) definition code for java.awt.geom.GeneralPath.GeneralPath(java.awt.Shape) (Shape sample code for java.awt.Shape definition code for java.awt.Shape  s)
          Constructs a new GeneralPath object from an arbitrary Shape sample code for java.awt.Shape definition code for java.awt.Shape object.
 
Method Summary
 void append sample code for java.awt.geom.GeneralPath.append(java.awt.geom.PathIterator, boolean) definition code for java.awt.geom.GeneralPath.append(java.awt.geom.PathIterator, boolean) (PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator  pi, boolean connect)
          Appends the geometry of the specified PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator object to the path, possibly connecting the new geometry to the existing path segments with a line segment.
 void append sample code for java.awt.geom.GeneralPath.append(java.awt.Shape, boolean) definition code for java.awt.geom.GeneralPath.append(java.awt.Shape, boolean) (Shape sample code for java.awt.Shape definition code for java.awt.Shape  s, boolean connect)
          Appends the geometry of the specified Shape object to the path, possibly connecting the new geometry to the existing path segments with a line segment.
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.awt.geom.GeneralPath.clone() definition code for java.awt.geom.GeneralPath.clone() ()
          Creates a new object of the same class as this object.
 void closePath sample code for java.awt.geom.GeneralPath.closePath() definition code for java.awt.geom.GeneralPath.closePath() ()
          Closes the current subpath by drawing a straight line back to the coordinates of the last moveTo.
 boolean contains sample code for java.awt.geom.GeneralPath.contains(double, double) definition code for java.awt.geom.GeneralPath.contains(double, double) (double x, double y)
          Tests if the specified coordinates are inside the boundary of this Shape.
 boolean contains sample code for java.awt.geom.GeneralPath.contains(double, double, double, double) definition code for java.awt.geom.GeneralPath.contains(double, double, double, double) (double x, double y, double w, double h)
          Tests if the specified rectangular area is inside the boundary of this Shape.
 boolean contains sample code for java.awt.geom.GeneralPath.contains(java.awt.geom.Point2D) definition code for java.awt.geom.GeneralPath.contains(java.awt.geom.Point2D) (Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  p)
          Tests if the specified Point2D is inside the boundary of this Shape.
 boolean contains sample code for java.awt.geom.GeneralPath.contains(java.awt.geom.Rectangle2D) definition code for java.awt.geom.GeneralPath.contains(java.awt.geom.Rectangle2D) (Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  r)
          Tests if the specified Rectangle2D is inside the boundary of this Shape.
 Shape sample code for java.awt.Shape definition code for java.awt.Shape createTransformedShape sample code for java.awt.geom.GeneralPath.createTransformedShape(java.awt.geom.AffineTransform) definition code for java.awt.geom.GeneralPath.createTransformedShape(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
          Returns a new transformed Shape.
 void curveTo sample code for java.awt.geom.GeneralPath.curveTo(float, float, float, float, float, float) definition code for java.awt.geom.GeneralPath.curveTo(float, float, float, float, float, float) (float x1, float y1, float x2, float y2, float x3, float y3)
          Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bézier control points.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getBounds sample code for java.awt.geom.GeneralPath.getBounds() definition code for java.awt.geom.GeneralPath.getBounds() ()
          Return the bounding box of the path.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getBounds2D sample code for java.awt.geom.GeneralPath.getBounds2D() definition code for java.awt.geom.GeneralPath.getBounds2D() ()
          Returns the bounding box of the path.
 Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D getCurrentPoint sample code for java.awt.geom.GeneralPath.getCurrentPoint() definition code for java.awt.geom.GeneralPath.getCurrentPoint() ()
          Returns the coordinates most recently added to the end of the path as a Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D object.
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.geom.GeneralPath.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.geom.GeneralPath.getPathIterator(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
          Returns a PathIterator object that iterates along the boundary of this Shape and provides access to the geometry of the outline of this Shape.
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.geom.GeneralPath.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.geom.GeneralPath.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 a PathIterator object that iterates along the boundary of the flattened Shape and provides access to the geometry of the outline of the Shape.
 int getWindingRule sample code for java.awt.geom.GeneralPath.getWindingRule() definition code for java.awt.geom.GeneralPath.getWindingRule() ()
          Returns the fill style winding rule.
 boolean intersects sample code for java.awt.geom.GeneralPath.intersects(double, double, double, double) definition code for java.awt.geom.GeneralPath.intersects(double, double, double, double) (double x, double y, double w, double h)
          Tests if the interior of this Shape intersects the interior of a specified set of rectangular coordinates.
 boolean intersects sample code for java.awt.geom.GeneralPath.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.geom.GeneralPath.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 Shape intersects the interior of a specified Rectangle2D.
 void lineTo sample code for java.awt.geom.GeneralPath.lineTo(float, float) definition code for java.awt.geom.GeneralPath.lineTo(float, float) (float x, float y)
          Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates.
 void moveTo sample code for java.awt.geom.GeneralPath.moveTo(float, float) definition code for java.awt.geom.GeneralPath.moveTo(float, float) (float x, float y)
          Adds a point to the path by moving to the specified coordinates.
 void quadTo sample code for java.awt.geom.GeneralPath.quadTo(float, float, float, float) definition code for java.awt.geom.GeneralPath.quadTo(float, float, float, float) (float x1, float y1, float x2, float y2)
          Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the coordinates (x2, y2), using the specified point (x1, y1) as a quadratic parametric control point.
 void reset sample code for java.awt.geom.GeneralPath.reset() definition code for java.awt.geom.GeneralPath.reset() ()
          Resets the path to empty.
 void setWindingRule sample code for java.awt.geom.GeneralPath.setWindingRule(int) definition code for java.awt.geom.GeneralPath.setWindingRule(int) (int rule)
          Sets the winding rule for this path to the specified value.
 void transform sample code for java.awt.geom.GeneralPath.transform(java.awt.geom.AffineTransform) definition code for java.awt.geom.GeneralPath.transform(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
          Transforms the geometry of this path using the specified AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform .
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
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

WIND_EVEN_ODD sample code for java.awt.geom.GeneralPath.WIND_EVEN_ODD

public static final int WIND_EVEN_ODD
An even-odd winding rule for determining the interior of a path.

See Also:
Constant Field Values

WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO

public static final int WIND_NON_ZERO
A non-zero winding rule for determining the interior of a path.

See Also:
Constant Field Values
Constructor Detail

GeneralPath sample code for java.awt.geom.GeneralPath() definition code for java.awt.geom.GeneralPath()

public GeneralPath()
Constructs a new GeneralPath object. If an operation performed on this path requires the interior of the path to be defined then the default NON_ZERO winding rule is used.

See Also:
WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO definition code for java.awt.geom.GeneralPath.WIND_NON_ZERO

GeneralPath sample code for java.awt.geom.GeneralPath(int) definition code for java.awt.geom.GeneralPath(int)

public GeneralPath(int rule)
Constructs a new GeneralPath object with the specified winding rule to control operations that require the interior of the path to be defined.

Parameters:
rule - the winding rule
See Also:
WIND_EVEN_ODD sample code for java.awt.geom.GeneralPath.WIND_EVEN_ODD definition code for java.awt.geom.GeneralPath.WIND_EVEN_ODD , WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO definition code for java.awt.geom.GeneralPath.WIND_NON_ZERO

GeneralPath sample code for java.awt.geom.GeneralPath(int, int) definition code for java.awt.geom.GeneralPath(int, int)

public GeneralPath(int rule,
                   int initialCapacity)
Constructs a new GeneralPath object with the specified winding rule and the specified initial capacity to store path coordinates. This number is an initial guess as to how many path segments are in the path, but the storage is expanded as needed to store whatever path segments are added to this path.

Parameters:
rule - the winding rule
initialCapacity - the estimate for the number of path segments in the path
See Also:
WIND_EVEN_ODD sample code for java.awt.geom.GeneralPath.WIND_EVEN_ODD definition code for java.awt.geom.GeneralPath.WIND_EVEN_ODD , WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO definition code for java.awt.geom.GeneralPath.WIND_NON_ZERO

GeneralPath sample code for java.awt.geom.GeneralPath(java.awt.Shape) definition code for java.awt.geom.GeneralPath(java.awt.Shape)

public GeneralPath(Shape sample code for java.awt.Shape definition code for java.awt.Shape  s)
Constructs a new GeneralPath object from an arbitrary Shape sample code for java.awt.Shape definition code for java.awt.Shape object. All of the initial geometry and the winding rule for this path are taken from the specified Shape object.

Parameters:
s - the specified Shape object
Method Detail

moveTo sample code for java.awt.geom.GeneralPath.moveTo(float, float) definition code for java.awt.geom.GeneralPath.moveTo(float, float)

public void moveTo(float x,
                   float y)
Adds a point to the path by moving to the specified coordinates.

Parameters:
x, y - the specified coordinates

lineTo sample code for java.awt.geom.GeneralPath.lineTo(float, float) definition code for java.awt.geom.GeneralPath.lineTo(float, float)

public void lineTo(float x,
                   float y)
Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates.

Parameters:
x, y - the specified coordinates

quadTo sample code for java.awt.geom.GeneralPath.quadTo(float, float, float, float) definition code for java.awt.geom.GeneralPath.quadTo(float, float, float, float)

public void quadTo(float x1,
                   float y1,
                   float x2,
                   float y2)
Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the coordinates (x2, y2), using the specified point (x1, y1) as a quadratic parametric control point.

Parameters:
x1, y1 - the coordinates of the first quadratic control point
x2, y2 - the coordinates of the final endpoint

curveTo sample code for java.awt.geom.GeneralPath.curveTo(float, float, float, float, float, float) definition code for java.awt.geom.GeneralPath.curveTo(float, float, float, float, float, float)

public void curveTo(float x1,
                    float y1,
                    float x2,
                    float y2,
                    float x3,
                    float y3)
Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the coordinates (x3, y3), using the specified points (x1, y1) and (x2, y2) as Bézier control points.

Parameters:
x1, y1 - the coordinates of the first Béezier control point
x2, y2 - the coordinates of the second Bézier control point
x3, y3 - the coordinates of the final endpoint

closePath sample code for java.awt.geom.GeneralPath.closePath() definition code for java.awt.geom.GeneralPath.closePath()

public void closePath()
Closes the current subpath by drawing a straight line back to the coordinates of the last moveTo. If the path is already closed then this method has no effect.


append sample code for java.awt.geom.GeneralPath.append(java.awt.Shape, boolean) definition code for java.awt.geom.GeneralPath.append(java.awt.Shape, boolean)

public void append(Shape sample code for java.awt.Shape definition code for java.awt.Shape  s,
                   boolean connect)
Appends the geometry of the specified Shape object to the path, possibly connecting the new geometry to the existing path segments with a line segment. If the connect parameter is true and the path is not empty then any initial moveTo in the geometry of the appended Shape is turned into a lineTo segment. If the destination coordinates of such a connecting lineTo segment match the ending coordinates of a currently open subpath then the segment is omitted as superfluous. The winding rule of the specified Shape is ignored and the appended geometry is governed by the winding rule specified for this path.

Parameters:
s - the Shape whose geometry is appended to this path
connect - a boolean to control whether or not to turn an initial moveTo segment into a lineTo segment to connect the new geometry to the existing path

append sample code for java.awt.geom.GeneralPath.append(java.awt.geom.PathIterator, boolean) definition code for java.awt.geom.GeneralPath.append(java.awt.geom.PathIterator, boolean)

public void append(PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator  pi,
                   boolean connect)
Appends the geometry of the specified PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator object to the path, possibly connecting the new geometry to the existing path segments with a line segment. If the connect parameter is true and the path is not empty then any initial moveTo in the geometry of the appended Shape is turned into a lineTo segment. If the destination coordinates of such a connecting lineTo segment match the ending coordinates of a currently open subpath then the segment is omitted as superfluous. The winding rule of the specified Shape is ignored and the appended geometry is governed by the winding rule specified for this path.

Parameters:
pi - the PathIterator whose geometry is appended to this path
connect - a boolean to control whether or not to turn an initial moveTo segment into a lineTo segment to connect the new geometry to the existing path

getWindingRule sample code for java.awt.geom.GeneralPath.getWindingRule() definition code for java.awt.geom.GeneralPath.getWindingRule()

public int getWindingRule()
Returns the fill style winding rule.

Returns:
an integer representing the current winding rule.
See Also:
WIND_EVEN_ODD sample code for java.awt.geom.GeneralPath.WIND_EVEN_ODD definition code for java.awt.geom.GeneralPath.WIND_EVEN_ODD , WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO definition code for java.awt.geom.GeneralPath.WIND_NON_ZERO , setWindingRule(int) sample code for java.awt.geom.GeneralPath.setWindingRule(int) definition code for java.awt.geom.GeneralPath.setWindingRule(int)

setWindingRule sample code for java.awt.geom.GeneralPath.setWindingRule(int) definition code for java.awt.geom.GeneralPath.setWindingRule(int)

public void setWindingRule(int rule)
Sets the winding rule for this path to the specified value.

Parameters:
rule - an integer representing the specified winding rule
Throws:
IllegalArgumentException - if rule is not either WIND_EVEN_ODD or WIND_NON_ZERO
See Also:
WIND_EVEN_ODD sample code for java.awt.geom.GeneralPath.WIND_EVEN_ODD definition code for java.awt.geom.GeneralPath.WIND_EVEN_ODD , WIND_NON_ZERO sample code for java.awt.geom.GeneralPath.WIND_NON_ZERO definition code for java.awt.geom.GeneralPath.WIND_NON_ZERO , getWindingRule() sample code for java.awt.geom.GeneralPath.getWindingRule() definition code for java.awt.geom.GeneralPath.getWindingRule()

getCurrentPoint sample code for java.awt.geom.GeneralPath.getCurrentPoint() definition code for java.awt.geom.GeneralPath.getCurrentPoint()

public Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D  getCurrentPoint()
Returns the coordinates most recently added to the end of the path as a Point2D sample code for java.awt.geom.Point2D definition code for java.awt.geom.Point2D object.

Returns:
a Point2D object containing the ending coordinates of the path or null if there are no points in the path.

reset sample code for java.awt.geom.GeneralPath.reset() definition code for java.awt.geom.GeneralPath.reset()

public void reset()
Resets the path to empty. The append position is set back to the beginning of the path and all coordinates and point types are forgotten.


transform sample code for java.awt.geom.GeneralPath.transform(java.awt.geom.AffineTransform) definition code for java.awt.geom.GeneralPath.transform(java.awt.geom.AffineTransform)

public void transform(AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
Transforms the geometry of this path using the specified AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform . The geometry is transformed in place, which permanently changes the boundary defined by this object.

Parameters:
at - the AffineTransform used to transform the area

createTransformedShape sample code for java.awt.geom.GeneralPath.createTransformedShape(java.awt.geom.AffineTransform) definition code for java.awt.geom.GeneralPath.createTransformedShape(java.awt.geom.AffineTransform)

public Shape sample code for java.awt.Shape definition code for java.awt.Shape  createTransformedShape(AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
Returns a new transformed Shape.

Parameters:
at - the AffineTransform used to transform a new Shape.
Returns:
a new Shape, transformed with the specified AffineTransform.

getBounds sample code for java.awt.geom.GeneralPath.getBounds() definition code for java.awt.geom.GeneralPath.getBounds()

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getBounds()
Return the bounding box of the path.

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 sample code for java.awt.Rectangle definition code for java.awt.Rectangle object that bounds the current path.
See Also:
Shape.getBounds2D() sample code for java.awt.Shape.getBounds2D() definition code for java.awt.Shape.getBounds2D()

getBounds2D sample code for java.awt.geom.GeneralPath.getBounds2D() definition code for java.awt.geom.GeneralPath.getBounds2D()

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

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 object that bounds the current path.
See Also:
Shape.getBounds() sample code for java.awt.Shape.getBounds() definition code for java.awt.Shape.getBounds()

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

public boolean contains(double x,
                        double y)
Tests if the specified coordinates are inside the boundary of this 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, y - the specified coordinates
Returns:
true if the specified coordinates are inside this Shape; false otherwise

contains sample code for java.awt.geom.GeneralPath.contains(java.awt.geom.Point2D) definition code for java.awt.geom.GeneralPath.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 the specified Point2D is inside the boundary of this Shape.

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 - the specified Point2D
Returns:
true if this Shape contains the specified Point2D, false otherwise.

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

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Tests if the specified rectangular area is inside the boundary of this Shape.

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, y - the specified coordinates
w - the width of the specified rectangular area
h - the height of the specified rectangular area
Returns:
true if this Shape contains the specified rectangluar area; false otherwise.
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.geom.GeneralPath.contains(java.awt.geom.Rectangle2D) definition code for java.awt.geom.GeneralPath.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 specified Rectangle2D is inside the boundary of this Shape.

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 - a specified Rectangle2D
Returns:
true if this Shape bounds the specified Rectangle2D; false otherwise.
See Also:
Shape.contains(double, double, double, double) sample code for java.awt.Shape.contains(double, double, double, double) definition code for java.awt.Shape.contains(double, double, double, double)

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

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Tests if the interior of this Shape 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, y - the specified coordinates
w - the width of the specified rectangular coordinates
h - the height of the specified rectangular coordinates
Returns:
true if this Shape and the interior of the specified set of rectangular coordinates intersect each other; false otherwise.
See Also:
Area sample code for java.awt.geom.Area definition code for java.awt.geom.Area

intersects sample code for java.awt.geom.GeneralPath.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.geom.GeneralPath.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 Shape 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 - the specified Rectangle2D
Returns:
true if this Shape 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)

getPathIterator sample code for java.awt.geom.GeneralPath.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.geom.GeneralPath.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 a PathIterator object that iterates along the boundary of this Shape and provides access to the geometry of the outline of this Shape. The iterator for this class is not multi-threaded safe, which means that this GeneralPath class does not guarantee that modifications to the geometry of this GeneralPath object do not affect any iterations of that geometry that are already in process.

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 AffineTransform
Returns:
a new PathIterator that iterates along the boundary of this Shape and provides access to the geometry of this Shape's outline

getPathIterator sample code for java.awt.geom.GeneralPath.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.geom.GeneralPath.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 a PathIterator object that iterates along the boundary of the flattened Shape and provides access to the geometry of the outline of the Shape. The iterator for this class is not multi-threaded safe, which means that this GeneralPath class does not guarantee that modifications to the geometry of this GeneralPath object do not affect any iterations of that geometry that are already in process.

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 AffineTransform
flatness - the maximum distance that the line segments used to approximate the curved segments are allowed to deviate from any point on the original curve
Returns:
a new PathIterator that iterates along the flattened Shape boundary.

clone sample code for java.awt.geom.GeneralPath.clone() definition code for java.awt.geom.GeneralPath.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Creates a new object of the same class as this object.

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a clone of this instance.
Throws:
OutOfMemoryError sample code for java.lang.OutOfMemoryError definition code for java.lang.OutOfMemoryError - if there is not enough memory.
Since:
1.2
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable