157 |
*/ |
*/ |
158 |
protected PropertyChangeListener propertyChangeListener; |
protected PropertyChangeListener propertyChangeListener; |
159 |
|
|
160 |
|
/** |
161 |
|
* The button background. |
162 |
|
* @see #installDefaults() |
163 |
|
*/ |
164 |
|
private Color buttonBackground; |
165 |
|
|
166 |
|
/** |
167 |
|
* The button shadow. |
168 |
|
* @see #installDefaults() |
169 |
|
*/ |
170 |
|
private Color buttonShadow; |
171 |
|
|
172 |
/** |
/** |
173 |
* Colors that are used to render selected item in the combo box. |
* The button dark shadow. |
174 |
|
* @see #installDefaults() |
175 |
*/ |
*/ |
176 |
private Color shadow; |
private Color buttonDarkShadow; |
177 |
private Color darkShadow; |
|
178 |
private Color highlight; |
/** |
179 |
|
* The button highlight. |
180 |
|
* @see #installDefaults() |
181 |
|
*/ |
182 |
|
private Color buttonHighlight; |
183 |
|
|
184 |
/* Size of the largest item in the comboBox |
/* Size of the largest item in the comboBox |
185 |
* This is package-private to avoid an accessor method. |
* This is package-private to avoid an accessor method. |
261 |
{ |
{ |
262 |
LookAndFeel.installColorsAndFont(comboBox, "ComboBox.background", |
LookAndFeel.installColorsAndFont(comboBox, "ComboBox.background", |
263 |
"ComboBox.foreground", "ComboBox.font"); |
"ComboBox.foreground", "ComboBox.font"); |
264 |
|
|
265 |
// fetch the button color scheme |
// fetch the button color scheme |
266 |
shadow = UIManager.getColor("ComboBox.buttonShadow"); |
buttonBackground = UIManager.getColor("ComboBox.buttonBackground"); |
267 |
darkShadow = UIManager.getColor("ComboBox.buttonDarkShadow"); |
buttonShadow = UIManager.getColor("ComboBox.buttonShadow"); |
268 |
highlight = UIManager.getColor("ComboBox.buttonHighlight"); |
buttonDarkShadow = UIManager.getColor("ComboBox.buttonDarkShadow"); |
269 |
|
buttonHighlight = UIManager.getColor("ComboBox.buttonHighlight"); |
270 |
} |
} |
271 |
|
|
272 |
/** |
/** |
314 |
if (comboBox.getBackground() instanceof UIResource) |
if (comboBox.getBackground() instanceof UIResource) |
315 |
comboBox.setBackground(null); |
comboBox.setBackground(null); |
316 |
|
|
317 |
shadow = null; |
buttonBackground = null; |
318 |
darkShadow = null; |
buttonShadow = null; |
319 |
highlight = null; |
buttonDarkShadow = null; |
320 |
|
buttonHighlight = null; |
321 |
} |
} |
322 |
|
|
323 |
/** |
/** |
452 |
*/ |
*/ |
453 |
protected ComboBoxEditor createEditor() |
protected ComboBoxEditor createEditor() |
454 |
{ |
{ |
455 |
return new BasicComboBoxEditor(); |
return new BasicComboBoxEditor.UIResource(); |
456 |
} |
} |
457 |
|
|
458 |
/** |
/** |
571 |
*/ |
*/ |
572 |
protected JButton createArrowButton() |
protected JButton createArrowButton() |
573 |
{ |
{ |
574 |
return new BasicArrowButton(BasicArrowButton.SOUTH); |
return new BasicArrowButton(BasicArrowButton.SOUTH, buttonBackground, |
575 |
|
buttonShadow, buttonDarkShadow, buttonHighlight); |
576 |
} |
} |
577 |
|
|
578 |
/** |
/** |
670 |
* |
* |
671 |
* @param c The {@link JComponent} to find the maximum size for |
* @param c The {@link JComponent} to find the maximum size for |
672 |
* |
* |
673 |
* @return The dimensions of the minimum size. |
* @return The maximum size (<code>Dimension(32767, 32767)</code>). |
674 |
*/ |
*/ |
675 |
public Dimension getMaximumSize(JComponent c) |
public Dimension getMaximumSize(JComponent c) |
676 |
{ |
{ |