/[classpath]/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java

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

revision 1.6.2.2 by gnu_andrew, Sat Sep 10 15:31:52 2005 UTC revision 1.6.2.3 by gnu_andrew, Wed Nov 2 00:43:58 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package javax.swing.plaf.basic;  package javax.swing.plaf.basic;
40    
41    import java.awt.Color;
42    import java.awt.Dimension;
43  import java.awt.Font;  import java.awt.Font;
44  import java.awt.Graphics;  import java.awt.Graphics;
45  import java.awt.Rectangle;  import java.awt.Rectangle;
# Line 93  public class BasicRadioButtonUI extends Line 95  public class BasicRadioButtonUI extends
95        b.setIcon(icon);        b.setIcon(icon);
96      if (b.getSelectedIcon() == null)      if (b.getSelectedIcon() == null)
97        b.setSelectedIcon(icon);        b.setSelectedIcon(icon);
98        if (b.getDisabledIcon() == null)
99          b.setDisabledIcon(icon);
100        if (b.getDisabledSelectedIcon() == null)
101          b.setDisabledSelectedIcon(icon);
102    }    }
103    
104    /**    /**
# Line 139  public class BasicRadioButtonUI extends Line 145  public class BasicRadioButtonUI extends
145      g.setFont(f);      g.setFont(f);
146    
147      Icon currentIcon = null;      Icon currentIcon = null;
148      if (b.isSelected())      if (b.isSelected() && b.isEnabled())
149        currentIcon = b.getSelectedIcon();        currentIcon = b.getSelectedIcon();
150      else      else if (!b.isSelected() && b.isEnabled())
151        currentIcon = b.getIcon();        currentIcon = b.getIcon();
152        else if (b.isSelected() && !b.isEnabled())
153          currentIcon = b.getDisabledSelectedIcon();
154        else // (!b.isSelected() && !b.isEnabled())
155          currentIcon = b.getDisabledIcon();
156    
157      SwingUtilities.calculateInnerArea(b, vr);      SwingUtilities.calculateInnerArea(b, vr);
158      String text = SwingUtilities.layoutCompoundLabel      String text = SwingUtilities.layoutCompoundLabel
# Line 157  public class BasicRadioButtonUI extends Line 167  public class BasicRadioButtonUI extends
167        }        }
168      if (text != null)      if (text != null)
169        paintText(g, b, tr, text);        paintText(g, b, tr, text);
170      paintFocus(g, b, vr, tr, ir);      // TODO: Figure out what is the size parameter?
171        if (b.hasFocus() && b.isFocusPainted() && b.isEnabled())
172          paintFocus(g, tr, null);
173      }
174    
175      /**
176       * Paints the focus indicator for JRadioButtons.
177       *
178       * @param g the graphics context
179       * @param tr the rectangle for the text label
180       * @param size the size (??)
181       */
182      // TODO: Figure out what for is the size parameter.
183      protected void paintFocus(Graphics g, Rectangle tr, Dimension size)
184      {
185        Color focusColor = UIManager.getColor(getPropertyPrefix() + ".focus");
186        Color saved = g.getColor();
187        g.setColor(focusColor);
188        g.drawRect(tr.x, tr.y, tr.width, tr.height);
189        g.setColor(saved);
190    }    }
191  }  }

Legend:
Removed from v.1.6.2.2  
changed lines
  Added in v.1.6.2.3

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