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

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

public class BalancingNodePlacer
extends AbstractAlgorithm
implements INodePlacer

Node placing algorithm that improves the overall balance of the graph after executing a basic node placer.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
BalancingNodePlacer(BasicNodePlacer thebasicNodePlacer)
          Creates a balancing node placer using a basic node placer.
 
Method Summary
 void placeNodes(LayeredGraph layeredGraph, float theobjSpacing, float borderSpacing, boolean thebalanceOverSize)
          Determine a placement for each node in the given layered graph.
 
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.core.alg.IAlgorithm
reset, reset, setProgressMonitor
 

Constructor Detail

BalancingNodePlacer

public BalancingNodePlacer(BasicNodePlacer thebasicNodePlacer)
Creates a balancing node placer using a basic node placer. The basic node placer is expected to create a layout where all layer elements are aligned to the top for horizontal layout or to the left for vertical layout.

Parameters:
thebasicNodePlacer - node placing algorithm that creates an initial unbalanced placement for each node
Method Detail

placeNodes

public void placeNodes(LayeredGraph layeredGraph,
                       float theobjSpacing,
                       float borderSpacing,
                       boolean thebalanceOverSize)
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
borderSpacing - spacing to the border
thebalanceOverSize - indicates whether node balancing has priority over diagram size