Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Interface java.awt.Shape

Implementing Classes:
Polygon, RectangularShape, Rectangle, Line2D, CubicCurve2D, Area, GeneralPath, QuadCurve2D

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 Summary
boolean  contains(double x, double y)
Test if a given coordinate is inside the boundary of the shape.
boolean  contains(Point2D p)
Test if a given Point is inside the boundary of the shape.
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.
boolean  contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle.
Rectangle  getBounds()
Return the bounding box of the shape.
Rectangle2D  getBounds2D()
Return the high precision bounding box of the shape.
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.
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.
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.
boolean  intersects(Rectangle2D r)
Test if the interior of the Shape intersects the interior of a given Rectangle.
 

Method Detail

getBounds

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

getBounds2D

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

contains

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

contains

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

intersects

public 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.

intersects

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

contains

public 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.

contains

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

getPathIterator

public 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.

getPathIterator

public 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.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.