public class SynthXListUI extends BasicXListUI implements SynthConstants, SynthUI
BasicXListUI.FocusHandler, BasicXListUI.ListDataHandler, BasicXListUI.ListSelectionHandler, BasicXListUI.MouseInputHandler, BasicXListUI.PropertyChangeHandler
Modifier and Type | Field and Description |
---|---|
private SynthStyle |
style |
private boolean |
useListColors |
private boolean |
useUIBorder |
cellHeight, cellHeights, cellRendererChanged, cellWidth, fixedCellHeightChanged, fixedCellWidthChanged, focusListener, fontChanged, list, listDataListener, listSelectionListener, modelChanged, mouseInputListener, propertyChangeListener, prototypeCellValueChanged, rendererPane, selectionModelChanged, updateLayoutStateNeeded
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
Constructor and Description |
---|
SynthXListUI() |
Modifier and Type | Method and Description |
---|---|
protected PropertyChangeListener |
createPropertyChangeListener()
Creates an instance of PropertyChangeHandler that's added to
the JList by installUI().
|
static ComponentUI |
createUI(JComponent list)
Returns a new instance of SynthXListUI.
|
private int |
getComponentState()
Returns the current component state for the controlled list.
|
private SynthContext |
getContext()
Returns the context based on current state.
|
private SynthContext |
getContext(int state)
Returns a Context with the given component state.
|
SynthContext |
getContext(JComponent c)
Returns a context for the component's current state.
|
private Region |
getRegion() |
private SynthStyle |
getStyle()
Returns the style for this component from the style factory.
|
protected void |
installDefaults()
Initialize JList properties, e.g. font, foreground, and background,
and add the CellRendererPane.
|
protected void |
installSynthBorder()
Installs a SynthBorder from the current style, if ui-installable.
|
void |
paintBorder(SynthContext context,
Graphics g,
int x,
int y,
int w,
int h)
Paints border with the context's style's painter.
|
protected void |
uninstallDefaults()
Set the JList properties that haven't been explicitly overridden to
null.
|
void |
update(Graphics g,
JComponent c)
Overridden to fill background, Synth-style.
|
private void |
updateStyle() |
convertRowToY, convertYToRow, createFocusListener, createListDataListener, createListSelectionListener, createMouseInputListener, getBaseline, getBaselineResizeBehavior, getCellBounds, getElementAt, getElementCount, getPreferredSize, getRowHeight, getSortUI, getViewModel, indexToLocation, installKeyboardActions, installListeners, installSortUI, installUI, invalidateCellSizeCache, loadActionMap, locationToIndex, maybeUpdateLayoutState, paint, paintCell, processedBySortUI, processedBySortUI, selectNextIndex, selectPreviousIndex, uninstallKeyboardActions, uninstallListeners, uninstallSortUI, uninstallUI, updateLayoutState, updateSortUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize
private SynthStyle style
private boolean useListColors
private boolean useUIBorder
public SynthXListUI()
public static ComponentUI createUI(JComponent list)
public void update(Graphics g, JComponent c)
Overridden to fill background, Synth-style.
update
in class ComponentUI
protected PropertyChangeListener createPropertyChangeListener()
class MyListUI extends BasicXListUI { protected PropertyChangeListener createPropertyChangeListener() { return new MyPropertyChangeListener(); } public class MyPropertyChangeListener extends PropertyChangeHandler { public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { // do some extra work when the model changes } super.propertyChange(e); } } }
Overridden to update style if appropriate.
createPropertyChangeListener
in class BasicXListUI
PropertyChangeListener
,
BasicXListUI.installUI(javax.swing.JComponent)
protected void installDefaults()
Overridden to install properties, Synth-style.
installDefaults
in class BasicXListUI
BasicXListUI.uninstallDefaults()
,
BasicXListUI.installUI(javax.swing.JComponent)
,
CellRendererPane
private void updateStyle()
protected void installSynthBorder()
context
- the contextprotected void uninstallDefaults()
Overridden to uninstall properties, Synth-style, after calling super.
uninstallDefaults
in class BasicXListUI
BasicXListUI.installDefaults()
,
BasicXListUI.uninstallUI(javax.swing.JComponent)
,
CellRendererPane
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
paintBorder
in interface SynthUI
public SynthContext getContext(JComponent c)
Returns a context for the component's current state. Implemented for SynthUI interface.
PENDING JW: not entirely sure if allowed ... but need to replace SynthUI anyway?.
getContext
in interface SynthUI
IllegalArgumentException
- if the component is not controlled by this
delegateprivate SynthContext getContext()
private int getComponentState()
private SynthContext getContext(int state)
state
- private SynthStyle getStyle()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses