edu.ucsf.groups.data
Interface GroupAttributesHandler


public interface GroupAttributesHandler

An interface for classes that handle the node and edge attributes of groups. Since there are many different ways of transfering node and edge attributes from children nodes and edges to their parent nodes, we need an interface that then can be implemented by classes so that they can handle this operation as they desire.


Field Summary
static String DEFAULT_NODE_LABEL_ATTRIBUTE
          The default attribute that is used to label nodes, this is not the same as the unique ID of nodes which are internal keys to nodes
 
Method Summary
 String assignName(CyNetwork cy_net, CyNode node)
          Creates a unique name for the CyNode and registers this name and node into Cytoscape
 String getDefaultNodeLabelAttribute()
          Returns the current default node label attribute.
 String getNodeLabelAttribute()
          Gets the name of the node attribute to which meta-node names should be assigned to, if not set, it is DEFAULT_NODE_LABEL_ATTRIBUTE
 boolean removeFromAttributes(CyNetwork cy_network, CyNode group_node, List meta_edge_list)
          Removes all attributes created for the given group node
 boolean removeMetaEdgesFromAttributes(CyNetwork cy_network, CyNode group_node, List meta_edge_list)
          Remove attributes for the given meta-edges in CyNetwork, but leave the attributes for the group node as they are.
 boolean setAttributes(CyNetwork cy_network, CyNode group_node, List members, cern.colt.map.AbstractIntIntMap meta_edge_to_child_edge)
          Sets the node and edge attributes of the meta-node
 boolean setEdgeAttributes(CyNetwork cy_network, CyNode group_node, cern.colt.map.AbstractIntIntMap meta_edge_to_child_edge)
          Sets the edge attributes of the group node
 boolean setNodeAttributes(CyNetwork cy_network, CyNode group_node, List children)
          Sets the node attributes of the group node
 void setNodeLabelAttribute(String attribute_name)
          Sets the name of the node attribute to which meta-node names should be assigned to, if not set, it is DEFAULT_NODE_LABEL_ATTRIBUTE
 

Field Detail

DEFAULT_NODE_LABEL_ATTRIBUTE

static final String DEFAULT_NODE_LABEL_ATTRIBUTE
The default attribute that is used to label nodes, this is not the same as the unique ID of nodes which are internal keys to nodes

See Also:
Constant Field Values
Method Detail

getDefaultNodeLabelAttribute

String getDefaultNodeLabelAttribute()
Returns the current default node label attribute.

Returns:
the String representing the default node label.

setNodeLabelAttribute

void setNodeLabelAttribute(String attribute_name)
Sets the name of the node attribute to which meta-node names should be assigned to, if not set, it is DEFAULT_NODE_LABEL_ATTRIBUTE

Parameters:
attribute_name - the name of a node attribute of type String

getNodeLabelAttribute

String getNodeLabelAttribute()
Gets the name of the node attribute to which meta-node names should be assigned to, if not set, it is DEFAULT_NODE_LABEL_ATTRIBUTE

Returns:
a String representing the name of the node attribute

assignName

String assignName(CyNetwork cy_net,
                  CyNode node)
Creates a unique name for the CyNode and registers this name and node into Cytoscape

Parameters:
cy_net - the CyNetwork where the node is contained
node - the node
Returns:
the name, or null if something went wrong

setAttributes

boolean setAttributes(CyNetwork cy_network,
                      CyNode group_node,
                      List members,
                      cern.colt.map.AbstractIntIntMap meta_edge_to_child_edge)
Sets the node and edge attributes of the meta-node

Parameters:
cy_network - the CyNetwork that contains the member nodes of the group
group_node - the group node
members - an array of CyNodes that are the member nodes of "node"
meta_edge_to_child_edge - maps a meta-edge (edge connected to the group_node) to a child edge (edge that connects a member of the group node to another node) so that classes implementing this interface know which child edge corresponds to which meta-edge
Returns:
true if all went well, false if there was an error

setNodeAttributes

boolean setNodeAttributes(CyNetwork cy_network,
                          CyNode group_node,
                          List children)
Sets the node attributes of the group node

Parameters:
cy_network - the CyNetwork that contains the member nodes of "node"
group_node - the group node for which node attributes will be set
children - an List of CyNodes that are members of the given node
Returns:
true if all went well, false if there was an error

setEdgeAttributes

boolean setEdgeAttributes(CyNetwork cy_network,
                          CyNode group_node,
                          cern.colt.map.AbstractIntIntMap meta_edge_to_child_edge)
Sets the edge attributes of the group node

Parameters:
cy_network - the CyNetwork that contains the member nodes of "node"
group_node - the group node for which edge attributes will be set
meta_edge_to_child_edge - maps a meta-edge (edge connected to the group node) to a child edge (edge that connects a child of the group node to another node) so that classes implementing this interface know which child edge corresponds to which meta-edge
Returns:
true if all went well, false if there was an error

removeFromAttributes

boolean removeFromAttributes(CyNetwork cy_network,
                             CyNode group_node,
                             List meta_edge_list)
Removes all attributes created for the given group node

Parameters:
cy_network - were the members for the group live
group_node - the group node
meta_edge_list - the edges connected to the group node whose attributes should alse be removed
Returns:
true if all went well, false otherwise

removeMetaEdgesFromAttributes

boolean removeMetaEdgesFromAttributes(CyNetwork cy_network,
                                      CyNode group_node,
                                      List meta_edge_list)
Remove attributes for the given meta-edges in CyNetwork, but leave the attributes for the group node as they are.

Parameters:
cy_network - the CyNetwork where the meta-edges are
group_node - the group node
meta_edge_list - a list of CyEdges for which the attributes should be removed
Returns:
true if all went well, false otherwise