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

cytoscape.groups
Class CyGroupImpl

java.lang.Object
  extended by cytoscape.groups.CyGroupImpl
All Implemented Interfaces:
CyGroup

public class CyGroupImpl
extends Object
implements CyGroup

The CyGroup class provides the implementation for a group model that maintains the list of nodes belonging to a group, the parent of a particular group, and the node that represents the group. Group information is stored in the CyGroup itself, as well as in special group attributes that are associated with the network, nodes, and edges involved. These attributes provide a natural mechanism for the saving and restoration of groups. There are also opaque flags


Field Summary
 
Fields inherited from interface cytoscape.groups.CyGroup
GROUP_STATE_ATTR, GROUP_VIEWER_ATTR, MEMBER_LIST_ATTR
 
Method Summary
 void addInnerEdge(CyEdge edge)
          Add an inner edge to the map.
 void addNode(CyNode node)
          Add a new node to this group
 void addOuterEdge(CyEdge edge)
          Add an outer edge to the map.
 boolean contains(CyNode node)
          Determine if a node is a member of this group
 String getGroupName()
          Return the name of this group
 CyNode getGroupNode()
          Get the CyNode that represents this group
 List<CyEdge> getInnerEdges()
          Get all of the edges completely contained within this group
 Iterator<CyNode> getNodeIterator()
          Get an iterator over all of the nodes in this group
 List<CyNode> getNodes()
          Get all of the nodes in this group
 List<CyEdge> getOuterEdges()
          Get all of the edges partially contained within this group
 int getState()
          Get the state of the group
 String getViewer()
          Get the name of the viewer for this group
 Object getViewValue()
          Get the viewValue for the group
 void removeNode(CyNode node)
          Remove a node from a group
 void setGroupName(String name)
          Set the name of this group
 void setState(int state)
          Set the state of the group.
 void setViewValue(Object viewValue)
          Set the viewValue for the group
 String toString()
          Provide the default toString method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getGroupName

public String getGroupName()
Return the name of this group

Specified by:
getGroupName in interface CyGroup

setGroupName

public void setGroupName(String name)
Set the name of this group


getNodes

public List<CyNode> getNodes()
Get all of the nodes in this group

Specified by:
getNodes in interface CyGroup
Returns:
list of nodes in the group

getGroupNode

public CyNode getGroupNode()
Get the CyNode that represents this group

Specified by:
getGroupNode in interface CyGroup
Returns:
CyNode representing the group

getNodeIterator

public Iterator<CyNode> getNodeIterator()
Get an iterator over all of the nodes in this group

Specified by:
getNodeIterator in interface CyGroup
Returns:
node iterator

getInnerEdges

public List<CyEdge> getInnerEdges()
Get all of the edges completely contained within this group

Specified by:
getInnerEdges in interface CyGroup
Returns:
list of edges in the group

getOuterEdges

public List<CyEdge> getOuterEdges()
Get all of the edges partially contained within this group

Specified by:
getOuterEdges in interface CyGroup
Returns:
list of edges in the group

addOuterEdge

public void addOuterEdge(CyEdge edge)
Add an outer edge to the map. Some viewers may need to do this if they add and remove edges, for example.

Specified by:
addOuterEdge in interface CyGroup
Parameters:
edge - the CyEdge to add to the outer edge map

addInnerEdge

public void addInnerEdge(CyEdge edge)
Add an inner edge to the map. Some viewers may need to do this if they add and remove edges, for example.

Specified by:
addInnerEdge in interface CyGroup
Parameters:
edge - the CyEdge to add to the innter edge map

contains

public boolean contains(CyNode node)
Determine if a node is a member of this group

Specified by:
contains in interface CyGroup
Parameters:
node - the CyNode to test
Returns:
true if node is a member of the group

setState

public void setState(int state)
Set the state of the group. Setting the state of a group has two byproducts. First, the attribute "__groupState" is set to the state value to allow persistance across saves and restores. Second, if there is a viewer for this group, it is informed that the state has changed. This is used by the metaNode viewer, for example to provide programmatic control of whether the group is expanded or collapsed.

Specified by:
setState in interface CyGroup
Parameters:
state - the state to set

getState

public int getState()
Get the state of the group

Specified by:
getState in interface CyGroup
Returns:
group state

setViewValue

public void setViewValue(Object viewValue)
Set the viewValue for the group

Parameters:
viewValue - the view value to set

getViewValue

public Object getViewValue()
Get the viewValue for the group

Returns:
the view value

toString

public String toString()
Provide the default toString method

Specified by:
toString in interface CyGroup
Overrides:
toString in class Object
Returns:
group name

getViewer

public String getViewer()
Get the name of the viewer for this group

Specified by:
getViewer in interface CyGroup
Returns:
viewer for this group

addNode

public void addNode(CyNode node)
Add a new node to this group

Specified by:
addNode in interface CyGroup
Parameters:
node - the node to add

removeNode

public void removeNode(CyNode node)
Remove a node from a group

Specified by:
removeNode in interface CyGroup
Parameters:
node - the node to remove

www.cytoscape.org