de.cau.cs.kieler.klodd.hierarchical.structures
Class LayerConnection

java.lang.Object
  extended by de.cau.cs.kieler.klodd.hierarchical.structures.LayerConnection

public class LayerConnection
extends Object

Connection between two layer elements in a layered graph.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
LayerConnection(KEdge theedge, LayerElement sourceElem, KPort thesourcePort, LayerElement targetElem, KPort thetargetPort)
          Creates a layer connection with given source and target.
 
Method Summary
 void applyLayout(KPoint offset, KInsets insets)
          Applies the layout of this layer connection to the contained edge.
 float calcSourcePos(float minDist)
          Determines the source position of this edge from the current layout position.
 float calcTargetPos(float minDist)
          Determines the target position of this edge from the current layout position.
 List<KPoint> getBendPoints()
          Returns the bend points.
 float getSourceAnchorPos()
          Returns the source anchor position.
 int getSourceBackPos()
          Returns the source back position.
 LayerElement getSourceElement()
          Gets the source element.
 KPort getSourcePort()
          Gets the source port.
 int getSourceSidePos()
          Returns the source side position.
 float getTargetAnchorPos()
          Returns the target anchor position.
 LayerElement getTargetElement()
          Gets the target element.
 int getTargetFrontPos()
          Returns the target front position.
 KPort getTargetPort()
          Gets the target port.
 int getTargetSidePos()
          Returns the target side position.
 void setSourceBackPos(int thesourceBackPos)
          Sets the source back position.
 void setSourceSidePos(int thesourceSidePos)
          Sets the source side position.
 void setTargetFrontPos(int thetargetFrontPos)
          Sets the target front position.
 void setTargetSidePos(int thetargetSidePos)
          Sets the target side position.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayerConnection

public LayerConnection(KEdge theedge,
                       LayerElement sourceElem,
                       KPort thesourcePort,
                       LayerElement targetElem,
                       KPort thetargetPort)
Creates a layer connection with given source and target.

Parameters:
theedge - the edge that is to be contained in this layer connection
sourceElem - the source element
thesourcePort - the source port
targetElem - the target element
thetargetPort - the target port
Method Detail

toString

public String toString()

Overrides:
toString in class Object

applyLayout

public void applyLayout(KPoint offset,
                        KInsets insets)
Applies the layout of this layer connection to the contained edge.

Parameters:
offset - offset to be added to each bend point
insets - insets of the containing parent layout node

getSourceElement

public LayerElement getSourceElement()
Gets the source element.

Returns:
the sourceElement

getSourcePort

public KPort getSourcePort()
Gets the source port.

Returns:
the sourcePort

getTargetElement

public LayerElement getTargetElement()
Gets the target element.

Returns:
the targetElement

getTargetPort

public KPort getTargetPort()
Gets the target port.

Returns:
the targetPort

calcSourcePos

public float calcSourcePos(float minDist)
Determines the source position of this edge from the current layout position.

Parameters:
minDist - minimal distance between elements
Returns:
position

calcTargetPos

public float calcTargetPos(float minDist)
Determines the target position of this edge from the current layout position.

Parameters:
minDist - minimal distance between elements
Returns:
position

setSourceSidePos

public void setSourceSidePos(int thesourceSidePos)
Sets the source side position.

Parameters:
thesourceSidePos - the source side position to set

getSourceSidePos

public int getSourceSidePos()
Returns the source side position.

Returns:
the source side position

setTargetSidePos

public void setTargetSidePos(int thetargetSidePos)
Sets the target side position.

Parameters:
thetargetSidePos - the target side position to set

getTargetSidePos

public int getTargetSidePos()
Returns the target side position.

Returns:
the target side position

setSourceBackPos

public void setSourceBackPos(int thesourceBackPos)
Sets the source back position.

Parameters:
thesourceBackPos - the source back position to set

getSourceBackPos

public int getSourceBackPos()
Returns the source back position.

Returns:
the source back position

setTargetFrontPos

public void setTargetFrontPos(int thetargetFrontPos)
Sets the target front position.

Parameters:
thetargetFrontPos - the target front position to set

getTargetFrontPos

public int getTargetFrontPos()
Returns the target front position.

Returns:
the target front position

getSourceAnchorPos

public float getSourceAnchorPos()
Returns the source anchor position.

Returns:
the source anchor position

getTargetAnchorPos

public float getTargetAnchorPos()
Returns the target anchor position.

Returns:
the target anchor position

getBendPoints

public List<KPoint> getBendPoints()
Returns the bend points.

Returns:
the bend points