|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cytoscape.dialogs.plugins.ManagerModel
public class ManagerModel
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 |
---|
protected EventListenerList listenerList
Constructor Detail |
---|
public ManagerModel(TreeNode Root)
Method Detail |
---|
public void removeNodesFromParent(List<TreeNode> children)
public void removeNodeFromParent(TreeNode child)
child
- public void addNodeToParent(TreeNode parent, TreeNode child)
parent
- child
- protected void nodesAdded(TreeNode parent, int[] childIndicies, TreeNode[] addedChildren)
parent
- childIndicies
- addedChildren
- protected void nodesRemoved(TreeNode parent, int[] childIndicies, TreeNode[] removedChildren)
parent
- childIndicies
- removedChildren
- public Object getChild(Object parent, int index)
getChild
in interface TreeModel
parent
- index
- public int getChildCount(Object parent)
getChildCount
in interface TreeModel
parent
- public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
parent
- child
- public Object getRoot()
getRoot
in interface TreeModel
public boolean isLeaf(Object node)
TreeNode.isLeaf()
return true;
isLeaf
in interface TreeModel
node
- public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
l
- public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
l
- public TreeModelListener[] getTreeModelListeners()
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndicies, Object[] children)
protected void fireTreeNodesAdded(Object source, Object[] path, int[] childIndicies, Object[] children)
protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndicies, Object[] children)
public TreeNode[] getPathToRoot(TreeNode node)
node
-
protected TreeNode[] getPathToRoot(TreeNode node, int depth)
public void reload()
public void reload(TreeNode node)
node
- public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |