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 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 TypeFieldDescriptionprotected Colorprivate Colorprivate Iconprivate Iconprivate Iconprivate Colorprivate Colorprivate Colorprivate booleanprotected booleanprotected intprotected Colorprotected Colorprotected Colorprotected Colorprotected Colorprotected Insetsprotected booleanprotected booleanprotected booleanprotected booleanFields inherited from class 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 voidapplyStyle(Object style) protected ObjectapplyStyleProperty(String key, Object value) protected MouseListenerprotected PropertyChangeListenerprotected TreeSelectionListenerstatic ComponentUIprotected RectanglegetPathBounds(JTree tree, TreePath path) getStyleableValue(JComponent c, String key) protected voidprotected voidvoidprivate booleanisDropRow(int row) Checks whether dropping on a row.protected booleanprotected booleanprotected booleanvoidpaint(Graphics g, JComponent c) private voidpaintCellBackground(Graphics g, Component rendererComponent, Rectangle bounds, int row, boolean paintSelection) protected voidpaintHorizontalLine(Graphics g, JComponent c, int y, int left, int right) protected voidpaintRow(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 voidpaintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom) private voidpaintWideSelection(Graphics g, Rectangle bounds, int row) private voidprivate ColorsetRendererBackgroundSelectionColor(Component rendererComponent, Color color) private ColorsetRendererBorderSelectionColor(Component rendererComponent, Color color) private voidsetRendererForeground(Component rendererComponent, Color color) protected voidprotected voidprivate booleanMethods inherited from class 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, updateSizeMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Field Details
-
selectionBackground
-
selectionForeground
-
selectionInactiveBackground
-
selectionInactiveForeground
-
selectionBorderColor
-
alternateRowColor
- Since:
- 3.6
-
selectionInsets
- Since:
- 3
-
selectionArc
protected int selectionArc- Since:
- 3
-
wideSelection
protected boolean wideSelection -
wideCellRenderer
protected boolean wideCellRenderer- Since:
- 3.6
-
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:
installUIin classBasicTreeUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaultsin classBasicTreeUI
-
uninstallDefaults
protected void uninstallDefaults()- Overrides:
uninstallDefaultsin classBasicTreeUI
-
updateRenderer
protected void updateRenderer()- Overrides:
updateRendererin classBasicTreeUI
-
createMouseListener
- Overrides:
createMouseListenerin classBasicTreeUI
-
createPropertyChangeListener
- Overrides:
createPropertyChangeListenerin classBasicTreeUI
-
repaintWideDropLocation
-
createTreeSelectionListener
- Overrides:
createTreeSelectionListenerin classBasicTreeUI
-
getPathBounds
- Overrides:
getPathBoundsin classBasicTreeUI
-
installStyle
protected void installStyle()- Since:
- 2
-
applyStyle
- Since:
- 2
-
applyStyleProperty
-
getStyleableInfos
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableUI- Since:
- 2.5
-
paint
- Overrides:
paintin 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:
paintRowin classBasicTreeUI
-
setRendererBackgroundSelectionColor
-
setRendererForeground
-
setRendererBorderSelectionColor
-
paintWideSelection
-
paintCellBackground
-
useUnitedRoundedSelection
private boolean useUnitedRoundedSelection() -
paintVerticalLine
- Overrides:
paintVerticalLinein classBasicTreeUI
-
paintHorizontalLine
- Overrides:
paintHorizontalLinein classBasicTreeUI
-
isDropRow
private boolean isDropRow(int row) Checks whether dropping on a row. See DefaultTreeCellRenderer.getTreeCellRendererComponent(). -
getDropLineRect
- Overrides:
getDropLineRectin classBasicTreeUI
-
isWideSelection
protected boolean isWideSelection() -
isWideCellRenderer
protected boolean isWideCellRenderer()- Since:
- 3.6
-
isPaintSelection
protected boolean isPaintSelection()
-