Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.dialogs.plugins
Class ManagerModel

java.lang.Object
  extended by cytoscape.dialogs.plugins.ManagerModel
All Implemented Interfaces:
TreeModel

public class ManagerModel
extends Object
implements TreeModel

Fairly similar to DefaultTreeModel but I wanted to add some extra functionality to removing/adding nodes and use my own node objects


Constructor Summary
ManagerModel(TreeNode Root)
           
 
Method Summary
 void addNodeToParent(TreeNode parent, TreeNode child)
          Adds node to given parent, fires event
 void addTreeModelListener(TreeModelListener l)
          Adds given listener
 Object getChild(Object parent, int index)
          Gets child TreeNode from given parent at given index.
 int getChildCount(Object parent)
          Gets count of all children under given parent (not including leaves)
 int getIndexOfChild(Object parent, Object child)
          Gets the index of the given child node from the given parent node.
 TreeNode[] getPathToRoot(TreeNode node)
           
 Object getRoot()
          Gets root TreeNode
 TreeModelListener[] getTreeModelListeners()
           
 boolean isLeaf(Object node)
          Checks if given node is a leaf.
 void reload()
          Reloads entire tree, fires event
 void reload(TreeNode node)
          Reloads given node, fires event.
 void removeNodeFromParent(TreeNode child)
          Removes given node from it's parent.
 void removeNodesFromParent(List<TreeNode> children)
           
 void removeTreeModelListener(TreeModelListener l)
          Removes given listener
 void valueForPathChanged(TreePath path, Object newValue)
          NOT IMPLEMENTED
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagerModel

public ManagerModel(TreeNode Root)
Method Detail

removeNodesFromParent

public void removeNodesFromParent(List<TreeNode> children)

removeNodeFromParent

public void removeNodeFromParent(TreeNode child)
Removes given node from it's parent.

Parameters:
child -

addNodeToParent

public void addNodeToParent(TreeNode parent,
                            TreeNode child)
Adds node to given parent, fires event

Parameters:
parent -
child -

getChild

public Object getChild(Object parent,
                       int index)
Gets child TreeNode from given parent at given index.

Specified by:
getChild in interface TreeModel
Parameters:
parent -
index -

getChildCount

public int getChildCount(Object parent)
Gets count of all children under given parent (not including leaves)

Specified by:
getChildCount in interface TreeModel
Parameters:
parent -

getIndexOfChild

public int getIndexOfChild(Object parent,
                           Object child)
Gets the index of the given child node from the given parent node.

Specified by:
getIndexOfChild in interface TreeModel
Parameters:
parent -
child -

getRoot

public Object getRoot()
Gets root TreeNode

Specified by:
getRoot in interface TreeModel
Returns:
root

isLeaf

public boolean isLeaf(Object node)
Checks if given node is a leaf. True if it either has no children or is TreeNode.isLeaf() return true;

Specified by:
isLeaf in interface TreeModel
Parameters:
node -

removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)
Removes given listener

Specified by:
removeTreeModelListener in interface TreeModel
Parameters:
l -

addTreeModelListener

public void addTreeModelListener(TreeModelListener l)
Adds given listener

Specified by:
addTreeModelListener in interface TreeModel
Parameters:
l -

getTreeModelListeners

public TreeModelListener[] getTreeModelListeners()
Returns:
TreeModelListener[]

getPathToRoot

public TreeNode[] getPathToRoot(TreeNode node)
Parameters:
node -
Returns:

reload

public void reload()
Reloads entire tree, fires event


reload

public void reload(TreeNode node)
Reloads given node, fires event.

Parameters:
node -

valueForPathChanged

public void valueForPathChanged(TreePath path,
                                Object newValue)
NOT IMPLEMENTED

Specified by:
valueForPathChanged in interface TreeModel

www.cytoscape.org