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

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

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

revision 1.1.2.3 by gnu_andrew, Tue Sep 20 18:46:34 2005 UTC revision 1.1.2.4 by gnu_andrew, Wed Nov 2 00:44: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    
 import java.util.HashMap;  
   
41  import javax.swing.JComponent;  import javax.swing.JComponent;
42    import javax.swing.JProgressBar;
43  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
44  import javax.swing.plaf.basic.BasicProgressBarUI;  import javax.swing.plaf.basic.BasicProgressBarUI;
45    
46  public class MetalProgressBarUI  /**
47    extends BasicProgressBarUI   * A UI delegate for the {@link JProgressBar} component.
48     */
49    public class MetalProgressBarUI extends BasicProgressBarUI
50  {    {  
   /** The UI instances for MetalTreeUIs */  
   private static HashMap instances = null;  
   
51    /**    /**
52     * Constructs a new instance of MetalProgressBarUI.     * Constructs a new instance of <code>MetalProgressBarUI</code>.
53     */     */
54    public MetalProgressBarUI()    public MetalProgressBarUI()
55    {    {
# Line 59  public class MetalProgressBarUI Line 57  public class MetalProgressBarUI
57    }    }
58    
59    /**    /**
60     * Returns an instance of MetalProgressBarUI.     * Returns a new instance of <code>MetalProgressBarUI</code>.
61     *     *
62     * @param component the component for which we return an UI instance     * @param component the component for which we return an UI instance
63     *     *
64     * @return an instance of MetalProgressBarUI     * @return A new instance of <code>MetalProgressBarUI</code>.
65     */     */
66    public static ComponentUI createUI(JComponent component)    public static ComponentUI createUI(JComponent component)
67    {    {
68      if (instances == null)      return new MetalProgressBarUI();
       instances = new HashMap();  
   
     Object o = instances.get(component);  
     MetalProgressBarUI instance;  
     if (o == null)  
       {  
         instance = new MetalProgressBarUI();  
         instances.put(component, instance);  
       }  
     else  
       instance = (MetalProgressBarUI) o;  
   
     return instance;  
69    }    }
70  }  }

Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4

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