Package org.pushingpixels.substance.internal.ui

# Class SubstanceListUI

java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ListUI
javax.swing.plaf.basic.BasicListUI
org.pushingpixels.substance.internal.ui.SubstanceListUI

All Implemented Interfaces:
  `UpdateOptimizationAware`

public class SubstanceListUI extends BasicListUI implements UpdateOptimizationAware
UI for lists in Substance look and feel.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`SubstanceListUI.CellRepaintCallback`
Repaints a single cell during the fade animation cycle.

## Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicListUI

`BasicListUI.FocusHandler, BasicListUI.ListDataHandler, BasicListUI.ListSelectionHandler, BasicListUI.MouseInputHandler, BasicListUI.PropertyChangeHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected int`
`rolledOverIndex`
Holds the currently rolled-over index, or -1 is there is none such.
`protected Map<Integer,Object>`
`selectedIndices`
Holds the list of currently selected indices.
`protected org.pushingpixels.substance.internal.ui.SubstanceListUI.RolloverFadeListener`
`substanceFadeRolloverListener`
Listener for transition animations on list rollovers.
`protected ListSelectionListener`
`substanceListSelectionListener`
Listener for transition animations on list selections.
`protected PropertyChangeListener`
`substancePropertyChangeListener`
Property listener that listens to the `SubstanceLookAndFeel.WATERMARK_VISIBLE` property.

### Fields inherited from class javax.swing.plaf.basic.BasicListUI

`cellHeight, cellHeights, cellRendererChanged, cellWidth, fixedCellHeightChanged, fixedCellWidthChanged, focusListener, fontChanged, list, listDataListener, listSelectionListener, modelChanged, mouseInputListener, propertyChangeListener, prototypeCellValueChanged, rendererPane, selectionModelChanged, updateLayoutStateNeeded`

## Constructor Summary

Constructors
Constructor
Description
`SubstanceListUI()`
Creates a UI delegate for list.

## Method Summary

Modifier and Type
Method
Description
`static ComponentUI`
`createUI(JComponent comp)`
`ComponentState`
`getCellState(int cellIndex, Component rendererComponent)`
Returns the current state for the specified cell.
`StateTransitionTracker.ModelStateInfo`
`getModelStateInfo(int row, Component rendererComponent)`
`StateTransitionTracker`
`getStateTransitionTracker(int row)`
`UpdateOptimizationInfo`
`getUpdateOptimizationInfo()`
`protected void`
`installDefaults()`
`protected void`
`installListeners()`
`protected void`
`paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)`
`void`
`resetRolloverIndex()`
Resets the rollover index.
`protected void`
`uninstallDefaults()`
`protected void`
`uninstallListeners()`
`void`
`uninstallUI(JComponent c)`
`void`
`update(Graphics g, JComponent c)`

### Methods inherited from class javax.swing.plaf.basic.BasicListUI

`convertRowToY, convertYToRow, createFocusListener, createListDataListener, createListSelectionListener, createMouseInputListener, createPropertyChangeListener, getBaseline, getBaselineResizeBehavior, getCellBounds, getPreferredSize, getRowHeight, indexToLocation, installKeyboardActions, installUI, locationToIndex, maybeUpdateLayoutState, paint, selectNextIndex, selectPreviousIndex, uninstallKeyboardActions, updateLayoutState`

### 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`

## Field Details

### selectedIndices

protected Map<Integer,Object> selectedIndices
Holds the list of currently selected indices.

### rolledOverIndex

protected int rolledOverIndex
Holds the currently rolled-over index, or -1 is there is none such.

### substancePropertyChangeListener

protected PropertyChangeListener substancePropertyChangeListener
Property listener that listens to the `SubstanceLookAndFeel.WATERMARK_VISIBLE` property.

### substanceListSelectionListener

protected ListSelectionListener substanceListSelectionListener
Listener for transition animations on list selections.

### substanceFadeRolloverListener

protected org.pushingpixels.substance.internal.ui.SubstanceListUI.RolloverFadeListener substanceFadeRolloverListener
Listener for transition animations on list rollovers.

## Constructor Details

### SubstanceListUI

public SubstanceListUI()
Creates a UI delegate for list.

## Method Details

### createUI

public static ComponentUI createUI(JComponent comp)

### installDefaults

protected void installDefaults()

Overrides:
  `installDefaults` in class `BasicListUI`

### uninstallDefaults

protected void uninstallDefaults()

Overrides:
  `uninstallDefaults` in class `BasicListUI`

### uninstallUI

public void uninstallUI(JComponent c)

Overrides:
  `uninstallUI` in class `BasicListUI`

### installListeners

protected void installListeners()

Overrides:
  `installListeners` in class `BasicListUI`

### uninstallListeners

protected void uninstallListeners()

Overrides:
  `uninstallListeners` in class `BasicListUI`

### paintCell

protected void paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)

Overrides:
  `paintCell` in class `BasicListUI`

### getStateTransitionTracker

public StateTransitionTracker getStateTransitionTracker(int row)

### getCellState

public ComponentState getCellState(int cellIndex, Component rendererComponent)
Returns the current state for the specified cell.

Parameters:
  `cellIndex` - Cell index.
  `rendererComponent` - Renderer component for the specified cell index.
Returns:
  The current state for the specified cell.

### getModelStateInfo

public StateTransitionTracker.ModelStateInfo getModelStateInfo(int row, Component rendererComponent)

### resetRolloverIndex

public void resetRolloverIndex()
Resets the rollover index.

### update

public void update(Graphics g, JComponent c)

Overrides:
  `update` in class `ComponentUI`

### getUpdateOptimizationInfo

public UpdateOptimizationInfo getUpdateOptimizationInfo()

Specified by:
  `getUpdateOptimizationInfo` in interface `UpdateOptimizationAware`