All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.basic.VisibleTreeNode

java.lang.Object
   |
   +----com.sun.java.swing.tree.DefaultMutableTreeNode
           |
           +----com.sun.java.swing.basic.VisibleTreeNode

public class VisibleTreeNode
extends DefaultMutableTreeNode
VisibleTreeNode is used by AbstractTreeUI to keep track of each of the nodes that have been expanded. This will also cache the preferred size of the value this represents.


Variable Index

 o EMPTY_SIZE
 o expanded
Is this node currently expanded?
 o hasBeenExpanded
Has this node been expanded at least once?
 o isValid
Is this node in a tree?
 o preferredSize
Preferred size needed to draw the user object.
 o treeUI
AbstractTreeUI this was created for.
 o yOrigin
Y location that the user object will be drawn at.

Constructor Index

 o VisibleTreeNode(AbstractTreeUI, Object, int)

Method Index

 o children()
Returns the children of the receiver.
 o collapse()
Collapsed the receiver.
 o collapse(boolean)
Collapses this node in the tree.
 o didAdjustTree()
Messaged from expand and collapse.
 o expand()
Expands the receiver.
 o expand(boolean)
Expands this node in the tree.
 o getLastVisibleNode()
Returns the last visible node that is a child of this instance.
 o getLoadedChildren(boolean)
If createIfNeeded is true the children will be loaded from the model if they haven't already been loaded.
 o getModelChildCount()
Returns the number of children this will have.
 o getNodeBounds()
Returns the location and size of this node.
 o getPreferredSize()
Returns the preferred size needed to draw the value this node represents.
 o getRow()
Returns the row of the receiver.
 o getTreePath()
Returns a TreePath instance for this node.
 o getValue()
Returns the value the receiver is representing.
 o getVisibleLevel()
The highest visible nodes have a depth of 0.
 o getVisibleNodes()
Returns the visibleNodes instance variable of the tree the receiver is contained in.
 o getYOrigin()
Returns the y origin the user object will be drawn at.
 o hasBeenExpanded()
Returns true if this node has been expanded at least once.
 o hasValidSize()
Returns true if this node has a valid size.
 o isExpanded()
Returns true if the receiver has been expanded.
 o isLeaf()
Returns true if the receiver is a leaf.
 o isSelected()
Returns true if the receiver is selected.
 o isVisible()
Returns true if the receiver is currently visible.
 o modelChildCountChanged()
Messaged when the child count has changed and this node hasn't yet been expanded.
 o setParent(MutableTreeNode)
Passes this message on to super and if the newParent is null, meaning we're no longer in the tree.
 o setYOrigin(int)
Sets y origin the user object will be drawn at to newYOrigin.
 o shiftYOriginBy(int)
Shifts the y origin by offset.
 o toggleExpanded()
Toggles the receiver between expanded and collapsed.
 o updatePreferredSize()
 o updatePreferredSize(int)
Updates the preferred size by asking the current renderer for the Dimension needed to draw the user object this instance represents.
 o updateTreeYLocationsFrom(int)
Messages the tree with updateYLocationsFrom(row).
 o visibleChildCount()
Returns the number of visible children.

Variables

 o treeUI
 protected AbstractTreeUI treeUI
AbstractTreeUI this was created for.

 o preferredSize
 protected Dimension preferredSize
Preferred size needed to draw the user object.

 o yOrigin
 protected int yOrigin
Y location that the user object will be drawn at.

 o expanded
 protected boolean expanded
Is this node currently expanded?

 o hasBeenExpanded
 protected boolean hasBeenExpanded
Has this node been expanded at least once?

 o isValid
 protected boolean isValid
Is this node in a tree?

 o EMPTY_SIZE
 public static final Dimension EMPTY_SIZE

Constructors

 o VisibleTreeNode
 public VisibleTreeNode(AbstractTreeUI treeUI,
                        Object value,
                        int index)

Methods

 o setParent
 public void setParent(MutableTreeNode newParent)
Passes this message on to super and if the newParent is null, meaning we're no longer in the tree. markInvalid is messaged.

Overrides:
setParent in class DefaultMutableTreeNode
 o setYOrigin
 protected void setYOrigin(int newYOrigin)
Sets y origin the user object will be drawn at to newYOrigin.

 o getYOrigin
 public int getYOrigin()
Returns the y origin the user object will be drawn at.

 o shiftYOriginBy
 protected void shiftYOriginBy(int offset)
Shifts the y origin by offset.

 o updatePreferredSize
 public void updatePreferredSize()
 o updatePreferredSize
 protected void updatePreferredSize(int index)
Updates the preferred size by asking the current renderer for the Dimension needed to draw the user object this instance represents.

 o hasValidSize
 public boolean hasValidSize()
Returns true if this node has a valid size.

 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size needed to draw the value this node represents. Will always return a valid dimenion, but dimension may be 0, 0

 o getNodeBounds
 public Rectangle getNodeBounds()
Returns the location and size of this node.

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

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

 o hasBeenExpanded
 public boolean hasBeenExpanded()
Returns true if this node has been expanded at least once.

 o isExpanded
 public boolean isExpanded()
Returns true if the receiver has been expanded.

 o isSelected
 public boolean isSelected()
Returns true if the receiver is selected.

 o isLeaf
 public boolean isLeaf()
Returns true if the receiver is a leaf.

Overrides:
isLeaf in class DefaultMutableTreeNode
 o getLastVisibleNode
 public VisibleTreeNode getLastVisibleNode()
Returns the last visible node that is a child of this instance.

 o getLoadedChildren
 public Enumeration getLoadedChildren(boolean createIfNeeded)
If createIfNeeded is true the children will be loaded from the model if they haven't already been loaded. The children are then loaded, regardless of whether or not this node is currently expanded.

 o children
 public Enumeration children()
Returns the children of the receiver. If the receiver is not currently expanded, this will return an empty enumeration.

Overrides:
children in class DefaultMutableTreeNode
 o isVisible
 public boolean isVisible()
Returns true if the receiver is currently visible.

 o modelChildCountChanged
 public void modelChildCountChanged()
Messaged when the child count has changed and this node hasn't yet been expanded. This is meant to be used by subclassers.

 o getModelChildCount
 public int getModelChildCount()
Returns the number of children this will have. If the children have not yet been loaded, this messages the model.

 o visibleChildCount
 public int visibleChildCount()
Returns the number of visible children. This is a deep search.

 o toggleExpanded
 public void toggleExpanded()
Toggles the receiver between expanded and collapsed.

 o didAdjustTree
 protected void didAdjustTree()
Messaged from expand and collapse. This is meant for subclassers that may wish to do something interesting with this.

 o expand
 public void expand()
Expands the receiver.

 o expand
 protected void expand(boolean adjustTree)
Expands this node in the tree. This will load the children from the treeModel if this node has not previously been expanded. If adjustTree is true the tree and selection are updated accordingly.

 o collapse
 public void collapse()
Collapsed the receiver.

 o collapse
 protected void collapse(boolean adjustTree)
Collapses this node in the tree. If adjustTree is true the tree and selection are updated accordingly.

 o getValue
 public Object getValue()
Returns the value the receiver is representing. This is a cover for getUserObject.

 o getTreePath
 protected TreePath getTreePath()
Returns a TreePath instance for this node.

 o getVisibleNodes
 protected Vector getVisibleNodes()
Returns the visibleNodes instance variable of the tree the receiver is contained in.

 o updateTreeYLocationsFrom
 protected void updateTreeYLocationsFrom(int row)
Messages the tree with updateYLocationsFrom(row).


All Packages  Class Hierarchy  This Package  Previous  Next  Index