All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.basic.LargeTreeModelNode
java.lang.Object
|
+----java.awt.swing.tree.DefaultMutableTreeNode
|
+----java.awt.swing.basic.LargeTreeModelNode
- public class LargeTreeModelNode
- extends DefaultMutableTreeNode
LargeTreeModelNode is used by AbstractTreeUI to track what has been
expanded. LargeTreeModelNode differs from VisibleTreeNode in that it
is highly model intensive. That is almost all queries to a
LargeTreeModelNode result in the TreeModel being queried. It also
will not support odd sized row heights.
childIndex- Index of this node from the model.
isExpanded- Is this node expanded?
treeUI- Tree UI this is created for.
LargeTreeModelNode(AbstractTreeUI, Object, int)
-
addLargeTreeModelNode(LargeTreeModelNode)
- Adds newChild to this nodes children at the appropriate location.
adjustLargeRowCountBy(int)
- Adjust the large row count of the AbstractTreeUI the receiver was
created with.
childAtModelIndex(int)
- Returns the child for the passed in model index.
childInsertedAtModelIndex(int)
- Messaged when a child has been inserted at index.
childRemovedAtModelIndex(int)
- Messaged when a child has been removed from the model at the
specified index.
collapse(boolean)
- Collapses the receiver.
didAdjustTree()
- Messaged when this node either expands or collapses.
expand(boolean)
- Expands the receiver.
getChildIndex()
- Returns the index of the reciever in the model.
getCountTo(int)
- Asks all the children of the receiver for their totalChildCount
and returns this value (plus stopIndex).
getModel()
- Returns the model for the current tree.
getPathForRow(int, int[], TreePath[], LargeTreeModelNode[], boolean[], int[])
- Returns the TreePath for the given row.
getRow()
- Returns the row of the receiver.
getRow(Object[], int, int, boolean, int[])
- Returns, by reference in rowCounter, the row for the given
path.
getTotalChildCount()
- Returns the number of children in the receiver by descending all
expanded nodes and messaging them with getTotalChildCount.
getVisibleLevel()
- The highest visible nodes have a depth of 0.
isExpanded()
- Returns true if this node is expanded.
isVisible()
- Returns true if this node is visible.
modelChildCountChanged()
- Messaged when the child count has changed and this node hasn't
yet been expanded, does nothing.
toggleExpanded()
- Makes the receiver collapse if it is currently expanded, otherwise
expands the reciever.
treeUI
protected AbstractTreeUI treeUI
- Tree UI this is created for.
isExpanded
protected boolean isExpanded
- Is this node expanded?
childIndex
protected int childIndex
- Index of this node from the model.
LargeTreeModelNode
public LargeTreeModelNode(AbstractTreeUI treeUI,
Object userObject,
int childIndex)
getModel
public TreeModel getModel()
- Returns the model for the current tree.
getChildIndex
public int getChildIndex()
- Returns the index of the reciever in the model.
childAtModelIndex
public LargeTreeModelNode childAtModelIndex(int index)
- Returns the child for the passed in model index.
isVisible
public boolean isVisible()
- Returns true if this node is visible. This is determined by
asking all the parents if they are expanded.
getRow
public int getRow()
- Returns the row of the receiver.
expand
public void expand(boolean adjustTree)
- Expands the receiver. If adjustTree is true didAdjustTree and
visibleNodesChanged is messaged.
collapse
public void collapse(boolean adjustTree)
- Collapses the receiver. If
adjustTree
is true
didAdjustTree and pathWasCollapsed are messaged.
getTotalChildCount
public int getTotalChildCount()
- Returns the number of children in the receiver by descending all
expanded nodes and messaging them with getTotalChildCount.
isExpanded
public boolean isExpanded()
- Returns true if this node is expanded.
modelChildCountChanged
public void modelChildCountChanged()
- Messaged when the child count has changed and this node hasn't
yet been expanded, does nothing.
getVisibleLevel
public int getVisibleLevel()
- The highest visible nodes have a depth of 0.
toggleExpanded
public void toggleExpanded()
- Makes the receiver collapse if it is currently expanded, otherwise
expands the reciever.
adjustLargeRowCountBy
protected void adjustLargeRowCountBy(int changeAmount)
- Adjust the large row count of the AbstractTreeUI the receiver was
created with.
addLargeTreeModelNode
protected void addLargeTreeModelNode(LargeTreeModelNode newChild)
- Adds newChild to this nodes children at the appropriate location.
The location is determined from the childIndex of newChild.
childRemovedAtModelIndex
protected void childRemovedAtModelIndex(int index)
- Messaged when a child has been removed from the model at the
specified index. Will shift down all the childIndexs that
are >= index.
childInsertedAtModelIndex
protected void childInsertedAtModelIndex(int index)
- Messaged when a child has been inserted at index. For all the
children that have a childIndex >= index their index is incremented
by one.
getPathForRow
protected boolean getPathForRow(int row,
int[] rowCounter,
TreePath[] retPath,
LargeTreeModelNode[] eNode,
boolean[] isParentNode,
int[] childIndex)
- Returns the TreePath for the given row. This will return null
if the row is greater than the number of expanded nodes.
rowCounter is used to count the number of nodes while descending
the hierarchy.
If eNode is non-null then eNode will be set to either the matching
node, or its parent if the last element has not yet been
expanded, or is a leaf.
isParentNode will be set to true if the parent is set in
eNode, otherwise false.
The TreePath will be returned in retPath (if it is non-null)
Returns the child index of the returned row in childIndex (if
non-null).
The reason for all these arguments is different methods call
this with different requirements and rather than having 4
different methods, there is one big one.
If no match is found, false is returned, otherwise true.
getCountTo
protected int getCountTo(int stopIndex)
- Asks all the children of the receiver for their totalChildCount
and returns this value (plus stopIndex).
getRow
protected boolean getRow(Object[] path,
int pathCounter,
int pathLength,
boolean isInPath,
int[] rowCounter)
- Returns, by reference in rowCounter, the row for the given
path. This is meant to be called from the root, it will not
compute the row of the receiver.
Path is the path that is being searched for.
pathCounter is the current index into path
pathLength is the length of the path (avoids path.length);
isInPath is true if the parents path is contained in path.
returns true if the row is found.
didAdjustTree
protected void didAdjustTree()
- Messaged when this node either expands or collapses.
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature