Skip to content

Commit 6b51bfd

Browse files
committed
Random Bounded Context shapes
1 parent 8f00e1c commit 6b51bfd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: src/main/java/org/contextmapper/contextmap/generator/graphviz/ContextMapGenerator.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ public void generateContextMapGraphic(ContextMap contextMap, String fileName) th
5151
contextMap.getBoundedContexts().forEach(bc -> {
5252
MutableNode node = mutNode(bc.getId());
5353
node.add(Label.lines(bc.getName()));
54-
node.add(getShape());
54+
node.add(Shape.EGG);
5555
node.add(attr("margin", "0.3"));
56+
node.add(attr("orientation", orientationDegree()));
5657
bcNodesMap.put(bc.getId(), node);
5758
});
5859

@@ -89,14 +90,21 @@ public void generateContextMapGraphic(ContextMap contextMap, String fileName) th
8990
/*
9091
* Select shape randomly
9192
*/
92-
private Shape getShape() {
93+
/*private Shape getShape() {
9394
int selection = new Random().nextInt(2);
9495
switch (selection) {
9596
case 1:
9697
return Shape.EGG;
9798
default:
9899
return Shape.ELLIPSE;
99100
}
101+
}*/
102+
103+
/*
104+
* Generate random orientation degree
105+
*/
106+
private int orientationDegree() {
107+
return new Random().nextInt(350);
100108
}
101109

102110
private Set<String> downstreamPatternsToStrings(Set<DownstreamPatterns> patterns) {

0 commit comments

Comments
 (0)