Package org.cytoscape.group
Interface CyGroup
public interface CyGroup
An object that represents a group of nodes and edges. A CyGroup
is an object that encapsulates a
CyNode
that represents
a collection of CyNode
s and connecting CyEdge
s
stored as a CyNetwork
. In addition a CyGroup maintains
information about the links between the nodes in the group and
nodes external to the group. Groups may be collapsed or expanded.
A collapsed group is represented in a network as the CyNode
representing the group and a series of "meta" edges that represent
the edges between nodes within the group and external nodes. Like
any other node, the group node can also have edges connecting to other
nodes.Module: group-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>group-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a list of edges to a group.void
addGroupToNetwork
(CyNetwork network) Add a group to an additional network.void
Add a list of nodes and their edgesvoid
Collapse this group in the designated network.void
Expand this group in the designated network.Returns the list of exterior edges connected to the nodes within this group.Returns the network referenced by this group.Return theCyNode
that represents this group in the network.Returns the list of edges contained within this group.Return the list ofCyNetwork
s this group is in.Returns the list of nodes contained within this group.Return the root network for this group.boolean
isCollapsed
(CyNetwork network) Return whether this group is expanded or collapsed in the designated network.boolean
isInNetwork
(CyNetwork network) Check to see if this group is defined in a particular network.void
removeEdges
(List<CyEdge> edges) Remove a set of edges from a group.void
removeGroupFromNetwork
(CyNetwork network) Remove a group from a network.void
removeNodes
(List<CyNode> nodes) Remove a set of nodes and their edges from a group
-
Method Details
-
getGroupNode
CyNode getGroupNode()Return theCyNode
that represents this group in the network.- Returns:
- the
CyNode
for this group
-
getNodeList
Returns the list of nodes contained within this group.- Returns:
- A list of CyNodes returns null otherwise.
-
getInternalEdgeList
Returns the list of edges contained within this group.- Returns:
- A list of CyEdges
-
getExternalEdgeList
Returns the list of exterior edges connected to the nodes within this group.- Returns:
- A list of CyEdges
-
getGroupNetwork
CyNetwork getGroupNetwork()Returns the network referenced by this group. All groups will point to a network, although the network might not have any nodes or edges. This is the internal network representation of the group, not the networks that the group is a member of.- Returns:
- A reference to a CyNetwork
-
addNodes
Add a list of nodes and their edges- Parameters:
nodes
- the list of nodes to add
-
addEdges
Add a list of edges to a group. The edges will be added either to the internal edges or external edges lists. Note that unlikeaddNodes(java.util.List<org.cytoscape.model.CyNode>)
either the source node or target node for the edge must be in the group.- Parameters:
edges
- the list of edges to add
-
removeNodes
Remove a set of nodes and their edges from a group- Parameters:
nodes
- the nodes to remove
-
removeEdges
Remove a set of edges from a group. Edges can be either internal edges or external edges.- Parameters:
edges
- the edges to remove
-
getRootNetwork
CyRootNetwork getRootNetwork()Return the root network for this group. A group can only exist within one root network, and all nodes and edges that are part of the group must exist within that root network also.- Returns:
- the root network for this group
-
addGroupToNetwork
Add a group to an additional network. When groups are created, they are created in a particular network. The can also be shown in other networks, as long as all of the networks are in the sameCyRootNetwork
- Parameters:
network
- theCyNetwork
to add the group to
-
removeGroupFromNetwork
Remove a group from a network.- Parameters:
network
- theCyNetwork
to remove the group from
-
getNetworkSet
Return the list ofCyNetwork
s this group is in.- Returns:
- the set of
CyNetwork
s that contain this group
-
isInNetwork
Check to see if this group is defined in a particular network.- Parameters:
network
- theCyNetwork
to test- Returns:
- true if the group is in that network
-
collapse
Collapse this group in the designated network. Note that this is a "model-level" collapse, which removes all of the member nodes and edges and replaces them with the node that represents the group in the network. This does not imply a specific visual representation.- Parameters:
network
- theCyNetwork
that this group should be collapsed in
-
expand
Expand this group in the designated network. Note that this is a "model-level" expansion, which removes the node that represents the group from the network and adds all of the member nodes and edges. This does not imply a specific visual representation.- Parameters:
network
- theCyNetwork
that this group should be expanded in
-
isCollapsed
Return whether this group is expanded or collapsed in the designated network.- Parameters:
network
- theCyNetwork
we're interested in- Returns:
- true if the group is collapsed in that network.
-