|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object charvax.swing.JTree
(UNDER CONSTRUCTION) A component that displays hierarchical data.
Field Summary | |
protected TreeSelectionModel |
_selectionModel
|
protected TreeModel |
_treeModel
|
protected int |
_visibleRowCount
|
Constructor Summary | |
JTree(TreeNode root)
Returns a JTree with the specified TreeNode as its root, which displays the root node. |
|
JTree(TreeNode root,
boolean asksAllowsChildren)
Returns a JTree with the specified TreeNode as its root, which displays the root node and which decides whether a node is a leaf node in the specified manner. |
Method Summary | |
void |
clearSelection()
Clears the selection. |
void |
collapsePath(TreePath path)
Ensures that the node identified by the specified path is collapsed |
protected static TreeModel |
createTreeModel(java.lang.Object value)
Returns a TreeModel wrapping the specified object. |
void |
expandPath(TreePath path)
Ensures that the node identified by the specified path is expanded and viewable. |
TreeModel |
getModel()
Returns the TreeModel that is providing the data. |
TreePath |
getPathForRow(int row)
Returns the path for the specified row. |
int |
getRowCount()
Returns the number of rows that are currently being displayed. |
TreeSelectionModel |
getSelectionModel()
Returns the model for selections. |
TreePath |
getSelectionPath()
Returns the path to the first selected node. |
int |
getVisibleRowCount()
Returns the maximum number of rows that are displayed in the display area. |
boolean |
isPathSelected(TreePath path)
Returns true if the item identified by the path is currently selected. |
boolean |
isRootVisible()
Returns true if the root node of the tree is displayed. |
boolean |
isSelectionEmpty()
Returns true if the selection is currently empty. |
boolean |
isVisible(TreePath path)
Returns true if the value identified by path is currently viewable, which means it is either the root or all of its parents are expanded. |
void |
makeVisible(TreePath path)
Ensures that the node identified by path is currently viewable. |
void |
removeSelectionPath(TreePath path)
Removes the node identified by the specified path from the current selection. |
void |
removeSelectionRow(int row)
Removes the row at the index row from the current selection. |
void |
scrollPathToVisible(TreePath path)
Makes sure all the path components in path are expanded (except for the last path component) and scrolls so that the node identified by the path is displayed. |
void |
scrollRowToVisible(int row)
Scrolls the item identified by row until it is displayed. |
void |
setModel(TreeModel newModel_)
Sets the TreeModel that will provide the data. |
void |
setRootVisible(boolean rootVisible)
Determines whether or not the root node from the TreeModel is visible. |
void |
setSelectionModel(TreeSelectionModel selectionModel)
Sets the tree's selection model. |
void |
setSelectionPath(TreePath path)
Selects the node identified by the specified path. |
void |
setSelectionRow(int row)
Selects the node at the specified row in the display. |
void |
setVisibleRowCount(int newCount)
Sets the number of rows that are to be displayed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected TreeModel _treeModel
protected TreeSelectionModel _selectionModel
protected int _visibleRowCount
Constructor Detail |
public JTree(TreeNode root)
public JTree(TreeNode root, boolean asksAllowsChildren)
root
- a TreeNode objectasksAllowsChildren
- if false, any node without children is a
leaf node; if true, only nodes that do not allow children are leaf nodesMethod Detail |
public TreeModel getModel()
public void setModel(TreeModel newModel_)
public boolean isRootVisible()
public void setRootVisible(boolean rootVisible)
rootVisible
- true if the root node of the tree is to be
displayedpublic int getRowCount()
public void setSelectionPath(TreePath path)
public void setSelectionRow(int row)
public TreePath getSelectionPath()
public boolean isPathSelected(TreePath path)
public void makeVisible(TreePath path)
public boolean isVisible(TreePath path)
public void scrollPathToVisible(TreePath path)
public void scrollRowToVisible(int row)
row
- an integer specifying the row to scroll, where 0 is the
first row in the displaypublic TreePath getPathForRow(int row)
public void expandPath(TreePath path)
public void collapsePath(TreePath path)
public void setSelectionModel(TreeSelectionModel selectionModel)
public TreeSelectionModel getSelectionModel()
public void removeSelectionPath(TreePath path)
public void removeSelectionRow(int row)
public void clearSelection()
public boolean isSelectionEmpty()
public void setVisibleRowCount(int newCount)
public int getVisibleRowCount()
protected static TreeModel createTreeModel(java.lang.Object value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |