edu.ucsf.groups
Class GroupManager

java.lang.Object
  extended by edu.ucsf.groups.GroupManager

public class GroupManager
extends Object

This is just a container class to provide convenient access to the group methods.


Constructor Summary
GroupManager()
           
 
Method Summary
static CyNode copyGroup(CyNode group, CyNetwork newNetwork)
          This method copies a group from one network to another.
static CyNode createGroup(CyNetwork network, CyNetwork child_network)
          This method creates a group when given two networks: the current network and the new network that will be "contained" within the group.
static CyNode createGroup(CyNetwork network, CyNetwork child_network, GroupAttributesHandler att_handler, GroupModel model)
          This method creates a group when given two networks: the current network and the new network that will be "contained" within the group.
static List getAllGroupNodes(CyNode member)
          This method returns the list of groups (as represented by CyNodes) that this CyNode is a member of (reguardless of which network).
static CyNetwork getCyNetwork(CyNode group_node)
          This method returns the CyNetwork this group is part of.
static GroupAttributesHandler getGroupAttributesHandler(CyNode group_node)
          This method returns the current attributes handler for this group.
static CyNetwork getGroupMembers(CyNode group_node)
          This method returns the list of members that are contained within this group.
static GroupModel getGroupModel(CyNode group_node)
          This method returns the current model for this group.
static List getGroupNodes(CyNetwork network, CyNode member)
          This method returns the list of groups (as represented by CyNodes) that this CyNode is a member of.
static List getSubGroups(CyNode group_node)
          This method returns a List of the groups contained within this group
static boolean isGrouped(CyNode group_node)
          Test to see if a group node is in the "group" or "ungrouped" state.
static void regroupGroup(CyNode group_node, boolean create_multiple_edges, boolean create_relationship_edges)
          This method will "regroup" the group, that is, it will present the nodes in an "grouped" state.
static void removeGroup(CyNode group_node)
          This method will remove a group -- essentially a permanent "ungroup".
static void setGroupAttributesHandler(CyNode group_node, GroupAttributesHandler handler)
          This method allows the caller to explicitly set the attributes handler used with this group.
static void setGroupModel(CyNode group_node, GroupModel model)
          This method allows the caller to explicitly set the abstraction model used to represent the group.
static void ungroupGroup(CyNode group_node, boolean recursive)
          This method will "ungroup" the group, that is, it will present the nodes in an "ungrouped" state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupManager

public GroupManager()
Method Detail

createGroup

public static CyNode createGroup(CyNetwork network,
                                 CyNetwork child_network,
                                 GroupAttributesHandler att_handler,
                                 GroupModel model)
This method creates a group when given two networks: the current network and the new network that will be "contained" within the group.

Parameters:
network - the CyNetwork that will contain the resulting group node
child_network - the CyNetwork that contains the nodes to be grouped
att_handler - the group attributes handler
model - the grouping abstraction modeler
Returns:
the CyNode that represents the group

createGroup

public static CyNode createGroup(CyNetwork network,
                                 CyNetwork child_network)
This method creates a group when given two networks: the current network and the new network that will be "contained" within the group.

Parameters:
network - the CyNetwork that will contain the resulting group node
child_network - the CyNetwork that contains the nodes to be grouped
Returns:
the CyNode that represents the group

copyGroup

public static CyNode copyGroup(CyNode group,
                               CyNetwork newNetwork)
This method copies a group from one network to another. Note that this is a /shallow/ copy, so only the group-related data structures are copied. Enclosed nodes should already exist in the destination network.

Parameters:
group - the CyNode that represents the group to be copied
newNetwork - the CyNetwork that will contain the new group
Returns:
the CyNode that represents the new group

ungroupGroup

public static void ungroupGroup(CyNode group_node,
                                boolean recursive)
This method will "ungroup" the group, that is, it will present the nodes in an "ungrouped" state.

Parameters:
group_node - the CyNode that 'contains' this group
recursive - if this is 'true', all groups contained within this group will be ungrouped

regroupGroup

public static void regroupGroup(CyNode group_node,
                                boolean create_multiple_edges,
                                boolean create_relationship_edges)
This method will "regroup" the group, that is, it will present the nodes in an "grouped" state.

Parameters:
group_node - the CyNode that 'contains' this group
create_multiple_edges - if the grouping action results in the "hiding" of the internal edges, then setting this to true will cause the external edges will be created with one external edge for every internal edge that connects to an external node. Otherwise, only one edge will be created between the group node and any externally connected node.
create_relationship_edges - if the grouping action results in the "hiding" of the internal edges, then setting this to true will cause the creations of edges that represent the relationship between this group and possible children. This provides a mechanism to node that an ungrouped node from a different group is also a member of this group.

removeGroup

public static void removeGroup(CyNode group_node)
This method will remove a group -- essentially a permanent "ungroup".

Parameters:
group_node - the CyNode representing the group.

setGroupModel

public static void setGroupModel(CyNode group_node,
                                 GroupModel model)
This method allows the caller to explicitly set the abstraction model used to represent the group. This provides a mechanism for plug-in authors to provide alternate abstractions.

Parameters:
group_node - The CyNode that represents the group
model - The GroupModel to use with this group

getGroupModel

public static GroupModel getGroupModel(CyNode group_node)
This method returns the current model for this group.

Parameters:
group_node - The CyNode that represents the group
Returns:
The GroupModel in use with this group

setGroupAttributesHandler

public static void setGroupAttributesHandler(CyNode group_node,
                                             GroupAttributesHandler handler)
This method allows the caller to explicitly set the attributes handler used with this group. This provides a mechanism for plug-in authors to provide alternate attributes handlers.

Parameters:
group_node - The CyNode that represents the group
handler - The GroupAttributesHandler to use with this group

getGroupAttributesHandler

public static GroupAttributesHandler getGroupAttributesHandler(CyNode group_node)
This method returns the current attributes handler for this group.

Parameters:
group_node - The CyNode that represents the group
Returns:
The GroupAttributesHandler in use with this group

getGroupNodes

public static List getGroupNodes(CyNetwork network,
                                 CyNode member)
This method returns the list of groups (as represented by CyNodes) that this CyNode is a member of.

Parameters:
network - limit the search to this CyNetwork.
member - the CyNode whose membership we are looking for
Returns:
a List of group CyNodes

getAllGroupNodes

public static List getAllGroupNodes(CyNode member)
This method returns the list of groups (as represented by CyNodes) that this CyNode is a member of (reguardless of which network).

Parameters:
member - the CyNode whose membership we are looking for
Returns:
a List of group CyNodes

getSubGroups

public static List getSubGroups(CyNode group_node)
This method returns a List of the groups contained within this group

Parameters:
group_node - the CyNode representing the group
Returns:
a List of group CyNodes

getGroupMembers

public static CyNetwork getGroupMembers(CyNode group_node)
This method returns the list of members that are contained within this group.

Parameters:
group_node - the group CyNode whose members we want
Returns:
the CyNetwork that is the subnetwork representing this group

getCyNetwork

public static CyNetwork getCyNetwork(CyNode group_node)
This method returns the CyNetwork this group is part of.

Parameters:
group_node - the group CyNode whose CyNetwork we want
Returns:
the CyNetwork this group is part of

isGrouped

public static boolean isGrouped(CyNode group_node)
Test to see if a group node is in the "group" or "ungrouped" state.

Parameters:
group_node - the group CyNode whose state we want to check.
Returns:
a boolean true if the group is in the 'grouped' state.