@@ -0,0 +1,1435 @@
+//%0A// $Id: SmartPolygon.java,v 1.1 2002/02/19 03:41:41 mdb Exp $%0A//%0A// samskivert library - useful routines for java programs%0A// Copyright (C) 2001 Michael Bayne%0A// %0A// This library is free software; you can redistribute it and/or modify it%0A// under the terms of the GNU Lesser General Public License as published%0A// by the Free Software Foundation; either version 2.1 of the License, or%0A// (at your option) any later version.%0A//%0A// This library is distributed in the hope that it will be useful,%0A// but WITHOUT ANY WARRANTY; without even the implied warranty of%0A// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A// Lesser General Public License for more details.%0A//%0A// You should have received a copy of the GNU Lesser General Public%0A// License along with this library; if not, write to the Free Software%0A// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA%0A%0Apackage com.samskivert.swing;%0A%0Aimport java.awt.Polygon;%0Aimport java.awt.Rectangle;%0A%0A/**%0A * Extends the AWT polygon class and provides a %7B@link #getBounds%7D method%0A * that doesn't annoyingly make a copy of the bounds rectangle every time%0A * it is returned.%0A */%0Apublic class SmartPolygon extends Polygon%0A%7B%0A    /**%0A     * Returns the internally cached bounds rectangle for this polygon.%0A     * %3Cem%3EDon't modify it!%3C/em%3E%0A     */%0A    public Rectangle getBounds ()%0A    %7B%0A        return (bounds == null) ? super.getBounds() : bounds;%0A    %7D%0A%7D%0A

Created a polygon extension that can return its bounds without creating a freaking Rectangle object each time.