javax.swing.plaf
public abstract class TreeUI extends ComponentUI
Constructor Summary | |
---|---|
TreeUI()
Constructs a new TreeUI . |
Method Summary | |
---|---|
abstract void | cancelEditing(JTree tree)
Cancels editing a tree cell, discarding any entered value.
|
abstract TreePath | getClosestPathForLocation(JTree tree, int x, int y)
Finds the path that is closest to the specified position.
|
abstract TreePath | getEditingPath(JTree tree)
Retrieves the tree cell that is currently being edited.
|
abstract Rectangle | getPathBounds(JTree tree, TreePath path)
Determines the geometric extent of the label that is
drawn for a path.
|
abstract TreePath | getPathForRow(JTree tree, int row)
Creates a TreePath for the specified row.
|
abstract int | getRowCount(JTree tree)
Counts how many rows are currently displayed.
|
abstract int | getRowForPath(JTree tree, TreePath path)
Determines in which row a TreePath is currently
being displayed.
|
abstract boolean | isEditing(JTree tree)
Determines whether the user is currently editing a tree cell.
|
abstract void | startEditingAtPath(JTree tree, TreePath path)
Starts a session to edit a tree cell. |
abstract boolean | stopEditing(JTree tree)
Stops editing a tree cell, committing the entered value into the
tree’s model. |
TreeUI
.Parameters: tree the JTree
for which this delegate
object provides the user interface.
As shown by the above illustration, the bounds of the closest path do not necessarily need to contain the passed location.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
x the horizontal location, relative to the origin
of tree
.
y the vertical location, relative to the origin
of tree
.
Returns: the closest path, or null
if the
tree is currenlty not displaying any paths at all.
Returns: the currently edited path, or null
if no editing session is currently active.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
path the path whose label extent is requested.
Returns: a rectangle enclosing the label, or null
if path
contains invalid nodes.
TreePath
for the specified row.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
row the index of the row, which should be a number
in the range [0, getRowCount(tree) - 1]
.
Returns: a TreePath
for the specified row, or
null
if row
is outside
the valid range.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
Returns: the number of visible rows.
TreePath
is currently
being displayed.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
path the path for which the caller wants to know
in which row it is being displayed.
Returns: a number in the range [0, getRowCount(tree)
- 1]
if the path is currently on display;
-1
if the path is not shown to the
user.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
See Also: TreeUI
Parameters: tree the JTree
for which this delegate
object provides the user interface.
path the cell to edit.
Parameters: tree the JTree
for which this delegate
object provides the user interface.
Returns: false
if the editing still goes on because
the cell editor has objected to stopping the session;
true
if editing has been stopped.