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

Diff of /classpath/javax/swing/plaf/metal/MetalSplitPaneUI.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, Sun Jun 5 19:36:39 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.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
45  import javax.swing.plaf.basic.BasicSplitPaneUI;  import javax.swing.plaf.basic.BasicSplitPaneUI;
# Line 46  public class MetalSplitPaneUI Line 48  public class MetalSplitPaneUI
48    extends BasicSplitPaneUI    extends BasicSplitPaneUI
49  {  {
50    
51    // FIXME: maybe replace by a Map of instances when this becomes stateful    /** The UI instances for MetalSplitPaneUIs */
52    /** The shared UI instance for MetalSplitPaneUIs */    private static HashMap instances;
   private static MetalSplitPaneUI instance = null;  
53    
54    /**    /**
55     * Constructs a new instance of MetalSplitPaneUI.     * Constructs a new instance of MetalSplitPaneUI.
# Line 67  public class MetalSplitPaneUI Line 68  public class MetalSplitPaneUI
68     */     */
69    public static ComponentUI createUI(JComponent component)    public static ComponentUI createUI(JComponent component)
70    {    {
71      if (instance == null)      if (instances == null)
72        instance = new MetalSplitPaneUI();        instances = new HashMap();
73    
74        Object o = instances.get(component);
75        MetalSplitPaneUI instance;
76        if (o == null)
77          {
78            instance = new MetalSplitPaneUI();
79            instances.put(component, instance);
80          }
81        else
82          instance = (MetalSplitPaneUI) o;
83    
84      return instance;      return instance;
85    }    }
86  }  }

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