/[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.4 by trebligd, Thu Aug 25 10:48:59 2005 UTC revision 1.5 by trebligd, Sat Sep 10 20:52:47 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.JInternalFrame;  import javax.swing.JInternalFrame;
43  import javax.swing.border.EmptyBorder;  import javax.swing.border.EmptyBorder;
44  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
45  import javax.swing.plaf.basic.BasicInternalFrameUI;  import javax.swing.plaf.basic.BasicInternalFrameUI;
46    
47    /**
48     * A UI delegate for the {@link JInternalFrame} component under the
49     * {@link MetalLookAndFeel}.
50     */
51  public class MetalInternalFrameUI  public class MetalInternalFrameUI
52    extends BasicInternalFrameUI    extends BasicInternalFrameUI
53  {  {
54    
   /** The instances of MetalInternalFrameUI*/  
   private static HashMap instances;  
   
55    /**    /**
56     * Constructs a new instance of MetalInternalFrameUI.     * Constructs a new instance of <code>MetalInternalFrameUI</code>.
57       *
58       * @param frame  the frame.
59     */     */
60    public MetalInternalFrameUI(JInternalFrame frame)    public MetalInternalFrameUI(JInternalFrame frame)
61    {    {
# Line 63  public class MetalInternalFrameUI Line 63  public class MetalInternalFrameUI
63    }    }
64    
65    /**    /**
66     * Returns an instance of MetalInternalFrameUI.     * Returns an instance of <code>MetalInternalFrameUI</code>.
67     *     *
68     * @param component the component for which we return an UI instance     * @param component the component for which we return an UI instance
69     *     *
# Line 71  public class MetalInternalFrameUI Line 71  public class MetalInternalFrameUI
71     */     */
72    public static ComponentUI createUI(JComponent component)    public static ComponentUI createUI(JComponent component)
73    {    {
74      if (instances == null)      return new MetalInternalFrameUI((JInternalFrame) component);
       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;  
75    }    }
76        
77      /**
78       * Creates and returns the component that will be used for the north pane
79       * of the {@link JInternalFrame}.  
80       *
81       * @param w  the internal frame.
82       *
83       * @return A new instance of {@link MetalInternalFrameTitlePane}.
84       */
85    protected JComponent createNorthPane(JInternalFrame w)    protected JComponent createNorthPane(JInternalFrame w)
86    {    {
87      titlePane = new MetalInternalFrameTitlePane(w);      titlePane = new MetalInternalFrameTitlePane(w);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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