de.cau.cs.kieler.klay.layered.p5edges
Class ObjectBoxCalculator

java.lang.Object
  extended by de.cau.cs.kieler.core.alg.AbstractAlgorithm
      extended by de.cau.cs.kieler.klay.layered.p5edges.ObjectBoxCalculator
All Implemented Interfaces:
IAlgorithm, IBoxCalculator

public class ObjectBoxCalculator
extends AbstractAlgorithm
implements IBoxCalculator

Rating red

Constructor Summary
ObjectBoxCalculator()
           
 
Method Summary
 boolean addEdge(BezierSpline spline)
          add an edge that takes space.
 boolean addEdge(LEdge edge)
          add an egde that takes linear space with maybe bending points.
 void addNode(LNode node)
          Add a node to the box calculator.
 LinkedList<Rectangle2D.Double> getBoxes(LEdge edge)
          compute a box array for a given edge.
 LinkedList<Line2D.Double> getLines(LinkedList<Rectangle2D.Double> boxes)
          calculate intersection between boxes.
 void initialize(LayeredGraph lg)
          initialize the box calculator for a given 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
 

Constructor Detail

ObjectBoxCalculator

public ObjectBoxCalculator()
Method Detail

addEdge

public boolean addEdge(BezierSpline spline)
add an edge that takes space.

Specified by:
addEdge in interface IBoxCalculator
Parameters:
spline - the spline to add
Returns:
true if success, false otherwise

addEdge

public boolean addEdge(LEdge edge)
add an egde that takes linear space with maybe bending points.

Specified by:
addEdge in interface IBoxCalculator
Parameters:
edge - the edge to add
Returns:
true if success, false otherwise

getBoxes

public LinkedList<Rectangle2D.Double> getBoxes(LEdge edge)
compute a box array for a given edge. compute_bboxes computes the space actually taken up by the curve. It computes the array BB0 , . . . , BBm, where BBi is the narrowest sub-box of Bi containing the curve.

Specified by:
getBoxes in interface IBoxCalculator
Parameters:
edge - the edge to find a array for
Returns:
the box array between q and s

getLines

public LinkedList<Line2D.Double> getLines(LinkedList<Rectangle2D.Double> boxes)
calculate intersection between boxes. compute_L_array computes the array L0 , . . . , Lm + 1 where Li is the line segment that is the intersection of box Bi - 1 with box Bi. lArray.size = boxArray.size - 1 ALWAYS

Specified by:
getLines in interface IBoxCalculator
Parameters:
boxes - the boxes to intersect
Returns:
the intersecting lines

addNode

public void addNode(LNode node)
Add a node to the box calculator.

Specified by:
addNode in interface IBoxCalculator
Parameters:
node - the LNode to add

initialize

public void initialize(LayeredGraph lg)
initialize the box calculator for a given graph.

Specified by:
initialize in interface IBoxCalculator
Parameters:
lg - the graph to operate on