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

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

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

revision 1.1 by rabbit78, Thu Apr 14 18:00:46 2005 UTC revision 1.2 by rabbit78, Mon Apr 18 10:25:01 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.BasicScrollBarUI;  import javax.swing.plaf.basic.BasicScrollBarUI;
# Line 48  public class MetalScrollBarUI Line 50  public class MetalScrollBarUI
50    
51    // FIXME: maybe replace by a Map of instances when this becomes stateful    // FIXME: maybe replace by a Map of instances when this becomes stateful
52    /** The shared UI instance for JScrollBars. */    /** The shared UI instance for JScrollBars. */
53    private static MetalScrollBarUI instance = null;    private static HashMap instances = null;
54    
55    /**    /**
56     * Constructs a new instance of MetalScrollBarUI.     * Constructs a new instance of MetalScrollBarUI.
# Line 67  public class MetalScrollBarUI Line 69  public class MetalScrollBarUI
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 MetalScrollBarUI();        instances = new HashMap();
74    
75        Object o = instances.get(component);
76        MetalScrollBarUI instance;
77        if (o == null)
78          {
79            instance = new MetalScrollBarUI();
80            instances.put(component, instance);
81          }
82        else
83          instance = (MetalScrollBarUI) o;
84    
85      return instance;      return instance;
86    }    }
87  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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