Package eu.bandm.tools.d2d2.base
Class SyntaxGraph.Layouter
java.lang.Object
eu.bandm.tools.d2d2.model.MATCH_ONLY_00
eu.bandm.tools.d2d2.model.SinglePhase
eu.bandm.tools.d2d2.base.SyntaxGraph.Layouter
- Enclosing class:
SyntaxGraph
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
action(eu.bandm.tools.d2d2.model.Opt) is commented in
detail to demonstrate this strategy.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) SyntaxGraph.SizeInfoCurrent visitor register holding the return value of the last visit.Fields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_debug_stream, partial -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalculate graphic size and position of an Alt-Expressin.voidaction(CharBinary exp) Caculates the size of the sub-expressions, shifts them to some co-ordinates relative to the binary operator expression, and calculates the resultingsizeInfo.voidaction(CharSetConst cs) Calculate the size of the visual representation of a character set const.voidaction(CharsRegExp def) voidvoidvoidCaculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Opt-expression, and calculates the resultingsizeInfo:voidaction(ParseParticle pp) Caculates the size of the sub-expressions, shifts them to some co-ordinates relative to the operator expression, and calculates the resultingsizeInfo.voidCalculate size for the standard constant "#PCDATA" sub-expression.voidCalculate graphic size and position of a Perm Alt-Expressin.voidCaculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Plus-expression, and calculates the resultingsizeInfo.voidvoidCaculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Seq-expression, and calculates the resultingsizeInfo.voidCaculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Star-expression, and calculates the resultingsizeInfo.voidaction(StringConst sc) Calculate the size of the visual representation of a String const.voidvoidaction(TagsRegExp def) void(package private) voidMake room for a dashed box around an expression.Service Access Point: calculate layout coordinates (in/out y, xIn, xOut) for all sub-exprssions in an expression tree.protected voidprocessAltOrInnerPerm(Iterator<Expression> subs, int outerW) Caculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Alt- or Perm-expression, and calculates the resultingsizeInfo.protected SyntaxGraph.SizeInfoCalculate according to the dimensions of the text to print.Methods inherited from class eu.bandm.tools.d2d2.model.SinglePhase
action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, follow_definitions, follow_defInstances, follow_docu, follow_firsts, follow_globalSubsts, follow_imports, follow_itemDocu, follow_localdefs, follow_localSubsts, follow_modules, follow_namespaces, follow_obligates, follow_on, follow_rawModules, follow_text, follow_weakfirsts, follow_xattributesMethods inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00
_visitor_trace, action, action, action, action, action, compile, followAll_definitions, followAll_defInstances, followAll_docu, followAll_firsts, followAll_globalSubsts, followAll_imports, followAll_itemDocu, followAll_localdefs, followAll_localSubsts, followAll_modules, followAll_namespaces, followAll_obligates, followAll_on, followAll_rawModules, followAll_text, followAll_weakfirsts, followAll_xattributes, foreignObject, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, nomatch
-
Field Details
-
sizeInfo
SyntaxGraph.SizeInfo sizeInfoCurrent visitor register holding the return value of the last visit.
-
-
Constructor Details
-
Layouter
public Layouter()
-
-
Method Details
-
layout
Service Access Point: calculate layout coordinates (in/out y, xIn, xOut) for all sub-exprssions in an expression tree. -
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
sizeInfoByNormalText
Calculate according to the dimensions of the text to print. UsesSyntaxGraph.mainFont. -
action
Calculate size for the standard constant "#PCDATA" sub-expression.- Overrides:
actionin classSinglePhase
-
calculateMetaBox
Make room for a dashed box around an expression. -
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
- Overrides:
actionin classSinglePhase
-
action
Caculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Opt-expression, and calculates the resultingsizeInfo:--------------------------- passline \__xxxxxxxx__/ __ y xxxxxxxx xxxxxxxx = relative co-ordinates of the sub-expr. ^xin ^xout- Overrides:
actionin classSinglePhase
-
action
Caculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Star-expression, and calculates the resultingsizeInfo. For details seeaction(eu.bandm.tools.d2d2.model.Opt).- Overrides:
actionin classSinglePhase
-
action
Caculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Plus-expression, and calculates the resultingsizeInfo. For details seeaction(eu.bandm.tools.d2d2.model.Opt).- Overrides:
actionin classSinglePhase
-
processAltOrInnerPerm
Caculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Alt- or Perm-expression, and calculates the resultingsizeInfo. For details seeaction(eu.bandm.tools.d2d2.model.Opt). -
action
Calculate graphic size and position of an Alt-Expressin.- Overrides:
actionin classSinglePhase- See Also:
-
action
Calculate graphic size and position of a Perm Alt-Expressin.- Overrides:
actionin classSinglePhase- See Also:
-
action
Caculates the size of the sub-expression, shifts the sub-expression to some co-ordinates relative to the Seq-expression, and calculates the resultingsizeInfo. For details seeaction(eu.bandm.tools.d2d2.model.Opt).- Overrides:
actionin classSinglePhase
-
action
Calculate the size of the visual representation of a character set const.- Overrides:
actionin classSinglePhase
-
action
Caculates the size of the sub-expressions, shifts them to some co-ordinates relative to the binary operator expression, and calculates the resultingsizeInfo. For details seeaction(eu.bandm.tools.d2d2.model.Opt).- Overrides:
actionin classSinglePhase
-
action
Caculates the size of the sub-expressions, shifts them to some co-ordinates relative to the operator expression, and calculates the resultingsizeInfo. For details seeaction(eu.bandm.tools.d2d2.model.Opt).- Overrides:
actionin classSinglePhase
-
action
Calculate the size of the visual representation of a String const.- Overrides:
actionin classSinglePhase
-