All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.basic.LargeTreeModelNode

java.lang.Object
   |
   +----com.sun.java.swing.tree.DefaultMutableTreeNode
           |
           +----com.sun.java.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.


Variable Index

 o childIndex
Index of this node from the model.
 o isExpanded
Is this node expanded?
 o treeUI
Tree UI this is created for.

Constructor Index

 o LargeTreeModelNode(AbstractTreeUI, Object, int)

Method Index

 o addLargeTreeModelNode(LargeTreeModelNode)
Adds newChild to this nodes children at the appropriate location.
 o adjustLargeRowCountBy(int)
Adjust the large row count of the AbstractTreeUI the receiver was created with.
 o childAtModelIndex(int)
Returns the child for the passed in model index.
 o childInsertedAtModelIndex(int)
Messaged when a child has been inserted at index.
 o childRemovedAtModelIndex(int)
Messaged when a child has been removed from the model at the specified index.
 o collapse(boolean)
Collapses the receiver.
 o didAdjustTree()
Messaged when this node either expands or collapses.
 o expand(boolean)
Expands the receiver.
 o getChildIndex()
Returns the index of the reciever in the model.
 o getCountTo(int)
Asks all the children of the receiver for their totalChildCount and returns this value (plus stopIndex).
 o getModel()
Returns the model for the current tree.
 o getPathForRow(int, int[], TreePath[], LargeTreeModelNode[], boolean[], int[])
Returns the TreePath for the given row.
 o getRow()
Returns the row of the receiver.
 o getRow(Object[], int, int, boolean, int[])
Returns, by reference in rowCounter, the row for the given path.
 o getTotalChildCount()
Returns the number of children in the receiver by descending all expanded nodes and messaging them with getTotalChildCount.
 o getVisibleLevel()
The highest visible nodes have a depth of 0.
 o isExpanded()
Returns true if this node is expanded.
 o isVisible()
Returns true if this node is visible.
 o modelChildCountChanged()
Messaged when the child count has changed and this node hasn't yet been expanded, does nothing.
 o toggleExpanded()
Makes the receiver collapse if it is currently expanded, otherwise expands the reciever.

Variables

 o treeUI
 protected AbstractTreeUI treeUI
Tree UI this is created for.

 o isExpanded
 protected boolean isExpanded
Is this node expanded?

 o childIndex
 protected int childIndex
Index of this node from the model.

Constructors

 o LargeTreeModelNode
 public LargeTreeModelNode(AbstractTreeUI treeUI,
                           Object userObject,
                           int childIndex)

Methods

 o getModel
 public TreeModel getModel()
Returns the model for the current tree.

 o getChildIndex
 public int getChildIndex()
Returns the index of the reciever in the model.

 o childAtModelIndex
 public LargeTreeModelNode childAtModelIndex(int index)
Returns the child for the passed in model index.

 o isVisible
 public boolean isVisible()
Returns true if this node is visible. This is determined by asking all the parents if they are expanded.

 o getRow
 public int getRow()
Returns the row of the receiver.

 o expand
 public void expand(boolean adjustTree)
Expands the receiver. If adjustTree is true didAdjustTree and visibleNodesChanged is messaged.

 o collapse
 public void collapse(boolean adjustTree)
Collapses the receiver. If adjustTree is true didAdjustTree and pathWasCollapsed are messaged.

 o getTotalChildCount
 public int getTotalChildCount()
Returns the number of children in the receiver by descending all expanded nodes and messaging them with getTotalChildCount.

 o isExpanded
 public boolean isExpanded()
Returns true if this node is expanded.

 o modelChildCountChanged
 public void modelChildCountChanged()
Messaged when the child count has changed and this node hasn't yet been expanded, does nothing.

 o getVisibleLevel
 public int getVisibleLevel()
The highest visible nodes have a depth of 0.

 o toggleExpanded
 public void toggleExpanded()
Makes the receiver collapse if it is currently expanded, otherwise expands the reciever.

 o adjustLargeRowCountBy
 protected void adjustLargeRowCountBy(int changeAmount)
Adjust the large row count of the AbstractTreeUI the receiver was created with.

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

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

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

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

 o getCountTo
 protected int getCountTo(int stopIndex)
Asks all the children of the receiver for their totalChildCount and returns this value (plus stopIndex).

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

 o didAdjustTree
 protected void didAdjustTree()
Messaged when this node either expands or collapses.


All Packages  Class Hierarchy  This Package  Previous  Next  Index