All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.TreeNode
java.lang.Object
|
+----symantec.itools.awt.TreeNode
- public class TreeNode
- extends Object
This is a single node in the TreeView panel.
It displays text and optionally one of two images depending on its state,
collapsed or expanded.
It also may have an object associated with it that doesn't get displayed.
- See Also:
- TreeView
-
TreeNode(String)
- Constructs a TreeNode with the given text label.
-
TreeNode(String, Image, Image)
- Constructs a TreeNode with the given text label, and collapsed and
expanded images.
-
collapse()
- Sets a flag indicating that this node is not expanded.
-
expand()
- Sets a flag indicating that this node is expanded, if it is expandable.
-
getChild()
- Gets the child of this node.
-
getDataObject()
- Gets the object associated with this node.
-
getDepth()
- Gets the depth of this node as previously noted in the latest setDepth() call.
-
getImage()
- Gets the proper image for this node in its current state, expanded or collapsed.
-
getParent()
- Gets the parent of this node.
-
getSibling()
- Gets the next sibling of this node.
-
getText()
- Gets the current text label for this node.
-
isExpandable()
- Determines whether this node is expandable.
-
isExpanded()
- Determines whether this node is expanded.
-
setCollapsedImage(Image)
- Sets the image to use for this node when it is not expanded.
-
setDataObject(Object)
- Sets an object to associate with this node.
-
setExpandedImage(Image)
- Sets the image to use for this node when it is expanded.
-
setText(String)
- Sets a new text label for this node.
-
toggle()
- Toggles the node state between collapsed and expanded, if the node
is expandable.
TreeNode
public TreeNode(String text)
- Constructs a TreeNode with the given text label.
- Parameters:
- text - the text to display for this node
TreeNode
public TreeNode(String text,
Image collapsedImage,
Image expandedImage)
- Constructs a TreeNode with the given text label, and collapsed and
expanded images.
- Parameters:
- text - the text to display for this node
- collapsedImage - the image to use when this node is collapsed, hiding
all of its child nodes
- expandedImage - the image to use when this node is expanded, showing
all of its child nodes
getDepth
public int getDepth()
- Gets the depth of this node as previously noted in the latest setDepth() call.
- Returns:
- the depth of this node
- See Also:
- setDepth
isExpanded
public boolean isExpanded()
- Determines whether this node is expanded.
A node is expanded if its child nodes are visible.
- Returns:
- true if the node is expanded, false if it is collapsed
isExpandable
public boolean isExpandable()
- Determines whether this node is expandable.
A node is expandable if it has one or more child nodes.
- Returns:
- true if the node is expandable, false if not
expand
public void expand()
- Sets a flag indicating that this node is expanded, if it is expandable.
collapse
public void collapse()
- Sets a flag indicating that this node is not expanded.
toggle
public void toggle()
- Toggles the node state between collapsed and expanded, if the node
is expandable.
getImage
public Image getImage()
- Gets the proper image for this node in its current state, expanded or collapsed.
- Returns:
- the current image for this node in its current state
setExpandedImage
public void setExpandedImage(Image image)
- Sets the image to use for this node when it is expanded.
- Parameters:
- image - the image to use when this node is expanded
- See Also:
- setCollapsedImage, getImage
setCollapsedImage
public void setCollapsedImage(Image image)
- Sets the image to use for this node when it is not expanded.
- Parameters:
- image - the image to use when this node is collapsed
- See Also:
- setExpandedImage, getImage
getText
public String getText()
- Gets the current text label for this node.
- Returns:
- the current text label for this node
- See Also:
- setText
setText
public void setText(String s)
- Sets a new text label for this node.
- Parameters:
- s - the new text label for this node
- See Also:
- getText
getDataObject
public Object getDataObject()
- Gets the object associated with this node.
This object does not get displayed.
- Returns:
- the object associated with this node
- See Also:
- setDataObject
setDataObject
public void setDataObject(Object theObject)
- Sets an object to associate with this node.
This object does not get displayed.
- Parameters:
- theObject - an object to associate with this node
- See Also:
- getDataObject
getParent
public TreeNode getParent()
- Gets the parent of this node.
- Returns:
- this node's parent node
- See Also:
- getChild, getSibling
getChild
public TreeNode getChild()
- Gets the child of this node.
- Returns:
- this node's child node
- See Also:
- getParent, getSibling
getSibling
public TreeNode getSibling()
- Gets the next sibling of this node.
- Returns:
- this node's next sibling node
- See Also:
- getChild, getParent
All Packages Class Hierarchy This Package Previous Next Index