diff options
Diffstat (limited to 'libjava/java/awt/Polygon.java')
-rw-r--r-- | libjava/java/awt/Polygon.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libjava/java/awt/Polygon.java b/libjava/java/awt/Polygon.java index 113dad9..e91144c 100644 --- a/libjava/java/awt/Polygon.java +++ b/libjava/java/awt/Polygon.java @@ -258,10 +258,24 @@ public class Polygon implements Shape, Serializable */ public Rectangle getBounds() { + return getBoundingBox (); + } + + /** + * Returns the bounding box of this polygon. This is the smallest + * rectangle with sides parallel to the X axis that will contain this + * polygon. + * + * @return the bounding box for this polygon + * @see #getBounds2D() + * @deprecated use {@link #getBounds()} instead + */ + public Rectangle getBoundingBox() + { if (bounds == null) { if (npoints == 0) - return bounds = new Rectangle(); + return bounds = new Rectangle (); int i = npoints - 1; int minx = xpoints[i]; int maxx = minx; @@ -280,26 +294,12 @@ public class Polygon implements Shape, Serializable else if (y > maxy) maxy = y; } - bounds = new Rectangle(minx, maxy, maxx - minx, maxy - miny); + bounds = new Rectangle (minx, maxy, maxx - minx, maxy - miny); } return bounds; } /** - * Returns the bounding box of this polygon. This is the smallest - * rectangle with sides parallel to the X axis that will contain this - * polygon. - * - * @return the bounding box for this polygon - * @see #getBounds2D() - * @deprecated use {@link #getBounds()} instead - */ - public Rectangle getBoundingBox() - { - return getBounds(); - } - - /** * Tests whether or not the specified point is inside this polygon. * * @param p the point to test |