classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] FYI: BasicComboBoxUI


From: Lillian Angel
Subject: Re: [cp-patches] FYI: BasicComboBoxUI
Date: Wed, 28 Sep 2005 10:04:15 -0400

Committed.

2005-09-28  Lillian Angel  <address@hidden>

        * javax/swing/plaf/basic/BasicComboBoxUI.java
        (installDefaults): Fixed checks for setting defaults.
        Should check if default is null also.


On Tue, 2005-09-13 at 22:11 +0000, David Gilbert wrote:
> I committed this patch:
> 
> 2005-09-13  David Gilbert  <address@hidden>
> 
>       * javax/swing/plaf/basic/BasicComboBoxUI.java
>       (lightHighlight): removed,
>       (installDefaults): only update component attributes if they are tagged
>       with UIResource, initialise button colors from correct defaults,
>       (uninstallDefaults): only clear attributes that are tagged with
>       UIResource.
> 
> Regards,
> 
> Dave Gilbert
> plain text document attachment (diff.txt)
> Index: javax/swing/plaf/basic/BasicComboBoxUI.java
> ===================================================================
> RCS file: 
> /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java,v
> retrieving revision 1.10
> diff -u -r1.10 BasicComboBoxUI.java
> --- javax/swing/plaf/basic/BasicComboBoxUI.java       9 Sep 2005 04:17:15 
> -0000       1.10
> +++ javax/swing/plaf/basic/BasicComboBoxUI.java       13 Sep 2005 20:56:49 
> -0000
> @@ -75,6 +75,7 @@
>  import javax.swing.event.ListDataListener;
>  import javax.swing.plaf.ComboBoxUI;
>  import javax.swing.plaf.ComponentUI;
> +import javax.swing.plaf.UIResource;
>  
>  /**
>   * UI Delegate for JComboBox
> @@ -158,7 +159,6 @@
>    private Color shadow;
>    private Color darkShadow;
>    private Color highlight;
> -  private Color lightHighlight;
>  
>    /* Size of the largest item in the comboBox
>     * This is package-private to avoid an accessor method.
> @@ -245,16 +245,19 @@
>    {
>      UIDefaults defaults = UIManager.getLookAndFeelDefaults();
>  
> -    comboBox.setBackground(defaults.getColor("ComboBox.background"));
> -    comboBox.setFont(defaults.getFont("ComboBox.font"));
> -    comboBox.setForeground(defaults.getColor("ComboBox.foreground"));
> -
> -    // Set default color that should be used to to render selected item
> -    // of the combo box.
> -    shadow = defaults.getColor("Button.shadow");
> -    darkShadow = defaults.getColor("Button.darkShadow");
> -    lightHighlight = defaults.getColor("Button.light");
> -    highlight = defaults.getColor("Button.highlight");
> +    if (comboBox.getFont() instanceof UIResource)
> +      comboBox.setFont(defaults.getFont("ComboBox.font"));
> +    
> +    if (comboBox.getForeground() instanceof UIResource)
> +      comboBox.setForeground(defaults.getColor("ComboBox.foreground"));
> +
> +    if (comboBox.getBackground() instanceof UIResource)
> +      comboBox.setBackground(defaults.getColor("ComboBox.background"));
> +
> +    // fetch the button color scheme
> +    shadow = defaults.getColor("ComboBox.buttonShadow");
> +    darkShadow = defaults.getColor("ComboBox.buttonDarkShadow");
> +    highlight = defaults.getColor("ComboBox.buttonHighlight");
>    }
>  
>    /**
> @@ -291,15 +294,17 @@
>     */
>    protected void uninstallDefaults()
>    {
> -    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
> +    if (comboBox.getFont() instanceof UIResource)
> +      comboBox.setFont(null);
>  
> -    comboBox.setBackground(null);
> -    comboBox.setFont(null);
> -    comboBox.setForeground(null);
> +    if (comboBox.getForeground() instanceof UIResource)
> +      comboBox.setForeground(null);
> +    
> +    if (comboBox.getBackground() instanceof UIResource)
> +      comboBox.setBackground(null);
>  
>      shadow = null;
>      darkShadow = null;
> -    lightHighlight = null;
>      highlight = null;
>    }
>  
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches

Attachment: patch.diff
Description: Text Data


reply via email to

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