classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: MetalInternalFrameUI


From: David Gilbert
Subject: [cp-patches] FYI: MetalInternalFrameUI
Date: Sat, 10 Sep 2005 21:53:58 +0000
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050728)

I committed this patch - it simplifies the createUI method and adds API docs:

2005-09-10  David Gilbert  <address@hidden>

        * 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 address@hidden JInternalFrame} component under the 
+ * address@hidden 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 address@hidden JInternalFrame}.  
+   * 
+   * @param w  the internal frame.
+   * 
+   * @return A new instance of address@hidden MetalInternalFrameTitlePane}.
+   */
   protected JComponent createNorthPane(JInternalFrame w)
   {
     titlePane = new MetalInternalFrameTitlePane(w);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]