de.cau.cs.kieler.klay.layered.p5edges
Interface OrthogonalRoutingGenerator.IRoutingDirectionStrategy

All Known Implementing Classes:
OrthogonalRoutingGenerator.NorthToSouthRoutingStrategy, OrthogonalRoutingGenerator.SouthToNorthRoutingStrategy, OrthogonalRoutingGenerator.WestToEastRoutingStrategy
Enclosing class:
OrthogonalRoutingGenerator

public static interface OrthogonalRoutingGenerator.IRoutingDirectionStrategy

A routing direction strategy adapts the OrthogonalRoutingGenerator to different routing directions. Usually, but not always, edges will be routes from west to east. However, with northern and southern external ports, this changes. Routing strategies support that.

Rating red

Method Summary
 void calculateBendPoints(de.cau.cs.kieler.klay.layered.p5edges.OrthogonalRoutingGenerator.HyperNode hyperNode, double startPos, double edgeSpacing)
          Calculates and assigns bend points for edges incident to the ports belonging to the given hyper edge.
 double getPortPositionOnHyperNode(LPort port)
          Returns the port's position on a hyper edge axis.
 PortSide getSourcePortSide()
          Returns the side of ports that should be considered on a source layer.
 PortSide getTargetPortSide()
          Returns the side of ports that should be considered on a target layer.
 

Method Detail

getPortPositionOnHyperNode

double getPortPositionOnHyperNode(LPort port)
Returns the port's position on a hyper edge axis. In the west-to-east routing case, this would be the port's exact y coordinate.

Parameters:
port - the port.
Returns:
the port's coordinate on the hyper edge axis.

getSourcePortSide

PortSide getSourcePortSide()
Returns the side of ports that should be considered on a source layer. For a west-to-east routing, this would probably be the eastern ports of each western layer.

Returns:
the side of ports to be considered in the source layer.

getTargetPortSide

PortSide getTargetPortSide()
Returns the side of ports that should be considered on a target layer. For a west-to-east routing, this would probably be the western ports of each eastern layer.

Returns:
the side of ports to be considered in the target layer.

calculateBendPoints

void calculateBendPoints(de.cau.cs.kieler.klay.layered.p5edges.OrthogonalRoutingGenerator.HyperNode hyperNode,
                         double startPos,
                         double edgeSpacing)
Calculates and assigns bend points for edges incident to the ports belonging to the given hyper edge.

Parameters:
hyperNode - the hyper edge.
startPos - the position of the trunk of the first hyper edge between the layers. This position, together with the current hyper node's rank allows the calculation of the hyper node's trunk's position.
edgeSpacing - the space between two edges.