Skip to content
Snippets Groups Projects
Commit 530a1593 authored by René Schöne's avatar René Schöne
Browse files

cleanup grammar and fix using documentation page

parent c0b33b2d
No related branches found
No related tags found
No related merge requests found
...@@ -5,9 +5,9 @@ DumpNode ::= DumpChildNode* DumpToken* DumpRelation* ...@@ -5,9 +5,9 @@ DumpNode ::= DumpChildNode* DumpToken* DumpRelation*
<Name> <Label> <BackgroundColor> <TextColor> <Object:Object> <Invisible:boolean> <Computed:boolean> <ManualStereotypes> <Name> <Label> <BackgroundColor> <TextColor> <Object:Object> <Invisible:boolean> <Computed:boolean> <ManualStereotypes>
/InvisiblePath/ ; /InvisiblePath/ ;
InnerDumpNode ::= <OriginalIndex:int> <Label> <LineColor> <TextColor> ; //TODO remove colors (and label?) InnerDumpNode ::= <OriginalIndex:int> <Label> <LineColor> <TextColor> ;
rel InnerDumpNode.DumpNode <-> DumpNode.ContainerOfInner? ; rel InnerDumpNode.DumpNode <-> DumpNode.ContainerOfInner? ;
InnerRelationDumpNode ::= <OriginalIndex:int> <Label> <LineColor> <TextColor> ; //TODO remove colors (and label?) InnerRelationDumpNode ::= <OriginalIndex:int> <Label> <LineColor> <TextColor> ;
rel InnerRelationDumpNode.DumpNode <-> DumpNode.ContainerOfRelationInner* ; rel InnerRelationDumpNode.DumpNode <-> DumpNode.ContainerOfRelationInner* ;
abstract DumpChildNode ::= <Label> <Computed:boolean> <LineColor> <TextColor> ; abstract DumpChildNode ::= <Label> <Computed:boolean> <LineColor> <TextColor> ;
......
...@@ -28,7 +28,7 @@ public class Main { ...@@ -28,7 +28,7 @@ public class Main {
return !contextName.equals("EndEffector"); return !contextName.equals("EndEffector");
}) })
.nodeStyle((node, style) -> { .nodeStyle((node, style) -> {
style.useSimpleName(); // (4) style.useSimpleLabel(); // (4)
style.setBackgroundColor(node.size() > 30 ? "blue" : "white"); // (5) style.setBackgroundColor(node.size() > 30 ? "blue" : "white"); // (5)
}) })
.relationStyle((source, target, isComputed, isContainment, style) -> { .relationStyle((source, target, isComputed, isContainment, style) -> {
...@@ -37,7 +37,7 @@ public class Main { ...@@ -37,7 +37,7 @@ public class Main {
} }
}) })
.skinParam(SkinParamBooleanSetting.Shadowing, false); // (7) .skinParam(SkinParamBooleanSetting.Shadowing, false); // (7)
builder.dumpAsPng(Paths.get("featureTest.png")); // (8) builder.dumpAsPNG(Paths.get("featureTest.png")); // (8)
builder.dumpAsSVG(Paths.get("featureTest.svg")); // (9) builder.dumpAsSVG(Paths.get("featureTest.svg")); // (9)
OutputStream os = getMyOutputStream(); OutputStream os = getMyOutputStream();
builder.dumpAsPNG(os); // (10) builder.dumpAsPNG(os); // (10)
...@@ -59,7 +59,7 @@ The steps in detail: ...@@ -59,7 +59,7 @@ The steps in detail:
- (4) and (5) [Optional] To style a node, the method `nodeStyle` is used. It accepts a lambda function, in which the style of every node can be customized by calling methods on the given `Style` object, e.g. setting the name (5) or background color (6). The default name is to use the class name along with the hashcode of the object (`node == null ? "null" : node.getClass().getSimpleName() + "@" + Integer.toHexString(node.hashCode())`). - (4) and (5) [Optional] To style a node, the method `nodeStyle` is used. It accepts a lambda function, in which the style of every node can be customized by calling methods on the given `Style` object, e.g. setting the name (5) or background color (6). The default name is to use the class name along with the hashcode of the object (`node == null ? "null" : node.getClass().getSimpleName() + "@" + Integer.toHexString(node.hashCode())`).
- (6) [Optional] To style a relation, the method `relationStyle` is used. It is used similar to `nodeStyle`, but is called with source and target node of a relation (containment and non-containment). Note, that (a) the default label can be retrieved with `style.getLabel()`, (b) `target` can be `null` for lists, (c) secondary connections from a list node to the target nodes use the style of the relation and use their index as label. - (6) [Optional] To style a relation, the method `relationStyle` is used. It is used similar to `nodeStyle`, but is called with source and target node of a relation (containment and non-containment). Note, that (a) the default label can be retrieved with `style.getLabel()`, (b) `target` can be `null` for lists, (c) secondary connections from a list node to the target nodes use the style of the relation and use their index as label.
- (7) [Optional] There are a few ways to style the output in general through [SkinParam](https://plantuml.com/de/skinparam). Not all of those parameters are supported; see `SkinParamBooleanSetting` and `SkinParamStringSetting`. - (7) [Optional] There are a few ways to style the output in general through [SkinParam](https://plantuml.com/de/skinparam). Not all of those parameters are supported; see `SkinParamBooleanSetting` and `SkinParamStringSetting`.
- (8), (9) and (10) To create an output image, use `dumpAsPng` for PNG (`dumpAsSVG` for SVG). Those methods do not return the builder object, as they produce an output. They potentially throw two kinds of exception: `IOException` (when the file could not be written) and `TransformationException` (when the AST could not be processed). As shown here, the builder object must be stored in a variable to create multiple outputs. Alternatively to a file, the result can be written to a given `OutputStream` (10). - (8), (9) and (10) To create an output image, use `dumpAsPNG` for PNG (`dumpAsSVG` for SVG). Those methods do not return the builder object, as they produce an output. They potentially throw two kinds of exception: `IOException` (when the file could not be written) and `TransformationException` (when the AST could not be processed). As shown here, the builder object must be stored in a variable to create multiple outputs. Alternatively to a file, the result can be written to a given `OutputStream` (10).
To summarise the required steps: Specify the AST to read in, configure the output, and write ("dump") the output. To summarise the required steps: Specify the AST to read in, configure the output, and write ("dump") the output.
For more configuration options, please consult the [API Docs of DumpBuilder](../ragdoc/#/type/DumpBuilder) or check out [FeatureTestMain](https://git-st.inf.tu-dresden.de/jastadd/dumpAst/-/blob/main/dumpAst.prototyping/src/main/java/de/tudresden/inf/st/jastadd/featureTest/FeatureTestMain.java). For more configuration options, please consult the [API Docs of DumpBuilder](../ragdoc/#/type/DumpBuilder) or check out [FeatureTestMain](https://git-st.inf.tu-dresden.de/jastadd/dumpAst/-/blob/main/dumpAst.prototyping/src/main/java/de/tudresden/inf/st/jastadd/featureTest/FeatureTestMain.java).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment