Shape

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

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

- it lies completely inside the`Shape` boundary or
- it lies exactly on the `Shape` boundary and the space immediately adjacent to the point in the increasing `X` direction is entirely inside the boundary or
- it lies exactly on a horizontal boundary segment and the space immediately adjacent to the point in the increasing `Y` direction is inside the boundary.

The `contains` and `intersects` methods consider the interior of a `Shape` to be the area it encloses as if it were filled. This means that these methods consider unclosed shapes to be implicitly closed for the purpose of determining if a shape contains or intersects a rectangle or if a shape contains a point.

Version:
  1.19 06/24/98
Author:
  Jim Graham
See Also:
  ``

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

Method Detail

### getBounds

    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.

  Returns:
    an integer `Rectangle` that completely encloses the `Shape`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD