I committed this patch - it simplifies the createUI method and adds API docs:
2005-09-10 David Gilbert <[EMAIL PROTECTED]> * javax/swing/plaf/metal/MetalInternalFrameUI.java: (instances): removed, (createUI): just return new instance, API docs all over. Regards, Dave Gilbert
Index: javax/swing/plaf/metal/MetalInternalFrameUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java,v retrieving revision 1.4 diff -u -r1.4 MetalInternalFrameUI.java --- javax/swing/plaf/metal/MetalInternalFrameUI.java 25 Aug 2005 10:48:59 -0000 1.4 +++ javax/swing/plaf/metal/MetalInternalFrameUI.java 10 Sep 2005 17:21:22 -0000 @@ -38,24 +38,24 @@ package javax.swing.plaf.metal; -import java.util.HashMap; - import javax.swing.JComponent; import javax.swing.JInternalFrame; import javax.swing.border.EmptyBorder; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicInternalFrameUI; - +/** + * A UI delegate for the [EMAIL PROTECTED] JInternalFrame} component under the + * [EMAIL PROTECTED] MetalLookAndFeel}. + */ public class MetalInternalFrameUI extends BasicInternalFrameUI { - /** The instances of MetalInternalFrameUI*/ - private static HashMap instances; - /** - * Constructs a new instance of MetalInternalFrameUI. + * Constructs a new instance of <code>MetalInternalFrameUI</code>. + * + * @param frame the frame. */ public MetalInternalFrameUI(JInternalFrame frame) { @@ -63,7 +63,7 @@ } /** - * Returns an instance of MetalInternalFrameUI. + * Returns an instance of <code>MetalInternalFrameUI</code>. * * @param component the component for which we return an UI instance * @@ -71,23 +71,17 @@ */ public static ComponentUI createUI(JComponent component) { - if (instances == null) - instances = new HashMap(); - - - Object o = instances.get(component); - MetalInternalFrameUI instance; - if (o == null) - { - instance = new MetalInternalFrameUI((JInternalFrame) component); - instances.put(component, instance); - } - else - instance = (MetalInternalFrameUI) o; - - return instance; + return new MetalInternalFrameUI((JInternalFrame) component); } + /** + * Creates and returns the component that will be used for the north pane + * of the [EMAIL PROTECTED] JInternalFrame}. + * + * @param w the internal frame. + * + * @return A new instance of [EMAIL PROTECTED] MetalInternalFrameTitlePane}. + */ protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w);
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches