Class LayoutEdge

  • All Implemented Interfaces:
    Comparable<LayoutEdge>

    public final class LayoutEdge
    extends Object
    implements Comparable<LayoutEdge>
    The LayoutEdge class. This class is used as a container for information about the edges in a layout. In particular, it provides a convenient handle to information about the weights associated with edges, and pointers to the LayoutNodes that are joined by this edge.

    Module: layout-api

    To use this in your app, include the following dependency in your POM:

    <dependency>
        <groupId>org.cytoscape</groupId>
        <artifactId>layout-api</artifactId>
    </dependency>

    Cytoscape Backwards Compatibility (Final Class): This class is final and therefore can't be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
    • Constructor Detail

      • LayoutEdge

        public LayoutEdge​(CyEdge edge,
                          CyRow row)
        Create a LayoutEdge that will contain information about this edge. Additional information must be filled in later.
        Parameters:
        edge - Edge that this LayoutEdge represents
      • LayoutEdge

        public LayoutEdge​(CyEdge edge,
                          LayoutNode v1,
                          LayoutNode v2,
                          CyRow row)
        Create a LayoutEdge that will contains information about this edge, and that record that it connects LayoutNodes v1 and v2.
        Parameters:
        edge - Edge that this LayoutEdge represents
        v1 - The LayoutNode that represents the source of the edge
        v2 - The LayoutNode that represents the target of the edge
    • Method Detail

      • addNodes

        public void addNodes​(LayoutNode v1,
                             LayoutNode v2)
        Set the nodes associated with this edge. This is used subsequent to a call to the LayoutEdge(Edge) constructor to associate the source and target nodes since we don't always know that information at the time the edge is encountered.
        Parameters:
        v1 - The LayoutNode that represents the source of the edge
        v2 - The LayoutNode that represents the target of the edge
      • setWeight

        public void setWeight​(double weight)
        Set the weight for this LayoutEdge. This assumes that all of the weight calculations are being handled externally.
        Parameters:
        weight - the actual weight
      • setLogWeight

        public void setLogWeight​(double logWeight)
        Set the log weight for this LayoutEdge. This assumes that all of the weight calculations are being handled externally.
        Parameters:
        logWeight - the actual -log of the weight
      • getWeight

        public double getWeight()
        Return the current value for this edge's weight.
        Returns:
        This edge's weight as a double
      • getLogWeight

        public double getLogWeight()
        Return the current value for this edge's logWeight (-log(weight)).
        Returns:
        This edge's logWeight as a double
      • getSource

        public LayoutNode getSource()
        Return the source of this edge
        Returns:
        This edge's source
      • getTarget

        public LayoutNode getTarget()
        Return the target of this edge
        Returns:
        This edge's target
      • getEdge

        public CyEdge getEdge()
        Return the Edge this LayoutEdge represents
        Returns:
        The Edge for this LayoutEdge
      • getRow

        public CyRow getRow()
        Return the CyRow for this LayoutEdge
        Returns:
        The CyRow for this LayoutEdge
      • getIdentifier

        public String getIdentifier()
        Return the edge's identifier.
        Returns:
        String containing the edge's identifier
      • toString

        public String toString()
        Return a string representation for this LayoutEdge.
        Overrides:
        toString in class Object
        Returns:
        A String containing the name of the Edge, the connecting LayoutNodes and the current weight.