Package com.formdev.flatlaf.ui
Class FlatTreeUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TreeUI
javax.swing.plaf.basic.BasicTreeUI
com.formdev.flatlaf.ui.FlatTreeUI
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate for
JTree
.
-
Nested Class Summary
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
FieldsModifier and TypeFieldDescriptionprivate Color
private Icon
private Icon
private Icon
private Color
private Color
private Color
private boolean
protected boolean
protected int
protected Color
protected Color
protected Color
protected Color
protected Color
protected Insets
protected boolean
protected boolean
protected boolean
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyStyle
(Object style) protected Object
applyStyleProperty
(String key, Object value) protected MouseListener
protected PropertyChangeListener
protected TreeSelectionListener
static ComponentUI
protected Rectangle
getPathBounds
(JTree tree, TreePath path) getStyleableValue
(JComponent c, String key) protected void
protected void
void
private boolean
isDropRow
(int row) Checks whether dropping on a row.protected boolean
protected boolean
void
paint
(Graphics g, JComponent c) private void
paintCellBackground
(Graphics g, Component rendererComponent, Rectangle bounds, int row, boolean paintSelection) protected void
paintHorizontalLine
(Graphics g, JComponent c, int y, int left, int right) protected void
paintRow
(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) Similar to super.paintRow(), but supports wide selection and uses inactive selection background/foreground if tree is not focused.protected void
paintVerticalLine
(Graphics g, JComponent c, int x, int top, int bottom) private void
paintWideSelection
(Graphics g, Rectangle bounds, int row) private void
private Color
setRendererBackgroundSelectionColor
(Component rendererComponent, Color color) private Color
setRendererBorderSelectionColor
(Component rendererComponent, Color color) private void
setRendererForeground
(Component rendererComponent, Color color) protected void
protected void
private boolean
Methods inherited from class javax.swing.plaf.basic.BasicTreeUI
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createDefaultCellRenderer, createFocusListener, createKeyListener, createLayoutCache, createNodeDimensions, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, 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, installListeners, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintDropLine, paintExpandControl, paintHorizontalPartOfLeg, paintVerticalPartOfLeg, 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, uninstallListeners, uninstallUI, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateSize
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Field Details
-
selectionBackground
-
selectionForeground
-
selectionInactiveBackground
-
selectionInactiveForeground
-
selectionBorderColor
-
selectionInsets
- Since:
- 3
-
selectionArc
protected int selectionArc- Since:
- 3
-
wideSelection
protected boolean wideSelection -
showCellFocusIndicator
protected boolean showCellFocusIndicator -
showDefaultIcons
protected boolean showDefaultIcons- Since:
- 3
-
iconArrowType
- Since:
- 2
-
iconExpandedColor
- Since:
- 2
-
iconCollapsedColor
- Since:
- 2
-
iconLeafColor
- Since:
- 2
-
iconClosedColor
- Since:
- 2
-
iconOpenColor
- Since:
- 2
-
paintSelection
protected boolean paintSelection- Since:
- 2
-
defaultLeafIcon
-
defaultClosedIcon
-
defaultOpenIcon
-
paintLines
private boolean paintLines -
defaultCellNonSelectionBackground
-
defaultSelectionBackground
-
defaultSelectionForeground
-
defaultSelectionBorderColor
-
oldStyleValues
-
-
Constructor Details
-
FlatTreeUI
public FlatTreeUI()
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUI
in classBasicTreeUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaults
in classBasicTreeUI
-
uninstallDefaults
protected void uninstallDefaults()- Overrides:
uninstallDefaults
in classBasicTreeUI
-
updateRenderer
protected void updateRenderer()- Overrides:
updateRenderer
in classBasicTreeUI
-
createMouseListener
- Overrides:
createMouseListener
in classBasicTreeUI
-
createPropertyChangeListener
- Overrides:
createPropertyChangeListener
in classBasicTreeUI
-
repaintWideDropLocation
-
createTreeSelectionListener
- Overrides:
createTreeSelectionListener
in classBasicTreeUI
-
getPathBounds
- Overrides:
getPathBounds
in classBasicTreeUI
-
installStyle
protected void installStyle()- Since:
- 2
-
applyStyle
- Since:
- 2
-
applyStyleProperty
- Since:
- 2
-
getStyleableInfos
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
paint
- Overrides:
paint
in classBasicTreeUI
-
paintRow
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) Similar to super.paintRow(), but supports wide selection and uses inactive selection background/foreground if tree is not focused.- Overrides:
paintRow
in classBasicTreeUI
-
setRendererBackgroundSelectionColor
-
setRendererForeground
-
setRendererBorderSelectionColor
-
paintWideSelection
-
paintCellBackground
-
useUnitedRoundedSelection
private boolean useUnitedRoundedSelection() -
paintVerticalLine
- Overrides:
paintVerticalLine
in classBasicTreeUI
-
paintHorizontalLine
- Overrides:
paintHorizontalLine
in classBasicTreeUI
-
isDropRow
private boolean isDropRow(int row) Checks whether dropping on a row. See DefaultTreeCellRenderer.getTreeCellRendererComponent(). -
getDropLineRect
- Overrides:
getDropLineRect
in classBasicTreeUI
-
isWideSelection
protected boolean isWideSelection() -
isPaintSelection
protected boolean isPaintSelection()
-