Cytoscape 2.8.0 API

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 copyGroup(CyGroup group, CyNetwork network)
          Create a copy of a group, potentially in a new network, and name the copy automatically.
static CyGroup copyGroup(String newName, CyGroup group, CyNetwork network)
          Create a copy of a group, potentially in a new network, and name the copy with the provided new name.
static CyGroup createGroup(CyNode groupNode, List<CyNode> nodeList, String viewer)
          Create a new group with a list of nodes as initial members, and a precreated group node.
static CyGroup createGroup(CyNode groupNode, List<CyNode> nodeList, String viewer, CyNetwork network)
          Create a new group with a list of nodes as initial members, and a precreated group node.
static CyGroup createGroup(String groupName, List<CyNode> nodeList, List<CyEdge> innerEdgeList, List<CyEdge> outerEdgeList, String viewer, CyNetwork network)
          Create a new group by specifying all components.
static CyGroup createGroup(String groupName, List<CyNode> nodeList, String viewer)
          Create a new, empty group.
static CyGroup createGroup(String groupName, List<CyNode> nodeList, String viewer, CyNetwork network)
          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 createGroup(String groupName, String viewer, CyNetwork network)
          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 List<CyGroup> getGroupList(CyNetwork network)
          Return the list of all groups for this network
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
clone, equals, finalize, 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(CyNetwork network)
Return the list of all groups for this network

Parameters:
network - the network we're interested in. If network is null, return the list of global 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

copyGroup

public static CyGroup copyGroup(CyGroup group,
                                CyNetwork network)
Create a copy of a group, potentially in a new network, and name the copy automatically. The copy name is simply formed by placing an integer in brackets after the name of the current group.

Parameters:
group - the group to make a copy of
network - the network the copy is to be part of
Returns:
the new group, or null if we can't find a suitable name

copyGroup

public static CyGroup copyGroup(String newName,
                                CyGroup group,
                                CyNetwork network)
Create a copy of a group, potentially in a new network, and name the copy with the provided new name.

Parameters:
newName - the name of the copied group
group - the group to make a copy of
network - the network the copy is to be part of
Returns:
the new group, or null if a node of 'newName' already exists

createGroup

public static CyGroup createGroup(String groupName,
                                  List<CyNode> nodeList,
                                  List<CyEdge> innerEdgeList,
                                  List<CyEdge> outerEdgeList,
                                  String viewer,
                                  CyNetwork network)
Create a new group by specifying all components. Use this to get a new group. This constructor allows the caller to provide all of the components required to create a group. This is the most efficient of all of the constructors in that no additional processing is done to find internal and external edges, etc. If innerEdgeList and outerEdgeList are both null, the underlying implementation will find all internal and external edges.

Parameters:
groupName - the identifier to use for this group -- should be unique!
nodeList - the initial set of nodes for this group
innerEdgeList - the initial set of internal edges for this group
outerEdgeList - the initial set of external edges for this group
viewer - the name of the viewer to manage this group
network - the network that this group is in
Returns:
the newly created group

createGroup

public static CyGroup createGroup(String groupName,
                                  String viewer,
                                  CyNetwork network)
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
network - the network that this group is in
Returns:
the newly created group

createGroup

public static CyGroup createGroup(String groupName,
                                  List<CyNode> nodeList,
                                  String viewer,
                                  CyNetwork network)
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
network - the network that this group is in

createGroup

public static CyGroup createGroup(CyNode groupNode,
                                  List<CyNode> nodeList,
                                  String viewer,
                                  CyNetwork network)
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
network - the network that this group is in

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<CyNode> nodeList,
                                  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!
nodeList - the initial set of nodes for this group
viewer - the name of the viewer to manage this group
Returns:
the newly created group

createGroup

public static CyGroup createGroup(CyNode groupNode,
                                  List<CyNode> 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

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.