Class SyntaxGraph.Layouter

Enclosing class:
SyntaxGraph

public class SyntaxGraph.Layouter extends SinglePhase
First phase which calculates the sizes of all sub-terms and their positions relative to the containing term. Every action method returns a SizeInfo object in the register sizeInfo. Each graph has one y-value as its entry and exit height, and an entry and exit x-pos. These are stored in SyntaxGraph.y, SyntaxGraph.inX and SyntaxGraph.outX and are all relative to the containing graph.

The action method for a combinator shifts the SizeInfo areas relative to its origin (0,0), and stores the resulting co-ordinates.

In the second phase (the drawing process) these shifts are respected by concatenating affine transformations.

The y-coordinate grows downward. The code for {@link Layouter#(eu.bandm.tools.d2d2.model.Opt)} is commented in detail to demonstrate this strategy.