Class SynthXListUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ListUI
javax.swing.plaf.basic.BasicListUI
org.jdesktop.swingx.plaf.basic.core.BasicXListUI
org.jdesktop.swingx.plaf.synth.SynthXListUI
- All Implemented Interfaces:
SynthConstants, SynthUI
TODO add type doc
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicXListUI
BasicXListUI.FocusHandler, BasicXListUI.ListDataHandler, BasicXListUI.ListSelectionHandler, BasicXListUI.MouseInputHandler, BasicXListUI.PropertyChangeHandler -
Field Summary
FieldsFields inherited from class BasicXListUI
cellHeight, cellHeights, cellRendererChanged, cellWidth, fixedCellHeightChanged, fixedCellWidthChanged, focusListener, fontChanged, list, listDataListener, listSelectionListener, modelChanged, mouseInputListener, propertyChangeListener, prototypeCellValueChanged, rendererPane, selectionModelChanged, updateLayoutStateNeededFields inherited from interface SynthConstants
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertyChangeListenerCreates an instance of PropertyChangeHandler that's added to the JList by installUI().static ComponentUIcreateUI(JComponent list) Returns a new instance of SynthXListUI.private intReturns the current component state for the controlled list.private SynthContextReturns the context based on current state.private SynthContextgetContext(int state) Returns a Context with the given component state.private Regionprivate SynthStylegetStyle()Returns the style for this component from the style factory.protected voidInitialize JList properties, e.g.protected voidInstalls a SynthBorder from the current style, if ui-installable.voidpaintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) Paints border with the context's style's painter.protected voidSet the JList properties that haven't been explicitly overridden to null.voidupdate(Graphics g, JComponent c) private voidMethods inherited from class BasicXListUI
checkBaselinePrecondition, 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, updateSortUIMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize
-
Field Details
-
style
-
useListColors
private boolean useListColors -
useUIBorder
private boolean useUIBorder
-
-
Constructor Details
-
SynthXListUI
public SynthXListUI()
-
-
Method Details
-
createUI
Returns a new instance of SynthXListUI. SynthXListUI delegates are allocated one per JList.- Returns:
- A new ListUI implementation for the Synth look and feel.
-
update
Overridden to fill background, Synth-style.
- Overrides:
updatein classComponentUI
-
createPropertyChangeListener
Creates an instance of PropertyChangeHandler that's added to the JList by installUI(). Subclasses can override this method to return a custom PropertyChangeListener, e.g.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.
- Overrides:
createPropertyChangeListenerin classBasicXListUI- See Also:
-
installDefaults
protected void installDefaults()Initialize JList properties, e.g. font, foreground, and background, and add the CellRendererPane. The font, foreground, and background properties are only set if their current value is either null or a UIResource, other properties are set if the current value is null.Overridden to install properties, Synth-style.
- Overrides:
installDefaultsin classBasicXListUI- See Also:
-
updateStyle
private void updateStyle() -
installSynthBorder
protected void installSynthBorder()Installs a SynthBorder from the current style, if ui-installable.- Parameters:
context- the context
-
uninstallDefaults
protected void uninstallDefaults()Set the JList properties that haven't been explicitly overridden to null. A property is considered overridden if its current value is not a UIResource.Overridden to uninstall properties, Synth-style, after calling super.
- Overrides:
uninstallDefaultsin classBasicXListUI- See Also:
-
paintBorder
Paints border with the context's style's painter. Implemented for SynthUI interface.- Specified by:
paintBorderin interfaceSynthUI
-
getContext
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?.
- Specified by:
getContextin interfaceSynthUI- Throws:
IllegalArgumentException- if the component is not controlled by this delegate
-
getContext
-
getComponentState
private int getComponentState()Returns the current component state for the controlled list.- Returns:
-
getContext
Returns a Context with the given component state.- Parameters:
state-- Returns:
-
getRegion
-
getStyle
-