org.jvnet.substance
Class SubstanceListUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ListUI
          extended by javax.swing.plaf.basic.BasicListUI
              extended by org.jvnet.substance.SubstanceListUI

public class SubstanceListUI
extends javax.swing.plaf.basic.BasicListUI

UI for lists in Substance look and feel.

Author:
Kirill Grouchnikov

Nested Class Summary
protected  class SubstanceListUI.CellRepaintCallback
          Repaints a single cell during the fade animation cycle.
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicListUI
javax.swing.plaf.basic.BasicListUI.FocusHandler, javax.swing.plaf.basic.BasicListUI.ListDataHandler, javax.swing.plaf.basic.BasicListUI.ListSelectionHandler, javax.swing.plaf.basic.BasicListUI.MouseInputHandler, javax.swing.plaf.basic.BasicListUI.PropertyChangeHandler
 
Field Summary
protected  boolean isFileList
          Local cache of JList's client property "List.isFileList"
protected  boolean isLeftToRight
          Local cache of JList's component orientation property
protected  int rolledOverIndex
          Holds the currently rolled-over index, or -1 is there is none such.
protected  java.util.Map<java.lang.Integer,java.lang.Object> selectedIndices
          Holds the list of currently selected indices.
protected  org.jvnet.substance.SubstanceListUI.RolloverFadeListener substanceFadeRolloverListener
          Listener for fade animations on list rollovers.
protected  javax.swing.event.ListSelectionListener substanceFadeSelectionListener
          Listener for fade animations on list selections.
protected  java.beans.PropertyChangeListener substancePropertyChangeListener
          Property listener that listens to the SubstanceLookAndFeel.WATERMARK_TO_BLEED 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
SubstanceListUI()
          Creates a UI delegate for list.
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent list)
           
 ComponentState getCellState(int cellIndex)
          Returns the current state for the specified cell.
 ComponentState getPrevCellState(int cellIndex)
          Returns the previous state for the specified cell.
protected  void installDefaults()
           
protected  void installListeners()
           
protected  void paintCell(java.awt.Graphics g, int row, java.awt.Rectangle rowBounds, javax.swing.ListCellRenderer cellRenderer, javax.swing.ListModel dataModel, javax.swing.ListSelectionModel selModel, int leadIndex)
           
 void resetRolloverIndex()
          Resets the rollover index.
protected  void uninstallDefaults()
           
protected  void uninstallListeners()
           
 
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, uninstallUI, updateLayoutState
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectedIndices

protected java.util.Map<java.lang.Integer,java.lang.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 java.beans.PropertyChangeListener substancePropertyChangeListener
Property listener that listens to the SubstanceLookAndFeel.WATERMARK_TO_BLEED property.


isFileList

protected boolean isFileList
Local cache of JList's client property "List.isFileList"


isLeftToRight

protected boolean isLeftToRight
Local cache of JList's component orientation property


substanceFadeSelectionListener

protected javax.swing.event.ListSelectionListener substanceFadeSelectionListener
Listener for fade animations on list selections.


substanceFadeRolloverListener

protected org.jvnet.substance.SubstanceListUI.RolloverFadeListener substanceFadeRolloverListener
Listener for fade animations on list rollovers.

Constructor Detail

SubstanceListUI

public SubstanceListUI()
Creates a UI delegate for list.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent list)

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicListUI

uninstallDefaults

protected void uninstallDefaults()
Overrides:
uninstallDefaults in class javax.swing.plaf.basic.BasicListUI

installListeners

protected void installListeners()
Overrides:
installListeners in class javax.swing.plaf.basic.BasicListUI

uninstallListeners

protected void uninstallListeners()
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicListUI

paintCell

protected void paintCell(java.awt.Graphics g,
                         int row,
                         java.awt.Rectangle rowBounds,
                         javax.swing.ListCellRenderer cellRenderer,
                         javax.swing.ListModel dataModel,
                         javax.swing.ListSelectionModel selModel,
                         int leadIndex)
Overrides:
paintCell in class javax.swing.plaf.basic.BasicListUI

getPrevCellState

public ComponentState getPrevCellState(int cellIndex)
Returns the previous state for the specified cell.

Parameters:
cellIndex - Cell index.
Returns:
The previous state for the specified cell.

getCellState

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

Parameters:
cellIndex - Cell index.
Returns:
The current state for the specified cell.

resetRolloverIndex

public void resetRolloverIndex()
Resets the rollover index.