All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.plaf.TreeUI

java.lang.Object
   |
   +----com.sun.java.swing.plaf.ComponentUI
           |
           +----com.sun.java.swing.plaf.TreeUI

public abstract class TreeUI
extends ComponentUI
Pluggable look and feel interface for JTree.


Constructor Index

 o TreeUI()

Method Index

 o collapsePath(TreePath)
Insures that the last item identified in path is collapsed and visible.
 o collapseRow(int)
Insures that the item identified by row is collapsed.
 o expandPath(TreePath)
Insures that the last item identified in path is expanded and visible.
 o expandRow(int)
Insures that the item identified by row is expanded.
 o getClosestPathForLocation(int, int)
Returns the path to the node that is closest to x,y.
 o getClosestRowForLocation(int, int)
Returns the row to the node that is closest to x,y.
 o getEditingPath()
Returns the path to the element that is being edited.
 o getPathBounds(TreePath)
Returns the Rectangle enclosing the label portion that the last item in path will be drawn into.
 o getPathForRow(int)
Returns the path for passed in row.
 o getRowBounds(int)
Returns the Rectangle enclosing the label portion that the item identified by row will be drawn into.
 o getRowCount()
Returns the number of rows that are being displayed.
 o getRowForPath(TreePath)
Returns the row that the last item identified in path is visible at.
 o isCollapsed(int)
Returns true if the value identified by row is currently collapsed.
 o 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.
 o isEditing()
Returns true if the tree is being edited.
 o isExpanded(int)
Returns true if the value identified by row is currently expanded.
 o 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.
 o isVisible(TreePath)
Returns true if all the parents of path are currently expanded.
 o makeVisible(TreePath)
Ensures that all of the parents of path are currently expanded.
 o 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).
 o scrollRowToVisible(int)
Scrolls the item identified by row to be visible.
 o startEditingAtPath(TreePath)
Selects the last item in path and tries to edit it.
 o stopEditing()
Stops the current editing session.

Constructors

 o TreeUI
 public TreeUI()

Methods

 o getRowCount
 public abstract int getRowCount()
Returns the number of rows that are being displayed.

 o 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.

 o isExpanded
 public abstract boolean isExpanded(int row)
Returns true if the value identified by row is currently expanded.

 o 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.

 o isCollapsed
 public abstract boolean isCollapsed(int row)
Returns true if the value identified by row is currently collapsed.

 o 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.

 o isVisible
 public abstract boolean isVisible(TreePath path)
Returns true if all the parents of path are currently expanded.

 o 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.

 o getRowBounds
 public abstract Rectangle getRowBounds(int row)
Returns the Rectangle enclosing the label portion that the item identified by row will be drawn into.

 o 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).

 o 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.

 o getPathForRow
 public abstract TreePath getPathForRow(int row)
Returns the path for passed in row. If row is not visible null is returned.

 o 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.

 o 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.

 o expandRow
 public abstract void expandRow(int row)
Insures that the item identified by row is expanded.

 o collapsePath
 public abstract void collapsePath(TreePath path)
Insures that the last item identified in path is collapsed and visible.

 o collapseRow
 public abstract void collapseRow(int row)
Insures that the item identified by row is collapsed.

 o 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.

 o 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.

 o isEditing
 public abstract boolean isEditing()
Returns true if the tree is being edited. The item that is being edited can be returned by getEditingPath().

 o 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.

 o 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.

 o getEditingPath
 public abstract TreePath getEditingPath()
Returns the path to the element that is being edited.


All Packages  Class Hierarchy  This Package  Previous  Next  Index