Class SynthXListUI

  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ListUI
          extended by javax.swing.plaf.basic.BasicListUI
              extended by org.jdesktop.swingx.plaf.basic.core.BasicXListUI
                  extended by org.jdesktop.swingx.plaf.synth.SynthXListUI
All Implemented Interfaces:
SynthConstants, SynthUI

public class SynthXListUI
extends BasicXListUI
implements SynthConstants, SynthUI

TODO add type doc

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
Fields inherited from interface javax.swing.plaf.synth.SynthConstants
Constructor Summary
Method Summary
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.
 SynthContext getContext(JComponent c)
protected  void installDefaults()
          Initialize JList properties, e.g.
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)
          Notifies this UI delegate that it's time to paint the specified component.
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, loadActionMap, locationToIndex, maybeUpdateLayoutState, paint, paintCell, processedBySortUI, processedBySortUI, selectNextIndex, selectPreviousIndex, uninstallKeyboardActions, uninstallListeners, uninstallSortUI, uninstallUI, updateLayoutState, updateSortUI
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SynthXListUI()
Method Detail


public static ComponentUI createUI(JComponent list)
Returns a new instance of SynthXListUI. SynthXListUI delegates are allocated one per JList.

A new ListUI implementation for the Synth look and feel.


public void update(Graphics g,
                   JComponent c)
Notifies this UI delegate that it's time to paint the specified component. This method is invoked by JComponent when the specified component is being painted. By default this method will fill the specified component with its background color (if its opaque property is true) and then immediately call paint. In general this method need not be overridden by subclasses; all look-and-feel rendering code should reside in the paint method.

Overridden to fill background, Synth-style.

update in class ComponentUI
g - the Graphics context in which to paint
c - the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent), JComponent.paintComponent(java.awt.Graphics)


protected 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

Overridden to update style if appropriate.

createPropertyChangeListener in class BasicXListUI
See Also:
PropertyChangeListener, BasicXListUI.installUI(javax.swing.JComponent)


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.

installDefaults in class BasicXListUI
See Also:
BasicXListUI.uninstallDefaults(), BasicXListUI.installUI(javax.swing.JComponent), CellRendererPane


protected void installSynthBorder()
Installs a SynthBorder from the current style, if ui-installable.

context - the context


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.

uninstallDefaults in class BasicXListUI
See Also:
BasicXListUI.installDefaults(), BasicXListUI.uninstallUI(javax.swing.JComponent), CellRendererPane


public void paintBorder(SynthContext context,
                        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:
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?.

Specified by:
getContext in interface SynthUI
IllegalArgumentException - if the component is not controlled by this delegate