classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: RadioButton and CheckBox icon cleanup


From: Roman Kennke
Subject: [cp-patches] FYI: RadioButton and CheckBox icon cleanup
Date: Thu, 21 Jul 2005 14:09:49 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

I did clean up the RadioButton and CheckBox icons in Classpath. This included implementing empty dummy icons for the BasicL&F, implementing real Metal icons for RadioButton (I already did MetalCheckBoxIcon some days ago) and registering all these icons in the LookAndFeel classes.

In the case that you wonder: No, the icons for JCheckBox and JRadioButtons are not visible in the BasicLookAndFeel. This is what's in the JDK, so do we.

2005-07-21  Roman Kennke  <address@hidden>

       * javax/swing/AbstractButton.java
       (init): Only set icon if the supplied icon is not null. Otherwise
       we would override icons that are possibly set by the UI.
       * javax/swing/plaf/basic/BasicIconFactory.java
       (CheckBoxIcon): An new Icon implementation used for CheckBoxes
       in the Basic L&F.
       (RadioButtonIcon): An new Icon implementation used for
       RadioButtons in the Basic L&F.
       (getCheckBoxIcon): Now returns a (cached) instance of CheckBoxIcon
       instead of the (wrong) inner icon implementation.
       (getRadioButtonIcon): Now returns a (cached) instance of
       RadioButtonIcon instead of the (wrong) inner icon implementation.
       * javax/swing/plaf/basic/BasicLookAndFeel.java
       (initComponentDefaults): Registered new icons for CheckBox and
       RadioButton, using a LazyValue entry.
       * javax/swing/plaf/basic/BasicRadioButtonUI.java
       Added API documentation all over.
       (installUI): Removed this method.
       (installDefaults): New method. Installs the default icons if there
       is no other icon set.
       (getPropertyPrefix): New method. Returns the prefix that is used
       to look up UIDefault entries.
       (getDefaultIcon): Use propertyPrefix instead of hardcoded property.
       (paint): New method. Override paint for customized painting
       of RadioButtons.
       * javax/swing/plaf/metal/MetalCheckBoxIcon.java
       (drawCheck): Respect the x and y parameter.
       * javax/swing/plaf/metal/MetalIconFactory.java
       (RadioButtonIcon): An Icon implementation for Metal RadioButtons.
       (getRadioButtonIcon): New method. Returns a shared instance of
       RadioButtonIcon.
       * javax/swing/plaf/metal/MetalLookAndFeel.java
       (initComponentDefaults): Register new icons for CheckBox and
       RadioButton using a LazyValue entry.

/Roman
? javax/swing/DumpHierarchy.java
Index: javax/swing/AbstractButton.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractButton.java,v
retrieving revision 1.40
diff -u -r1.40 AbstractButton.java
--- javax/swing/AbstractButton.java     21 Jul 2005 09:06:08 -0000      1.40
+++ javax/swing/AbstractButton.java     21 Jul 2005 11:55:22 -0000
@@ -572,7 +572,9 @@
     if(text != null)
         this.text = text;
 
-    default_icon = icon;
+    if (icon != null)
+      default_icon = icon;
+
     actionListener = createActionListener();
     changeListener = createChangeListener();
     itemListener = createItemListener();
Index: javax/swing/plaf/basic/BasicIconFactory.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicIconFactory.java,v
retrieving revision 1.9
diff -u -r1.9 BasicIconFactory.java
--- javax/swing/plaf/basic/BasicIconFactory.java        2 Jul 2005 20:32:50 
-0000       1.9
+++ javax/swing/plaf/basic/BasicIconFactory.java        21 Jul 2005 11:55:22 
-0000
@@ -70,10 +70,100 @@
     }
   }
 
-
-  public BasicIconFactory()
-  {
+  /**
+   * The icon used for CheckBoxes in the BasicLookAndFeel. This is an empty
+   * icon with a size of 13x13 pixels.
+   */
+  static class CheckBoxIcon
+    implements Icon
+  {
+    /**
+     * Returns the height of the icon. The BasicLookAndFeel CheckBox icon
+     * has a height of 13 pixels.
+     *
+     * @return the height of the icon
+     */
+    public int getIconHeight()
+    {
+      return 13;
+    }
+
+    /**
+     * Returns the width of the icon. The BasicLookAndFeel CheckBox icon
+     * has a width of 13 pixels.
+     *
+     * @return the height of the icon
+     */
+    public int getIconWidth()
+    {
+      return 13;
+    }
+
+    /**
+     * Paints the icon. The BasicLookAndFeel CheckBox icon is empty and does
+     * not need to be painted.
+     *
+     * @param c the component to be painted
+     * @param g the Graphics context to be painted with
+     * @param x the x position of the icon
+     * @param y the y position of the icon
+     */
+    public void paintIcon(Component c, Graphics g, int x, int y)
+    {
+      // The icon is empty and needs no painting.
+    }
+  }
+
+  /**
+   * The icon used for RadioButtons in the BasicLookAndFeel. This is an empty
+   * icon with a size of 13x13 pixels.
+   */
+  static class RadioButtonIcon
+    implements Icon
+  {
+    /**
+     * Returns the height of the icon. The BasicLookAndFeel RadioButton icon
+     * has a height of 13 pixels.
+     *
+     * @return the height of the icon
+     */
+    public int getIconHeight()
+    {
+      return 13;
+    }
+
+    /**
+     * Returns the width of the icon. The BasicLookAndFeel RadioButton icon
+     * has a width of 13 pixels.
+     *
+     * @return the height of the icon
+     */
+    public int getIconWidth()
+    {
+      return 13;
+    }
+
+    /**
+     * Paints the icon. The BasicLookAndFeel RadioButton icon is empty and does
+     * not need to be painted.
+     *
+     * @param c the component to be painted
+     * @param g the Graphics context to be painted with
+     * @param x the x position of the icon
+     * @param y the y position of the icon
+     */
+    public void paintIcon(Component c, Graphics g, int x, int y)
+    {
+      // The icon is empty and needs no painting.
+    }
   }
+
+  /** The cached CheckBoxIcon instance. */
+  private static CheckBoxIcon checkBoxIcon;
+
+  /** The cached CheckBoxIcon instance. */
+  private static RadioButtonIcon radioButtonIcon;
+
   public static Icon getMenuItemCheckIcon()
   {
     return new DummyIcon();
@@ -114,115 +204,34 @@
       };
   }
 
+  /**
+   * Returns an icon for CheckBoxes in the BasicLookAndFeel. CheckBox icons
+   * in the Basic L&amp;F are empty and have a size of 13x13 pixels.
+   * This method returns a shared single instance of this icon.
+   *
+   * @return an icon for CheckBoxes in the BasicLookAndFeel
+   */
   public static Icon getCheckBoxIcon()
   {
-    return new Icon()
-      {        
-        public int getIconHeight() 
-        { 
-          return 10; 
-        }
-        public int getIconWidth() 
-        { 
-          return 10; 
-        }
-        public void paintIcon(Component c, Graphics g, int x, int y)
-        {
-          if (c instanceof AbstractButton)
-            {
-              UIDefaults defaults;
-              defaults = UIManager.getLookAndFeelDefaults();
-              Color hi = defaults.getColor("CheckBox.highlight");
-              Color low = defaults.getColor("CheckBox.darkShadow");
-              Color sel = defaults.getColor("CheckBox.foreground");
-              Color dim = defaults.getColor("CheckBox.shadow");
-              Polygon check = new Polygon(new int[] {x+3, x+3, x+8},
-                                          new int[] {y+5, y+9, y+3}, 3);
-              AbstractButton b = (AbstractButton) c;
-              Color saved = g.getColor();
-              if (b.isEnabled())
-                {
-                  g.setColor(low);
-                  g.drawRect(x, y, 10, 10);
-                  g.setColor(hi);
-                  g.drawRect(x+1, y+1, 10, 10);
-                  if (b.isSelected())
-                    {
-                      g.setColor(sel);
-                      if (b.isSelected())
-                        {
-                          g.drawLine(x+3, y+5, x+3, y+8);
-                          g.drawLine(x+4, y+5, x+4, y+8);
-                          g.drawLine(x+3, y+8, x+8, y+3);
-                          g.drawLine(x+4, y+8, x+8, y+3);
-                        }
-                    }
-                }
-              else
-                {                  
-                  g.setColor(hi);
-                  g.drawRect(x, y, 10, 10);
-                  if (b.isSelected())
-                    {
-                      g.drawLine(x+3, y+5, x+3, y+9);
-                      g.drawLine(x+3, y+9, x+8, y+3);
-                    }
-                }
-              g.setColor(saved);
-            }
-        }
-      };
+    if (checkBoxIcon == null)
+      checkBoxIcon = new CheckBoxIcon();
+    return checkBoxIcon;
   }
 
+  /**
+   * Returns an icon for RadioButtons in the BasicLookAndFeel. RadioButton
+   * icons in the Basic L&amp;F are empty and have a size of 13x13 pixels.
+   * This method returns a shared single instance of this icon.
+   *
+   * @return an icon for RadioButtons in the BasicLookAndFeel
+   */
   public static Icon getRadioButtonIcon()
   {
-    return new Icon()
-      {        
-        public int getIconHeight() 
-        { 
-          return 12; 
-        }
-        public int getIconWidth() 
-        { 
-          return 12; 
-        }
-        public void paintIcon(Component c, Graphics g, int x, int y)
-        {
-          UIDefaults defaults;      
-          defaults = UIManager.getLookAndFeelDefaults();
-          Color hi = defaults.getColor("RadioButton.highlight");
-          Color low = defaults.getColor("RadioButton.darkShadow");
-          Color sel = defaults.getColor("RadioButton.foreground");
-          Color dim = defaults.getColor("RadioButton.shadow");
-
-          if (c instanceof AbstractButton)
-            {
-              AbstractButton b = (AbstractButton) c;
-              Color saved = g.getColor();
-              if (b.isEnabled())
-                {
-                  g.setColor(low);
-                  g.drawOval(x, y, 12, 12);
-                  g.setColor(hi);
-                  g.drawOval(x+1, y+1, 12, 12);
-                  if (b.isSelected())
-                    {
-                      g.setColor(sel);
-                      g.fillOval(x+4, y+4, 6, 6);
-                    }
-                }
-              else
-                {                  
-                  g.setColor(hi);
-                  g.drawOval(x, y, 12, 12);
-                  if (b.isSelected())
-                    g.fillOval(x+4, y+4, 6, 6);
-                }
-              g.setColor(saved);
-            }
-        }
-      };
+    if (radioButtonIcon == null)
+      radioButtonIcon = new RadioButtonIcon();
+    return radioButtonIcon;
   }
+
   public static Icon getCheckBoxMenuItemIcon()
   {
     return getCheckBoxIcon();
Index: javax/swing/plaf/basic/BasicLookAndFeel.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java,v
retrieving revision 1.38
diff -u -r1.38 BasicLookAndFeel.java
--- javax/swing/plaf/basic/BasicLookAndFeel.java        20 Jul 2005 15:25:55 
-0000      1.38
+++ javax/swing/plaf/basic/BasicLookAndFeel.java        21 Jul 2005 11:55:22 
-0000
@@ -286,7 +286,14 @@
       }),
       "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12),
       "CheckBox.foreground", new ColorUIResource(darkShadow),
-      "CheckBox.icon", BasicIconFactory.getCheckBoxIcon(),
+      "CheckBox.icon",
+      new UIDefaults.LazyValue()
+      {
+        public Object createValue(UIDefaults def)
+        {
+          return BasicIconFactory.getCheckBoxIcon();
+        }
+      },
       "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2),
       "CheckBox.textIconGap", new Integer(4),
       "CheckBox.textShiftOffset", new Integer(0),
@@ -657,7 +664,14 @@
       "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12),
       "RadioButton.foreground", new ColorUIResource(darkShadow),
       "RadioButton.highlight", new ColorUIResource(highLight),
-      "RadioButton.icon", BasicIconFactory.getRadioButtonIcon(),
+      "RadioButton.icon",
+      new UIDefaults.LazyValue()
+      {
+        public Object createValue(UIDefaults def)
+        {
+          return BasicIconFactory.getRadioButtonIcon();
+        }
+      },
       "RadioButton.light", new ColorUIResource(highLight),
       "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2),
       "RadioButton.shadow", new ColorUIResource(shadow),
Index: javax/swing/plaf/basic/BasicRadioButtonUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java,v
retrieving revision 1.7
diff -u -r1.7 BasicRadioButtonUI.java
--- javax/swing/plaf/basic/BasicRadioButtonUI.java      2 Jul 2005 20:32:50 
-0000       1.7
+++ javax/swing/plaf/basic/BasicRadioButtonUI.java      21 Jul 2005 11:55:22 
-0000
@@ -38,50 +38,125 @@
 
 package javax.swing.plaf.basic;
 
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+
 import javax.swing.AbstractButton;
 import javax.swing.Icon;
 import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
 import javax.swing.UIDefaults;
 import javax.swing.UIManager;
 import javax.swing.plaf.ComponentUI;
 
+/**
+ * The BasicLookAndFeel UI implementation for
+ * address@hidden javax.swing.JRadioButtons}.
+ */
 public class BasicRadioButtonUI extends BasicToggleButtonUI
 {
-
+  /**
+   * The default icon for JRadioButtons. The default icon displays the usual
+   * RadioButton and is sensible to the selection state of the button,
+   * and can be used both as normal icon as well as selectedIcon.
+   */
   protected Icon icon;
 
+  /**
+   * Creates and returns a new instance of <code>BasicRadioButtonUI</code>.
+   *
+   * @return a new instance of <code>BasicRadioButtonUI</code>
+   */
   public static ComponentUI createUI(final JComponent c)  {
     return new BasicRadioButtonUI();
   }
 
+  /**
+   * Creates a new instance of <code>BasicButtonUI</code>.
+   */
   public BasicRadioButtonUI()
   {
     icon = getDefaultIcon();
   }
 
-  public void installUI(final JComponent c)  {
-    super.installUI(c);
-    if (c instanceof AbstractButton)
-      {
-        AbstractButton b = (AbstractButton) c;        
-        b.setIcon(icon);
-      }
+  /**
+   * Installs defaults from the Look &amp; Feel table on the specified
+   * button.
+   *
+   * @param b the button on which to install the defaults
+   */
+  protected void installDefaults(AbstractButton b)
+  {
+    super.installDefaults(b);
+    if (b.getIcon() == null)
+      b.setIcon(icon);
+    if (b.getSelectedIcon() == null)
+      b.setSelectedIcon(icon);
+  }
+
+  /**
+   * Returns the prefix used for UIDefaults properties. This is
+   * <code>RadioButton</code> in this case.
+   *
+   * @return the prefix used for UIDefaults properties
+   */
+  protected String getPropertyPrefix()
+  {
+    return "RadioButton";
   }
 
+  /**
+   * Returns the default icon for JRadioButtons.
+   * The default icon displays the usual
+   * RadioButton and is sensible to the selection state of the button,
+   * and can be used both as normal icon as well as selectedIcon.
+   *
+   * @return the default icon for JRadioButtons
+   */
   public Icon getDefaultIcon()
   {
     UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-    return defaults.getIcon("RadioButton.icon");
+    return defaults.getIcon(getPropertyPrefix() + ".icon");
   }
-    
-}
-
-
-
-
-
-
-
-
 
+  /**
+   * Paints the RadioButton.
+   *
+   * @param g the Graphics context to paint with
+   * @param c the button to paint
+   */
+  public void paint(Graphics g, JComponent c)
+  {
+    AbstractButton b = (AbstractButton) c;
 
+    Rectangle tr = new Rectangle();
+    Rectangle ir = new Rectangle();
+    Rectangle vr = new Rectangle();
+
+    Font f = c.getFont();
+
+    g.setFont(f);
+
+    Icon currentIcon = null;
+    if (b.isSelected())
+      currentIcon = b.getSelectedIcon();
+    else
+      currentIcon = b.getIcon();
+
+    SwingUtilities.calculateInnerArea(b, vr);
+    String text = SwingUtilities.layoutCompoundLabel
+      (c, g.getFontMetrics(f), b.getText(), currentIcon,
+       b.getVerticalAlignment(), b.getHorizontalAlignment(),
+       b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
+       vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset);
+    
+    if (currentIcon != null)
+      {
+        currentIcon.paintIcon(c, g, ir.x, ir.y);
+      }
+    if (text != null)
+      paintText(g, b, tr, text);
+    paintFocus(g, b, vr, tr, ir);
+  }
+}
Index: javax/swing/plaf/metal/MetalCheckBoxIcon.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java,v
retrieving revision 1.1
diff -u -r1.1 MetalCheckBoxIcon.java
--- javax/swing/plaf/metal/MetalCheckBoxIcon.java       15 Jul 2005 14:55:25 
-0000      1.1
+++ javax/swing/plaf/metal/MetalCheckBoxIcon.java       21 Jul 2005 11:55:22 
-0000
@@ -80,10 +80,10 @@
   protected void drawCheck(Component c, Graphics g, int x, int y)
   {
     g.setColor(Color.BLACK);
-    g.drawLine(3, 5, 3, 9);
-    g.drawLine(4, 5, 4, 9);
-    g.drawLine(5, 7, 9, 3);
-    g.drawLine(5, 8, 9, 4);
+    g.drawLine(3 + x, 5 + y, 3 + x, 9 + y);
+    g.drawLine(4 + x, 5 + y, 4 + x, 9 + y);
+    g.drawLine(5 + x, 7 + y, 9 + x, 3 + y);
+    g.drawLine(5 + x, 8 + y, 9 + x, 4 + y);
   }
 
   /**
Index: javax/swing/plaf/metal/MetalIconFactory.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalIconFactory.java,v
retrieving revision 1.2
diff -u -r1.2 MetalIconFactory.java
--- javax/swing/plaf/metal/MetalIconFactory.java        11 Jul 2005 21:17:39 
-0000      1.2
+++ javax/swing/plaf/metal/MetalIconFactory.java        21 Jul 2005 11:55:22 
-0000
@@ -44,7 +44,9 @@
 import java.io.Serializable;
 
 import javax.swing.Icon;
+import javax.swing.JRadioButton;
 import javax.swing.JSlider;
+import javax.swing.plaf.UIResource;
 
 /**
  * Creates icons for the address@hidden MetalLookAndFeel}.
@@ -208,6 +210,105 @@
         
   }
    
+  /**
+   * An address@hidden Icon} implementation for address@hidden JCheckBox}es in 
the
+   * Metal Look &amp; Feel.
+   *
+   * @author Roman Kennke (address@hidden)
+   */
+  static class RadioButtonIcon
+    implements Icon, UIResource, Serializable
+  {
+    /**
+     * Draws the check in the RadioButton.
+     *
+     * @param c the component to draw on
+     * @param g the Graphics context to draw with
+     * @param x the X position
+     * @param y the Y position
+     */
+    protected void drawCheck(Component c, Graphics g)
+    {
+      g.setColor(MetalLookAndFeel.getBlack());
+      g.fillRect(4, 3, 4, 6);
+      g.drawLine(3, 4, 3, 7);
+      g.drawLine(8, 4, 8, 7);
+    }
+
+    /**
+     * Returns the width of the icon in pixels.
+     *
+     * @return the width of the icon in pixels
+     */
+    public int getIconWidth()
+    {
+      return 13;
+    }
+
+    /**
+     * Returns the height of the icon in pixels.
+     *
+     * @return the height of the icon in pixels
+     */
+    public int getIconHeight()
+    {
+      return 13;
+    }
+
+    /**
+     * Paints the icon. This first paints the border of the RadioButton and
+     * if the CheckBox is selected it calls address@hidden #drawCheck} to draw
+     * the check.
+     *
+     * @param c the Component to draw on (gets casted to JCheckBox)
+     * @param g the Graphics context to draw with
+     * @param x the X position
+     * @param x the Y position
+     */
+    public void paintIcon(Component c, Graphics g, int x, int y)
+    {
+      Color dark = MetalLookAndFeel.getControlDarkShadow();
+      Color light = MetalLookAndFeel.getWhite();
+      g.translate(x, y);
+
+      // The light 'circle'
+      g.setColor(light);
+      g.drawLine(4, 1, 10, 1);
+      g.drawLine(2, 2, 3, 2);
+      g.drawLine(8, 2, 11, 2);
+      g.drawLine(2, 3, 2, 3);
+      g.drawLine(11, 2, 11, 9);
+      g.drawLine(1, 4, 1, 7);
+      g.drawLine(12, 4, 12, 7);
+      g.drawLine(2, 8, 2, 11);
+      g.drawLine(11, 8, 11, 9);
+      g.drawLine(10, 10, 10, 10);
+      g.drawLine(2, 11, 9, 11);
+      g.drawLine(4, 12, 7, 12);
+
+      // The dark 'circle'
+      g.setColor(dark);
+      g.drawLine(4, 0, 7, 0);
+      g.drawLine(2, 1, 3, 1);
+      g.drawLine(8, 1, 9, 1);
+      g.drawLine(1, 2, 1, 3);
+      g.drawLine(10, 2, 10, 3);
+      g.drawLine(0, 4, 0, 7);
+      g.drawLine(11, 4, 11, 7);
+      g.drawLine(1, 8, 1, 9);
+      g.drawLine(10, 8, 10, 9);
+      g.drawLine(2, 10, 3, 10);
+      g.drawLine(8, 10, 9, 10);
+      g.drawLine(4, 11, 7, 11);
+
+      JRadioButton rb = (JRadioButton) c;
+      if (rb.isSelected())
+        drawCheck(c, g);
+
+      g.translate(-x, -y);
+    }
+  }
+
     /**
    * The icon used to display the thumb control on a horizontally oriented
    * address@hidden JSlider} component.
@@ -606,6 +707,9 @@
     }
   }
     
+  /** The cached RadioButtonIcon instance. */
+  private static RadioButtonIcon radioButtonIcon;
+
   /**
    * Creates a new instance.  All the methods are static, so creating an 
    * instance isn't necessary.
@@ -613,7 +717,19 @@
   public MetalIconFactory() 
   {   
   }
-  
+
+  /**
+   * Returns an icon for RadioButtons in the Metal L&amp;F.
+   *
+   * @return an icon for RadioButtons in the Metal L&amp;F
+   */
+  public static Icon getRadioButtonIcon()
+  {
+    if (radioButtonIcon == null)
+      radioButtonIcon = new RadioButtonIcon();
+    return radioButtonIcon;
+  }
+
   /**
    * Returns the icon used to display the thumb for a horizontally oriented
    * address@hidden JSlider}.
Index: javax/swing/plaf/metal/MetalLookAndFeel.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java,v
retrieving revision 1.29
diff -u -r1.29 MetalLookAndFeel.java
--- javax/swing/plaf/metal/MetalLookAndFeel.java        13 Jul 2005 21:15:42 
-0000      1.29
+++ javax/swing/plaf/metal/MetalLookAndFeel.java        21 Jul 2005 11:55:22 
-0000
@@ -771,6 +771,9 @@
       "Button.select", new ColorUIResource(getPrimaryControlShadow()),
       "Button.shadow", new ColorUIResource(getPrimaryControlShadow()),
       "CheckBox.background", new ColorUIResource(getControl()),
+      "CheckBox.icon",
+      new UIDefaults.ProxyLazyValue
+      ("javax.swing.plaf.metal.MetalCheckBoxIcon"),
       "CheckBoxMenuItem.background", new ColorUIResource(getControl()),
       "ToolBar.background", new ColorUIResource(getControl()),
       "Panel.background", new ColorUIResource(getControl()),
@@ -789,6 +792,14 @@
       "MenuBar.font", getControlTextFont(),
       "MenuItem.background", new ColorUIResource(getControl()),
       "MenuItem.font", getControlTextFont(),
+      "RadioButton.icon",
+      new UIDefaults.LazyValue()
+      {
+        public Object createValue(UIDefaults def)
+          {
+            return MetalIconFactory.getRadioButtonIcon();
+          }
+      },
       "ScrollBar.background", new ColorUIResource(getControl()),
       "ScrollBar.shadow", new ColorUIResource(getControlShadow()),
       "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()),

reply via email to

[Prev in Thread] Current Thread [Next in Thread]