This patch (committed) moves the color field initialisation from the constructor to the installDefaults() method, fixing some failing Mauve tests:

2005-10-27  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/plaf/metal/MetalToggleButtonUI.java:
        (MetalToggleButtonUI): removed color field initialisation,
        (installDefaults): added color field initialisation formerly in
        the constructor.

Regards,

Dave
Index: javax/swing/plaf/metal/MetalToggleButtonUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java,v
retrieving revision 1.5
diff -u -r1.5 MetalToggleButtonUI.java
--- javax/swing/plaf/metal/MetalToggleButtonUI.java     25 Oct 2005 19:57:04 
-0000      1.5
+++ javax/swing/plaf/metal/MetalToggleButtonUI.java     27 Oct 2005 08:28:22 
-0000
@@ -55,7 +55,7 @@
 import javax.swing.plaf.basic.BasicToggleButtonUI;
 
 /**
- * A UI delegate for [EMAIL PROTECTED] JToggleButton} components.
+ * A UI delegate for the [EMAIL PROTECTED] JToggleButton} component.
  */
 public class MetalToggleButtonUI
   extends BasicToggleButtonUI
@@ -71,11 +71,11 @@
   protected Color disabledTextColor;
 
   /**
-   * Returns an instance of MetalToggleButtonUI.
+   * Returns a new instance of <code>MetalToggleButtonUI</code>.
    *
    * @param component the component for which we return an UI instance
    *
-   * @return an instance of MetalToggleButtonUI
+   * @return A new instance of <code>MetalToggleButtonUI</code>.
    */
   public static ComponentUI createUI(JComponent component)
   {
@@ -83,15 +83,11 @@
   }
 
   /**
-   * Constructs a new instance of MetalToggleButtonUI.
+   * Constructs a new instance of <code>MetalToggleButtonUI</code>.
    */
   public MetalToggleButtonUI()
   {
     super();
-    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-    focusColor = defaults.getColor(getPropertyPrefix() + "focus");
-    selectColor = defaults.getColor(getPropertyPrefix() + "select");
-    disabledTextColor = defaults.getColor(getPropertyPrefix() + 
"disabledText");
   }
 
   /**
@@ -115,9 +111,12 @@
   }
 
   /**
-   * Returns the color for the text label of disabled buttons.
+   * Returns the color for the text label of disabled buttons.  The value 
+   * is initialised in the [EMAIL PROTECTED] #installDefaults(AbstractButton)} 
method
+   * by reading the <code>ToggleButton.disabledText</code> item from the UI 
+   * defaults.
    *
-   * @return the color for the text label of disabled buttons
+   * @return The color for the text label of disabled buttons.
    */
   protected Color getDisabledTextColor()
   {
@@ -131,9 +130,11 @@
    */
   public void installDefaults(AbstractButton b)
   {
-    // FIXME: for now, this override just changes the visibility of the method
-    // in the super-class, to satisfy japi...but there must be something else.
     super.installDefaults(b);
+    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
+    focusColor = defaults.getColor(getPropertyPrefix() + "focus");
+    selectColor = defaults.getColor(getPropertyPrefix() + "select");
+    disabledTextColor = defaults.getColor(getPropertyPrefix() + 
"disabledText");
   }
   
   /**
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to