public abstract class TreeUI extends ComponentUI
JTree
.JTree
Constructor and Description |
---|
TreeUI()
Constructs a new
TreeUI . |
Modifier and Type | Method and Description |
---|---|
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.
|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
public TreeUI()
TreeUI
.public abstract Rectangle getPathBounds(JTree tree, TreePath path)
tree
- the JTree
for which this delegate
object provides the user interface.path
- the path whose label extent is requested.null
if path
contains invalid nodes.public abstract TreePath getPathForRow(JTree tree, int row)
TreePath
for the specified row.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]
.TreePath
for the specified row, or
null
if row
is outside
the valid range.public abstract int getRowForPath(JTree tree, TreePath path)
TreePath
is currently
being displayed.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.[0, getRowCount(tree)
- 1]
if the path is currently on display;
-1
if the path is not shown to the
user.public abstract int getRowCount(JTree tree)
tree
- the JTree
for which this delegate
object provides the user interface.public abstract TreePath getClosestPathForLocation(JTree tree, int x, int y)
As shown by the above illustration, the bounds of the closest path do not necessarily need to contain the passed location.
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
.null
if the
tree is currenlty not displaying any paths at all.public abstract boolean isEditing(JTree tree)
tree
- the JTree
for which this delegate
object provides the user interface.getEditingPath(javax.swing.JTree)
public abstract boolean stopEditing(JTree tree)
tree
- the JTree
for which this delegate
object provides the user interface.false
if the editing still goes on because
the cell editor has objected to stopping the session;
true
if editing has been stopped.public abstract void cancelEditing(JTree tree)
tree
- the JTree
for which this delegate
object provides the user interface.public abstract void startEditingAtPath(JTree tree, TreePath path)
tree
- the JTree
for which this delegate
object provides the user interface.path
- the cell to edit.public abstract TreePath getEditingPath(JTree tree)
null
if no editing session is currently active.