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

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

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

revision 1.2 by mark, Sat Jul 2 20:32:51 2005 UTC revision 1.3 by rabbit78, Fri Jul 22 08:04:42 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.awt.Color;
42    
43  import javax.swing.JComponent;  import javax.swing.JComponent;
44    import javax.swing.UIDefaults;
45    import javax.swing.UIManager;
46  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
47  import javax.swing.plaf.basic.BasicToggleButtonUI;  import javax.swing.plaf.basic.BasicToggleButtonUI;
48    
# Line 46  public class MetalToggleButtonUI Line 50  public class MetalToggleButtonUI
50    extends BasicToggleButtonUI    extends BasicToggleButtonUI
51  {  {
52    
53    // FIXME: maybe replace by a Map of instances when this becomes stateful    /** The color for the focus border. */
54      protected Color focusColor;
55    
56      /** The color that indicates a selected button. */
57      protected Color selectColor;
58    
59      /** The color for disabled button labels. */
60      protected Color disabledTextColor;
61    
62    /** The shared UI instance for MetalToggleButtonUIs */    /** The shared UI instance for MetalToggleButtonUIs */
63    private static MetalToggleButtonUI instance = null;    private static MetalToggleButtonUI instance = null;
64    
# Line 56  public class MetalToggleButtonUI Line 68  public class MetalToggleButtonUI
68    public MetalToggleButtonUI()    public MetalToggleButtonUI()
69    {    {
70      super();      super();
71        focusColor = getFocusColor();
72        selectColor = getSelectColor();
73        disabledTextColor = getDisabledTextColor();
74      }
75    
76    
77      /**
78       * Returns the color for the focus border.
79       *
80       * @return the color for the focus border
81       */
82      protected Color getFocusColor()
83      {
84        UIDefaults def = UIManager.getLookAndFeelDefaults();
85        return def.getColor(getPropertyPrefix() + ".focus");
86      }
87    
88      /**
89       * Returns the color that indicates a selected button.
90       *
91       * @return the color that indicates a selected button
92       */
93      protected Color getSelectColor()
94      {
95        UIDefaults def = UIManager.getLookAndFeelDefaults();
96        return def.getColor(getPropertyPrefix() + ".select");
97      }
98    
99      /**
100       * Returns the color for the text label of disabled buttons.
101       *
102       * @return the color for the text label of disabled buttons
103       */
104      protected Color getDisabledTextColor()
105      {
106        UIDefaults def = UIManager.getLookAndFeelDefaults();
107        return def.getColor(getPropertyPrefix() + ".disabledText");
108    }    }
109    
110    /**    /**

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

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