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 CyNodes and connecting CyEdges 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 Detail

      • getGroupNode

        CyNode getGroupNode()
        Return the CyNode that represents this group in the network.
        Returns:
        the CyNode for this group
      • getNodeList

        List<CyNode> getNodeList()
        Returns the list of nodes contained within this group.
        Returns:
        A list of CyNodes returns null otherwise.
      • getInternalEdgeList

        List<CyEdge> getInternalEdgeList()
        Returns the list of edges contained within this group.
        Returns:
        A list of CyEdges
      • getExternalEdgeList

        Set<CyEdge> 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

        void addNodes​(List<CyNode> nodes)
        Add a list of nodes and their edges
        Parameters:
        nodes - the list of nodes to add
      • addEdges

        void addEdges​(List<CyEdge> edges)
        Add a list of edges to a group. The edges will be added either to the internal edges or external edges lists. Note that unlike addNodes(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

        void removeNodes​(List<CyNode> nodes)
        Remove a set of nodes and their edges from a group
        Parameters:
        nodes - the nodes to remove
      • removeEdges

        void removeEdges​(List<CyEdge> edges)
        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

        void addGroupToNetwork​(CyNetwork network)
        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 same CyRootNetwork
        Parameters:
        network - the CyNetwork to add the group to
      • removeGroupFromNetwork

        void removeGroupFromNetwork​(CyNetwork network)
        Remove a group from a network.
        Parameters:
        network - the CyNetwork to remove the group from
      • getNetworkSet

        Set<CyNetwork> getNetworkSet()
        Return the list of CyNetworks this group is in.
        Returns:
        the set of CyNetworks that contain this group
      • isInNetwork

        boolean isInNetwork​(CyNetwork network)
        Check to see if this group is defined in a particular network.
        Parameters:
        network - the CyNetwork to test
        Returns:
        true if the group is in that network
      • collapse

        void collapse​(CyNetwork network)
        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 - the CyNetwork that this group should be collapsed in
      • expand

        void expand​(CyNetwork network)
        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 - the CyNetwork that this group should be expanded in
      • isCollapsed

        boolean isCollapsed​(CyNetwork network)
        Return whether this group is expanded or collapsed in the designated network.
        Parameters:
        network - the CyNetwork we're interested in
        Returns:
        true if the group is collapsed in that network.