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

Constructor Index

 o TreeNode(String)
Constructs a TreeNode with the given text label.
 o TreeNode(String, Image, Image)
Constructs a TreeNode with the given text label, and collapsed and expanded images.

Method Index

 o collapse()
Sets a flag indicating that this node is not expanded.
 o expand()
Sets a flag indicating that this node is expanded, if it is expandable.
 o getChild()
Gets the child of this node.
 o getDataObject()
Gets the object associated with this node.
 o getDepth()
Gets the depth of this node as previously noted in the latest setDepth() call.
 o getImage()
Gets the proper image for this node in its current state, expanded or collapsed.
 o getParent()
Gets the parent of this node.
 o getSibling()
Gets the next sibling of this node.
 o getText()
Gets the current text label for this node.
 o isExpandable()
Determines whether this node is expandable.
 o isExpanded()
Determines whether this node is expanded.
 o setCollapsedImage(Image)
Sets the image to use for this node when it is not expanded.
 o setDataObject(Object)
Sets an object to associate with this node.
 o setExpandedImage(Image)
Sets the image to use for this node when it is expanded.
 o setText(String)
Sets a new text label for this node.
 o toggle()
Toggles the node state between collapsed and expanded, if the node is expandable.

Constructors

 o TreeNode
  public TreeNode(String text)
Constructs a TreeNode with the given text label.

Parameters:
text - the text to display for this node
 o 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

Methods

 o 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
 o 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
 o 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
 o expand
  public void expand()
Sets a flag indicating that this node is expanded, if it is expandable.

 o collapse
  public void collapse()
Sets a flag indicating that this node is not expanded.

 o toggle
  public void toggle()
Toggles the node state between collapsed and expanded, if the node is expandable.

 o 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
 o 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
 o 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
 o getText
  public String getText()
Gets the current text label for this node.

Returns:
the current text label for this node
See Also:
setText
 o 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
 o 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
 o 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
 o getParent
  public TreeNode getParent()
Gets the parent of this node.

Returns:
this node's parent node
See Also:
getChild, getSibling
 o getChild
  public TreeNode getChild()
Gets the child of this node.

Returns:
this node's child node
See Also:
getParent, getSibling
 o 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