void
|
cancelEditing(JTree tree)
Cancels the current editing session.
|
void
|
checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
If the mouseX and mouseY are in the
expand/collapse region of the row , this will toggle
the row.
|
void
|
completeEditing()
Messages to stop the editing session.
|
void
|
completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
Stops the editing session.
|
void
|
completeUIInstall()
Invoked from installUI after all the defaults/listeners have been
installed.
|
void
|
completeUIUninstall()
|
void
|
configureLayoutCache()
Resets the TreeState instance based on the tree we're providing the
look and feel for.
|
CellEditorListener
|
createCellEditorListener()
Creates a listener to handle events from the current editor.
|
CellRendererPane
|
createCellRendererPane()
Returns the renderer pane that renderer components are placed in.
|
ComponentListener
|
createComponentListener()
Creates and returns a new ComponentHandler.
|
TreeCellEditor
|
createDefaultCellEditor()
Creates a default cell editor.
|
TreeCellRenderer
|
createDefaultCellRenderer()
Returns the default cell renderer that is used to do the
stamping of each node.
|
FocusListener
|
createFocusListener()
Creates a listener that is responsible for updating the display
when focus is lost/gained.
|
KeyListener
|
createKeyListener()
Creates the listener reponsible for getting key events from
the tree.
|
AbstractLayoutCache
|
createLayoutCache()
Creates the object responsible for managing what is expanded, as
well as the size of nodes.
|
MouseListener
|
createMouseListener()
Creates the listener responsible for updating the selection based on
mouse events.
|
AbstractLayoutCache.NodeDimensions
|
createNodeDimensions()
Creates an instance of NodeDimensions that is able to determine
the size of a given node in the tree.
|
PropertyChangeListener
|
createPropertyChangeListener()
Creates a listener that is responsible that updates the UI based on
how the tree changes.
|
PropertyChangeListener
|
createSelectionModelPropertyChangeListener()
Creates the listener responsible for getting property change
events from the selection model.
|
TreeExpansionListener
|
createTreeExpansionListener()
Creates and returns the object responsible for updating the treestate
when nodes expanded state changes.
|
TreeModelListener
|
createTreeModelListener()
Returns a listener that can update the tree when the model changes.
|
TreeSelectionListener
|
createTreeSelectionListener()
Creates the listener that updates the display based on selection change
methods.
|
static
ComponentUI
|
createUI(JComponent x)
|
void
|
drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
|
void
|
drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
|
void
|
drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
|
void
|
ensureRowsAreVisible(int beginRow, int endRow)
Ensures that the rows identified by beginRow through endRow are
visible.
|
int
|
getBaseline(JComponent c, int width, int height)
Returns the baseline.
|
Component.BaselineResizeBehavior
|
getBaselineResizeBehavior(JComponent c)
Returns an enum indicating how the baseline of the component
changes as the size changes.
|
TreeCellEditor
|
getCellEditor()
|
TreeCellRenderer
|
getCellRenderer()
Return currentCellRenderer, which will either be the trees
renderer, or defaultCellRenderer, which ever wasn't null.
|
TreePath
|
getClosestPathForLocation(JTree tree, int x, int y)
Returns the path to the node that is closest to x,y.
|
Icon
|
getCollapsedIcon()
|
TreePath
|
getEditingPath(JTree tree)
Returns the path to the element that is being edited.
|
Icon
|
getExpandedIcon()
|
Color
|
getHashColor()
|
int
|
getHorizontalLegBuffer()
The horizontal element of legs between nodes starts at the
right of the left-hand side of the child node by default.
|
TreePath
|
getLastChildPath(TreePath parent)
Returns a path to the last child of parent .
|
int
|
getLeftChildIndent()
|
Dimension
|
getMaximumSize(JComponent c)
Returns the maximum size for this component, which will be the
preferred size if the instance is currently in a JTree, or 0, 0.
|
Dimension
|
getMinimumSize(JComponent c)
Returns the minimum size for this component.
|
TreeModel
|
getModel()
|
Rectangle
|
getPathBounds(JTree tree, TreePath path)
Returns the Rectangle enclosing the label portion that the
last item in path will be drawn into.
|
TreePath
|
getPathForRow(JTree tree, int row)
Returns the path for passed in row.
|
Dimension
|
getPreferredMinSize()
Returns the minimum preferred size.
|
Dimension
|
getPreferredSize(JComponent c)
Returns the preferred size to properly display the tree,
this is a cover method for getPreferredSize(c, false).
|
Dimension
|
getPreferredSize(JComponent c, boolean checkConsistancy)
Returns the preferred size to represent the tree in
c.
|
int
|
getRightChildIndent()
|
int
|
getRowCount(JTree tree)
Returns the number of rows that are being displayed.
|
int
|
getRowForPath(JTree tree, TreePath path)
Returns the row that the last item identified in path is visible
at.
|
int
|
getRowHeight()
|
int
|
getRowX(int row, int depth)
Returns the location, along the x-axis, to render a particular row
at.
|
TreeSelectionModel
|
getSelectionModel()
|
boolean
|
getShowsRootHandles()
|
int
|
getVerticalLegBuffer()
The vertical element of legs between nodes starts at the bottom of the
parent node by default.
|
void
|
handleExpandControlClick(TreePath path, int mouseX, int mouseY)
Messaged when the user clicks the particular row, this invokes
toggleExpandState.
|
void
|
installComponents()
Intalls the subcomponents of the tree, which is the renderer pane.
|
void
|
installDefaults()
|
void
|
installKeyboardActions()
|
void
|
installListeners()
|
void
|
installUI(JComponent c)
Configures the specified component appropriate for the look and feel.
|
boolean
|
isEditable()
|
boolean
|
isEditing(JTree tree)
Returns true if the tree is being edited.
|
boolean
|
isLargeModel()
|
boolean
|
isLeaf(int row)
|
boolean
|
isLocationInExpandControl(TreePath path, int mouseX, int 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.
|
boolean
|
isMultiSelectEvent(MouseEvent event)
Returning true signifies a mouse event on the node should select
from the anchor point.
|
boolean
|
isRootVisible()
|
boolean
|
isToggleEvent(MouseEvent event)
Returning true indicates the row under the mouse should be toggled
based on the event.
|
boolean
|
isToggleSelectionEvent(MouseEvent event)
Returning true signifies a mouse event on the node should toggle
the selection of only the row under mouse.
|
void
|
paint(Graphics g, JComponent c)
Paints the specified component appropriate for the look and feel.
|
void
|
paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Paints the expand (toggle) part of a row.
|
void
|
paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
Paints a horizontal line.
|
void
|
paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Paints the horizontal part of the leg.
|
void
|
paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Paints the renderer part of a row.
|
void
|
paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
Paints a vertical line.
|
void
|
paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
Paints the vertical part of the leg.
|
void
|
pathWasCollapsed(TreePath path)
Messaged from the VisibleTreeNode after it has collapsed.
|
void
|
pathWasExpanded(TreePath path)
Messaged from the VisibleTreeNode after it has been expanded.
|
void
|
prepareForUIInstall()
Invoked after the tree instance variable has been
set, but before any defaults/listeners have been installed.
|
void
|
prepareForUIUninstall()
|
void
|
selectPathForEvent(TreePath path, MouseEvent event)
Messaged to update the selection based on a MouseEvent over a
particular row.
|
void
|
setCellEditor(TreeCellEditor editor)
Sets the cell editor.
|
void
|
setCellRenderer(TreeCellRenderer tcr)
Sets the TreeCellRenderer to tcr .
|
void
|
setCollapsedIcon(Icon newG)
|
void
|
setEditable(boolean newValue)
Configures the receiver to allow, or not allow, editing.
|
void
|
setExpandedIcon(Icon newG)
|
void
|
setHashColor(Color color)
|
void
|
setLargeModel(boolean largeModel)
Updates the componentListener, if necessary.
|
void
|
setLeftChildIndent(int newAmount)
|
void
|
setModel(TreeModel model)
Sets the TreeModel.
|
void
|
setPreferredMinSize(Dimension newSize)
Sets the preferred minimum size.
|
void
|
setRightChildIndent(int newAmount)
|
void
|
setRootVisible(boolean newValue)
Sets the root to being visible.
|
void
|
setRowHeight(int rowHeight)
Sets the row height, this is forwarded to the treeState.
|
void
|
setSelectionModel(TreeSelectionModel newLSM)
Resets the selection model.
|
void
|
setShowsRootHandles(boolean newValue)
Determines whether the node handles are to be displayed.
|
boolean
|
shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
Returns true if the expand (toggle) control should be drawn for
the specified row.
|
boolean
|
startEditing(TreePath path, MouseEvent event)
Will start editing for node if there is a cellEditor and
shouldSelectCell returns true.
|
void
|
startEditingAtPath(JTree tree, TreePath path)
Selects the last item in path and tries to edit it.
|
boolean
|
stopEditing(JTree tree)
Stops the current editing session.
|
void
|
toggleExpandState(TreePath path)
Expands path if it is not expanded, or collapses row if it is expanded.
|
void
|
uninstallComponents()
Uninstalls the renderer pane.
|
void
|
uninstallDefaults()
|
void
|
uninstallKeyboardActions()
|
void
|
uninstallListeners()
|
void
|
uninstallUI(JComponent c)
Reverses configuration which was done on the specified component during
installUI .
|
void
|
updateCachedPreferredSize()
Updates the preferredSize instance variable,
which is returned from getPreferredSize() .
|
void
|
updateCellEditor()
Updates the cellEditor based on the editability of the JTree that
we're contained in.
|
void
|
updateDepthOffset()
Updates how much each depth should be offset by.
|
void
|
updateExpandedDescendants(TreePath 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.
|
void
|
updateLayoutCacheExpandedNodes()
Makes all the nodes that are expanded in JTree expanded in LayoutCache.
|
void
|
updateRenderer()
Messaged from the tree we're in when the renderer has changed.
|
void
|
updateSize()
Marks the cached size as being invalid, and messages the
tree with treeDidChange .
|