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
-
public class FlatTreeUI extends BasicTreeUI
Provides the Flat LaF UI delegate forJTree.- UiDefault:
- Tree.font Font, Tree.background Color, Tree.hash Color, Tree.dropLineColor Color, Tree.expandedIcon Icon, Tree.collapsedIcon Icon, Tree.leftChildIndent int, Tree.rightChildIndent int, Tree.rowHeight int, Tree.scrollsOnExpand boolean, Tree.scrollsHorizontallyAndVertically boolean, Tree.paintLines boolean, Tree.lineTypeDashed boolean, Tree.showsRootHandles boolean, Tree.repaintWholeRow boolean , Tree.leafIcon Icon, Tree.closedIcon Icon, Tree.openIcon Icon, Tree.textBackground Color, Tree.textForeground Color, Tree.selectionBackground Color, Tree.selectionForeground Color, Tree.selectionBorderColor Color focus indicator border color, Tree.drawsFocusBorderAroundIcon boolean, Tree.drawDashedFocusIndicator boolean, Tree.rendererFillBackground boolean default is true, Tree.rendererMargins Insets, Tree.dropCellBackground Color, Tree.dropCellForeground Color , Tree.editorBorder Border, Tree.editorBorderSelectionColor Color , Tree.border Border, Tree.selectionBackground Color, Tree.selectionForeground Color, Tree.selectionInactiveBackground Color, Tree.selectionInactiveForeground Color, Tree.wideSelection boolean, Tree.showCellFocusIndicator boolean
-
-
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
Fields Modifier and Type Field Description protected ColorselectionBackgroundprotected ColorselectionBorderColorprotected ColorselectionForegroundprotected ColorselectionInactiveBackgroundprotected ColorselectionInactiveForegroundprotected booleanshowCellFocusIndicatorprotected booleanwideSelection-
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 FlatTreeUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MouseListenercreateMouseListener()protected PropertyChangeListenercreatePropertyChangeListener()static ComponentUIcreateUI(JComponent c)protected RectanglegetDropLineRect(JTree.DropLocation loc)RectanglegetPathBounds(JTree tree, TreePath path)protected voidinstallDefaults()protected booleanisPaintSelection()protected booleanisWideSelection()protected voidpaintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)Same as super.paintRow(), but supports wide selection and uses inactive selection background/foreground if tree is not focused.protected voiduninstallDefaults()-
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, createTreeSelectionListener, 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, installUI, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paint, paintDropLine, paintExpandControl, paintHorizontalLine, paintHorizontalPartOfLeg, paintVerticalLine, 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, updateRenderer, updateSize
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
-
-
-
Field Detail
-
selectionBackground
protected Color selectionBackground
-
selectionForeground
protected Color selectionForeground
-
selectionInactiveBackground
protected Color selectionInactiveBackground
-
selectionInactiveForeground
protected Color selectionInactiveForeground
-
selectionBorderColor
protected Color selectionBorderColor
-
wideSelection
protected boolean wideSelection
-
showCellFocusIndicator
protected boolean showCellFocusIndicator
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classBasicTreeUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classBasicTreeUI
-
createMouseListener
protected MouseListener createMouseListener()
- Overrides:
createMouseListenerin classBasicTreeUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListenerin classBasicTreeUI
-
getPathBounds
public Rectangle getPathBounds(JTree tree, TreePath path)
- Overrides:
getPathBoundsin classBasicTreeUI
-
paintRow
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Same as super.paintRow(), but supports wide selection and uses inactive selection background/foreground if tree is not focused.- Overrides:
paintRowin classBasicTreeUI
-
getDropLineRect
protected Rectangle getDropLineRect(JTree.DropLocation loc)
- Overrides:
getDropLineRectin classBasicTreeUI
-
isWideSelection
protected boolean isWideSelection()
-
isPaintSelection
protected boolean isPaintSelection()
-
-