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

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

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

revision 1.2.2.4 by gnu_andrew, Wed Nov 2 00:44:01 2005 UTC revision 1.2.2.5 by gnu_andrew, Sun Nov 27 21:00:41 2005 UTC
# Line 46  import java.awt.Rectangle; Line 46  import java.awt.Rectangle;
46  import javax.swing.AbstractButton;  import javax.swing.AbstractButton;
47  import javax.swing.JComponent;  import javax.swing.JComponent;
48  import javax.swing.JRadioButton;  import javax.swing.JRadioButton;
 import javax.swing.UIDefaults;  
49  import javax.swing.UIManager;  import javax.swing.UIManager;
50  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
51  import javax.swing.plaf.basic.BasicRadioButtonUI;  import javax.swing.plaf.basic.BasicRadioButtonUI;
# Line 96  public class MetalRadioButtonUI Line 95  public class MetalRadioButtonUI
95    public void installDefaults(AbstractButton b)    public void installDefaults(AbstractButton b)
96    {    {
97      super.installDefaults(b);      super.installDefaults(b);
98      UIDefaults defaults = UIManager.getLookAndFeelDefaults();      disabledTextColor = UIManager.getColor("RadioButton.disabledText");
99      disabledTextColor = defaults.getColor("RadioButton.disabledText");      focusColor = UIManager.getColor("RadioButton.focus");
100      focusColor = defaults.getColor("RadioButton.focus");      selectColor = UIManager.getColor("RadioButton.select");
     selectColor = defaults.getColor("RadioButton.select");  
101    }    }
102        
103    /**    /**
# Line 118  public class MetalRadioButtonUI Line 116  public class MetalRadioButtonUI
116    /**    /**
117     * Returns the color used to fill the {@link JRadioButton}'s icon when the     * Returns the color used to fill the {@link JRadioButton}'s icon when the
118     * button is pressed.  The default color is obtained from the     * button is pressed.  The default color is obtained from the
119     * {@link UIDefaults} via an entry with the key     * {@link UIManager} defaults via an entry with the key
120     * <code>RadioButton.select</code>.     * <code>RadioButton.select</code>.
121     *     *
122     * @return The select color.     * @return The select color.
# Line 130  public class MetalRadioButtonUI Line 128  public class MetalRadioButtonUI
128        
129    /**    /**
130     * Returns the color for the {@link JRadioButton}'s text when the button is     * Returns the color for the {@link JRadioButton}'s text when the button is
131     * disabled.  The default color is obtained from the {@link UIDefaults} via     * disabled.  The default color is obtained from the {@link UIManager}
132     * an entry with the key <code>RadioButton.disabledText</code>.     * defaults via an entry with the key <code>RadioButton.disabledText</code>.
133     *     *
134     * @return The disabled text color.     * @return The disabled text color.
135     */     */
# Line 143  public class MetalRadioButtonUI Line 141  public class MetalRadioButtonUI
141    /**    /**
142     * Returns the color used to draw the focus rectangle when the     * Returns the color used to draw the focus rectangle when the
143     * {@link JRadioButton} has the focus.  The default color is obtained from     * {@link JRadioButton} has the focus.  The default color is obtained from
144     * the {@link UIDefaults} via an entry with the key     * the {@link UIManager} defaults via an entry with the key
145     * <code>RadioButton.focus</code>.     * <code>RadioButton.focus</code>.
146     *     *
147     * @return The color used to draw the focus rectangle.     * @return The color used to draw the focus rectangle.
# Line 178  public class MetalRadioButtonUI Line 176  public class MetalRadioButtonUI
176    protected void paintFocus(Graphics g, Rectangle t, Dimension d)    protected void paintFocus(Graphics g, Rectangle t, Dimension d)
177    {    {
178      g.setColor(focusColor);      g.setColor(focusColor);
179      // minus 2 because of line thickness. Prevents border      g.drawRect(t.x - 1, t.y + 2, t.width + 2, t.height - 4);
     // from being cutoff.  
     g.drawRect(t.x, t.y, t.width - 2, t.height - 2);  
180    }    }
181        
182  }  }

Legend:
Removed from v.1.2.2.4  
changed lines
  Added in v.1.2.2.5

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