public class SyntaxGraph extends Object
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.
Modifier and Type | Class and Description |
---|---|
class |
SyntaxGraph.Layouter
Every action method returns a SizeInfo object in the register
SyntaxGraph.Layouter.sizeInfo . |
static class |
SyntaxGraph.LayoutParameters
all distances/offsets measured in pixels, font sizes in "points = 1/72 inch"
|
class |
SyntaxGraph.Painter |
static class |
SyntaxGraph.RectMap |
static interface |
SyntaxGraph.RefPainter
Plugged into a painter for customized representation of references.
|
class |
SyntaxGraph.RefPainter_simple |
static class |
SyntaxGraph.SizeInfo
Represents the result of a layout sub-process
as a TeX-like box model with three length values.
|
Modifier and Type | Field and Description |
---|---|
protected Graphics2D |
graphics2D |
protected Map<Expression,Integer> |
inX
All positions (inX, outX, y, and more) of each expression
are RELATIVE to the enclosing construct.
|
protected SyntaxGraph.LayoutParameters |
layoutParameters |
protected Font |
mainFont |
protected Map<Expression,Integer> |
outX |
protected Font |
smallFont |
protected Font |
ttFont |
protected Map<Expression,Integer> |
y |
protected Map<Expression,Integer> |
y2
auxiliary ypos which cannot be easily calculated from contents,
e.g.
|
protected Map<Expression,Integer> |
yaux
auxiliary ypos which cannot be easily calculated from contents,
e.g.
|
Constructor and Description |
---|
SyntaxGraph(Graphics2D graphics2D) |
SyntaxGraph(Graphics2D graphics2D,
SyntaxGraph.LayoutParameters layoutParameters) |
Modifier and Type | Method and Description |
---|---|
protected int |
calcTextWidth(String s,
Font f)
FIXME 1) font/fontSize should be selectable,
2) different kinds of text/represented objects dto. |
protected String |
getTag(Reference ref) |
void |
setGraphics(Graphics2D graphics2D) |
static void |
test(Module mod) |
protected final SyntaxGraph.LayoutParameters layoutParameters
protected Graphics2D graphics2D
protected Map<Expression,Integer> inX
protected Map<Expression,Integer> outX
protected Map<Expression,Integer> y
protected Map<Expression,Integer> y2
protected Map<Expression,Integer> yaux
protected final Font mainFont
protected final Font smallFont
protected final Font ttFont
public SyntaxGraph(Graphics2D graphics2D, SyntaxGraph.LayoutParameters layoutParameters)
public SyntaxGraph(Graphics2D graphics2D)
public void setGraphics(Graphics2D graphics2D)
protected int calcTextWidth(String s, Font f)
public static void test(Module mod)
see also the complete user documentation .