Package eu.bandm.tools.d2d2.base
Class SyntaxGraph
java.lang.Object
eu.bandm.tools.d2d2.base.SyntaxGraph
Calculates and paints an extended regex as graphic.
Usage is a little bit redundant, see Def2Doc(3):
s = new SyntaxGraph(Graphics gr); SizeInfo = s.new Layouter().layout(def); Image = create writeable image gri = image, get drawing Graphics s.setGraphic(gri);
The symbols follow the "Wirth"-tradition, and additionally render the permutation "a & b
" like "(a|b)
", but with special triangular symbols as border lines.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Every action method returns a SizeInfo object in the registerSyntaxGraph.Layouter.sizeInfo
.static class
Intended to be overwritten in anonymous subclasses.class
static class
static interface
Plugged into a painter for customized representation of references.class
static class
Represents the result of a layout sub-process as a TeX-like box model with three length values. -
Field Summary
Modifier and TypeFieldDescriptionprotected Graphics2D
protected Map<Expression,
Integer> All positions (inX, outX, y, and more) of each expression are RELATIVE to the enclosing construct.protected final SyntaxGraph.LayoutParameters
protected final Font
protected Map<Expression,
Integer> protected final Font
protected final Font
protected Map<Expression,
Integer> protected Map<Expression,
Integer> auxiliary ypos which cannot be easily calculated from contents, e.g.protected Map<Expression,
Integer> -
Constructor Summary
ConstructorDescriptionSyntaxGraph
(Graphics2D graphics2D) SyntaxGraph
(Graphics2D graphics2D, SyntaxGraph.LayoutParameters layoutParameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
calcTextWidth
(String s, Font f) FIXME 1) font/fontSize should be selectable,
2) different kinds of text/represented objects dto.protected String
void
setGraphics
(Graphics2D graphics2D)
-
Field Details
-
layoutParameters
-
graphics2D
-
inX
All positions (inX, outX, y, and more) of each expression are RELATIVE to the enclosing construct. Therefore, when calculating, the graph of every expression starts at (0,0); when painting, every Expression before descending into a sub-expression opens a further AffineTransform, which maps the sub-expression's origin=(0,0) to the coordinates relative to its own origin=(0.0), where the sub-expression shall be positioned. These are the co-ordinates stored here. -
outX
-
y
-
y2
auxiliary ypos which cannot be easily calculated from contents, e.g. for plus/y pos of backline and subst/height of box -
yaux
-
mainFont
-
smallFont
-
ttFont
-
-
Constructor Details
-
SyntaxGraph
-
SyntaxGraph
-
-
Method Details
-
setGraphics
-
calcTextWidth
FIXME 1) font/fontSize should be selectable,
2) different kinds of text/represented objects dto. -
getTag
-