Package org.cytoscape.view.layout
Class LayoutEdge
- java.lang.Object
-
- org.cytoscape.view.layout.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 Summary
Constructors Constructor Description LayoutEdge(CyEdge edge, CyRow row)
Create a LayoutEdge that will contain information about this edge.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNodes(LayoutNode v1, LayoutNode v2)
Set the nodes associated with this edge.int
compareTo(LayoutEdge edgeView)
CyEdge
getEdge()
Return the Edge this LayoutEdge representsString
getIdentifier()
Return the edge's identifier.double
getLogWeight()
Return the current value for this edge's logWeight (-log(weight)).CyRow
getRow()
Return the CyRow for this LayoutEdgeLayoutNode
getSource()
Return the source of this edgeLayoutNode
getTarget()
Return the target of this edgedouble
getWeight()
Return the current value for this edge's weight.void
setLogWeight(double logWeight)
Set the log weight for this LayoutEdge.void
setWeight(double weight)
Set the weight for this LayoutEdge.String
toString()
Return a string representation for this LayoutEdge.
-
-
-
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 representsv1
- The LayoutNode that represents the source of the edgev2
- 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 edgev2
- 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.
-
compareTo
public int compareTo(LayoutEdge edgeView)
- Specified by:
compareTo
in interfaceComparable<LayoutEdge>
-
-