BasicTreeUI
, MultiTreeUI
public abstract class TreeUI extends ComponentUI
Modifier | Constructor | Description |
---|---|---|
protected |
Constructor for subclasses to call. |
Modifier and Type | Method | Description |
---|---|---|
abstract void |
cancelEditing |
Cancels the current editing session. |
abstract TreePath |
getClosestPathForLocation |
Returns the path to the node that is closest to x,y. |
abstract TreePath |
getEditingPath |
Returns the path to the element that is being edited. |
abstract Rectangle |
getPathBounds |
Returns the Rectangle enclosing the label portion that the last item in path will be drawn into. |
abstract TreePath |
getPathForRow |
Returns the path for passed in row. |
abstract int |
getRowCount |
Returns the number of rows that are being displayed. |
abstract int |
getRowForPath |
Returns the row that the last item identified in path is visible at. |
abstract boolean |
isEditing |
Returns true if the tree is being edited. |
abstract void |
startEditingAtPath |
Selects the last item in path and tries to edit it. |
abstract boolean |
stopEditing |
Stops the current editing session. |
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
protected TreeUI()
public abstract Rectangle getPathBounds(JTree tree, TreePath path)
tree
- the JTree
for path
path
- the TreePath
identifying the nodeRectangle
enclosing the label portion that the last item in path will be drawn into, null
if any component in path is currently valid.public abstract TreePath getPathForRow(JTree tree, int row)
tree
- a JTree
objectrow
- an integer specifying a rowpath
for row
or null
if row
is not visiblepublic abstract int getRowForPath(JTree tree, TreePath path)
tree
- the JTree
for path
path
- the TreePath
object to look inpath
are not currently visiblepublic abstract int getRowCount(JTree tree)
tree
- the JTree
for which to count rowspublic abstract TreePath getClosestPathForLocation(JTree tree, int x, int y)
tree
- a JTree
objectx
- an integer giving the number of pixels horizontally from the left edge of the display areay
- an integer giving the number of pixels vertically from the top of the display area, minus any top marginTreePath
node closest to x,y
or null
if there is nothing currently visiblepublic abstract boolean isEditing(JTree tree)
tree
- a JTree
objecttree
is being editedpublic abstract boolean stopEditing(JTree tree)
tree
- a JTree
objectpublic abstract void cancelEditing(JTree tree)
tree
- a JTree
objectpublic abstract void startEditingAtPath(JTree tree, TreePath path)
tree
- the JTree
being editedpath
- the TreePath
to be editedpublic abstract TreePath getEditingPath(JTree tree)
tree
- the JTree
for which to return a pathTreePath
containing the path to tree
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/plaf/TreeUI.html