|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.TableUI
javax.swing.plaf.basic.BasicTableUI
org.pushingpixels.substance.internal.ui.SubstanceTableUI
public class SubstanceTableUI
UI for tables in Substance look and feel. Unfortunately, the entire
painting stack has been copied from BasicTableUI
since the methods
are private. The animation effects are implemented in the
BasicTableUI.paintCell(Graphics, Rectangle, int, int)
.
Nested Class Summary | |
---|---|
protected class |
SubstanceTableUI.CellRepaintCallback
Repaints a single cell during the fade animation cycle. |
protected class |
SubstanceTableUI.ColumnRepaintCallback
Repaints a single column during the fade animation cycle. |
protected class |
SubstanceTableUI.RowRepaintCallback
Repaints a single row during the fade animation cycle. |
static class |
SubstanceTableUI.TableCellId
ID of a single table cell. |
protected class |
SubstanceTableUI.TableStateListener
State listener for tracking the selection changes. |
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTableUI |
---|
javax.swing.plaf.basic.BasicTableUI.FocusHandler, javax.swing.plaf.basic.BasicTableUI.KeyHandler, javax.swing.plaf.basic.BasicTableUI.MouseInputHandler |
Field Summary | |
---|---|
protected java.util.Map<java.lang.Class<?>,javax.swing.table.TableCellEditor> |
defaultEditors
Map of default editors. |
protected java.util.Map<java.lang.Class<?>,javax.swing.table.TableCellRenderer> |
defaultRenderers
Map of default renderers. |
protected SubstanceTableUI.TableCellId |
focusedCellId
|
protected int |
rolledOverColumn
Holds the currently rolled-over column index, or -1 if none
such. |
protected java.util.Set<SubstanceTableUI.TableCellId> |
rolledOverIndices
Holds the currently rolled-over row-column index, or null if
none such. |
protected java.util.Map<SubstanceTableUI.TableCellId,java.lang.Object> |
selectedIndices
Holds the list of currently selected row-column indexes. |
protected org.pushingpixels.substance.internal.ui.SubstanceTableUI.RolloverFadeListener |
substanceFadeRolloverListener
Listener for transition animations on table rollovers. |
protected java.awt.event.FocusListener |
substanceFocusListener
|
protected java.beans.PropertyChangeListener |
substancePropertyChangeListener
Listener that listens to changes on table properties. |
protected SubstanceTableUI.TableStateListener |
substanceTableStateListener
Listener for transition animations on list selections. |
Fields inherited from class javax.swing.plaf.basic.BasicTableUI |
---|
focusListener, keyListener, mouseInputListener, rendererPane, table |
Constructor Summary | |
---|---|
SubstanceTableUI()
Creates a UI delegate for table. |
Method Summary | |
---|---|
protected boolean |
_hasAnimations()
Checks whether the table has animations. |
protected boolean |
_hasRolloverAnimations()
Checks whether the table has rollover animations. |
protected boolean |
_hasSelectionAnimations()
Checks whether the table has selection animations. |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent comp)
|
java.awt.Insets |
getCellRendererInsets()
Returns the cell renderer insets of this table. |
ComponentState |
getCellState(SubstanceTableUI.TableCellId cellIndex)
Returns the current state for the specified cell. |
SubstanceTableUI.TableCellId |
getId(int row,
int column)
Returns a comparable ID for the specified location. |
StateTransitionTracker.ModelStateInfo |
getModelStateInfo(SubstanceTableUI.TableCellId cellId)
Returns the current state for the specified cell. |
int |
getRolloverColumnIndex()
Returns the index of the rollover column. |
StateTransitionTracker |
getStateTransitionTracker(SubstanceTableUI.TableCellId tableId)
|
UpdateOptimizationInfo |
getUpdateOptimizationInfo()
|
boolean |
hasRolloverAnimations()
|
boolean |
hasSelectionAnimations()
|
protected void |
installDefaults()
|
protected void |
installEditorIfNecessary(java.lang.Class<?> clazz,
javax.swing.table.TableCellEditor editor)
Installs Substance-specific renderers for column classes that don't have application-specific renderers installed by the user code. |
protected void |
installListeners()
|
protected void |
installRendererIfNecessary(java.lang.Class<?> clazz,
javax.swing.table.TableCellRenderer renderer)
Installs Substance-specific renderers for column classes that don't have application-specific renderers installed by the user code. |
boolean |
isFocusedCell(int row,
int column)
Returns indication whether the specified cell has focus. |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paint a representation of the table instance that was set in
installUI(). |
protected void |
paintCell(java.awt.Graphics g,
java.awt.Rectangle cellRect,
java.awt.Rectangle highlightCellRect,
int row,
int column)
|
protected void |
paintCells(java.awt.Graphics g,
int rMin,
int rMax,
int cMin,
int cMax)
|
protected void |
paintDraggedArea(java.awt.Graphics g,
int rMin,
int rMax,
javax.swing.table.TableColumn draggedColumn,
int distance)
|
protected void |
paintDropLines(java.awt.Graphics g)
|
protected void |
paintGrid(java.awt.Graphics g,
int rMin,
int rMax,
int cMin,
int cMax)
Paints the grid lines within aRect, using the grid color set with setGridColor. |
protected void |
syncSelection(boolean enforceNoAnimations)
Synchronizes the current selection state. |
protected void |
uninstallDefaults()
|
protected void |
uninstallEditorIfNecessary(java.lang.Class<?> clazz,
javax.swing.table.TableCellEditor editor)
Uninstalls default Substance editors that were installed in installEditorIfNecessary(Class, TableCellEditor) . |
protected void |
uninstallListeners()
|
protected void |
uninstallRendererIfNecessary(java.lang.Class<?> clazz,
javax.swing.table.TableCellRenderer renderer)
Uninstalls default Substance renderers that were installed in installRendererIfNecessary(Class, TableCellRenderer) . |
void |
update(java.awt.Graphics g,
javax.swing.JComponent c)
|
Methods inherited from class javax.swing.plaf.basic.BasicTableUI |
---|
createFocusListener, createKeyListener, createMouseInputListener, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installKeyboardActions, installUI, uninstallKeyboardActions, uninstallUI |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<SubstanceTableUI.TableCellId,java.lang.Object> selectedIndices
protected java.util.Set<SubstanceTableUI.TableCellId> rolledOverIndices
null
if
none such.
protected SubstanceTableUI.TableCellId focusedCellId
protected int rolledOverColumn
-1
if none
such. This is used for the table header animations.
protected java.util.Map<java.lang.Class<?>,javax.swing.table.TableCellRenderer> defaultRenderers
protected java.util.Map<java.lang.Class<?>,javax.swing.table.TableCellEditor> defaultEditors
protected java.beans.PropertyChangeListener substancePropertyChangeListener
protected SubstanceTableUI.TableStateListener substanceTableStateListener
protected org.pushingpixels.substance.internal.ui.SubstanceTableUI.RolloverFadeListener substanceFadeRolloverListener
protected java.awt.event.FocusListener substanceFocusListener
Constructor Detail |
---|
public SubstanceTableUI()
Method Detail |
---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
protected void installDefaults()
installDefaults
in class javax.swing.plaf.basic.BasicTableUI
protected void installRendererIfNecessary(java.lang.Class<?> clazz, javax.swing.table.TableCellRenderer renderer)
clazz
- Column class.renderer
- Default renderer for the specified column class.protected void installEditorIfNecessary(java.lang.Class<?> clazz, javax.swing.table.TableCellEditor editor)
clazz
- Column class.editor
- Default renderer for the specified column class.protected void uninstallDefaults()
uninstallDefaults
in class javax.swing.plaf.basic.BasicTableUI
protected void uninstallRendererIfNecessary(java.lang.Class<?> clazz, javax.swing.table.TableCellRenderer renderer)
installRendererIfNecessary(Class, TableCellRenderer)
.
clazz
- Column class.renderer
- Renderer to restore.protected void uninstallEditorIfNecessary(java.lang.Class<?> clazz, javax.swing.table.TableCellEditor editor)
installEditorIfNecessary(Class, TableCellEditor)
.
clazz
- Column class.editor
- Editor to restore.protected void installListeners()
installListeners
in class javax.swing.plaf.basic.BasicTableUI
protected void uninstallListeners()
uninstallListeners
in class javax.swing.plaf.basic.BasicTableUI
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
table
instance that was set in
installUI().
paint
in class javax.swing.plaf.basic.BasicTableUI
protected void paintGrid(java.awt.Graphics g, int rMin, int rMax, int cMin, int cMax)
getShowVerticalLines()
returns true and paints horizontal
lines if getShowHorizontalLines()
returns true.
protected void paintCells(java.awt.Graphics g, int rMin, int rMax, int cMin, int cMax)
protected void paintDraggedArea(java.awt.Graphics g, int rMin, int rMax, javax.swing.table.TableColumn draggedColumn, int distance)
protected void paintCell(java.awt.Graphics g, java.awt.Rectangle cellRect, java.awt.Rectangle highlightCellRect, int row, int column)
protected void paintDropLines(java.awt.Graphics g)
public SubstanceTableUI.TableCellId getId(int row, int column)
row
- Row index.column
- Column index.
protected void syncSelection(boolean enforceNoAnimations)
enforceNoAnimations
- Whether to force no animations.public ComponentState getCellState(SubstanceTableUI.TableCellId cellIndex)
cellIndex
- Cell index.
public StateTransitionTracker.ModelStateInfo getModelStateInfo(SubstanceTableUI.TableCellId cellId)
cellId
- Cell index.
protected boolean _hasAnimations()
true
if the table has animations, false
otherwise.protected boolean _hasSelectionAnimations()
true
if the table has selection animations,
false
otherwise.protected boolean _hasRolloverAnimations()
true
if the table has rollover animations,
false
otherwise.public int getRolloverColumnIndex()
public boolean isFocusedCell(int row, int column)
row
- Cell row index.column
- Cell column index.
true
If the focus is on the specified cell,
false
otherwise.public void update(java.awt.Graphics g, javax.swing.JComponent c)
update
in class javax.swing.plaf.ComponentUI
public java.awt.Insets getCellRendererInsets()
public boolean hasSelectionAnimations()
public boolean hasRolloverAnimations()
public UpdateOptimizationInfo getUpdateOptimizationInfo()
getUpdateOptimizationInfo
in interface UpdateOptimizationAware
public StateTransitionTracker getStateTransitionTracker(SubstanceTableUI.TableCellId tableId)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |