APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicTreeUI

extends TreeUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.metal.MetalTreeUI, javax.swing.plaf.synth.SynthTreeUI, com.sun.java.swing.plaf.motif.MotifTreeUI
Imports
java.awt.BasicStroke, .Color, .Component, .Dimension, .Graphics, .Graphics2D, .Insets, .Point, .Rectangle, .Stroke, java.awt.datatransfer.Transferable, java.awt.event.ActionEvent, .ActionListener, .ComponentAdapter, .ComponentEvent, .ComponentListener, .FocusEvent, .FocusListener, .KeyAdapter, .KeyEvent, .KeyListener, .MouseAdapter, .MouseEvent, .MouseListener, .MouseMotionListener, java.beans.PropertyChangeEvent, .PropertyChangeListener, java.util.ArrayList, .Comparator, .Enumeration, .Hashtable, javax.swing.AbstractAction, .Action, .CellRendererPane, .Icon, .InputMap, .JComponent, .JScrollBar, .JScrollPane, .JTextField, .JTree, .JViewport, .KeyStroke, .LookAndFeel, .SwingConstants, .SwingUtilities, .Timer, .TransferHandler, .UIDefaults, .UIManager, javax.swing.event.CellEditorListener, .ChangeEvent, .MouseInputListener, .TreeExpansionEvent, .TreeExpansionListener, .TreeModelEvent, .TreeModelListener, .TreeSelectionEvent, .TreeSelectionListener, javax.swing.plaf.ComponentUI, .TreeUI, .UIResource, javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag, javax.swing.text.Position, javax.swing.tree.AbstractLayoutCache, .DefaultTreeCellEditor, .DefaultTreeCellRenderer, .FixedHeightLayoutCache, .TreeCellEditor, .TreeCellRenderer, .TreeModel, .TreePath, .TreeSelectionModel, .VariableHeightLayoutCache, sun.awt.AWTAccessor, sun.swing.DefaultLookup, .SwingUtilities2, .UIAction

The basic L&F for a hierarchical data structure.
Authors
Scott Violet, Shannon Hickey (drag and drop)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public class
BasicTreeUI.CellEditorHandler

Listener responsible for getting cell editing events and updating the tree accordingly.

public class
BasicTreeUI.ComponentHandler

Updates the preferred size when scrolling (if necessary).

public class
BasicTreeUI.FocusHandler

Repaints the lead selection row when focus is lost/gained.

private class
public class
BasicTreeUI.KeyHandler

This is used to get multiple key down events to appropriately generate events.

public class
BasicTreeUI.MouseHandler

TreeMouseListener is responsible for updating the selection based on mouse events.

public class
BasicTreeUI.MouseInputHandler

MouseInputHandler handles passing all mouse events, including mouse motion events, until the mouse is released to the destination it is constructed with.

public class
BasicTreeUI.NodeDimensionsHandler

Class responsible for getting size of node, method is forwarded to BasicTreeUI method.

public class
BasicTreeUI.PropertyChangeHandler

PropertyChangeListener for the tree.

public class
BasicTreeUI.SelectionModelPropertyChangeHandler

Listener on the TreeSelectionModel, resets the row selection if any of the properties of the model change.

public class
BasicTreeUI.TreeCancelEditingAction

ActionListener that invokes cancelEditing when action performed.

public class
BasicTreeUI.TreeExpansionHandler

Updates the TreeState in response to nodes expanding/collapsing.

public class
BasicTreeUI.TreeHomeAction

TreeHomeAction is used to handle end/home actions.

public class
BasicTreeUI.TreeIncrementAction

TreeIncrementAction is used to handle up/down actions.

public class
BasicTreeUI.TreeModelHandler

Forwards all TreeModel events to the TreeState.

public class
BasicTreeUI.TreePageAction

TreePageAction handles page up and page down events.

public class
BasicTreeUI.TreeSelectionHandler

Listens for changes in the selection model and updates the display accordingly.

public class
BasicTreeUI.TreeToggleAction

For the first selected row expandedness will be toggled.

pack-priv static class
public class
BasicTreeUI.TreeTraverseAction

TreeTraverseAction is the action used for left/right keys.

Field Summary

Modifier and TypeField and Description
private static final StringBuilder
protected transient TreeCellEditor
cellEditor

Editor for the tree.

private CellEditorListener
cellEditorListener

Listens for CellEditor events.

protected transient Icon
collapsedIcon

The collapsed icon.

private ComponentListener
componentListener

Used for large models, listens for moved/resized events and updates the validCachedPreferredSize bit accordingly.

protected boolean
createdCellEditor

Set to true if editor that is currently in the tree was created by this instance.

protected boolean
createdRenderer

Set to true if the renderer that is currently in the tree was created by this instance.

protected transient TreeCellRenderer
currentCellRenderer

Renderer that is being used to do the actual cell drawing.

private static final TransferHandler
protected int
depthOffset

How much the depth should be offset to properly calculate x locations.

protected Hashtable<TreePath, Boolean>
drawingCache

Used for minimizing the drawing of vertical lines.

protected Component
editingComponent

When editing, this will be the Component that is doing the actual editing.

protected TreePath
editingPath

Path that is being edited.

protected int
editingRow

Row that is being edited.

protected boolean
editorHasDifferentSize

Set to true if the editor has a different size than the renderer.

protected transient Icon
expandedIcon

The expanded icon.

private FocusListener
private BasicTreeUI.Handler
private Color
hashColor

Color used to draw hash marks.

private boolean
ignoreLAChange

If true, the property change event for LEAD_SELECTION_PATH_PROPERTY, or ANCHOR_SELECTION_PATH_PROPERTY will not generate a repaint.

private KeyListener
protected boolean
largeModel

True if doing optimizations for a largeModel.

protected int
lastSelectedRow

Index of the row that was last selected.

private int
leadRow

Row corresponding to lead path.

protected int
leftChildIndent

Distance between left margin and where vertical dashes will be drawn.

private boolean
leftToRight

Indicates the orientation.

private boolean
lineTypeDashed

UI property for painting dashed lines

private MouseListener
protected AbstractLayoutCache.NodeDimensions
nodeDimensions

Responsible for telling the TreeState the size needed for a node.

private boolean
paintLines

UI property indicating whether to paint lines

protected Dimension
preferredMinSize

Minimum preferred size.

protected Dimension
preferredSize

Size needed to completely display all the nodes.

private PropertyChangeListener
private MouseEvent
releaseEvent

A temporary variable for communication between startEditingOnRelease and startEditing.

protected CellRendererPane
rendererPane

Used to paint the TreeCellRenderer.

protected int
rightChildIndent

Distance to add to leftChildIndent to determine where cell contents will be drawn.

private PropertyChangeListener
private static final BasicTreeUI.Actions
protected boolean
stopEditingInCompleteEditing

Set to false when editing and shouldSelectCell() returns true meaning the node should be selected before editing, used in completeEditing.

private long
timeFactor

The time factor to treat the series of typed alphanumeric key as prefix for first letter navigation.

protected int
totalChildIndent

Total distance that will be indented.

protected JTree
tree

Component that we're going to be drawing into.

private TreeExpansionListener
treeExpansionListener

Updates the treestate as the nodes expand.

protected TreeModel
treeModel

Used to determine what to display.

private TreeModelListener
treeModelListener

Is responsible for updating the display based on model events.

private TreeSelectionListener
treeSelectionListener

Updates the display when the selection changes.

protected TreeSelectionModel
treeSelectionModel

Model maintaining the selection.

protected AbstractLayoutCache
treeState

Object responsible for handling sizing and expanded issues.

protected boolean
validCachedPreferredSize

Is the preferredSize valid?

Constructor Summary

AccessConstructor and Description
public
BasicTreeUI()

Constructs a new instance of BasicTreeUI.

Method Summary

Modifier and TypeMethod and Description
public void
cancelEditing(JTree tree)

Implements abstract javax.swing.plaf.TreeUI.cancelEditing.

Cancels the current editing session.

protected void
checkForClickInExpandControl(TreePath
a tree path
path
,
int
an X coordinate
mouseX
,
int
an Y coordinate
mouseY
)

If the mouseX and mouseY are in the expand/collapse region of the row, this will toggle the row.

protected void
completeEditing()

Messages to stop the editing session.

protected void
completeEditing(boolean
message to stop editing
messageStop
,
boolean
message to cancel editing
messageCancel
,
boolean
message to tree
messageTree
)

Stops the editing session.

protected void
completeUIInstall()

Invoked from installUI after all the defaults/listeners have been installed.

protected void
completeUIUninstall()

Uninstalls UI.

protected void
configureLayoutCache()

Resets the TreeState instance based on the tree we're providing the look and feel for.

protected CellEditorListener

Returns:

an instance of the CellEditorListener
createCellEditorListener
()

Creates a listener to handle events from the current editor.

protected CellRendererPane

Returns:

an instance of the CellRendererPane
createCellRendererPane
()

Returns the renderer pane that renderer components are placed in.

protected ComponentListener

Returns:

an instance of the ComponentListener
createComponentListener
()

Creates and returns a new ComponentHandler.

protected TreeCellEditor

Returns:

a default cell editor
createDefaultCellEditor
()

Creates a default cell editor.

protected TreeCellRenderer

Returns:

an instance of TreeCellRenderer
createDefaultCellRenderer
()

Returns the default cell renderer that is used to do the stamping of each node.

protected FocusListener

Returns:

an instance of the FocusListener
createFocusListener
()

Creates a listener that is responsible for updating the display when focus is lost/gained.

protected KeyListener

Returns:

an instance of the KeyListener
createKeyListener
()

Creates the listener responsible for getting key events from the tree.

protected AbstractLayoutCache

Returns:

the object responsible for managing what is expanded
createLayoutCache
()

Creates the object responsible for managing what is expanded, as well as the size of nodes.

protected MouseListener

Returns:

an instance of the MouseListener
createMouseListener
()

Creates the listener responsible for updating the selection based on mouse events.

protected AbstractLayoutCache.NodeDimensions

Returns:

an instance of NodeDimensions
createNodeDimensions
()

Creates an instance of NodeDimensions that is able to determine the size of a given node in the tree.

protected PropertyChangeListener

Returns:

an instance of the PropertyChangeListener
createPropertyChangeListener
()

Creates a listener that is responsible that updates the UI based on how the tree changes.

protected PropertyChangeListener

Returns:

an instance of the PropertyChangeListener
createSelectionModelPropertyChangeListener
()

Creates the listener responsible for getting property change events from the selection model.

protected TreeExpansionListener

Returns:

an instance of the TreeExpansionListener
createTreeExpansionListener
()

Creates and returns the object responsible for updating the treestate when nodes expanded state changes.

protected TreeModelListener

Returns:

an instance of the TreeModelListener.
createTreeModelListener
()

Returns a listener that can update the tree when the model changes.

protected TreeSelectionListener

Returns:

an instance of the TreeSelectionListener
createTreeSelectionListener
()

Creates the listener that updates the display based on selection change methods.

public static ComponentUI

Returns:

a new instance of BasicTreeUI
createUI
(JComponent
a component
x
)

Hides javax.swing.plaf.ComponentUI.createUI.

Constructs a new instance of BasicTreeUI.

protected void
drawCentered(Component
a component
c
,
Graphics
a graphics context
graphics
,
Icon
an icon
icon
,
int
an X coordinate
x
,
int
an Y coordinate
y
)

Draws the icon centered at (x,y).

protected void
drawDashedHorizontalLine(Graphics
an instance of Graphics
g
,
int
an Y coordinate
y
,
int
an X1 coordinate
x1
,
int
an X2 coordinate
x2
)

Draws a horizontal dashed line.

private void
drawDashedLine(Graphics g, int v, int v1, int v2, boolean isVertical)

protected void
drawDashedVerticalLine(Graphics
an instance of Graphics
g
,
int
an X coordinate
x
,
int
an Y1 coordinate
y1
,
int
an Y2 coordinate
y2
)

Draws a vertical dashed line.

protected void
ensureRowsAreVisible(int
the begin row
beginRow
,
int
the end row
endRow
)

Ensures that the rows identified by beginRow through endRow are visible.

private void
extendSelection(TreePath newLead)

Extends the selection from the anchor to make newLead the lead of the selection.

private int
findCenteredX(int x, int iconWidth)

private TreePath
public int
getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.ComponentUI.getBaseline.

Returns the baseline.

public Component.BaselineResizeBehavior
getBaselineResizeBehavior(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getBaselineResizeBehavior.

Returns an enum indicating how the baseline of the component changes as the size changes.

protected TreeCellEditor

Returns:

the TreeCellEditor instance, or null
getCellEditor
()

Returns the editor used to edit entries in the drawn tree component, or null if the tree cannot be edited.

protected TreeCellRenderer

Returns:

the TreeCellRenderer instance
getCellRenderer
()

Returns the current instance of the TreeCellRenderer that is rendering each cell.

public TreePath
getClosestPathForLocation(JTree tree, int x, int y)

Implements abstract javax.swing.plaf.TreeUI.getClosestPathForLocation.

Returns the path to the node that is closest to x,y.

public Icon

Returns:

the collapsed icon
getCollapsedIcon
()

Returns the collapsed icon.

protected Rectangle

Returns:

bounding box for the drop line
getDropLineRect
(JTree.DropLocation
a DropLocation
loc
)

Returns a unbounding box for the drop line.

public TreePath
getEditingPath(JTree tree)

Implements abstract javax.swing.plaf.TreeUI.getEditingPath.

Returns the path to the element that is being edited.

public Icon

Returns:

the expanded icon
getExpandedIcon
()

Returns the expanded icon.

private BasicTreeUI.Handler
protected Color

Returns:

the hash color
getHashColor
()

Returns the hash color.

protected int

Returns:

the horizontal leg buffer
getHorizontalLegBuffer
()

The horizontal element of legs between nodes starts at the right of the left-hand side of the child node by default.

pack-priv InputMap
getInputMap(int condition)

protected TreePath

Returns:

a path to the last child of parent
getLastChildPath
(TreePath
a tree path
parent
)

Returns a path to the last child of parent.

private TreePath
protected int

Returns:

selection lead row
getLeadSelectionRow
()

Returns the lead row of the selection.

public int

Returns:

the left child indent
getLeftChildIndent
()

Returns the left child indent.

public Dimension
getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Returns the maximum size for this component, which will be the preferred size if the instance is currently in a JTree, or 0, 0.

public Dimension
getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the minimum size for this component.

protected TreeModel

Returns:

the tree model
getModel
()

Returns the tree model.

public Rectangle
getPathBounds(JTree tree, TreePath path)

Implements abstract javax.swing.plaf.TreeUI.getPathBounds.

Returns the Rectangle enclosing the label portion that the last item in path will be drawn into.

private Rectangle
getPathBounds(TreePath path, Insets insets, Rectangle bounds)

public TreePath
getPathForRow(JTree tree, int row)

Implements abstract javax.swing.plaf.TreeUI.getPathForRow.

Returns the path for passed in row.

public Dimension

Returns:

the minimum preferred size
getPreferredMinSize
()

Returns the minimum preferred size.

public Dimension

Returns:

the preferred size to represent the tree in the component
getPreferredSize
(JComponent
a component
c
)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the preferred size to properly display the tree, this is a cover method for getPreferredSize(c, true).

public Dimension

Returns:

the preferred size to represent the tree in the component
getPreferredSize
(JComponent
a component
c
,
boolean
if true consistency is checked
checkConsistency
)

Returns the preferred size to represent the tree in c.

private Rectangle
public int

Returns:

the right child indent
getRightChildIndent
()

Returns the right child indent.

public int
getRowCount(JTree tree)

Implements abstract javax.swing.plaf.TreeUI.getRowCount.

Returns the number of rows that are being displayed.

public int
getRowForPath(JTree tree, TreePath path)

Implements abstract javax.swing.plaf.TreeUI.getRowForPath.

Returns the row that the last item identified in path is visible at.

protected int

Returns:

the height of each row, in pixels
getRowHeight
()

Returns the height of each row in the drawn tree component.

protected int

Returns:

amount to indent the given row.
getRowX
(int
Row to return x location for
row
,
int
Depth of the row
depth
)

Returns the location, along the x-axis, to render a particular row at.

protected TreeSelectionModel

Returns:

the TreeSelectionModel instance
getSelectionModel
()

Returns the current instance of the TreeSelectionModel which is the model for selections.

protected boolean

Returns:

true if the root handles are to be displayed
getShowsRootHandles
()

Returns true if the root handles are to be displayed.

protected int

Returns:

the vertical leg buffer
getVerticalLegBuffer
()

The vertical element of legs between nodes starts at the bottom of the parent node by default.

protected void
handleExpandControlClick(TreePath
a tree path
path
,
int
an X coordinate
mouseX
,
int
an Y coordinate
mouseY
)

Messaged when the user clicks the particular row, this invokes toggleExpandState.

protected void
installComponents()

Installs the subcomponents of the tree, which is the renderer pane.

protected void
installDefaults()

Installs default properties.

protected void
installKeyboardActions()

Registers keyboard actions.

protected void
installListeners()

Registers listeners.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

protected boolean

Returns:

true if the drop location should be shown as a line
isDropLine
(JTree.DropLocation
a DropLocation
loc
)

Tells if a DropLocation should be indicated by a line between nodes.

protected boolean

Returns:

true if the tree is editable
isEditable
()

Returns whether the drawn tree component should be enabled for editing.

public boolean
isEditing(JTree tree)

Implements abstract javax.swing.plaf.TreeUI.isEditing.

Returns true if the tree is being edited.

protected boolean

Returns:

true if large model is set
isLargeModel
()

Returns true if large model is set.

protected boolean

Returns:

true if the node at row is a leaf
isLeaf
(int
a row
row
)

Returns true if the node at row is a leaf.

protected boolean

Returns:

true if the mouse cursor fall in the area of row that is used to expand/collapse the node and the node is not a leaf.
isLocationInExpandControl
(TreePath
a tree path
path
,
int
an X coordinate
mouseX
,
int
an Y coordinate
mouseY
)

Returns true if mouseX and mouseY fall in the area of row that is used to expand/collapse the node and the node at row does not represent a leaf.

protected boolean

Returns:

true if a mouse event on the node should select from the anchor point
isMultiSelectEvent
(MouseEvent
a mouse event
event
)

Returning true signifies a mouse event on the node should select from the anchor point.

protected boolean

Returns:

true if the root node of the tree is displayed
isRootVisible
()

Returns whether the root node of the drawn tree component should be displayed.

protected boolean

Returns:

true if the row under the mouse should be toggled
isToggleEvent
(MouseEvent
a mouse event
event
)

Returning true indicates the row under the mouse should be toggled based on the event.

protected boolean

Returns:

true if a mouse event on the node should toggle the selection
isToggleSelectionEvent
(MouseEvent
a mouse event
event
)

Returning true signifies a mouse event on the node should toggle the selection of only the row under mouse.

pack-priv static void
public void
paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.paint.

Paints the specified component appropriately for the look and feel.

protected void
paintDropLine(Graphics
Graphics object to draw on
g
)

Paints the drop line.

protected void
paintExpandControl(Graphics
a graphics context
g
,
Rectangle
a clipped rectangle
clipBounds
,
Insets
insets
insets
,
Rectangle
a bounding rectangle
bounds
,
TreePath
a tree path
path
,
int
a row
row
,
boolean
true if the path is expanded
isExpanded
,
boolean
true if the path has been expanded
hasBeenExpanded
,
boolean
true if the row is leaf
isLeaf
)

Paints the expand (toggle) part of a row.

protected void
paintHorizontalLine(Graphics
a graphics context
g
,
JComponent
a component
c
,
int
an Y coordinate
y
,
int
an X1 coordinate
left
,
int
an X2 coordinate
right
)

Paints a horizontal line.

protected void
paintHorizontalPartOfLeg(Graphics
a graphics context
g
,
Rectangle
a clipped rectangle
clipBounds
,
Insets
insets
insets
,
Rectangle
a bounding rectangle
bounds
,
TreePath
a tree path
path
,
int
a row
row
,
boolean
true if the path is expanded
isExpanded
,
boolean
true if the path has been expanded
hasBeenExpanded
,
boolean
true if the path is leaf
isLeaf
)

Paints the horizontal part of the leg.

protected void
paintRow(Graphics
a graphics context
g
,
Rectangle
a clipped rectangle
clipBounds
,
Insets
insets
insets
,
Rectangle
a bounding rectangle
bounds
,
TreePath
a tree path
path
,
int
a row
row
,
boolean
true if the path is expanded
isExpanded
,
boolean
true if the path has been expanded
hasBeenExpanded
,
boolean
true if the path is leaf
isLeaf
)

Paints the renderer part of a row.

protected void
paintVerticalLine(Graphics
a graphics context
g
,
JComponent
a component
c
,
int
an X coordinate
x
,
int
an Y1 coordinate
top
,
int
an Y2 coordinate
bottom
)

Paints a vertical line.

protected void
paintVerticalPartOfLeg(Graphics
a graphics context
g
,
Rectangle
a clipped rectangle
clipBounds
,
Insets
insets
insets
,
TreePath
a tree path
path
)

Paints the vertical part of the leg.

protected void
pathWasCollapsed(TreePath
a tree path
path
)

Messaged from the VisibleTreeNode after it has collapsed.

protected void
pathWasExpanded(TreePath
a tree path
path
)

Messaged from the VisibleTreeNode after it has been expanded.

protected void
prepareForUIInstall()

Invoked after the tree instance variable has been set, but before any defaults/listeners have been installed.

protected void
prepareForUIUninstall()

Invoked before uninstallation of UI.

private void
redoTheLayout()

Recomputes the right margin, and invalidates any tree states

private void
repaintPath(TreePath path)

Invokes repaint on the JTree for the passed in TreePath, path.

protected void
selectPathForEvent(TreePath
the selected path
path
,
MouseEvent
the mouse event
event
)

Messaged to update the selection based on a MouseEvent over a particular row.

private void
protected void
setCellEditor(TreeCellEditor
the new value of the cellEditor property
editor
)

Sets the cell editor.

protected void
setCellRenderer(TreeCellRenderer
the new value of the cellRenderer property
tcr
)

Sets the TreeCellRenderer to tcr.

public void
setCollapsedIcon(Icon
the collapsed icon
newG
)

Sets the collapsed icon.

protected void
setEditable(boolean
the new value of the editable property
newValue
)

Configures the receiver to allow, or not allow, editing.

public void
setExpandedIcon(Icon
the expanded icon
newG
)

Sets the expanded icon.

protected void
setHashColor(Color
the hash color
color
)

Sets the hash color.

protected void
setLargeModel(boolean
the new value of the largeModel property
largeModel
)

Sets the largeModel.

private void
private void
setLeadSelectionPath(TreePath newPath, boolean repaint)

public void
setLeftChildIndent(int
the left child indent
newAmount
)

Sets the left child indent.

protected void
setModel(TreeModel
the new value
model
)

Sets the TreeModel.

public void
setPreferredMinSize(Dimension
the new preferred size
newSize
)

Sets the preferred minimum size.

public void
setRightChildIndent(int
the right child indent
newAmount
)

Sets the right child indent.

protected void
setRootVisible(boolean
the new value of the rootVisible property
newValue
)

Sets the root to being visible.

protected void
setRowHeight(int
the new value of the rowHeight property
rowHeight
)

Sets the row height, this is forwarded to the treeState.

protected void
setSelectionModel(TreeSelectionModel
the new value of the selectionModel property
newLSM
)

Resets the selection model.

protected void
setShowsRootHandles(boolean
the new value of the showsRootHandles property
newValue
)

Determines whether the node handles are to be displayed.

protected boolean

Returns:

true if the expand (toggle) control should be drawn for the specified row
shouldPaintExpandControl
(TreePath
a tree path
path
,
int
a row
row
,
boolean
true if the path is expanded
isExpanded
,
boolean
true if the path has been expanded
hasBeenExpanded
,
boolean
true if the row is leaf
isLeaf
)

Returns true if the expand (toggle) control should be drawn for the specified row.

protected boolean

Returns:

true if the editing is successful
startEditing
(TreePath
a tree path
path
,
MouseEvent
a mouse event
event
)

Will start editing for node if there is a cellEditor and shouldSelectCell returns true.

public void
startEditingAtPath(JTree tree, TreePath path)

Implements abstract javax.swing.plaf.TreeUI.startEditingAtPath.

Selects the last item in path and tries to edit it.

private boolean
public boolean
stopEditing(JTree tree)

Implements abstract javax.swing.plaf.TreeUI.stopEditing.

Stops the current editing session.

protected void
toggleExpandState(TreePath
a tree path
path
)

Expands path if it is not expanded, or collapses row if it is expanded.

protected void
uninstallComponents()

Uninstalls the renderer pane.

protected void
uninstallDefaults()

Uninstalls default properties.

protected void
uninstallKeyboardActions()

Unregisters keyboard actions.

protected void
uninstallListeners()

Unregisters listeners.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.

protected void
updateCachedPreferredSize()

Updates the preferredSize instance variable, which is returned from getPreferredSize().

protected void
updateCellEditor()

Updates the cellEditor based on the editability of the JTree that we're contained in. If the tree is editable but doesn't have a cellEditor, a basic one will be used.

protected void
updateDepthOffset()

Updates how much each depth should be offset by.

protected void
updateExpandedDescendants(TreePath
a tree path
path
)

Updates the expanded state of all the descendants of path by getting the expanded descendants from the tree and forwarding to the tree state.

protected void
updateLayoutCacheExpandedNodes()

Makes all the nodes that are expanded in JTree expanded in LayoutCache.

private void
protected void
updateLeadSelectionRow()

Updates the lead row of the selection.

protected void
updateRenderer()

Messaged from the tree we're in when the renderer has changed.

protected void
updateSize()

Marks the cached size as being invalid, and messages the tree with treeDidChange.

private void