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

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.AbstractAlgorithm
      extended by de.cau.cs.kieler.klay.layered.p3order.AbstractCrossingMinimizer
All Implemented Interfaces:
IAlgorithm, ILayoutPhase, ILayoutProcessor
Direct Known Subclasses:
InteractiveCrossingMinimizer, LayerSweepCrossingMinimizer

public abstract class AbstractCrossingMinimizer
extends AbstractAlgorithm
implements ILayoutPhase

Abstract superclass for crossing minimizer implementations. Contains commonly used methods for port distribution.

Rating red

Field Summary
protected  float[] portBarycenter
          barycenter values for ports.
protected  float[] portPos
          port position array.
 
Constructor Summary
AbstractCrossingMinimizer()
           
 
Method Summary
protected  void assignPortPos(LNode[] layer)
          Determine positions for all ports in the given layer.
protected  void distributePorts(LNode[][] layeredGraph)
          Distribute the ports of the layered graph depending on the port constraints.
 IntermediateProcessingStrategy getIntermediateProcessingStrategy(LayeredGraph graph)
          Returns the intermediate layout processors this phase depends on.
protected  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 de.cau.cs.kieler.core.alg.AbstractAlgorithm
getMonitor, reset, reset, setProgressMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.cau.cs.kieler.klay.layered.ILayoutProcessor
process
 
Methods inherited from interface de.cau.cs.kieler.core.alg.IAlgorithm
reset, reset, setProgressMonitor
 

Field Detail

portBarycenter

protected float[] portBarycenter
barycenter values for ports.


portPos

protected float[] portPos
port position array.

Constructor Detail

AbstractCrossingMinimizer

public AbstractCrossingMinimizer()
Method Detail

getIntermediateProcessingStrategy

public IntermediateProcessingStrategy getIntermediateProcessingStrategy(LayeredGraph graph)
Returns the intermediate layout processors this phase depends on.

Specified by:
getIntermediateProcessingStrategy in interface ILayoutPhase
Parameters:
graph - the layered graph to be processed. The strategy may vary depending on certain properties of the graph.
Returns:
intermediate processing strategy. May be null.

assignPortPos

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

Parameters:
layer - a layer

getSortedInputPorts

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

Parameters:
node - the node whose input ports to return.
Returns:
list of input ports.

distributePorts

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

Parameters:
layeredGraph - a layered graph