Package eu.bandm.tools.d2d2.base
Class SyntaxGraph.Painter
java.lang.Object
eu.bandm.tools.d2d2.model.MATCH_ONLY_00
eu.bandm.tools.d2d2.model.SinglePhase
eu.bandm.tools.d2d2.base.SyntaxGraph.Painter
- Enclosing class:
- SyntaxGraph
Class which does the painting and creates the data structures for the
  "clickable" image.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ColorStored costructor parameterprotected final StrokeLine type for all normal lines and boxes.protected SyntaxGraph.RectMapVisitor result register: the map from areas to Strings, for clickability.protected SyntaxGraph.RefPainterThe object used to paint references.protected final StrokeLine type for operators without any intervening whitespace, like "~+" and "~".Fields inherited from class eu.bandm.tools.d2d2.model.MATCH_ONLY_00_visitor_debug_stream, partial
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidPaint an alt-expresion.voidPaint a character set binaryoperator.voidPaint a character set binaryoperator.voidPaint a character set binaryoperator.voidPaint a character set binaryoperator.voidaction(CharSetConst cs) Paint a character set constant.voidRender a greedy operator as a dashed and decorated box around the contained expression.voidRender an insertion.voidPaint an option-expresion.voidaction(ParseParticle pp) Paint the graphical representation of a tag-generating parse particle in a character parser.voidPaint the graphic representation of pc-data content.voidvoidPaint an plus-expresion.voidRender a reference.voidPaint a seq-expression.voidPaint a star-expresion.voidaction(StringConst sc) Paint the graphical representation of a String constant.voidRender a substituion operator as a dashed and decorated box around the contained expression.(package private) voiddrawArc(int xc, int yc, int quad, boolean isTight) Draw a quarter of a circle.(package private) voiddrawLine(int x0, int y0, int x1, int y1, boolean isTight) Draw a straight line.protected voiddrawtriangle(int x0, int x1, int x2, int y0, int y1, int y2) Draw a triangle which frames the Perm-expression.protected voidpaintCharBin(CharBinary bin, String operator) Paint a character set binaryoperator.paintIt(Expression expr, @Opt SyntaxGraph.RefPainter refPainter, Color backgroundColor) Central Service Access: Paint the complete expression tree.(package private) voidpaintMetaBox(Expression exp, Expression sub, String text) Paint a dashed box for insertion/substitution/greediness.(package private) voidpaintOptOrStar(GrUnary x, boolean isStar, boolean istight) Paint an option- or star-expresion.(package private) voidpaintPassline(int xw, int yInOut, boolean hasBackline, boolean istight) Draws a pass-line (for creating epsilon) and additionally a back-line beneath, iff selected.(package private) AffineTransformshiftCoordinates(int x, int y) Add a new transformation to the transformation pipeline and return its former state.Methods inherited from class eu.bandm.tools.d2d2.model.SinglePhaseaction, 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- 
backgroundColorStored costructor parameter
- 
rectMapVisitor result register: the map from areas to Strings, for clickability.
- 
refPainterThe object used to paint references.
- 
normalStrokeLine type for all normal lines and boxes.
- 
tightStrokeLine type for operators without any intervening whitespace, like "~+" and "~". Is broader than the normal line.
 
- 
- 
Constructor Details- 
Painterpublic Painter()
 
- 
- 
Method Details- 
paintItpublic SyntaxGraph.RectMap paintIt(Expression expr, @Opt @Opt SyntaxGraph.RefPainter refPainter, Color backgroundColor) Central Service Access: Paint the complete expression tree. Initial coordinate system is the image to create.
 All compound expressions update the affine transform state according to their ownSyntaxGraph.yandSyntaxGraph.inXpositions, then draw their (more or less complex) line systems and descend into the sub-expressions.
 All simple expressions do not change the affine transform state, but use their stored coordinate to paramtrize draw commands. (But they could do it also via the transform state.)- Parameters:
- expr- expression which shall be printed
- refPainter- used to paint the references. If ==null, a default will be used.
- Returns:
- the map of areas for to be clickable
 
- 
drawArcvoid drawArc(int xc, int yc, int quad, boolean isTight) Draw a quarter of a circle.- Parameters:
- xc- x coordinate of center
- yc- y coordinate of center
- quad- quadrant to paint, in mathematical numbering
- isTight- whether to draw with a bold line
 
- 
drawLinevoid drawLine(int x0, int y0, int x1, int y1, boolean isTight) Draw a straight line.- Parameters:
- x0- x coordinate of start
- y0- y coordinate of start
- x1- x coordinate of end
- y1- y coordinate of end
- isTight- whether to draw with a bold line
 
- 
shiftCoordinatesAdd a new transformation to the transformation pipeline and return its former state.
- 
actionPaint the graphic representation of pc-data content.- Overrides:
- actionin class- SinglePhase
 
- 
paintMetaBoxPaint a dashed box for insertion/substitution/greediness.- Parameters:
- exp- the higher expression
- sub- the contained expression
- text- to print
 
- 
actionRender an insertion. Either as a dashed box araound an expression, or simply containing the name of a reference.- Overrides:
- actionin class- SinglePhase
 
- 
actionRender a greedy operator as a dashed and decorated box around the contained expression.- Overrides:
- actionin class- SinglePhase
 
- 
actionRender a substituion operator as a dashed and decorated box around the contained expression.- Overrides:
- actionin class- SinglePhase
 
- 
actionRender a reference. CallsprocessReferring(Expression,String,boolean,boolean)- Overrides:
- actionin class- SinglePhase
 
- 
paintPasslinevoid paintPassline(int xw, int yInOut, boolean hasBackline, boolean istight) Draws a pass-line (for creating epsilon) and additionally a back-line beneath, iff selected. Assumes that this fact has already been respected when calculating the y_in and y_out coordinates and the y-coordinates of the sub-object !
- 
paintOptOrStarPaint an option- or star-expresion.
- 
actionPaint an option-expresion.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint a star-expresion.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint an plus-expresion.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint an alt-expresion. Assumes that alt.on is not a singleton, not "deprivated".- Overrides:
- actionin class- SinglePhase
 
- 
drawtriangleprotected void drawtriangle(int x0, int x1, int x2, int y0, int y1, int y2) Draw a triangle which frames the Perm-expression.
- 
action- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint a seq-expression.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint a character set constant.- Overrides:
- actionin class- SinglePhase
 
- 
paintCharBinPaint a character set binaryoperator.
- 
actionPaint a character set binaryoperator.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint a character set binaryoperator.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint a character set binaryoperator.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint a character set binaryoperator.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint the graphical representation of a tag-generating parse particle in a character parser.- Overrides:
- actionin class- SinglePhase
 
- 
actionPaint the graphical representation of a String constant.- Overrides:
- actionin class- SinglePhase
 
 
-