PDAP Public Review Draft

java.awt
Interface Shape

All Known Implementing Classes:
Polygon, Rectangle

public interface Shape

The Shape interface provides definitions for objects that represent some form of geometric shape. Each Shape object provides callbacks to get the bounding box of the geometry and determines whether points or rectangles lie partly or entirely within the interior of the Shape.

Definition of insideness: A point is considered to lie inside a Shape if and only if:


Method Summary
 Rectangle getBounds()
          Returns an integer Rectangle that completely encloses the Shape.
 

Method Detail

getBounds

public Rectangle getBounds()
Returns an integer Rectangle that completely encloses the Shape. Note that there is no guarantee that the returned Rectangle is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated Rectangle. The returned Rectangle might also fail to completely enclose the Shape if the Shape overflows the limited range of the integer data type. The getBounds2D method generally returns a tighter bounding box due to its greater flexibility in representation.
Returns:
an integer Rectangle that completely encloses the Shape.

PDAP 1.0 Spec, Rev. 0.16