Cytoscape 2.8.0 API

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


Field Summary
protected  EventListenerList listenerList
           
 
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
protected  void fireTreeNodesAdded(Object source, Object[] path, int[] childIndicies, Object[] children)
           
protected  void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndicies, Object[] children)
           
protected  void fireTreeStructureChanged(Object source, Object[] path, int[] childIndicies, Object[] children)
           
 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)
           
protected  TreeNode[] getPathToRoot(TreeNode node, int depth)
           
 Object getRoot()
          Gets root TreeNode
 TreeModelListener[] getTreeModelListeners()
           
 boolean isLeaf(Object node)
          Checks if given node is a leaf.
protected  void nodesAdded(TreeNode parent, int[] childIndicies, TreeNode[] addedChildren)
          Fires necessary event, use addNodeToParent
protected  void nodesRemoved(TreeNode parent, int[] childIndicies, TreeNode[] removedChildren)
          Fires necessary event, use removeNodeFromParent
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList
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 -

nodesAdded

protected void nodesAdded(TreeNode parent,
                          int[] childIndicies,
                          TreeNode[] addedChildren)
Fires necessary event, use addNodeToParent

Parameters:
parent -
childIndicies -
addedChildren -

nodesRemoved

protected void nodesRemoved(TreeNode parent,
                            int[] childIndicies,
                            TreeNode[] removedChildren)
Fires necessary event, use removeNodeFromParent

Parameters:
parent -
childIndicies -
removedChildren -

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[]

fireTreeNodesRemoved

protected void fireTreeNodesRemoved(Object source,
                                    Object[] path,
                                    int[] childIndicies,
                                    Object[] children)

fireTreeNodesAdded

protected void fireTreeNodesAdded(Object source,
                                  Object[] path,
                                  int[] childIndicies,
                                  Object[] children)

fireTreeStructureChanged

protected void fireTreeStructureChanged(Object source,
                                        Object[] path,
                                        int[] childIndicies,
                                        Object[] children)

getPathToRoot

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

getPathToRoot

protected TreeNode[] getPathToRoot(TreeNode node,
                                   int depth)

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

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.