From a2a12adb58f53546ba1355da7c98c0c4f218d88c Mon Sep 17 00:00:00 2001 From: matthew16550 Date: Mon, 1 Nov 2021 18:00:05 +1100 Subject: [PATCH] Update smetana arrows to support beta style line colors & change decorators to fill with diagram background color instead of white --- .../plantuml/sdot/SmetanaPath.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/net/sourceforge/plantuml/sdot/SmetanaPath.java b/src/net/sourceforge/plantuml/sdot/SmetanaPath.java index ed2ea0442..10c877d3f 100644 --- a/src/net/sourceforge/plantuml/sdot/SmetanaPath.java +++ b/src/net/sourceforge/plantuml/sdot/SmetanaPath.java @@ -46,6 +46,7 @@ import h.ST_textlabel_t; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.UmlDiagramType; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.LinkType; @@ -54,6 +55,9 @@ import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.posimo.DotPath; import net.sourceforge.plantuml.skin.rose.Rose; +import net.sourceforge.plantuml.style.PName; +import net.sourceforge.plantuml.style.SName; +import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.extremity.ExtremityFactory; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -108,7 +112,16 @@ public class SmetanaPath implements UDrawable { return; } - HColor color = rose.getHtmlColor(diagram.getSkinParam(), null, getArrowColorParam()); + HColor color; + + if (UseStyle.useBetaStyle()) { + color = StyleSignature.of(SName.root, SName.element, diagram.getUmlDiagramType().getStyleName(), SName.arrow) + .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()) + .value(PName.LineColor) + .asColor(diagram.getSkinParam().getThemeStyle(), diagram.getSkinParam().getIHtmlColorSet()); + } else { + color = rose.getHtmlColor(diagram.getSkinParam(), null, getArrowColorParam()); + } if (this.link.getColors() != null) { final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE); @@ -151,7 +164,7 @@ public class SmetanaPath implements UDrawable { private void printExtremityAtStart(UGraphic ug) { final ExtremityFactory extremityFactory2 = link.getType().getDecor2() - .getExtremityFactoryComplete(HColorUtils.WHITE); + .getExtremityFactoryComplete(diagram.getSkinParam().getBackgroundColor(false)); if (extremityFactory2 == null) { return; } @@ -175,7 +188,7 @@ public class SmetanaPath implements UDrawable { private void printExtremityAtEnd(UGraphic ug) { final ExtremityFactory extremityFactory1 = link.getType().getDecor1() - .getExtremityFactoryComplete(HColorUtils.WHITE); + .getExtremityFactoryComplete(diagram.getSkinParam().getBackgroundColor(false)); if (extremityFactory1 == null) { return; }