All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.plaf.TreeUI
java.lang.Object
|
+----java.awt.swing.plaf.ComponentUI
|
+----java.awt.swing.plaf.TreeUI
- public abstract class TreeUI
- extends ComponentUI
Pluggable look and feel interface for JTree.
TreeUI()
-
collapsePath(TreePath)
- Insures that the last item identified in path is collapsed and
visible.
collapseRow(int)
- Insures that the item identified by row is collapsed.
expandPath(TreePath)
- Insures that the last item identified in path is expanded and
visible.
expandRow(int)
- Insures that the item identified by row is expanded.
getClosestPathForLocation(int, int)
- Returns the path to the node that is closest to x,y.
getClosestRowForLocation(int, int)
- Returns the row to the node that is closest to x,y.
getEditingPath()
- Returns the path to the element that is being edited.
getPathBounds(TreePath)
- Returns the Rectangle enclosing the label portion that the
last item in path will be drawn into.
getPathForRow(int)
- Returns the path for passed in row.
getRowBounds(int)
- Returns the Rectangle enclosing the label portion that the
item identified by row will be drawn into.
getRowCount()
- Returns the number of rows that are being displayed.
getRowForPath(TreePath)
- Returns the row that the last item identified in path is visible
at.
isCollapsed(int)
- Returns true if the value identified by row is currently collapsed.
isCollapsed(TreePath)
- Returns true if the value identified by path is currently collapsed,
this will return false if any of the values in path are currently
not being displayed.
isEditing()
- Returns true if the tree is being edited.
isExpanded(int)
- Returns true if the value identified by row is currently expanded.
isExpanded(TreePath)
- Returns true if the value identified by path is currently expanded,
this will return false if any of the values in path are currently
not being displayed.
isVisible(TreePath)
- Returns true if all the parents of path are currently expanded.
makeVisible(TreePath)
- Ensures that all of the parents of path are currently expanded.
scrollPathToVisible(TreePath)
- Makes sure all the path components in path are expanded (accept
for the last path component) and tries to scroll the resulting path
to be visible (the scrolling will only work if the JTree is
contained in a JScrollPane).
scrollRowToVisible(int)
- Scrolls the item identified by row to be visible.
startEditingAtPath(TreePath)
- Selects the last item in path and tries to edit it.
stopEditing()
- Stops the current editing session.
TreeUI
public TreeUI()
getRowCount
public abstract int getRowCount()
- Returns the number of rows that are being displayed.
isExpanded
public abstract boolean isExpanded(TreePath path)
- Returns true if the value identified by path is currently expanded,
this will return false if any of the values in path are currently
not being displayed.
isExpanded
public abstract boolean isExpanded(int row)
- Returns true if the value identified by row is currently expanded.
isCollapsed
public abstract boolean isCollapsed(TreePath path)
- Returns true if the value identified by path is currently collapsed,
this will return false if any of the values in path are currently
not being displayed.
isCollapsed
public abstract boolean isCollapsed(int row)
- Returns true if the value identified by row is currently collapsed.
makeVisible
public abstract void makeVisible(TreePath path)
- Ensures that all of the parents of path are currently expanded.
To make sure it is truyly visible, you may wish to call
scrollPathToVisible, which will try and scroll the path to be
visibile if the JTree is in a scroller.
isVisible
public abstract boolean isVisible(TreePath path)
- Returns true if all the parents of path are currently expanded.
getPathBounds
public abstract Rectangle getPathBounds(TreePath path)
- Returns the Rectangle enclosing the label portion that the
last item in path will be drawn into. Will return null if
any component in path is currently valid.
getRowBounds
public abstract Rectangle getRowBounds(int row)
- Returns the Rectangle enclosing the label portion that the
item identified by row will be drawn into.
scrollPathToVisible
public abstract void scrollPathToVisible(TreePath path)
- Makes sure all the path components in path are expanded (accept
for the last path component) and tries to scroll the resulting path
to be visible (the scrolling will only work if the JTree is
contained in a JScrollPane).
scrollRowToVisible
public abstract void scrollRowToVisible(int row)
- Scrolls the item identified by row to be visible. This will
only work if the JTree is contained in a JSrollPane.
getPathForRow
public abstract TreePath getPathForRow(int row)
- Returns the path for passed in row. If row is not visible
null is returned.
getRowForPath
public abstract int getRowForPath(TreePath path)
- Returns the row that the last item identified in path is visible
at. Will return -1 if any of the elements in path are not
currently visible.
expandPath
public abstract void expandPath(TreePath path)
- Insures that the last item identified in path is expanded and
visible. This differs from makeVisible in that the last item
is expanded in this method.
expandRow
public abstract void expandRow(int row)
- Insures that the item identified by row is expanded.
collapsePath
public abstract void collapsePath(TreePath path)
- Insures that the last item identified in path is collapsed and
visible.
collapseRow
public abstract void collapseRow(int row)
- Insures that the item identified by row is collapsed.
getClosestPathForLocation
public abstract TreePath getClosestPathForLocation(int x,
int y)
- Returns the path to the node that is closest to x,y. If
there is nothing currently visible this will return null, otherwise
it'll always return a valid path. If you need to test if the
returned object is exactly at x, y you should get the bounds for
the returned path and test x, y against that.
getClosestRowForLocation
public abstract int getClosestRowForLocation(int x,
int y)
- Returns the row to the node that is closest to x,y. If
there is nothing currently visible this will return -1, otherwise
it'll always return a valid row. If you need to test if the
returned object is exactly at x, y you should get the bounds for
the returned row and test x, y against that.
isEditing
public abstract boolean isEditing()
- Returns true if the tree is being edited. The item that is being
edited can be returned by getEditingPath().
stopEditing
public abstract boolean stopEditing()
- Stops the current editing session. This has no effect if the
tree isn't being edited. Returns true if the editor allows the
editing session to stop.
startEditingAtPath
public abstract void startEditingAtPath(TreePath path)
- Selects the last item in path and tries to edit it. Editing will
fail if the CellEditor won't allow it for the selected item.
getEditingPath
public abstract TreePath getEditingPath()
- Returns the path to the element that is being edited.
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature