summaryrefslogtreecommitdiff
path: root/java/awt/Polygon.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/awt/Polygon.java')
-rw-r--r--java/awt/Polygon.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/java/awt/Polygon.java b/java/awt/Polygon.java
index 113dad992..e91144c88 100644
--- a/java/awt/Polygon.java
+++ b/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