Package org.cytoscape.view.layout
Class LayoutEdge
java.lang.Object
org.cytoscape.view.layout.LayoutEdge
- All Implemented Interfaces:
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.
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.
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>
-
Constructor Summary
ConstructorDescriptionLayoutEdge
(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
Modifier and TypeMethodDescriptionvoid
addNodes
(LayoutNode v1, LayoutNode v2) Set the nodes associated with this edge.int
compareTo
(LayoutEdge edgeView) getEdge()
Return the Edge this LayoutEdge representsReturn the edge's identifier.double
Return the current value for this edge's logWeight (-log(weight)).getRow()
Return the CyRow for this LayoutEdgeReturn the source of this edgeReturn the target of this edgedouble
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.toString()
Return a string representation for this LayoutEdge.
-
Constructor Details
-
LayoutEdge
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
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 Details
-
addNodes
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
Return the source of this edge- Returns:
- This edge's source
-
getTarget
Return the target of this edge- Returns:
- This edge's target
-
getEdge
Return the Edge this LayoutEdge represents- Returns:
- The Edge for this LayoutEdge
-
getRow
Return the CyRow for this LayoutEdge- Returns:
- The CyRow for this LayoutEdge
-
getIdentifier
Return the edge's identifier.- Returns:
- String containing the edge's identifier
-
toString
Return a string representation for this LayoutEdge. -
compareTo
- Specified by:
compareTo
in interfaceComparable<LayoutEdge>
-