Cytoscape 3.0.1 API

org.cytoscape.view.layout
Class LayoutEdge

java.lang.Object
  extended by 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.


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
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
 void addNodes(LayoutNode v1, LayoutNode v2)
          Set the nodes associated with this edge.
 int compareTo(LayoutEdge edgeView)
           
 CyEdge getEdge()
          Return the Edge this LayoutEdge represents
 String 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 LayoutEdge
 LayoutNode getSource()
          Return the source of this edge
 LayoutNode getTarget()
          Return the target of this edge
 double 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.

compareTo

public int compareTo(LayoutEdge edgeView)
Specified by:
compareTo in interface Comparable<LayoutEdge>

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.