Methods Summary |
---|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent list)
return new SynthListUI();
|
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()
if (list.getCellRenderer() == null ||
(list.getCellRenderer() instanceof UIResource)) {
list.setCellRenderer(new SynthListCellRenderer());
}
updateStyle(list);
|
protected void | installListeners()
super.installListeners();
list.addPropertyChangeListener(this);
|
public void | paintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)
context.getPainter().paintListBorder(context, g, x, y, w, h);
|
public void | propertyChange(java.beans.PropertyChangeEvent e)
if (SynthLookAndFeel.shouldUpdateStyle(e)) {
updateStyle((JList)e.getSource());
}
|
protected void | uninstallDefaults()
super.uninstallDefaults();
SynthContext context = getContext(list, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
|
protected void | uninstallListeners()
super.uninstallListeners();
list.removePropertyChangeListener(this);
|
public void | update(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintListBackground(context,
g, 0, 0, c.getWidth(), c.getHeight());
context.dispose();
paint(g, c);
|
private void | updateStyle(javax.swing.JComponent c)
SynthContext context = getContext(list, ENABLED);
SynthStyle oldStyle = style;
style = SynthLookAndFeel.updateStyle(context, this);
if (style != oldStyle) {
context.setComponentState(SELECTED);
Color sbg = list.getSelectionBackground();
if (sbg == null || sbg instanceof UIResource) {
list.setSelectionBackground(style.getColor(
context, ColorType.TEXT_BACKGROUND));
}
Color sfg = list.getSelectionForeground();
if (sfg == null || sfg instanceof UIResource) {
list.setSelectionForeground(style.getColor(
context, ColorType.TEXT_FOREGROUND));
}
useListColors = style.getBoolean(context,
"List.rendererUseListColors", true);
useUIBorder = style.getBoolean(context,
"List.rendererUseUIBorder", true);
int height = style.getInt(context, "List.cellHeight", -1);
if (height != -1) {
list.setFixedCellHeight(height);
}
if (oldStyle != null) {
uninstallKeyboardActions();
installKeyboardActions();
}
}
context.dispose();
|