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

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

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

revision 1.10 by fitzsim, Fri Sep 9 04:17:15 2005 UTC revision 1.11 by trebligd, Tue Sep 13 21:10:50 2005 UTC
# Line 75  import javax.swing.event.ListDataEvent; Line 75  import javax.swing.event.ListDataEvent;
75  import javax.swing.event.ListDataListener;  import javax.swing.event.ListDataListener;
76  import javax.swing.plaf.ComboBoxUI;  import javax.swing.plaf.ComboBoxUI;
77  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
78    import javax.swing.plaf.UIResource;
79    
80  /**  /**
81   * UI Delegate for JComboBox   * UI Delegate for JComboBox
# Line 158  public class BasicComboBoxUI extends Com Line 159  public class BasicComboBoxUI extends Com
159    private Color shadow;    private Color shadow;
160    private Color darkShadow;    private Color darkShadow;
161    private Color highlight;    private Color highlight;
   private Color lightHighlight;  
162    
163    /* Size of the largest item in the comboBox    /* Size of the largest item in the comboBox
164     * This is package-private to avoid an accessor method.     * This is package-private to avoid an accessor method.
# Line 245  public class BasicComboBoxUI extends Com Line 245  public class BasicComboBoxUI extends Com
245    {    {
246      UIDefaults defaults = UIManager.getLookAndFeelDefaults();      UIDefaults defaults = UIManager.getLookAndFeelDefaults();
247    
248      comboBox.setBackground(defaults.getColor("ComboBox.background"));      if (comboBox.getFont() instanceof UIResource)
249      comboBox.setFont(defaults.getFont("ComboBox.font"));        comboBox.setFont(defaults.getFont("ComboBox.font"));
250      comboBox.setForeground(defaults.getColor("ComboBox.foreground"));      
251        if (comboBox.getForeground() instanceof UIResource)
252      // Set default color that should be used to to render selected item        comboBox.setForeground(defaults.getColor("ComboBox.foreground"));
253      // of the combo box.  
254      shadow = defaults.getColor("Button.shadow");      if (comboBox.getBackground() instanceof UIResource)
255      darkShadow = defaults.getColor("Button.darkShadow");        comboBox.setBackground(defaults.getColor("ComboBox.background"));
256      lightHighlight = defaults.getColor("Button.light");  
257      highlight = defaults.getColor("Button.highlight");      // fetch the button color scheme
258        shadow = defaults.getColor("ComboBox.buttonShadow");
259        darkShadow = defaults.getColor("ComboBox.buttonDarkShadow");
260        highlight = defaults.getColor("ComboBox.buttonHighlight");
261    }    }
262    
263    /**    /**
# Line 291  public class BasicComboBoxUI extends Com Line 294  public class BasicComboBoxUI extends Com
294     */     */
295    protected void uninstallDefaults()    protected void uninstallDefaults()
296    {    {
297      UIDefaults defaults = UIManager.getLookAndFeelDefaults();      if (comboBox.getFont() instanceof UIResource)
298          comboBox.setFont(null);
299    
300      comboBox.setBackground(null);      if (comboBox.getForeground() instanceof UIResource)
301      comboBox.setFont(null);        comboBox.setForeground(null);
302      comboBox.setForeground(null);      
303        if (comboBox.getBackground() instanceof UIResource)
304          comboBox.setBackground(null);
305    
306      shadow = null;      shadow = null;
307      darkShadow = null;      darkShadow = null;
     lightHighlight = null;  
308      highlight = null;      highlight = null;
309    }    }
310    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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