de.cau.cs.kieler.klay.layered.p3order
Class NodeRelativePortDistributor

java.lang.Object
  extended by de.cau.cs.kieler.klay.layered.p3order.NodeRelativePortDistributor
All Implemented Interfaces:
IPortDistributor

public class NodeRelativePortDistributor
extends Object
implements IPortDistributor

Calculates port ranks and distributes ports.

Rating red

Constructor Summary
NodeRelativePortDistributor(float[] portRanks, float[] portBarycenters)
          Constructs a NodeRelativePortDistributor with the given portPos-array.
 
Method Summary
 void calculatePortRanks(LNode[] layer)
          Determine positions for all ports in the given layer.
 void distributePorts(LNode[][] layeredGraph)
          Distribute the ports of the layered graph depending on the port constraints.
 List<LPort> getSortedInputPorts(LNode node)
          Returns a list of input ports, beginning at the top right port of the eastern side, going clockwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeRelativePortDistributor

public NodeRelativePortDistributor(float[] portRanks,
                                   float[] portBarycenters)
Constructs a NodeRelativePortDistributor with the given portPos-array.

Parameters:
portRanks - The array of portRanks;
portBarycenters - The barycenter value array for ports.
Method Detail

calculatePortRanks

public void calculatePortRanks(LNode[] layer)
Determine positions for all ports in the given layer. Input and output ports are processed separately.

Specified by:
calculatePortRanks in interface IPortDistributor
Parameters:
layer - a layer

getSortedInputPorts

public List<LPort> getSortedInputPorts(LNode node)
Returns a list of input ports, beginning at the top right port of the eastern side, going clockwise.

Specified by:
getSortedInputPorts in interface IPortDistributor
Parameters:
node - the node whose input ports to return.
Returns:
list of input ports.

distributePorts

public void distributePorts(LNode[][] layeredGraph)
Distribute the ports of the layered graph depending on the port constraints.

Specified by:
distributePorts in interface IPortDistributor
Parameters:
layeredGraph - a layered graph