de.cau.cs.kieler.klay.layered.graph
Class LEdge

java.lang.Object
  extended by de.cau.cs.kieler.core.properties.MapPropertyHolder
      extended by de.cau.cs.kieler.klay.layered.graph.LGraphElement
          extended by de.cau.cs.kieler.klay.layered.graph.LEdge
All Implemented Interfaces:
IPropertyHolder, Comparable<LGraphElement>

public class LEdge
extends LGraphElement

An edge in a layered graph. Edges may only be connected to ports of a node, which represent the point where the edge touches the node.

Rating red

Field Summary
 
Fields inherited from class de.cau.cs.kieler.klay.layered.graph.LGraphElement
id
 
Constructor Summary
LEdge()
           
 
Method Summary
 KVectorChain getBendPoints()
          Returns the list of bend points, which is initially empty.
 List<LLabel> getLabels()
           
 LPort getSource()
          Returns the source port.
 KVector getSourcePoint()
          Return a new vector representing the source point of the edge, which has the same reference point as the bend points.
 LPort getTarget()
          Returns the target port.
 KVector getTargetPoint()
          Return a new vector representing the target point of the edge, which has the same reference point as the bend points.
 void reverse(boolean adaptPorts)
          Reverses the edge, including its bend points.
 void setSource(LPort source)
          Sets the source port of this edge and adds itself to the port's list of edges.
 void setTarget(LPort target)
          Sets the target port of this edge and adds itself to the port's list of edges.
 String toString()
          
 
Methods inherited from class de.cau.cs.kieler.klay.layered.graph.LGraphElement
compareTo
 
Methods inherited from class de.cau.cs.kieler.core.properties.MapPropertyHolder
checkProperties, copyProperties, getAllProperties, getProperty, getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LEdge

public LEdge()
Method Detail

toString

public String toString()

Overrides:
toString in class Object

reverse

public void reverse(boolean adaptPorts)
Reverses the edge, including its bend points. Negates the REVERSED property. (an edge that was marked as being reversed is then unmarked, and the other way around) This does not change any properties on the connected ports.

Parameters:
adaptPorts - If true and a connected port is a collector port (a port used to merge edges), the corresponding opposite port is used instead of the original one.

getSource

public LPort getSource()
Returns the source port.

Returns:
the source port

setSource

public void setSource(LPort source)
Sets the source port of this edge and adds itself to the port's list of edges. If the edge previously had another source, it is removed from the original port's list of edges. Be careful not to use this method while iterating through the edges list of the old port nor of the new port, since that could lead to ConcurrentModificationExceptions.

Parameters:
source - the source port to set

getTarget

public LPort getTarget()
Returns the target port.

Returns:
the target port

setTarget

public void setTarget(LPort target)
Sets the target port of this edge and adds itself to the port's list of edges. If the edge previously had another target, it is removed from the original port's list of edges. Be careful not to use this method while iterating through the edges list of the old port nor of the new port, since that could lead to ConcurrentModificationExceptions.

Parameters:
target - the target port to set

getBendPoints

public KVectorChain getBendPoints()
Returns the list of bend points, which is initially empty.

Returns:
the bend points

getSourcePoint

public KVector getSourcePoint()
Return a new vector representing the source point of the edge, which has the same reference point as the bend points.

Returns:
the source point

getTargetPoint

public KVector getTargetPoint()
Return a new vector representing the target point of the edge, which has the same reference point as the bend points.

Returns:
the target point.

getLabels

public List<LLabel> getLabels()
Returns:
all labels