de.cau.cs.kieler.klay.layered.p4nodes
Class LinearSegmentsNodePlacer

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.AbstractAlgorithm
      extended by de.cau.cs.kieler.klay.layered.p4nodes.LinearSegmentsNodePlacer
All Implemented Interfaces:
IAlgorithm, ILayoutPhase, ILayoutProcessor

public class LinearSegmentsNodePlacer
extends AbstractAlgorithm
implements ILayoutPhase

Node placement implementation that aligns long edges using linear segments. Inspired by Section 4 of

Precondition:
the graph has a proper layering with optimized nodes ordering; ports are properly arranged
Postcondition:
each node is assigned a vertical coordinate such that no two nodes overlap; the size of each layer is set according to the area occupied by contained nodes; the height of the graph is set to the maximal layer height

Rating red

Nested Class Summary
static class LinearSegmentsNodePlacer.LinearSegment
          A linear segment contains a single regular node or all dummy nodes of a long edge.
 class LinearSegmentsNodePlacer.Region
          A Region contains Nodes or LinearSegments, that are touching and therefor need to be moved as a unit.
 
Constructor Summary
LinearSegmentsNodePlacer()
           
 
Method Summary
 IntermediateProcessingStrategy getIntermediateProcessingStrategy(LayeredGraph graph)
          Returns the intermediate layout processors this phase depends on.
 LinearSegmentsNodePlacer.LinearSegment[] getLinearSegments()
           
 void process(LayeredGraph layeredGraph)
          Performs the phase's work on the given graph.
 void reset()
          Removes the associated progress monitor.
 
Methods inherited from class de.cau.cs.kieler.core.alg.AbstractAlgorithm
getMonitor, 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.core.alg.IAlgorithm
reset, setProgressMonitor
 

Constructor Detail

LinearSegmentsNodePlacer

public LinearSegmentsNodePlacer()
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.

reset

public void reset()
Removes the associated progress monitor. Any subclass that overrides this method should call super.reset().

Specified by:
reset in interface IAlgorithm
Overrides:
reset in class AbstractAlgorithm

process

public void process(LayeredGraph layeredGraph)
Performs the phase's work on the given graph.

Specified by:
process in interface ILayoutProcessor
Parameters:
layeredGraph - a layered graph

getLinearSegments

public LinearSegmentsNodePlacer.LinearSegment[] getLinearSegments()
Returns:
the linear segments