Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans
package.
Please see java.
.
Modifier and Type | Class and Description |
---|---|
public abstract static class | AbstractLayoutCache.
Used by |
Modifier and Type | Field and Description |
---|---|
protected AbstractLayoutCache. | nodeDimensions
Object responsible for getting the size of a node. |
protected boolean | rootVisible
True if the root node is displayed, false if its children are the highest visible nodes. |
protected int | rowHeight
Height to use for each row. |
protected TreeModel | treeModel
Model providing information. |
protected TreeSelectionModel | treeSelectionModel
Selection model. |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public abstract Rectangle | |
public abstract boolean | Returns: true if the path is expanded and visible, false otherwisethe path being queried path)Returns true if the path is expanded, and visible. |
public TreeModel | Returns: theTreeModel that is providing the dataReturns the |
public AbstractLayoutCache. | Returns: theNodeDimensions objectReturns the object that renders nodes in the tree, and which is responsible for calculating the dimensions of individual nodes. |
protected Rectangle | Returns: aRectangle containing the node dimensions,
or null if node has no dimensionthe value, int value to be representedrow being queried row, int the depth of the row depth, boolean true if row is expanded, false otherwise expanded, Rectangle a placeIn)Rectangle containing the size needed
to represent value Returns, by reference in |
public abstract TreePath | Returns: theTreePath closest to the specified pointthe horizontal component of the desired location x, int the vertical component of the desired location y)Returns the path to the node that is closest to x,y. |
public abstract TreePath | Returns: theTreePath for the given rowthe row being queried row)Returns the path for passed in row. |
public int | |
public int | Returns: the preferred width for the passed in regionthe region being queried bounds)Returns the preferred width for the passed in region. |
public abstract int | |
public abstract int | Returns: the row where the last item in path is visible or -1 if any elements in path aren't currently visiblethe path)TreePath being queriedReturns the row that the last item identified in path is visible at. |
public int | |
public int[] | Returns: an array of the same length that is passed in containing the rows that each corresponding where eachTreePath is displayed; if paths
is null , null is returnedthe array of paths)TreePath s being queriedImplements javax. Returns the rows that the |
public TreeSelectionModel | |
public abstract int | Returns: the number of visible children for the specified paththe path being queried path)Returns the number of visible children for row. |
public abstract Enumeration | Returns: theEnumerator starting at the desired locationthe starting location for the enumeration path)Returns an |
public abstract void | invalidatePathBounds(TreePath
the path being updated path)Instructs the |
public abstract void | invalidateSizes()
Informs the |
public abstract boolean | Returns: whether TreePath is expandedTreePath to check path)Returns true if the value identified by row is currently expanded. |
protected boolean | Returns: whether the height of each row is a fixed sizeReturns true if the height of each row is a fixed size. |
public boolean | Returns: true if the root node of the tree is displayedReturns true if the root node of the tree is displayed. |
public abstract void | setExpandedState(TreePath
the path being expanded or collapsed path, boolean true if the path should be expanded, false otherwise isExpanded)Marks the path |
public void | |
public void | setNodeDimensions(AbstractLayoutCache.
a ndNodeDimensions objectSets the renderer that is responsible for drawing nodes in the tree and which is therefore responsible for calculating the dimensions of individual nodes. |
public void | setRootVisible(boolean
true if the root node of the tree is to be displayed rootVisible)Determines whether or not the root node from
the |
public void | |
public void | setSelectionModel(TreeSelectionModel
the new newLSM)TreeSelectionModel Sets the |
public abstract void | treeNodesChanged(TreeModelEvent
the e)TreeModelEvent Invoked after a node (or a set of siblings) has changed in some way. |
public abstract void | treeNodesInserted(TreeModelEvent
the e)TreeModelEvent Invoked after nodes have been inserted into the tree. |
public abstract void | treeNodesRemoved(TreeModelEvent
the e)TreeModelEvent Invoked after nodes have been removed from the tree. |
public abstract void | treeStructureChanged(TreeModelEvent
the e)TreeModelEvent Invoked after the tree has drastically changed structure from a given node down. |
nodeDimensions | back to summary |
---|---|
protected AbstractLayoutCache. Object responsible for getting the size of a node. |
rootVisible | back to summary |
---|---|
protected boolean rootVisible True if the root node is displayed, false if its children are the highest visible nodes. |
rowHeight | back to summary |
---|---|
protected int rowHeight Height to use for each row. If this is <= 0 the renderer will be used to determine the height for each row. |
treeModel | back to summary |
---|---|
protected TreeModel treeModel Model providing information. |
treeSelectionModel | back to summary |
---|---|
protected TreeSelectionModel treeSelectionModel Selection model. |
AbstractLayoutCache | back to summary |
---|---|
protected AbstractLayoutCache() Constructor for subclasses to call. |
getBounds | back to summary |
---|---|
public abstract Rectangle getBounds(TreePath path, Rectangle placeIn) Returns a rectangle giving the bounds needed to draw path. |
getExpandedState | back to summary |
---|---|
public abstract boolean getExpandedState(TreePath path) Returns true if the path is expanded, and visible.
|
getModel | back to summary |
---|---|
public TreeModel getModel() Returns the
|
getNodeDimensions | back to summary |
---|---|
public AbstractLayoutCache. Returns the object that renders nodes in the tree, and which is responsible for calculating the dimensions of individual nodes.
|
getNodeDimensions | back to summary |
---|---|
protected Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle placeIn) Returns, by reference in
|
getPathClosestTo | back to summary |
---|---|
public abstract TreePath getPathClosestTo(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
|
getPathForRow | back to summary |
---|---|
public abstract TreePath getPathForRow(int row) Returns the path for passed in row. If row is not visible
|
getPreferredHeight | back to summary |
---|---|
public int getPreferredHeight() Returns the preferred height.
|
getPreferredWidth | back to summary |
---|---|
public int getPreferredWidth(Rectangle bounds) Returns the preferred width for the passed in region.
The region is defined by the path closest to
|
getRowCount | back to summary |
---|---|
public abstract int getRowCount() Number of rows being displayed.
|
getRowForPath | back to summary |
---|---|
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.
|
getRowHeight | back to summary |
---|---|
public int getRowHeight() Returns the height of each row. If the returned value is less than or equal to 0 the height for each row is determined by the renderer.
|
getRowsForPaths | back to summary |
---|---|
public int[] getRowsForPaths(TreePath[] paths) Implements javax. Returns the rows that the
|
getSelectionModel | back to summary |
---|---|
public TreeSelectionModel getSelectionModel() Returns the model used to maintain the selection.
|
getVisibleChildCount | back to summary |
---|---|
public abstract int getVisibleChildCount(TreePath path) Returns the number of visible children for row.
|
getVisiblePathsFrom | back to summary |
---|---|
public abstract Enumeration Returns an
|
invalidatePathBounds | back to summary |
---|---|
public abstract void invalidatePathBounds(TreePath path) Instructs the
|
invalidateSizes | back to summary |
---|---|
public abstract void invalidateSizes() Informs the |
isExpanded | back to summary |
---|---|
public abstract boolean isExpanded(TreePath path) Returns true if the value identified by row is currently expanded.
|
isFixedRowHeight | back to summary |
---|---|
protected boolean isFixedRowHeight() Returns true if the height of each row is a fixed size.
|
isRootVisible | back to summary |
---|---|
public boolean isRootVisible() Returns true if the root node of the tree is displayed.
|
setExpandedState | back to summary |
---|---|
public abstract void setExpandedState(TreePath path, boolean isExpanded) Marks the path
|
setModel | back to summary |
---|---|
public void setModel(TreeModel newModel) Sets the
|
setNodeDimensions | back to summary |
---|---|
public void setNodeDimensions(AbstractLayoutCache. Sets the renderer that is responsible for drawing nodes in the tree and which is therefore responsible for calculating the dimensions of individual nodes.
|
setRootVisible | back to summary |
---|---|
public void setRootVisible(boolean rootVisible) Determines whether or not the root node from
the
|
setRowHeight | back to summary |
---|---|
public void setRowHeight(int rowHeight) Sets the height of each cell. If the specified value is less than or equal to zero the current cell renderer is queried for each row's height.
|
setSelectionModel | back to summary |
---|---|
public void setSelectionModel(TreeSelectionModel newLSM) Sets the
|
treeNodesChanged | back to summary |
---|---|
public abstract void treeNodesChanged(TreeModelEvent e) Invoked after a node (or a set of siblings) has changed in some way. The node(s) have not changed locations in the tree or altered their children arrays, but other attributes have changed and may affect presentation. Example: the name of a file has changed, but it is in the same location in the file system. e.path() returns the path the parent of the changed node(s). e.childIndices() returns the index(es) of the changed node(s).
|
treeNodesInserted | back to summary |
---|---|
public abstract void treeNodesInserted(TreeModelEvent e) Invoked after nodes have been inserted into the tree. e.path() returns the parent of the new nodes e.childIndices() returns the indices of the new nodes in ascending order.
|
treeNodesRemoved | back to summary |
---|---|
public abstract void treeNodesRemoved(TreeModelEvent e) Invoked after nodes have been removed from the tree. Note that if a subtree is removed from the tree, this method may only be invoked once for the root of the removed subtree, not once for each individual set of siblings removed. e.path() returns the former parent of the deleted nodes. e.childIndices() returns the indices the nodes had before they were deleted in ascending order.
|
treeStructureChanged | back to summary |
---|---|
public abstract void treeStructureChanged(TreeModelEvent e) Invoked after the tree has drastically changed structure from a
given node down. If the path returned by e.path() holds the path to the node. e.childIndices() returns null.
|
AbstractLayoutCache
to determine the size
and x origin of a particular node.
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public abstract Rectangle | Returns: aRectangle containing the node dimensions,
or null if node has no dimensionthe value, int value to be representedrow being queried row, int the depth of the row depth, boolean true if row is expanded, false otherwise expanded, Rectangle a bounds)Rectangle containing the size needed
to represent value Returns, by reference in bounds, the size and x origin to place value at. |
NodeDimensions | back to summary |
---|---|
protected NodeDimensions() Constructor for subclasses to call. |
getNodeDimensions | back to summary |
---|---|
public abstract Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle bounds) Returns, by reference in bounds, the size and x origin to
place value at. The calling method is responsible for determining
the Y location. If bounds is
|