|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode javax.swing.tree.VariableHeightLayoutCache.TreeStateNode
TreeStateNode is used to keep track of each of the nodes that have been expanded. This will also cache the preferred size of the value it represents.
Nested Class Summary |
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode |
DefaultMutableTreeNode.BreadthFirstEnumeration, DefaultMutableTreeNode.PathBetweenNodesEnumeration, DefaultMutableTreeNode.PostorderEnumeration, DefaultMutableTreeNode.PreorderEnumeration |
Field Summary | |
protected boolean |
expanded
Is this node currently expanded? |
protected boolean |
hasBeenExpanded
Has this node been expanded at least once? |
protected TreePath |
path
Path of this node. |
protected int |
preferredHeight
|
protected int |
preferredWidth
Preferred size needed to draw the user object. |
protected int |
xOrigin
X location that the user object will be drawn at. |
protected int |
yOrigin
Y location that the user object will be drawn at. |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
VariableHeightLayoutCache.TreeStateNode(Object value)
|
Method Summary | |
Enumeration |
children()
Returns the children of the receiver. |
void |
collapse()
Collapses the receiver. |
protected void |
collapse(boolean adjustTree)
Collapses this node in the tree. |
protected void |
deepMarkSizeInvalid()
Marks the receivers size, and all its descendants sizes, as invalid. |
protected void |
didAdjustTree()
Messaged from expand and collapse. |
void |
expand()
Expands the receiver. |
protected void |
expand(boolean adjustTree)
Expands this node in the tree. |
protected void |
expandParentAndReceiver()
Invokes expandParentAndReceiver on the parent,
and expands the receiver. |
VariableHeightLayoutCache.TreeStateNode |
getLastVisibleNode()
Returns the last visible node that is a child of this instance. |
protected Enumeration |
getLoadedChildren(boolean createIfNeeded)
Returns the children of the receiver. |
int |
getModelChildCount()
Returns the number of children this will have. |
Rectangle |
getNodeBounds(Rectangle placeIn)
Returns the location and size of this node. |
int |
getPreferredHeight()
Returns the preferred height of the receiver. |
int |
getPreferredWidth()
Returns the preferred width of the receiver. |
int |
getRow()
Returns the row of the receiver. |
TreePath |
getTreePath()
Returns a TreePath instance for this node. |
Object |
getValue()
Returns the value the receiver is representing. |
int |
getVisibleChildCount()
Returns the number of visible children, that is the number of children that are expanded, or leafs. |
int |
getXOrigin()
|
int |
getYOrigin()
Returns the y origin the user object will be drawn at. |
boolean |
hasBeenExpanded()
Returns true if this node has been expanded at least once. |
boolean |
hasValidSize()
Returns true if this node has a valid size. |
boolean |
isExpanded()
Returns true if the receiver has been expanded. |
boolean |
isLeaf()
Returns true if the receiver is a leaf. |
boolean |
isVisible()
Returns true if the receiver is currently visible. |
void |
makeVisible()
Makes the receiver visible, but invoking expandParentAndReceiver on the superclass. |
protected void |
markSizeInvalid()
Marks the receivers size as invalid. |
void |
remove(int childIndex)
Messaged when this node is removed from its parent, this messages removedFromMapping to remove all the children. |
protected void |
removeFromMapping()
Removes the receiver, and all its children, from the mapping table. |
protected void |
resetChildrenPaths(TreePath parentPath)
Recreates the receivers path, and all its childrens paths. |
void |
setParent(MutableTreeNode parent)
Messaged when this node is added somewhere, resets the path and adds a mapping from path to this node. |
void |
setUserObject(Object o)
Messaged to set the user object. |
protected void |
setYOrigin(int newYOrigin)
Sets y origin the user object will be drawn at to newYOrigin. |
protected void |
shiftYOriginBy(int offset)
Shifts the y origin by offset . |
void |
toggleExpanded()
Toggles the receiver between expanded and collapsed. |
protected void |
updatePreferredSize()
Updates the receivers preferredSize by invoking updatePreferredSize with an argument of -1. |
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. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int preferredWidth
protected int preferredHeight
protected int xOrigin
protected int yOrigin
protected boolean expanded
protected boolean hasBeenExpanded
protected TreePath path
Constructor Detail |
public VariableHeightLayoutCache.TreeStateNode(Object value)
Method Detail |
public void setParent(MutableTreeNode parent)
setParent
in interface MutableTreeNode
setParent
in class DefaultMutableTreeNode
parent
- this node's new parentpublic void remove(int childIndex)
removedFromMapping
to remove all the children.
remove
in interface MutableTreeNode
remove
in class DefaultMutableTreeNode
childIndex
- the index in this node's child array
of the child to removepublic void setUserObject(Object o)
setUserObject
in interface MutableTreeNode
setUserObject
in class DefaultMutableTreeNode
o
- the Object that constitutes this node's
user-specified dataDefaultMutableTreeNode.getUserObject()
,
DefaultMutableTreeNode.toString()
public Enumeration children()
children
in interface TreeNode
children
in class DefaultMutableTreeNode
public boolean isLeaf()
isLeaf
in interface TreeNode
isLeaf
in class DefaultMutableTreeNode
DefaultMutableTreeNode.getAllowsChildren()
public Rectangle getNodeBounds(Rectangle placeIn)
public int getXOrigin()
public int getYOrigin()
public int getPreferredHeight()
public int getPreferredWidth()
public boolean hasValidSize()
public int getRow()
public boolean hasBeenExpanded()
public boolean isExpanded()
public VariableHeightLayoutCache.TreeStateNode getLastVisibleNode()
public boolean isVisible()
public int getModelChildCount()
public int getVisibleChildCount()
public void toggleExpanded()
public void makeVisible()
expandParentAndReceiver
on the superclass.
public void expand()
public void collapse()
public Object getValue()
public TreePath getTreePath()
protected void resetChildrenPaths(TreePath parentPath)
protected void setYOrigin(int newYOrigin)
protected void shiftYOriginBy(int offset)
offset
.
protected void updatePreferredSize()
updatePreferredSize
with an argument of -1.
protected void updatePreferredSize(int index)
protected void markSizeInvalid()
protected void deepMarkSizeInvalid()
protected Enumeration getLoadedChildren(boolean createIfNeeded)
createIfNeeded
is true, the children are first
loaded.
protected void didAdjustTree()
protected void expandParentAndReceiver()
expandParentAndReceiver
on the parent,
and expands the receiver.
protected void expand(boolean adjustTree)
protected void collapse(boolean adjustTree)
protected void removeFromMapping()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |