Skip to content

Commit c8ba7f9

Browse files
Better rendering for sequence diagrams.
1 parent aceacb9 commit c8ba7f9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

structurizr-export/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected void writeHeader(ModelView view, IndentingWriter writer) {
3434
plantUMLStyles = new HashSet<>();
3535
super.writeHeader(view, writer);
3636

37-
if (view instanceof DynamicView && renderAsSequenceDiagram(view)) {
37+
if (renderAsSequenceDiagram(view)) {
3838
// do nothing
3939
} else {
4040
if (view.getAutomaticLayout() != null) {
@@ -324,15 +324,14 @@ public Diagram export(DynamicView view) {
324324
@Override
325325
protected void writeElement(ModelView view, Element element, IndentingWriter writer) {
326326
ElementStyle elementStyle = findElementStyle(view, element);
327-
328327
PlantUMLElementStyle plantUMLElementStyle = new PlantUMLElementStyle(
329328
elementStyle.getTag(),
330329
elementStyle.getShape(),
331330
elementStyle.getWidth(),
332331
elementStyle.getBackground(),
333332
elementStyle.getColor(),
334333
elementStyle.getStroke(),
335-
elementStyle.getStrokeWidth() != null ? elementStyle.getStrokeWidth() : DEFAULT_STROKE_WIDTH,
334+
renderAsSequenceDiagram(view) ? DEFAULT_STROKE_WIDTH : elementStyle.getStrokeWidth() != null ? elementStyle.getStrokeWidth() : DEFAULT_STROKE_WIDTH,
336335
elementStyle.getBorder(),
337336
elementStyle.getFontSize(),
338337
elementStyle.getIcon(),
@@ -342,7 +341,7 @@ protected void writeElement(ModelView view, Element element, IndentingWriter wri
342341

343342
int metadataFontSize = calculateMetadataFontSize(elementStyle.getFontSize());
344343

345-
if (view instanceof DynamicView && renderAsSequenceDiagram(view)) {
344+
if (renderAsSequenceDiagram(view)) {
346345
writer.writeLine(String.format("%s \"%s\\n<size:%s>%s</size>\" as %s <<%s>> %s",
347346
plantumlSequenceType(view, element),
348347
element.getName(),
@@ -424,15 +423,15 @@ protected void writeRelationship(ModelView view, RelationshipView relationshipVi
424423
style.getTag(),
425424
style.getColor(),
426425
style.getStyle(),
427-
style.getThickness(),
426+
renderAsSequenceDiagram(view) ? DEFAULT_STROKE_WIDTH : style.getThickness(),
428427
style.getFontSize()
429428
);
430429
plantUMLStyles.add(plantUMLRelationshipStyle);
431430

432431
String description = "";
433432
String technology = relationship.getTechnology();
434433

435-
if (view instanceof DynamicView && renderAsSequenceDiagram(view)) {
434+
if (renderAsSequenceDiagram(view)) {
436435
// do nothing - sequence diagrams don't need the order
437436
} else {
438437
if (!StringUtils.isNullOrEmpty(relationshipView.getOrder())) {
@@ -442,7 +441,7 @@ protected void writeRelationship(ModelView view, RelationshipView relationshipVi
442441

443442
description += (hasValue(relationshipView.getDescription()) ? relationshipView.getDescription() : hasValue(relationshipView.getRelationship().getDescription()) ? relationshipView.getRelationship().getDescription() : "");
444443

445-
if (view instanceof DynamicView && renderAsSequenceDiagram(view)) {
444+
if (renderAsSequenceDiagram(view)) {
446445
String arrowStart = "-";
447446
String arrowEnd = ">";
448447

0 commit comments

Comments
 (0)