Package org.jdesktop.swingx.plaf.synth
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:
javax.swing.plaf.synth.SynthConstants,SynthUI
public class SynthXListUI extends BasicXListUI implements javax.swing.plaf.synth.SynthConstants, SynthUI
TODO add type doc- Author:
- Jeanette Winzenburg
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jdesktop.swingx.plaf.basic.core.BasicXListUI
BasicXListUI.FocusHandler, BasicXListUI.ListDataHandler, BasicXListUI.ListSelectionHandler, BasicXListUI.MouseInputHandler, BasicXListUI.PropertyChangeHandler
-
-
Field Summary
-
Fields inherited from class org.jdesktop.swingx.plaf.basic.core.BasicXListUI
cellHeight, cellHeights, cellRendererChanged, cellWidth, fixedCellHeightChanged, fixedCellWidthChanged, focusListener, fontChanged, list, listDataListener, listSelectionListener, modelChanged, mouseInputListener, propertyChangeListener, prototypeCellValueChanged, rendererPane, selectionModelChanged, updateLayoutStateNeeded
-
-
Constructor Summary
Constructors Constructor Description SynthXListUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.beans.PropertyChangeListenercreatePropertyChangeListener()Creates an instance of PropertyChangeHandler that's added to the JList by installUI().static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent list)Returns a new instance of SynthXListUI.javax.swing.plaf.synth.SynthContextgetContext(javax.swing.JComponent c)protected voidinstallDefaults()Initialize JList properties, e.g.protected voidinstallSynthBorder()Installs a SynthBorder from the current style, if ui-installable.voidpaintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints border with the context's style's painter.protected voiduninstallDefaults()Set the JList properties that haven't been explicitly overridden to null.voidupdate(java.awt.Graphics g, javax.swing.JComponent c)-
Methods inherited from class org.jdesktop.swingx.plaf.basic.core.BasicXListUI
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
-
-
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent list)
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
public void update(java.awt.Graphics g, javax.swing.JComponent c)Overridden to fill background, Synth-style.
- Overrides:
updatein classjavax.swing.plaf.ComponentUI
-
createPropertyChangeListener
protected java.beans.PropertyChangeListener 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:
PropertyChangeListener,BasicXListUI.installUI(javax.swing.JComponent)
-
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:
BasicXListUI.uninstallDefaults(),BasicXListUI.installUI(javax.swing.JComponent),CellRendererPane
-
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:
BasicXListUI.installDefaults(),BasicXListUI.uninstallUI(javax.swing.JComponent),CellRendererPane
-
paintBorder
public void paintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)Paints border with the context's style's painter. Implemented for SynthUI interface.- Specified by:
paintBorderin interfaceSynthUI
-
getContext
public javax.swing.plaf.synth.SynthContext getContext(javax.swing.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?.
- Specified by:
getContextin interfaceSynthUI- Throws:
java.lang.IllegalArgumentException- if the component is not controlled by this delegate
-
-