- java.lang.Object
- 
- javax.swing.plaf.ComponentUI
- 
- javax.swing.plaf.TreeUI
- 
- javax.swing.plaf.basic.BasicTreeUI
- 
- javax.swing.plaf.metal.MetalTreeUI
 
 
 
 
- 
 public class MetalTreeUI extends BasicTreeUI The metal look and feel implementation ofTreeUI.MetalTreeUIallows for configuring how to visually render the spacing and delineation between nodes. The following hints are supported:Descriptions of supported hints: Angled, Horizontal, and None Hint Description Angled A line is drawn connecting the child to the parent. For handling of the root node refer to JTree.setRootVisible(boolean)andJTree.setShowsRootHandles(boolean).Horizontal A horizontal line is drawn dividing the children of the root node. None Do not draw any visual indication between nodes. As it is typically impractical to obtain the TreeUIfrom theJTreeand cast to an instance ofMetalTreeUIyou enable this property via the client propertyJTree.lineStyle. For example, to switch toHorizontalstyle you would do:tree.putClientProperty("JTree.lineStyle", "Horizontal");The default is Angled.
- 
- 
Nested Class Summary- 
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicTreeUIBasicTreeUI.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 declared in class javax.swing.plaf.basic.BasicTreeUIcellEditor, 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 SummaryConstructors Constructor Description MetalTreeUI()Constructs theMetalTreeUI.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ComponentUIcreateUI(JComponent x)Constructs theMetalTreeUI.protected voiddecodeLineStyle(Object lineStyleFlag)Converts between the string passed into the client property and the internal representation (currently and int)protected booleanisLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY)Returnstrueif a point with X coordinatemouseXand Y coordinatemouseYis in expanded control.protected voidpaintHorizontalSeparators(Graphics g, JComponent c)Paints the horizontal separators.- 
Methods declared in class javax.swing.plaf.basic.BasicTreeUIcancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createDefaultCellRenderer, 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, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installKeyboardActions, installListeners, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintDropLine, paintExpandControl, paintHorizontalLine, paintHorizontalPartOfLeg, paintRow, 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, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateRenderer, updateSize
 - 
Methods declared in class javax.swing.plaf.ComponentUIcontains, getAccessibleChild, getAccessibleChildrenCount, installUI, paint, uninstallUI, update
 
- 
 
- 
- 
- 
Method Detail- 
createUIpublic static ComponentUI createUI(JComponent x) Constructs theMetalTreeUI.- Parameters:
- x- a component
- Returns:
- the instance of the MetalTreeUI
 
 - 
decodeLineStyleprotected void decodeLineStyle(Object lineStyleFlag) Converts between the string passed into the client property and the internal representation (currently and int)- Parameters:
- lineStyleFlag- a flag
 
 - 
isLocationInExpandControlprotected boolean isLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY)Returnstrueif a point with X coordinatemouseXand Y coordinatemouseYis in expanded control.- Parameters:
- row- a row
- rowLevel- a row level
- mouseX- X coordinate
- mouseY- Y coordinate
- Returns:
- trueif a point with X coordinate- mouseXand Y coordinate- mouseYis in expanded control.
 
 - 
paintHorizontalSeparatorsprotected void paintHorizontalSeparators(Graphics g, JComponent c) Paints the horizontal separators.- Parameters:
- g- an instance of- Graphics
- c- a component
 
 
- 
 
-