de.cau.cs.kieler.klodd.hierarchical.impl
Class BasicNodePlacer

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.AbstractAlgorithm
      extended by de.cau.cs.kieler.klodd.hierarchical.impl.BasicNodePlacer
All Implemented Interfaces:
IAlgorithm, INodePlacer

public class BasicNodePlacer
extends AbstractAlgorithm
implements INodePlacer

Node placing algorithm that orders all linear segments and creates an unbalanced placement.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
BasicNodePlacer()
           
 
Method Summary
 Map<LayerElement,Float> getElementSpacing()
          Gets a map for the amount of spacing available for each layer element.
 LinearSegment[] getMovableSegments()
          Gets the array of movable linear segments.
 void placeNodes(LayeredGraph layeredGraph, float theobjSpacing, float theborderSpacing, boolean balanceOverSize)
          Determine a placement for each node in the given layered 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

BasicNodePlacer

public BasicNodePlacer()
Method Detail

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

placeNodes

public void placeNodes(LayeredGraph layeredGraph,
                       float theobjSpacing,
                       float theborderSpacing,
                       boolean balanceOverSize)
Determine a placement for each node in the given layered graph.

Specified by:
placeNodes in interface INodePlacer
Parameters:
layeredGraph - layered graph to process
theobjSpacing - minimal distance between two nodes or edges in each layer
theborderSpacing - spacing to the border
balanceOverSize - indicates whether node balancing has priority over diagram size

getMovableSegments

public LinearSegment[] getMovableSegments()
Gets the array of movable linear segments. This excludes the external ports if their position is to be held fixed.

Returns:
movable linear segments

getElementSpacing

public Map<LayerElement,Float> getElementSpacing()
Gets a map for the amount of spacing available for each layer element. The last element of each layer is not stored in this map.

Returns:
spacing map