Class RadianceTreeUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TreeUI
-
- javax.swing.plaf.basic.BasicTreeUI
-
- org.pushingpixels.radiance.theming.internal.ui.RadianceTreeUI
-
public class RadianceTreeUI extends javax.swing.plaf.basic.BasicTreeUI
UI for lists in Radiance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
RadianceTreeUI.MyTreeSelectionListener
Selection listener for selection animation effects.protected class
RadianceTreeUI.PathRepaintCallback
Repaints a single path during the fade animation cycle.private class
RadianceTreeUI.RolloverFadeListener
Listener for rollover animation effects.private class
RadianceTreeUI.RowSelectionListener
Listener for selecting the entire rows.static class
RadianceTreeUI.TreePathId
ID of a single tree path.-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTreeUI
javax.swing.plaf.basic.BasicTreeUI.CellEditorHandler, javax.swing.plaf.basic.BasicTreeUI.ComponentHandler, javax.swing.plaf.basic.BasicTreeUI.FocusHandler, javax.swing.plaf.basic.BasicTreeUI.KeyHandler, javax.swing.plaf.basic.BasicTreeUI.MouseHandler, javax.swing.plaf.basic.BasicTreeUI.MouseInputHandler, javax.swing.plaf.basic.BasicTreeUI.NodeDimensionsHandler, javax.swing.plaf.basic.BasicTreeUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.SelectionModelPropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction, javax.swing.plaf.basic.BasicTreeUI.TreeExpansionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeHomeAction, javax.swing.plaf.basic.BasicTreeUI.TreeIncrementAction, javax.swing.plaf.basic.BasicTreeUI.TreeModelHandler, javax.swing.plaf.basic.BasicTreeUI.TreePageAction, javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeToggleAction, javax.swing.plaf.basic.BasicTreeUI.TreeTraverseAction
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Insets
cellRendererInsets
Cell renderer insets.private RadianceColorScheme
currDefaultColorScheme
The current default color scheme.private RadianceTreeUI.TreePathId
currRolloverPathId
Holds the currently rolled-over path ornull
if none such.private RadianceTreeUI.RolloverFadeListener
radianceFadeRolloverListener
Listener for transition animations on tree rollovers.private java.beans.PropertyChangeListener
radiancePropertyChangeListener
Listener that listens to changes on tree properties.private java.awt.event.MouseListener
radianceRowSelectionListener
Listener for selection of an entire row.private javax.swing.event.TreeSelectionListener
radianceSelectionFadeListener
Listener for selection animations.private java.util.Map<RadianceTreeUI.TreePathId,java.lang.Object>
selectedPaths
Holds the list of currently selected paths.private StateTransitionMultiTracker<RadianceTreeUI.TreePathId>
stateTransitionMultiTracker
private java.util.Set<RadianceThemingWidget<javax.swing.JComponent>>
themingWidgets
-
Fields inherited from class javax.swing.plaf.basic.BasicTreeUI
cellEditor, collapsedIcon, createdCellEditor, createdRenderer, currentCellRenderer, depthOffset, drawingCache, editingComponent, editingPath, editingRow, editorHasDifferentSize, expandedIcon, largeModel, lastSelectedRow, leftChildIndent, nodeDimensions, preferredMinSize, preferredSize, rendererPane, rightChildIndent, stopEditingInCompleteEditing, totalChildIndent, tree, treeModel, treeSelectionModel, treeState, validCachedPreferredSize
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RadianceTreeUI()
Creates a UI delegate for tree.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.tree.TreeCellRenderer
createDefaultCellRenderer()
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent comp)
java.awt.Insets
getCellRendererInsets()
Returns the cell renderer insets of this tree.RadianceColorScheme
getDefaultColorScheme()
Returns the default color scheme of this tree.StateTransitionTracker.ModelStateInfo
getModelStateInfo(RadianceTreeUI.TreePathId pathId)
java.awt.Rectangle
getPathBounds(javax.swing.JTree tree, javax.swing.tree.TreePath path)
ComponentState
getPathState(RadianceTreeUI.TreePathId pathId)
Returns the current state for the specified path.int
getPivotRendererX(java.awt.Rectangle paintBounds)
Returns the pivot X for the cells rendered in the specified area.private StateTransitionTracker
getTracker(RadianceTreeUI.TreePathId pathId, boolean initialRollover, boolean initialSelected)
protected void
installComponents()
protected void
installDefaults()
protected void
installListeners()
void
installUI(javax.swing.JComponent c)
protected void
paintExpandControl(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
private void
paintExpandControlEnforce(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Paints the expand control of the specified row.protected void
paintHorizontalPartOfLeg(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
protected void
paintRow(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
protected void
paintVerticalPartOfLeg(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, javax.swing.tree.TreePath path)
protected void
uninstallComponents()
protected void
uninstallDefaults()
protected void
uninstallListeners()
void
uninstallUI(javax.swing.JComponent c)
void
update(java.awt.Graphics g, javax.swing.JComponent c)
-
Methods inherited from class javax.swing.plaf.basic.BasicTreeUI
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createFocusListener, createKeyListener, createLayoutCache, createMouseListener, createNodeDimensions, createPropertyChangeListener, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, createTreeSelectionListener, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getDropLineRect, getEditingPath, getExpandedIcon, getHashColor, getHorizontalLegBuffer, getLastChildPath, getLeadSelectionRow, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installKeyboardActions, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paint, paintDropLine, paintHorizontalLine, paintVerticalLine, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, selectPathForEvent, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setModel, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallKeyboardActions, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateRenderer, updateSize
-
-
-
-
Field Detail
-
selectedPaths
private java.util.Map<RadianceTreeUI.TreePathId,java.lang.Object> selectedPaths
Holds the list of currently selected paths.
-
currRolloverPathId
private RadianceTreeUI.TreePathId currRolloverPathId
Holds the currently rolled-over path ornull
if none such.
-
radiancePropertyChangeListener
private java.beans.PropertyChangeListener radiancePropertyChangeListener
Listener that listens to changes on tree properties.
-
radianceSelectionFadeListener
private javax.swing.event.TreeSelectionListener radianceSelectionFadeListener
Listener for selection animations.
-
radianceFadeRolloverListener
private RadianceTreeUI.RolloverFadeListener radianceFadeRolloverListener
Listener for transition animations on tree rollovers.
-
radianceRowSelectionListener
private java.awt.event.MouseListener radianceRowSelectionListener
Listener for selection of an entire row.
-
stateTransitionMultiTracker
private StateTransitionMultiTracker<RadianceTreeUI.TreePathId> stateTransitionMultiTracker
-
currDefaultColorScheme
private RadianceColorScheme currDefaultColorScheme
The current default color scheme. Is computed inupdate(Graphics, JComponent)
and reused inRadianceDefaultTreeCellRenderer.getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)
for performance optimizations.
-
cellRendererInsets
private java.awt.Insets cellRendererInsets
Cell renderer insets. Is computed ininstallDefaults()
and reused inRadianceDefaultTreeCellRenderer.getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)
for performance optimizations.
-
themingWidgets
private java.util.Set<RadianceThemingWidget<javax.swing.JComponent>> themingWidgets
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent comp)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.basic.BasicTreeUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.basic.BasicTreeUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicTreeUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classjavax.swing.plaf.basic.BasicTreeUI
-
paintRow
protected void paintRow(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
- Overrides:
paintRow
in classjavax.swing.plaf.basic.BasicTreeUI
-
paintExpandControl
protected void paintExpandControl(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
- Overrides:
paintExpandControl
in classjavax.swing.plaf.basic.BasicTreeUI
-
paintExpandControlEnforce
private void paintExpandControlEnforce(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Paints the expand control of the specified row.- Parameters:
g
- Graphics context.clipBounds
- Clip bounds.insets
- Insets.bounds
- Row bounds.path
- Tree path.row
- Tree row.isExpanded
- Expand indication.hasBeenExpanded
- Indication whether this row has ever been expanded.isLeaf
- Indication whether this row is a leaf.
-
paintHorizontalPartOfLeg
protected void paintHorizontalPartOfLeg(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
- Overrides:
paintHorizontalPartOfLeg
in classjavax.swing.plaf.basic.BasicTreeUI
-
paintVerticalPartOfLeg
protected void paintVerticalPartOfLeg(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, javax.swing.tree.TreePath path)
- Overrides:
paintVerticalPartOfLeg
in classjavax.swing.plaf.basic.BasicTreeUI
-
createDefaultCellRenderer
protected javax.swing.tree.TreeCellRenderer createDefaultCellRenderer()
- Overrides:
createDefaultCellRenderer
in classjavax.swing.plaf.basic.BasicTreeUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicTreeUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classjavax.swing.plaf.basic.BasicTreeUI
-
installComponents
protected void installComponents()
- Overrides:
installComponents
in classjavax.swing.plaf.basic.BasicTreeUI
-
uninstallComponents
protected void uninstallComponents()
- Overrides:
uninstallComponents
in classjavax.swing.plaf.basic.BasicTreeUI
-
getPivotRendererX
public int getPivotRendererX(java.awt.Rectangle paintBounds)
Returns the pivot X for the cells rendered in the specified area. Used for the smart tree scroll (RadianceThemingSlices.AnimationFacet.TREE_SMART_SCROLL_ANIMATION
).- Parameters:
paintBounds
- Area bounds.- Returns:
- Pivot X for the cells rendered in the specified area
-
getPathState
public ComponentState getPathState(RadianceTreeUI.TreePathId pathId)
Returns the current state for the specified path.- Parameters:
pathId
- Path index.- Returns:
- The current state for the specified path.
-
getModelStateInfo
public StateTransitionTracker.ModelStateInfo getModelStateInfo(RadianceTreeUI.TreePathId pathId)
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.ComponentUI
-
getDefaultColorScheme
public RadianceColorScheme getDefaultColorScheme()
Returns the default color scheme of this tree. Is for internal use only.- Returns:
- The default color scheme of this tree.
-
getCellRendererInsets
public java.awt.Insets getCellRendererInsets()
Returns the cell renderer insets of this tree. Is for internal use only.- Returns:
- The cell renderer insets of this tree.
-
getPathBounds
public java.awt.Rectangle getPathBounds(javax.swing.JTree tree, javax.swing.tree.TreePath path)
- Overrides:
getPathBounds
in classjavax.swing.plaf.basic.BasicTreeUI
-
getTracker
private StateTransitionTracker getTracker(RadianceTreeUI.TreePathId pathId, boolean initialRollover, boolean initialSelected)
-
-