Methods Summary |
---|
protected javax.swing.JButton | createArrowButton()
SynthArrowButton button = new SynthArrowButton(SwingConstants.SOUTH);
button.setName("ComboBox.arrowButton");
return button;
|
protected javax.swing.ComboBoxEditor | createEditor()
return new SynthComboBoxEditor();
|
protected javax.swing.plaf.basic.ComboPopup | createPopup()
SynthComboPopup popup = new SynthComboPopup( comboBox );
return popup;
|
protected javax.swing.ListCellRenderer | createRenderer()
return new SynthComboBoxRenderer();
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent c)
return new SynthComboBoxUI();
|
private int | getComponentState(javax.swing.JComponent c)
return SynthLookAndFeel.getComponentState(c);
|
public javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c)
return getContext(c, getComponentState(c));
|
private javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c, int state)
return SynthContext.getContext(SynthContext.class, c,
SynthLookAndFeel.getRegion(c), style, state);
|
private javax.swing.plaf.synth.Region | getRegion(javax.swing.JComponent c)
return SynthLookAndFeel.getRegion(c);
|
protected void | installDefaults()
updateStyle(comboBox);
|
protected void | installListeners()
comboBox.addPropertyChangeListener(this);
super.installListeners();
|
public void | paint(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
paint(context, g);
context.dispose();
|
protected void | paint(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)
hasFocus = comboBox.hasFocus();
if ( !comboBox.isEditable() ) {
Rectangle r = rectangleForCurrentValue();
paintCurrentValue(g,r,hasFocus);
}
|
public void | paintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)
context.getPainter().paintComboBoxBorder(context, g, x, y, w, h);
|
public void | paintCurrentValue(java.awt.Graphics g, java.awt.Rectangle bounds, boolean hasFocus)Paints the currently selected item.
ListCellRenderer renderer = comboBox.getRenderer();
Component c;
if ( hasFocus && !isPopupVisible(comboBox) ) {
c = renderer.getListCellRendererComponent( listBox,
comboBox.getSelectedItem(),
-1,
false,
false );
}
else {
c = renderer.getListCellRendererComponent( listBox,
comboBox.getSelectedItem(),
-1,
false,
false );
}
// Fix for 4238829: should lay out the JPanel.
boolean shouldValidate = false;
if (c instanceof JPanel) {
shouldValidate = true;
}
if (c instanceof UIResource) {
c.setName("ComboBox.renderer");
currentValuePane.paintComponent(g,c,comboBox,bounds.x,bounds.y,
bounds.width,bounds.height, shouldValidate);
}
else {
currentValuePane.paintComponent(g,c,comboBox,bounds.x,bounds.y,
bounds.width,bounds.height, shouldValidate);
}
|
public void | propertyChange(java.beans.PropertyChangeEvent e)
if (SynthLookAndFeel.shouldUpdateStyle(e)) {
updateStyle(comboBox);
}
|
protected void | uninstallDefaults()
SynthContext context = getContext(comboBox, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
|
protected void | uninstallListeners()
comboBox.removePropertyChangeListener(this);
super.uninstallListeners();
|
public void | update(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintComboBoxBackground(context, g, 0, 0,
c.getWidth(), c.getHeight());
paint(context, g);
context.dispose();
|
private void | updateStyle(javax.swing.JComboBox comboBox)
SynthStyle oldStyle = style;
SynthContext context = getContext(comboBox, ENABLED);
style = SynthLookAndFeel.updateStyle(context, this);
if (style != oldStyle) {
useListColors = style.getBoolean(context,
"ComboBox.rendererUseListColors", true);
if (oldStyle != null) {
uninstallKeyboardActions();
installKeyboardActions();
}
}
context.dispose();
|