All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Interface java.awt.Shape

public interface Shape
The interface for objects which represent some form of geometric shape.

This interface will be revised in the upcoming Java2D project. It is meant to provide a common interface for various existing geometric AWT classes and methods which operate on them. Since it may be superseded or expanded in the future, developers should avoid implementing this interface in their own classes until it is completed in a later release.


Method Index

 o contains(double, double)
Test if a given coordinate is inside the boundary of the shape.
 o contains(double, double, double, double)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates.
 o contains(Point2D)
Test if a given Point is inside the boundary of the shape.
 o contains(Rectangle2D)
Test if the interior of the Shape entirely contains the given Rectangle.
 o getBounds()
Return the bounding box of the shape.
 o getBounds2D()
Return the high precision bounding box of the shape.
 o getPathIterator(AffineTransform)
Return an iterator object that iterates along the boundary of the shape and provides access to the geometry of the outline of the shape.
 o getPathIterator(AffineTransform, double)
Return an iterator object that iterates along the boundary of the shape and provides access to a flattened view of the geometry of the outline of the shape.
 o intersects(double, double, double, double)
Test if the interior of the Shape intersects the interior of a given set of rectangular coordinates.
 o intersects(Rectangle2D)
Test if the interior of the Shape intersects the interior of a given Rectangle.

Methods

 o getBounds
public abstract Rectangle getBounds()
Return the bounding box of the shape.

 o getBounds2D
public abstract Rectangle2D getBounds2D()
Return the high precision bounding box of the shape.

 o contains
public abstract boolean contains(double x,
                                 double y)
Test if a given coordinate is inside the boundary of the shape.

 o contains
public abstract boolean contains(Point2D p)
Test if a given Point is inside the boundary of the shape.

 o intersects
public abstract boolean intersects(double x,
                                   double y,
                                   double w,
                                   double h)
Test if the interior of the Shape intersects the interior of a given set of rectangular coordinates.

 o intersects
public abstract boolean intersects(Rectangle2D r)
Test if the interior of the Shape intersects the interior of a given Rectangle.

 o contains
public abstract boolean contains(double x,
                                 double y,
                                 double w,
                                 double h)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates.

 o contains
public abstract boolean contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle.

 o getPathIterator
public abstract PathIterator getPathIterator(AffineTransform at)
Return an iterator object that iterates along the boundary of the shape and provides access to the geometry of the outline of the shape. An optional affine transform can be specified in which case the coordinates returned in the iteration will be transformed accordingly.

Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if the untransformed coordinates are desired.
 o getPathIterator
public abstract PathIterator getPathIterator(AffineTransform at,
                                             double flatness)
Return an iterator object that iterates along the boundary of the shape and provides access to a flattened view of the geometry of the outline of the shape. Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will be returned by the iterator. The amount of subdivision of the curved segments is controlled by the flatness parameter which specifies ?REMIND?. An optional affine transform can be specified in which case the coordinates returned in the iteration will be transformed accordingly.

Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if the 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature