1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-05-31 23:50:49 +00:00

Update smetana arrows to support beta style line colors & change decorators to fill with diagram background color instead of white

This commit is contained in:
matthew16550 2021-11-01 18:00:05 +11:00
parent cf3bc22976
commit a2a12adb58

View File

@ -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;
}