Rolled back to deprecated call to getBoundingBox() so as to properly

effect desired functionality and avoid infinite recursion.  Since
Polygon.calculateBounds() has package-protected access, our only happily
non-deprecated alternative is to copy calculateBounds() and the code from
Polygon.getBoundingBox() into this class, explicitly avoiding a call to
bounds.getBounds(), but for now I choose to live with deprecation.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@821 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
shaper
2002-08-22 01:14:55 +00:00
parent 628addc144
commit deb729e2cd
@@ -1,5 +1,5 @@
// //
// $Id: SmartPolygon.java,v 1.3 2002/08/20 18:57:31 mdb Exp $ // $Id: SmartPolygon.java,v 1.4 2002/08/22 01:14:55 shaper Exp $
// //
// samskivert library - useful routines for java programs // samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne // Copyright (C) 2001 Michael Bayne
@@ -30,21 +30,12 @@ import java.awt.Rectangle;
*/ */
public class SmartPolygon extends Polygon public class SmartPolygon extends Polygon
{ {
/**
* Returns the internally cached bounds rectangle for this polygon.
* <em>Don't modify it!</em>
*/
public Rectangle getBounds ()
{
return (bounds == null) ? super.getBounds() : bounds;
}
/** /**
* Returns the internally cached bounds rectangle for this polygon. * Returns the internally cached bounds rectangle for this polygon.
* <em>Don't modify it!</em> * <em>Don't modify it!</em>
*/ */
public Rectangle getBoundingBox () public Rectangle getBoundingBox ()
{ {
return (bounds == null) ? super.getBounds() : bounds; return (bounds == null) ? super.getBoundingBox() : bounds;
} }
} }