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

cytoscape.groups
Class CyGroupManager

java.lang.Object
  extended by cytoscape.groups.CyGroupManager

public class CyGroupManager
extends Object

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


Constructor Summary
CyGroupManager()
           
 
Method Summary
static void addGroupChangeListener(CyGroupChangeListener listener)
          Add a new change listener to our list of listeners
static CyGroup createGroup(CyNode groupNode, List nodeList, String viewer)
          Create a new group with a list of nodes as initial members, and a precreated group node.
static CyGroup createGroup(String groupName, List nodeList, String viewer)
          Create a new group with a list of nodes as initial members.
static CyGroup createGroup(String groupName, String viewer)
          Create a new, empty group.
static CyGroup findGroup(String groupName)
          Search all groups for the group named 'groupName'
static CyGroup getCyGroup(CyNode groupNode)
          getCyGroup is a static method that returns a CyGroup structure when given the CyNode that represents this group.
static List<CyGroup> getGroup(CyNode memberNode)
          getGroup is a static method that returns a CyGroup structure when given a CyNode that is a member of a group.
static List<CyGroup> getGroupList()
          Return the list of all groups
static List<CyGroup> getGroupList(CyGroupViewer viewer)
          Return the list of all groups managed by a particular viewer
static CyGroupViewer getGroupViewer(String viewerName)
          Return the viewer object for a named viewer
static Collection<CyGroupViewer> getGroupViewers()
          Return a list of all registered viewers
static boolean isaGroup(CyNode groupNode)
          See if this CyNode represents a group
static void notifyCreateGroup(CyGroup group)
          Notify a viewer that a group has been created for them to manage.
static void notifyRemoveGroup(CyGroup group)
          Notify a viewer the a group of interest is going to be removed.
static void registerGroupViewer(CyGroupViewer viewer)
          Register a viewer.
static void removeGroup(CyGroup group)
          Remove (delete) a group
static void removeGroup(CyNode groupNode)
          Remove (delete) a group
static void removeGroupChangeListener(CyGroupChangeListener listener)
          Remove a change listener from our list of listeners
static void setGroupViewer(CyGroup group, String viewer, CyNetworkView myView, boolean notify)
          Set the viewer for a group
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyGroupManager

public CyGroupManager()
Method Detail

getCyGroup

public static CyGroup getCyGroup(CyNode groupNode)
getCyGroup is a static method that returns a CyGroup structure when given the CyNode that represents this group.

Parameters:
groupNode - the CyNode that represents this group
Returns:
the associated CyGroup structure

getGroup

public static List<CyGroup> getGroup(CyNode memberNode)
getGroup is a static method that returns a CyGroup structure when given a CyNode that is a member of a group.

Parameters:
memberNode - a CyNode whose group membership we're looking for
Returns:
a list of CyGroups this node is a member of

getGroupList

public static List<CyGroup> getGroupList()
Return the list of all groups

Returns:
the list of groups

getGroupList

public static List<CyGroup> getGroupList(CyGroupViewer viewer)
Return the list of all groups managed by a particular viewer

Parameters:
viewer - the CyGroupViewer
Returns:
the list of groups

findGroup

public static CyGroup findGroup(String groupName)
Search all groups for the group named 'groupName'

Parameters:
groupName - the name of the group to find
Returns:
the group, or null if no such group exists

createGroup

public static CyGroup createGroup(String groupName,
                                  String viewer)
Create a new, empty group. Use this to get a new group. In particular, this form should be used by internal routines (as opposed to view implementations) as this form will cause the viewer to be notified of the group creation. Viewers should use createGroup(String, List, String) as defined below.

Parameters:
groupName - the identifier to use for this group -- should be unique!
viewer - the name of the viewer to manage this group
Returns:
the newly created group

createGroup

public static CyGroup createGroup(String groupName,
                                  List nodeList,
                                  String viewer)
Create a new group with a list of nodes as initial members. Note that this method is the prefered method to be used by viewers. Using this method, once the group is created the viewer is *not* notified (since it is assumed they are doing the creation).

Parameters:
groupName - the identifier to use for this group -- should be unique!
nodeList - the initial set of nodes for this group
viewer - the name of the viewer to manage this group

createGroup

public static CyGroup createGroup(CyNode groupNode,
                                  List nodeList,
                                  String viewer)
Create a new group with a list of nodes as initial members, and a precreated group node. This is usually used by the XGMML reader since the group node may need to alread be created with its associated "extra" edges. Note that the node will be created, but *not* added to the network. That is the responsibility of the appropriate viewer.

Parameters:
groupNode - the groupNode to use for this group
nodeList - the initial set of nodes for this group
viewer - the name of the viewer to manage this group

removeGroup

public static void removeGroup(CyGroup group)
Remove (delete) a group

Parameters:
group - the group to remove

removeGroup

public static void removeGroup(CyNode groupNode)
Remove (delete) a group

Parameters:
groupNode - the group node of the group to remove

isaGroup

public static boolean isaGroup(CyNode groupNode)
See if this CyNode represents a group

Parameters:
groupNode - the node we want to test
Returns:
'true' if groupNode is a group

registerGroupViewer

public static void registerGroupViewer(CyGroupViewer viewer)
Register a viewer.

Parameters:
viewer - the viewer we're registering

getGroupViewers

public static Collection<CyGroupViewer> getGroupViewers()
Return a list of all registered viewers

Returns:
list of registered group viewers

setGroupViewer

public static void setGroupViewer(CyGroup group,
                                  String viewer,
                                  CyNetworkView myView,
                                  boolean notify)
Set the viewer for a group

Parameters:
group - the group we're associating with a viewer
viewer - the viewer
myView - the network view that this is being operated on
notify - if 'true' the viewer will be notified of the creation

getGroupViewer

public static CyGroupViewer getGroupViewer(String viewerName)
Return the viewer object for a named viewer

Parameters:
viewerName - the name of the viewer
Returns:
the viewer object

notifyCreateGroup

public static void notifyCreateGroup(CyGroup group)
Notify a viewer that a group has been created for them to manage.

Parameters:
group - the group that was just created

notifyRemoveGroup

public static void notifyRemoveGroup(CyGroup group)
Notify a viewer the a group of interest is going to be removed.

Parameters:
group - the group to be removed

addGroupChangeListener

public static void addGroupChangeListener(CyGroupChangeListener listener)
Add a new change listener to our list of listeners

Parameters:
listener - the listener to add

removeGroupChangeListener

public static void removeGroupChangeListener(CyGroupChangeListener listener)
Remove a change listener from our list of listeners

Parameters:
listener - the listener to remove

www.cytoscape.org