Class SubstanceTreeUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TreeUI
-
- javax.swing.plaf.basic.BasicTreeUI
-
- org.pushingpixels.substance.internal.ui.SubstanceTreeUI
-
public class SubstanceTreeUI extends BasicTreeUI
UI for lists in Substance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classSubstanceTreeUI.MyTreeSelectionListenerSelection listener for selection animation effects.protected classSubstanceTreeUI.PathRepaintCallbackRepaints a single path during the fade animation cycle.static classSubstanceTreeUI.TreePathIdID of a single tree path.-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTreeUI
BasicTreeUI.CellEditorHandler, BasicTreeUI.ComponentHandler, BasicTreeUI.FocusHandler, BasicTreeUI.KeyHandler, BasicTreeUI.MouseHandler, BasicTreeUI.MouseInputHandler, BasicTreeUI.NodeDimensionsHandler, BasicTreeUI.PropertyChangeHandler, BasicTreeUI.SelectionModelPropertyChangeHandler, BasicTreeUI.TreeCancelEditingAction, BasicTreeUI.TreeExpansionHandler, BasicTreeUI.TreeHomeAction, BasicTreeUI.TreeIncrementAction, BasicTreeUI.TreeModelHandler, BasicTreeUI.TreePageAction, BasicTreeUI.TreeSelectionHandler, BasicTreeUI.TreeToggleAction, BasicTreeUI.TreeTraverseAction
-
-
Field Summary
Fields Modifier and Type Field Description protected SubstanceTreeUI.TreePathIdcurrRolloverPathIdHolds the currently rolled-over path ornullif none such.protected Map<SubstanceTreeUI.TreePathId,Object>selectedPathsHolds the list of currently selected paths.protected org.pushingpixels.substance.internal.ui.SubstanceTreeUI.RolloverFadeListenersubstanceFadeRolloverListenerListener for transition animations on tree rollovers.protected PropertyChangeListenersubstancePropertyChangeListenerListener that listens to changes on tree properties.protected MouseListenersubstanceRowSelectionListenerListener for selection of an entire row.protected TreeSelectionListenersubstanceSelectionFadeListenerListener for selection animations.-
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 Constructor Description SubstanceTreeUI()Creates a UI delegate for tree.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TreeCellRenderercreateDefaultCellRenderer()static ComponentUIcreateUI(JComponent comp)InsetsgetCellRendererInsets()Returns the cell renderer insets of this tree.SubstanceColorSchemegetDefaultColorScheme()Returns the default color scheme of this tree.StateTransitionTracker.ModelStateInfogetModelStateInfo(SubstanceTreeUI.TreePathId pathId)RectanglegetPathBounds(JTree tree, TreePath path)ComponentStategetPathState(SubstanceTreeUI.TreePathId pathId)Returns the current state for the specified path.intgetPivotRendererX(Rectangle paintBounds)Returns the pivot X for the cells rendered in the specified area.StateTransitionTrackergetStateTransitionTracker(SubstanceTreeUI.TreePathId pathId)protected voidinstallDefaults()protected voidinstallListeners()protected voidpaintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)protected voidpaintExpandControlEnforce(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)Paints the expand control of the specified row.protected voidpaintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)protected voidpaintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)protected voidpaintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)protected voiduninstallDefaults()protected voiduninstallListeners()voidupdate(Graphics g, 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, installComponents, installKeyboardActions, installUI, 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, uninstallComponents, uninstallKeyboardActions, uninstallUI, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateRenderer, updateSize
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
-
-
-
Field Detail
-
selectedPaths
protected Map<SubstanceTreeUI.TreePathId,Object> selectedPaths
Holds the list of currently selected paths.
-
currRolloverPathId
protected SubstanceTreeUI.TreePathId currRolloverPathId
Holds the currently rolled-over path ornullif none such.
-
substancePropertyChangeListener
protected PropertyChangeListener substancePropertyChangeListener
Listener that listens to changes on tree properties.
-
substanceSelectionFadeListener
protected TreeSelectionListener substanceSelectionFadeListener
Listener for selection animations.
-
substanceFadeRolloverListener
protected org.pushingpixels.substance.internal.ui.SubstanceTreeUI.RolloverFadeListener substanceFadeRolloverListener
Listener for transition animations on tree rollovers.
-
substanceRowSelectionListener
protected MouseListener substanceRowSelectionListener
Listener for selection of an entire row.
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent comp)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classBasicTreeUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classBasicTreeUI
-
paintRow
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
- Overrides:
paintRowin classBasicTreeUI
-
paintExpandControl
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
- Overrides:
paintExpandControlin classBasicTreeUI
-
paintExpandControlEnforce
protected void paintExpandControlEnforce(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, 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(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
- Overrides:
paintHorizontalPartOfLegin classBasicTreeUI
-
paintVerticalPartOfLeg
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
- Overrides:
paintVerticalPartOfLegin classBasicTreeUI
-
createDefaultCellRenderer
protected TreeCellRenderer createDefaultCellRenderer()
- Overrides:
createDefaultCellRendererin classBasicTreeUI
-
installListeners
protected void installListeners()
- Overrides:
installListenersin classBasicTreeUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListenersin classBasicTreeUI
-
getPivotRendererX
public int getPivotRendererX(Rectangle paintBounds)
Returns the pivot X for the cells rendered in the specified area. Used for the smart tree scroll (SubstanceLookAndFeel.TREE_SMART_SCROLL_ANIMATION_KIND).- Parameters:
paintBounds- Area bounds.- Returns:
- Pivot X for the cells rendered in the specified area
-
getPathState
public ComponentState getPathState(SubstanceTreeUI.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(SubstanceTreeUI.TreePathId pathId)
-
update
public void update(Graphics g, JComponent c)
- Overrides:
updatein classComponentUI
-
getDefaultColorScheme
public SubstanceColorScheme getDefaultColorScheme()
Returns the default color scheme of this tree. Is for internal use only.- Returns:
- The default color scheme of this tree.
-
getCellRendererInsets
public 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 Rectangle getPathBounds(JTree tree, TreePath path)
- Overrides:
getPathBoundsin classBasicTreeUI
-
getStateTransitionTracker
public StateTransitionTracker getStateTransitionTracker(SubstanceTreeUI.TreePathId pathId)
-
-