|
|||||||||
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.jvnet.substance.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
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. |
protected static class |
SubstanceTableUI.TableCellId
ID of a single table cell. |
protected static class |
SubstanceTableUI.TableColumnId
ID of a single table column. |
protected static class |
SubstanceTableUI.TableRowId
ID of a single table row. |
protected class |
SubstanceTableUI.TableSelectionListener
Selection listener for selection animation effects. |
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.TableCellRenderer> |
defaultRenderers
Map of default renderers. |
protected int |
focusedColumn
Column index of the focused cell. |
protected int |
focusedRow
Row index of the focused cell. |
protected int |
rolledOverColumn
Holds the currently rolled-over column index, or -1 if
none such. |
protected java.lang.Comparable<?> |
rolledOverId
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.jvnet.substance.SubstanceTableUI.RolloverFadeListener |
substanceFadeRolloverListener
Listener for fade animations on table rollovers. |
protected javax.swing.event.ListSelectionListener |
substanceFadeSelectionListener
Listener for fade animations on list selections. |
protected java.beans.PropertyChangeListener |
substancePropertyChangeListener
Listener that listens to changes on SubstanceLookAndFeel.WATERMARK_TO_BLEED property. |
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 | |
---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
|
ComponentState |
getCellState(SubstanceTableUI.TableCellId cellIndex)
Returns the current state for the specified cell. |
java.lang.Comparable<?> |
getId(int row,
int column)
Returns a comparable ID for the specified location. |
ComponentState |
getPrevCellState(SubstanceTableUI.TableCellId cellIndex)
Returns the previous state for the specified cell. |
int |
getRolloverColumnIndex()
Returns the index of the rollover column. |
protected boolean |
hasAnimations2()
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. |
protected void |
installDefaults()
|
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,
int row,
int column)
|
protected void |
syncSelection(javax.swing.event.ListSelectionEvent e)
Synchronizes the current selection state. |
protected void |
uninstallDefaults()
|
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) . |
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, update |
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.lang.Comparable<?> rolledOverId
null
if none such.
protected int focusedRow
protected int focusedColumn
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.beans.PropertyChangeListener substancePropertyChangeListener
SubstanceLookAndFeel.WATERMARK_TO_BLEED
property.
protected javax.swing.event.ListSelectionListener substanceFadeSelectionListener
protected org.jvnet.substance.SubstanceTableUI.RolloverFadeListener substanceFadeRolloverListener
Constructor Detail |
---|
public SubstanceTableUI()
Method Detail |
---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
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 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 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 paintCell(java.awt.Graphics g, java.awt.Rectangle cellRect, int row, int column)
public java.lang.Comparable<?> getId(int row, int column)
SubstanceTableUI.TableRowId
, SubstanceTableUI.TableColumnId
or SubstanceTableUI.TableCellId
,
based on the row and column selection modes of the table.
row
- Row index.column
- Column index.
protected void syncSelection(javax.swing.event.ListSelectionEvent e)
e
- Selection event.public ComponentState getPrevCellState(SubstanceTableUI.TableCellId cellIndex)
cellIndex
- Cell index.
public ComponentState getCellState(SubstanceTableUI.TableCellId cellIndex)
cellIndex
- Cell index.
protected boolean hasAnimations2()
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |