Class RadianceTableUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TableUI
javax.swing.plaf.basic.BasicTableUI
org.pushingpixels.radiance.theming.internal.ui.RadianceTableUI
- All Implemented Interfaces:
UpdateOptimizationAware
UI for tables in Radiance look and feel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
protected class
Repaints a single cell during the fade animation cycle.private class
Listener for fade animations on table rollovers.static class
ID of a single table cell.protected class
State listener for tracking the selection changes.private class
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTableUI
BasicTableUI.FocusHandler, BasicTableUI.KeyHandler, BasicTableUI.MouseInputHandler
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) RadianceTableUI.TableCellId
private Insets
Cell renderer insets.private Map
<Class<?>, TableCellEditor> Map of default editors.private Map
<Class<?>, TableCellRenderer> Map of default renderers.private RadianceTableUI.TableCellId
Listener for transition animations on table rollovers.private FocusListener
private PropertyChangeListener
Listener that listens to changes on table properties.Listener for transition animations on list selections.private int
Holds the currently rolled-over column index, or-1
if none such.private Set
<RadianceTableUI.TableCellId> Holds the currently rolled-over row-column index, ornull
if none such.private int
private Map
<RadianceTableUI.TableCellId, Object> Holds the list of currently selected row-column indexes.Fields inherited from class javax.swing.plaf.basic.BasicTableUI
focusListener, keyListener, mouseInputListener, rendererPane, table
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Checks whether the table has animations.protected boolean
Checks whether the table has rollover animations.protected boolean
Checks whether the table has selection animations.static ComponentUI
createUI
(JComponent comp) private Rectangle
extendRect
(Rectangle rect, boolean horizontal) private Rectangle
getCellRectangleForRepaint
(int row, int column) Returns the cell renderer insets of this table.getCellState
(RadianceTableUI.TableCellId cellIndex) Returns the current state for the specified cell.private Rectangle
getId
(int row, int column) Returns a comparable ID for the specified location.Returns the current state for the specified cell.int
Returns the index of the rollover column.private StateTransitionTracker
getTracker
(RadianceTableUI.TableCellId tableCellId, boolean initialRollover, boolean initialSelected) private Rectangle
private boolean
hasLeadingVerticalGridLine
(int column) boolean
boolean
private boolean
hasTrailingVerticalGridLine
(TableColumnModel cm, int column) protected void
protected void
installEditorIfNecessary
(Class<?> clazz, TableCellEditor editor) Installs Radiance-specific renderers for column classes that don't have application-specific renderers installed by the user code.protected void
protected void
installRendererIfNecessary
(Class<?> clazz, TableCellRenderer renderer) Installs Radiance-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.private boolean
private boolean
isRadianceDefaultRenderer
(Object instance) void
paint
(Graphics g, JComponent c) Paint a representation of thetable
instance that was set in installUI().protected void
protected void
paintCells
(Graphics g, int rMin, int rMax, int cMin, int cMax) protected void
paintDraggedArea
(Graphics g, int rMin, int rMax, TableColumn draggedColumn, int distance) protected void
protected void
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
protected void
uninstallEditorIfNecessary
(Class<?> clazz, TableCellEditor editor) Uninstalls default Radiance editors that were installed ininstallEditorIfNecessary(Class, TableCellEditor)
.protected void
protected void
uninstallRendererIfNecessary
(Class<?> clazz, TableCellRenderer renderer) Uninstalls default Radiance renderers that were installed ininstallRendererIfNecessary(Class, TableCellRenderer)
.void
update
(Graphics g, JComponent c) private int
viewIndexForColumn
(TableColumn aColumn) 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
-
Field Details
-
selectedIndices
Holds the list of currently selected row-column indexes. -
rolledOverIndices
Holds the currently rolled-over row-column index, ornull
if none such. -
focusedCellId
-
rolledOverColumn
private int rolledOverColumnHolds the currently rolled-over column index, or-1
if none such. This is used for the table header animations. -
rolledOverRow
private int rolledOverRow -
defaultRenderers
Map of default renderers. -
defaultEditors
Map of default editors. -
radiancePropertyChangeListener
Listener that listens to changes on table properties. -
radianceTableStateListener
Listener for transition animations on list selections. -
radianceFadeRolloverListener
Listener for transition animations on table rollovers. -
radianceFocusListener
-
stateTransitionMultiTracker
-
cellRendererInsets
Cell renderer insets. Is computed ininstallDefaults()
and reused inRadianceDefaultTableCellRenderer.getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int)
andRadianceDefaultTableHeaderCellRenderer.getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int)
for performance optimizations. -
cellId
RadianceTableUI.TableCellId cellId -
updateInfo
-
-
Constructor Details
-
RadianceTableUI
protected RadianceTableUI()Creates a UI delegate for table.
-
-
Method Details
-
createUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaults
in classBasicTableUI
-
installRendererIfNecessary
Installs Radiance-specific renderers for column classes that don't have application-specific renderers installed by the user code.- Parameters:
clazz
- Column class.renderer
- Default renderer for the specified column class.
-
installEditorIfNecessary
Installs Radiance-specific renderers for column classes that don't have application-specific renderers installed by the user code.- Parameters:
clazz
- Column class.editor
- Default renderer for the specified column class.
-
uninstallDefaults
protected void uninstallDefaults()- Overrides:
uninstallDefaults
in classBasicTableUI
-
uninstallRendererIfNecessary
Uninstalls default Radiance renderers that were installed ininstallRendererIfNecessary(Class, TableCellRenderer)
.- Parameters:
clazz
- Column class.renderer
- Renderer to restore.
-
uninstallEditorIfNecessary
Uninstalls default Radiance editors that were installed ininstallEditorIfNecessary(Class, TableCellEditor)
.- Parameters:
clazz
- Column class.editor
- Editor to restore.
-
installListeners
protected void installListeners()- Overrides:
installListeners
in classBasicTableUI
-
uninstallListeners
protected void uninstallListeners()- Overrides:
uninstallListeners
in classBasicTableUI
-
paint
Paint a representation of thetable
instance that was set in installUI().- Overrides:
paint
in classBasicTableUI
-
paintGrid
Paints the grid lines within aRect, using the grid color set with setGridColor. Paints vertical lines ifgetShowVerticalLines()
returns true and paints horizontal lines ifgetShowHorizontalLines()
returns true. -
hasTrailingVerticalGridLine
-
hasLeadingVerticalGridLine
private boolean hasLeadingVerticalGridLine(int column) -
viewIndexForColumn
-
paintCells
-
paintDraggedArea
protected void paintDraggedArea(Graphics g, int rMin, int rMax, TableColumn draggedColumn, int distance) -
paintCell
-
paintDropLines
-
getHDropLineRect
-
getVDropLineRect
-
extendRect
-
getId
Returns a comparable ID for the specified location.- Parameters:
row
- Row index.column
- Column index.- Returns:
- Comparable ID for the specified location.
-
syncSelection
protected void syncSelection(boolean enforceNoAnimations) Synchronizes the current selection state. -
getCellState
Returns the current state for the specified cell.- Parameters:
cellIndex
- Cell index.- Returns:
- The current state for the specified cell.
-
getModelStateInfo
Returns the current state for the specified cell.- Parameters:
cellId
- Cell index.- Returns:
- The current state for the specified cell.
-
_hasAnimations
protected boolean _hasAnimations()Checks whether the table has animations.- Returns:
true
if the table has animations,false
otherwise.
-
_hasSelectionAnimations
protected boolean _hasSelectionAnimations()Checks whether the table has selection animations.- Returns:
true
if the table has selection animations,false
otherwise.
-
_hasRolloverAnimations
protected boolean _hasRolloverAnimations()Checks whether the table has rollover animations.- Returns:
true
if the table has rollover animations,false
otherwise.
-
getRolloverColumnIndex
public int getRolloverColumnIndex()Returns the index of the rollover column.- Returns:
- The index of the rollover column.
-
isFocusedCell
public boolean isFocusedCell(int row, int column) Returns indication whether the specified cell has focus.- Parameters:
row
- Cell row index.column
- Cell column index.- Returns:
true
If the focus is on the specified cell,false
otherwise.
-
update
- Overrides:
update
in classComponentUI
-
getCellRendererInsets
Returns the cell renderer insets of this table. Is for internal use only.- Returns:
- The cell renderer insets of this table.
-
hasSelectionAnimations
public boolean hasSelectionAnimations() -
hasRolloverAnimations
public boolean hasRolloverAnimations() -
getUpdateOptimizationInfo
- Specified by:
getUpdateOptimizationInfo
in interfaceUpdateOptimizationAware
-
isRadianceDefaultRenderer
-
isRadianceDefaultEditor
-
getCellRectangleForRepaint
-
getTracker
private StateTransitionTracker getTracker(RadianceTableUI.TableCellId tableCellId, boolean initialRollover, boolean initialSelected) -
getStateTransitionTracker
-