/[classpath]/classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by gnu_andrew, Mon Apr 18 01:37:40 2005 UTC revision 1.1.2.2 by gnu_andrew, Thu Apr 28 23:00:14 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package javax.swing.plaf.metal;  package javax.swing.plaf.metal;
40    
41    import java.util.HashMap;
42    
43  import javax.swing.JComponent;  import javax.swing.JComponent;
44  import javax.swing.JInternalFrame;  import javax.swing.JInternalFrame;
45  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
# Line 47  public class MetalInternalFrameUI Line 49  public class MetalInternalFrameUI
49    extends BasicInternalFrameUI    extends BasicInternalFrameUI
50  {  {
51    
52    // FIXME: maybe replace by a Map of instances when this becomes stateful    /** The instances of MetalInternalFrameUI*/
53    /** The shared UI instance for JInternalFrames */    private static HashMap instances;
   private static MetalInternalFrameUI instance = null;  
54    
55    /**    /**
56     * Constructs a new instance of MetalInternalFrameUI.     * Constructs a new instance of MetalInternalFrameUI.
# Line 68  public class MetalInternalFrameUI Line 69  public class MetalInternalFrameUI
69     */     */
70    public static ComponentUI createUI(JComponent component)    public static ComponentUI createUI(JComponent component)
71    {    {
72      if (instance == null)      if (instances == null)
73        instance = new MetalInternalFrameUI((JInternalFrame) component);        instances = new HashMap();
74    
75    
76        Object o = instances.get(component);
77        MetalInternalFrameUI instance;
78        if (o == null)
79          {
80            instance = new MetalInternalFrameUI((JInternalFrame) component);
81            instances.put(component, instance);
82          }
83        else
84          instance = (MetalInternalFrameUI) o;
85    
86      return instance;      return instance;
87    }    }
88  }  }

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26