Cytoscape 2.8.0 API

cytoscape.dialogs.plugins
Class TreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by cytoscape.dialogs.plugins.TreeNode
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode

public class TreeNode
extends DefaultMutableTreeNode

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, EMPTY_ENUMERATION, userObject
 
Constructor Summary
TreeNode(DownloadableInfo obj)
          Creates a TreeNode with given PluginInfo object, no parent and does not allow children.
TreeNode(DownloadableInfo obj, boolean allowsChildren)
          Creates a TreeNode with given PluginInfo object, no parent and allows children if specified.
TreeNode(String Title)
          Creates a TreeNode with given title, no parent and allows children.
TreeNode(String Title, boolean allowsChildren)
          Creates a TreeNode with given title, no parent and allows children if specified.
 
Method Summary
 void addChild(TreeNode newChild)
          Adds newChild to this node if children are allowed.
 void addChildren(TreeNode[] children)
          Adds all children to the child list of this node if children are allowed.
 void addObject(DownloadableInfo info)
          Adds a PluginInfo object to this node.
 TreeNode getChildAt(int index)
          Get child from this node's child list at given index.
 int getChildCount()
          Get total number of children for this node
 Vector<TreeNode> getChildren()
          Gets the list of children for this node
 int getIndexOfChild(TreeNode child)
          Gets the index of child from this node's child list.
 int getLeafCount()
          Gets the total (recursively) of all leaves under this node.
 DownloadableInfo getObject()
          Gets the PluginInfo object of this node.
 TreeNode getParent()
          Gets the parent of this node
 String getTitle()
          Gets the title of this node.
 int getTreeCount()
          Gets the total (recursively) of all child nodes that are not leaves.
 boolean isLeaf()
          Returns true if this node has no children or does not allow them.
 boolean isNodeAncestor(TreeNode otherNode)
          Returns true if otherNode is an ancestor of this node.
 boolean isVisible()
           
 void removeChild(TreeNode child)
          Removes child from this node.
 void removeChildren()
          Clears the list of children for this node.
 void setParent(TreeNode newParent)
          Sets this nodes parent to newParent, child list does not change.
 void setVisible(boolean vis)
           
 String toString()
          Gets string representation of this node as 'title: total leaves'
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLevel, getNextLeaf, getNextNode, getNextSibling, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(String Title)
Creates a TreeNode with given title, no parent and allows children.

Parameters:
Title -

TreeNode

public TreeNode(String Title,
                boolean allowsChildren)
Creates a TreeNode with given title, no parent and allows children if specified.

Parameters:
Title -
allowsChildren -

TreeNode

public TreeNode(DownloadableInfo obj)
Creates a TreeNode with given PluginInfo object, no parent and does not allow children.

Parameters:
obj -

TreeNode

public TreeNode(DownloadableInfo obj,
                boolean allowsChildren)
Creates a TreeNode with given PluginInfo object, no parent and allows children if specified.

Parameters:
obj -
allowsChildren -
Method Detail

setVisible

public void setVisible(boolean vis)

isVisible

public boolean isVisible()

isLeaf

public boolean isLeaf()
Returns true if this node has no children or does not allow them.

Specified by:
isLeaf in interface TreeNode
Overrides:
isLeaf in class DefaultMutableTreeNode
Returns:

isNodeAncestor

public boolean isNodeAncestor(TreeNode otherNode)
Returns true if otherNode is an ancestor of this node.

Parameters:
otherNode -
Returns:

setParent

public void setParent(TreeNode newParent)
Sets this nodes parent to newParent, child list does not change.

Parameters:
newParent -

getParent

public TreeNode getParent()
Gets the parent of this node

Specified by:
getParent in interface TreeNode
Overrides:
getParent in class DefaultMutableTreeNode
Returns:
TreeNode

addObject

public void addObject(DownloadableInfo info)
Adds a PluginInfo object to this node.

Parameters:
info -

addChild

public void addChild(TreeNode newChild)
Adds newChild to this node if children are allowed.

Parameters:
newChild -

removeChild

public void removeChild(TreeNode child)
Removes child from this node.

Parameters:
child -

removeChildren

public void removeChildren()
Clears the list of children for this node.


addChildren

public void addChildren(TreeNode[] children)
Adds all children to the child list of this node if children are allowed.

Parameters:
children -

getChildren

public Vector<TreeNode> getChildren()
Gets the list of children for this node

Returns:
Vector

getChildCount

public int getChildCount()
Get total number of children for this node

Specified by:
getChildCount in interface TreeNode
Overrides:
getChildCount in class DefaultMutableTreeNode
Returns:
int

getChildAt

public TreeNode getChildAt(int index)
Get child from this node's child list at given index.

Specified by:
getChildAt in interface TreeNode
Overrides:
getChildAt in class DefaultMutableTreeNode
Parameters:
index -
Returns:
TreeNode

getIndexOfChild

public int getIndexOfChild(TreeNode child)
Gets the index of child from this node's child list.

Parameters:
child -
Returns:
int

getTreeCount

public int getTreeCount()
Gets the total (recursively) of all child nodes that are not leaves.

Returns:
int

getLeafCount

public int getLeafCount()
Gets the total (recursively) of all leaves under this node.

Overrides:
getLeafCount in class DefaultMutableTreeNode
Returns:

getTitle

public String getTitle()
Gets the title of this node.

Returns:
String

getObject

public DownloadableInfo getObject()
Gets the PluginInfo object of this node.

Returns:
PluginInfo

toString

public String toString()
Gets string representation of this node as 'title: total leaves'

Overrides:
toString in class DefaultMutableTreeNode

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.