diff --git a/skin/plantuml.skin b/skin/plantuml.skin index b813836db..36024a082 100644 --- a/skin/plantuml.skin +++ b/skin/plantuml.skin @@ -1,4 +1,8 @@ root { + --common-background: #f1f1f1; + --note-background: #FEFFDD; + --grey-blue: #e2e2f0; + FontName SansSerif HyperLinkColor blue FontColor black @@ -9,8 +13,8 @@ root { DiagonalCorner 0 LineThickness 1.0 LineColor #181818 - BackGroundColor #f8f8f8 - Shadowing 0.0 + BackGroundColor: var(--common-background); + Shadowing: 0.0; } document { @@ -73,7 +77,13 @@ element { } } +element { + LineThickness 0.5 +} + group { + BackGroundColor transparent + LineThickness 1.0 package { LineThickness 1.5 LineColor black @@ -84,38 +94,32 @@ group { } } -group { - BackGroundColor transparent -} - sequenceDiagram { - group { - LineColor black - LineThickness 2.0 - FontSize 11 - FontStyle bold - } - - groupHeader { - BackGroundColor #e - LineColor black - FontSize 13 - FontStyle bold - } - - lifeLine { - BackGroundColor white - LineStyle 5 - } - - destroy { + group { + LineColor black + LineThickness 1.5 + FontSize 11 + FontStyle bold } + groupHeader { + LineThickness 1.5 + BackGroundColor #e + LineColor black + FontSize 13 + FontStyle bold + } + + lifeLine { + BackGroundColor white + LineStyle 5 + } + reference { FontSize 12 LineColor black BackGroundColor transparent - LineThickness 2.0 + LineThickness 1.5 HorizontalAlignment center } @@ -143,9 +147,20 @@ sequenceDiagram { FontSize 13 FontStyle bold } + participant { + RoundCorner 5 + } + + participant,actor,boundary,control,entity,queue,database,collections { + BackgroundColor: var(--grey-blue); + HorizontalAlignment center + } } -classDiagram { +classDiagram,componentDiagram,objectDiagram { + element { + RoundCorner 5 + } } visibilityIcon { @@ -202,6 +217,9 @@ stateDiagram { FontStyle plain } } + group { + LineThickness 0.5 + } } @@ -211,59 +229,24 @@ delay { HorizontalAlignment center } -participant { - LineThickness 1.5 - HorizontalAlignment center -} -actor { - LineThickness 2.0 - HorizontalAlignment center -} - -boundary { - LineThickness 2.0 - HorizontalAlignment center -} - -control { - LineThickness 2.0 - HorizontalAlignment center -} - -entity { - LineThickness 2.0 - HorizontalAlignment center -} - -queue { - LineThickness 2.0 - HorizontalAlignment center -} - -database { - HorizontalAlignment center -} - -collections { - LineThickness 1.5 - HorizontalAlignment center -} swimlane { BackGroundColor none LineColor black - LineThickness 2 + LineThickness 1.5 FontSize 18 } arrow { FontSize 13 + LineThickness 1.0 } note { FontSize 13 - BackGroundColor #ebebeb + BackGroundColor: var(--note-background); + LineThickness 0.5 } partition { @@ -298,7 +281,6 @@ wbsDiagram { activityDiagram { activity { - LineThickness 1.5 Padding 10 FontSize 12 RoundCorner 25 @@ -306,12 +288,14 @@ activityDiagram { partition { LineColor black BackgroundColor none + LineThickness 1.5 } diamond { FontSize 11 } arrow { FontSize 11 + LineThickness 1 } circle { start { @@ -362,10 +346,11 @@ ganttDiagram { LineColor #C0C0C0 } closed { - BackGroundColor #E0E0E0 + BackGroundColor #F1E5E5 FontColor #989898 } task { + BackGroundColor: var(--grey-blue); RoundCorner 0 Margin 2 2 2 2 Padding 0 @@ -385,7 +370,6 @@ usecase { } yamlDiagram,jsonDiagram { - BackGroundColor white FontColor black LineColor black arrow { @@ -412,10 +396,13 @@ timingDiagram { LineColor #3 FontColor #3 FontStyle bold - LineThickness 1.5 + LineThickness 0.5 timeline { FontStyle plain FontSize 11 + } + note { + LineThickness 0.5 } arrow { LineColor darkblue @@ -430,18 +417,20 @@ timingDiagram { } clock { LineColor darkgreen + LineThickness 1.5 } concise { FontSize 12 LineColor darkgreen - BackgroundColor #c + BackgroundColor: var(--grey-blue); + LineThickness 2 } robust { FontStyle plain FontSize 12 LineColor darkgreen LineThickness 2 - BackgroundColor #c + BackgroundColor: var(--grey-blue); } highlight { BackgroundColor #e @@ -452,6 +441,7 @@ timingDiagram { nwdiagDiagram { network { + BackgroundColor: var(--grey-blue); FontSize 12 } server { @@ -459,7 +449,7 @@ nwdiagDiagram { } group { FontSize 12 - BackGroundColor #d + BackGroundColor #e7e7e7 } arrow { FontSize 11 @@ -638,7 +628,6 @@ ganttDiagram { yamlDiagram,jsonDiagram { - BackGroundColor black FontColor white LineColor white node { diff --git a/src/ext/plantuml/com/google/zxing/common/BitArray.java b/src/ext/plantuml/com/google/zxing/common/BitArray.java index 3fe35d5d6..4145f54c8 100644 --- a/src/ext/plantuml/com/google/zxing/common/BitArray.java +++ b/src/ext/plantuml/com/google/zxing/common/BitArray.java @@ -231,8 +231,8 @@ public final class BitArray { private static int[] makeArray(int size) { final int tmp = (size + 31) >> 5; - if (tmp>1000) - throw new IllegalArgumentException("Memory error"); + if (tmp > 1000) + throw new IllegalArgumentException("Not even an issue :-) We just cancel flashcode generation."); return new int[tmp]; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java index ab580b315..b9885e246 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java @@ -42,10 +42,12 @@ import java.util.List; import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -86,7 +88,10 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile { throw new UnsupportedOperationException("" + getClass()); } - public final UStroke getThickness() { + public final UStroke getThickness(Style style) { + if (UseStyle.useBetaStyle()) + return style.getStroke(); + UStroke thickness = skinParam.getThickness(LineParam.activityBorder, null); if (thickness == null) { thickness = new UStroke(1.5); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java index b1086c5b8..f5e3eae65 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java @@ -43,12 +43,13 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; public interface Ftile extends Swimable, TextBlock { - public UStroke getThickness(); + public UStroke getThickness(Style style); public ISkinParam skinParam(); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java index 0a44acdde..c1d082ff4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -146,6 +147,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile { return Collections.emptyList(); } + @Override public Set getSwimlanes() { final Set result = new HashSet<>(); result.addAll(tile1.getSwimlanes()); @@ -153,14 +155,17 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile { return Collections.unmodifiableSet(result); } + @Override public ISkinParam skinParam() { return tile1.skinParam(); } - public UStroke getThickness() { - return tile1.getThickness(); + @Override + public UStroke getThickness(Style style) { + return tile1.getThickness(style); } + @Override public List getWeldingPoints() { final List result = new ArrayList<>(tile1.getWeldingPoints()); result.addAll(tile2.getWeldingPoints()); @@ -171,6 +176,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile { return Arrays.asList(tile1, tile2); } + @Override public HorizontalAlignment arrowHorizontalAlignment() { return tile1.arrowHorizontalAlignment(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java index 1750ec196..bc4c97e32 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java @@ -44,6 +44,7 @@ import java.util.List; import java.util.Objects; import net.sourceforge.plantuml.Direction; +import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; import net.sourceforge.plantuml.graphic.Rainbow; @@ -51,6 +52,8 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.VerticalAlignment; +import net.sourceforge.plantuml.style.Style; +import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; @@ -85,6 +88,7 @@ public class Snake implements UShape { private final List texts; private final MergeStrategy mergeable; private final Direction emphasizeDirection; + private final ISkinParam skinParam; public Snake transformX(PiecewiseAffineTransform compressionTransform) { final Snake result = cloneEmpty(); @@ -98,15 +102,15 @@ public class Snake implements UShape { public Snake move(double dx, double dy) { final Snake result = cloneEmpty(); - for (Point2D pt : worm) { + for (Point2D pt : worm) result.addPoint(pt.getX() + dx, pt.getY() + dy); - } + return result; } private Snake cloneEmpty() { - return new Snake(startDecoration, color, endDecoration, worm.cloneEmpty(), mergeable, emphasizeDirection, - texts); + return new Snake(skinParam, startDecoration, color, endDecoration, worm.cloneEmpty(), mergeable, + emphasizeDirection, texts); } public final Snake ignoreForCompression() { @@ -115,53 +119,59 @@ public class Snake implements UShape { } public Snake emphasizeDirection(Direction emphasizeDirection) { - return new Snake(startDecoration, color, endDecoration, worm, mergeable, emphasizeDirection, texts); + return new Snake(skinParam, startDecoration, color, endDecoration, worm, mergeable, emphasizeDirection, texts); } public Snake withoutEndDecoration() { - return new Snake(startDecoration, color, null, worm, mergeable, emphasizeDirection, texts); + return new Snake(skinParam, startDecoration, color, null, worm, mergeable, emphasizeDirection, texts); } public Snake withMerge(MergeStrategy mergeable) { - return new Snake(startDecoration, color, endDecoration, worm, mergeable, emphasizeDirection, texts); + return new Snake(skinParam, startDecoration, color, endDecoration, worm, mergeable, emphasizeDirection, texts); } public Snake withLabel(TextBlock textBlock, HorizontalAlignment horizontalAlignment) { - if (textBlock != null) { + if (textBlock != null) this.texts.add(new Text(textBlock, null, horizontalAlignment)); - } + return this; } public Snake withLabel(TextBlock textBlock, VerticalAlignment verticalAlignment) { - if (textBlock != null && textBlock != TextBlockUtils.EMPTY_TEXT_BLOCK) { + if (textBlock != null && textBlock != TextBlockUtils.EMPTY_TEXT_BLOCK) this.texts.add(new Text(textBlock, verticalAlignment, null)); - } - if (verticalAlignment != VerticalAlignment.CENTER) { + + if (verticalAlignment != VerticalAlignment.CENTER) throw new UnsupportedOperationException(); - } + return this; } - public static Snake create(Rainbow color) { - return new Snake(null, color, null, new Worm(), MergeStrategy.FULL, null, new ArrayList()); - } - - public static Snake create(Rainbow color, UPolygon endDecoration) { - return new Snake(null, color, endDecoration, new Worm(), MergeStrategy.FULL, null, new ArrayList()); - } - - public static Snake create(UPolygon startDecoration, Rainbow color, UPolygon endDecoration) { - return new Snake(startDecoration, color, endDecoration, new Worm(), MergeStrategy.FULL, null, + public static Snake create(ISkinParam skinParam, Rainbow color) { + final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + return new Snake(skinParam, null, color, null, new Worm(style), MergeStrategy.FULL, null, new ArrayList()); } - private Snake(UPolygon startDecoration, Rainbow color, UPolygon endDecoration, Worm worm, MergeStrategy mergeable, - Direction emphasizeDirection, List texts) { + public static Snake create(ISkinParam skinParam, Rainbow color, UPolygon endDecoration) { + final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + return new Snake(skinParam, null, color, endDecoration, new Worm(style), MergeStrategy.FULL, null, + new ArrayList()); + } - if (Objects.requireNonNull(color).size() == 0) { + public static Snake create(ISkinParam skinParam, UPolygon startDecoration, Rainbow color, UPolygon endDecoration) { + final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + return new Snake(skinParam, startDecoration, color, endDecoration, new Worm(style), MergeStrategy.FULL, null, + new ArrayList()); + } + + private Snake(ISkinParam skinParam, UPolygon startDecoration, Rainbow color, UPolygon endDecoration, Worm worm, + MergeStrategy mergeable, Direction emphasizeDirection, List texts) { + + if (Objects.requireNonNull(color).size() == 0) throw new IllegalArgumentException(); - } + + this.skinParam = skinParam; this.worm = worm; this.texts = Objects.requireNonNull(texts); this.emphasizeDirection = emphasizeDirection; @@ -210,14 +220,14 @@ public class Snake implements UShape { } final double globalMove = -1.0 * (colors.size() - 1) / 2.0; Worm current = worm.moveFirstPoint(mutation.getFirst().multiplyBy(globalMove)); - if (mutation.size() > 2) { + if (mutation.size() > 2) current = current.moveLastPoint(mutation.getLast().multiplyBy(globalMove)); - } + for (int i = 0; i < colors.size(); i++) { double stroke = 1.5; - if (colorArrowSeparationSpace == 0) { + if (colorArrowSeparationSpace == 0) stroke = i == colors.size() - 1 ? 2.0 : 3.0; - } + current.drawInternalOneColor(startDecoration, ug, colors.get(i), stroke, emphasizeDirection, endDecoration); current = mutation.mute(current); } @@ -235,9 +245,9 @@ public class Snake implements UShape { public double getMaxX(StringBounder stringBounder) { double result = -Double.MAX_VALUE; - for (Point2D pt : worm) { + for (Point2D pt : worm) result = Math.max(result, pt.getX()); - } + for (Text text : texts) { final Point2D position = getTextBlockPosition(stringBounder, text); final Dimension2D dim = text.textBlock.calculateDimension(stringBounder); @@ -302,14 +312,13 @@ public class Snake implements UShape { public Snake merge(Snake other, StringBounder stringBounder) { final MergeStrategy strategy = this.mergeable.max(other.mergeable); - if (strategy == MergeStrategy.NONE) { + if (strategy == MergeStrategy.NONE) return null; - } - for (Text text : other.texts) { - if (text.hasText(stringBounder)) { + + for (Text text : other.texts) + if (text.hasText(stringBounder)) return null; - } - } + if (same(this.getLast(), other.getFirst())) { final UPolygon oneOf = other.endDecoration == null ? endDecoration : other.endDecoration; if (this.startDecoration != null || other.startDecoration != null) { @@ -317,23 +326,23 @@ public class Snake implements UShape { } final ArrayList mergeTexts = new ArrayList(this.texts); mergeTexts.addAll(other.texts); - final Snake result = new Snake(null, color, oneOf, this.worm.merge(other.worm, strategy), strategy, - emphasizeDirection == null ? other.emphasizeDirection : emphasizeDirection, mergeTexts); + final Snake result = new Snake(skinParam, null, color, oneOf, this.worm.merge(other.worm, strategy), + strategy, emphasizeDirection == null ? other.emphasizeDirection : emphasizeDirection, mergeTexts); return result; } - if (same(this.getFirst(), other.getLast())) { + if (same(this.getFirst(), other.getLast())) return other.merge(this, stringBounder); - } + return null; } public boolean touches(Snake other) { - if (other.mergeable != MergeStrategy.FULL) { + if (other.mergeable != MergeStrategy.FULL) return false; - } - if (other.worm.isPureHorizontal()) { + + if (other.worm.isPureHorizontal()) return false; - } + return same(this.getLast(), other.getFirst()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java index e7e58d108..edf289d19 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java @@ -120,7 +120,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable return Collections.unmodifiableList(swimlanesSpecial); } - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.swimlane); } @@ -131,7 +131,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable protected Style getStyle() { if (style == null) { - this.style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); + this.style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); } return style; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java index 3f09e58c8..d0eed686e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java @@ -45,8 +45,12 @@ import java.util.List; import java.util.Objects; import net.sourceforge.plantuml.Direction; +import net.sourceforge.plantuml.ISkinParam; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; +import net.sourceforge.plantuml.style.Style; +import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; @@ -59,6 +63,11 @@ import net.sourceforge.plantuml.ugraphic.comp.CompressionMode; public class Worm implements Iterable { private final List points = new ArrayList(); + private final Style style; + + public Worm(Style style) { + this.style = style; + } public boolean isPureHorizontal() { return points.size() == 2 && points.get(0).getY() == points.get(1).getY(); @@ -67,32 +76,37 @@ public class Worm implements Iterable { private boolean ignoreForCompression; public Worm cloneEmpty() { - final Worm result = new Worm(); + final Worm result = new Worm(style); result.ignoreForCompression = this.ignoreForCompression; return result; } public final void setIgnoreForCompression() { - if (points.size() > 0) { + if (points.size() > 0) throw new IllegalStateException(); - } + this.ignoreForCompression = true; } public void drawInternalOneColor(UPolygon startDecoration, UGraphic ug, HtmlColorAndStyle colorAndStyle, - double stroke, Direction emphasizeDirection, UPolygon endDecoration) { + double strokeValue, Direction emphasizeDirection, UPolygon endDecoration) { final HColor arrowColor = Objects.requireNonNull(colorAndStyle.getArrowColor()); - final LinkStyle style = colorAndStyle.getStyle(); - if (style.isInvisible()) { + final LinkStyle linkStyle = colorAndStyle.getStyle(); + if (linkStyle.isInvisible()) return; - } + ug = ug.apply(arrowColor); ug = ug.apply(arrowColor.bg()); - if (style.isNormal()) { - ug = ug.apply(new UStroke(stroke)); + if (linkStyle.isNormal()) { + UStroke stroke = new UStroke(strokeValue); + if (UseStyle.useBetaStyle()) { + stroke = style.getStroke(); + } + ug = ug.apply(stroke); } else { - ug = ug.apply(style.goThickness(stroke).getStroke3()); + ug = ug.apply(linkStyle.goThickness(strokeValue).getStroke3()); } + boolean drawn = false; for (int i = 0; i < points.size() - 1; i++) { final java.awt.geom.Point2D.Double p1 = points.get(i); @@ -107,9 +121,9 @@ public class Worm implements Iterable { } final HColor arrowHeadColor = colorAndStyle.getArrowHeadColor(); - if (arrowHeadColor == null) { + if (arrowHeadColor == null) throw new IllegalStateException(); - } + // if (arrowHeadColor == null || arrowHeadColor.equals(HColorUtils.transparent())) { // return; // } @@ -119,17 +133,17 @@ public class Worm implements Iterable { if (startDecoration != null) { ug = ug.apply(new UStroke(1.5)); final Point2D start = points.get(0); - if (ignoreForCompression) { + if (ignoreForCompression) startDecoration.setCompressionMode(CompressionMode.ON_X); - } + ug.apply(new UTranslate(start)).apply(new UStroke()).draw(startDecoration); } if (endDecoration != null) { ug = ug.apply(new UStroke(1.5)); final Point2D end = points.get(points.size() - 1); - if (ignoreForCompression) { + if (ignoreForCompression) endDecoration.setCompressionMode(CompressionMode.ON_X); - } + ug.apply(new UTranslate(end)).apply(new UStroke()).draw(endDecoration); } } @@ -140,73 +154,73 @@ public class Worm implements Iterable { private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2, Direction direction) { ug = ug.apply(new UTranslate(x1, y1)); - if (direction != null) { + if (direction != null) ug.apply(new UTranslate((x2 - x1) / 2, (y2 - y1) / 2)).draw(Arrows.asTo(direction)); - } + ug.draw(new ULine(x2 - x1, y2 - y1)); } public Worm move(double dx, double dy) { - final Worm result = new Worm(); - for (Point2D pt : points) { + final Worm result = new Worm(style); + for (Point2D pt : points) result.addPoint(pt.getX() + dx, pt.getY() + dy); - } + return result; } public Worm moveFirstPoint(UTranslate move) { final double dx = move.getDx(); final double dy = move.getDy(); - if (dx != 0 && dy != 0) { + if (dx != 0 && dy != 0) throw new IllegalArgumentException("move=" + move); - } - final Worm result = new Worm(); + + final Worm result = new Worm(style); double x0 = this.points.get(0).getX(); double y0 = this.points.get(0).getY(); double x1 = this.points.get(1).getX(); double y1 = this.points.get(1).getY(); - if (dx != 0 && x0 == x1) { + if (dx != 0 && x0 == x1) x1 += dx; - } - if (dy != 0 && y0 == y1) { + + if (dy != 0 && y0 == y1) y1 += dy; - } + x0 += dx; y0 += dy; result.addPoint(x0, y0); result.addPoint(x1, y1); - for (int i = 2; i < this.points.size(); i++) { + for (int i = 2; i < this.points.size(); i++) result.addPoint(this.points.get(i)); - } + return result; } public Worm moveLastPoint(UTranslate move) { final double dx = move.getDx(); final double dy = move.getDy(); - if (dx != 0 && dy != 0) { + if (dx != 0 && dy != 0) throw new IllegalArgumentException("move=" + move); - } - final Worm result = new Worm(); + + final Worm result = new Worm(style); double x8 = this.points.get(this.points.size() - 2).getX(); double y8 = this.points.get(this.points.size() - 2).getY(); double x9 = this.points.get(this.points.size() - 1).getX(); double y9 = this.points.get(this.points.size() - 1).getY(); - if (dx != 0 && x8 == x9) { + if (dx != 0 && x8 == x9) x8 += dx; - } - if (dy != 0 && y8 == y9) { + + if (dy != 0 && y8 == y9) y8 += dy; - } + x9 += dx; y9 += dy; - for (int i = 0; i < this.points.size() - 2; i++) { + for (int i = 0; i < this.points.size() - 2; i++) result.addPoint(this.points.get(i)); - } + result.addPoint(x8, y8); result.addPoint(x9, y9); return result; @@ -215,24 +229,24 @@ public class Worm implements Iterable { @Override public String toString() { final StringBuilder result = new StringBuilder(); - for (int i = 0; i < points.size() - 1; i++) { + for (int i = 0; i < points.size() - 1; i++) result.append(getDirectionAtPoint(i) + " "); - } + return result + points.toString(); } public void addPoint(double x, double y) { - if (Double.isNaN(x)) { + if (Double.isNaN(x)) throw new IllegalArgumentException(); - } - if (Double.isNaN(y)) { + + if (Double.isNaN(y)) throw new IllegalArgumentException(); - } + if (points.size() > 0) { final Point2D last = getLast(); - if (last.getX() == x && last.getY() == y) { + if (last.getX() == x && last.getY() == y) return; - } + } this.points.add(new Point2D.Double(x, y)); } @@ -246,9 +260,9 @@ public class Worm implements Iterable { } SnakeDirection getDirection() { - if (points.size() < 2) { + if (points.size() < 2) throw new IllegalStateException(); - } + return SnakeDirection.getDirection(points.get(0), points.get(1)); } @@ -282,9 +296,9 @@ public class Worm implements Iterable { for (int i = 0; i < points.size() - 1; i++) { final Point2D.Double pt1 = get(i); final Point2D.Double pt2 = get(i + 1); - if (pt1.getY() == pt2.getY() && area.doesHorizontalCross(pt1, pt2)) { + if (pt1.getY() == pt2.getY() && area.doesHorizontalCross(pt1, pt2)) return true; - } + } return false; } @@ -325,10 +339,10 @@ public class Worm implements Iterable { } public Worm merge(Worm other, MergeStrategy merge) { - if (Snake.same(this.getLast(), other.getFirst()) == false) { + if (Snake.same(this.getLast(), other.getFirst()) == false) throw new IllegalArgumentException(); - } - final Worm result = new Worm(); + + final Worm result = new Worm(style); result.points.addAll(this.points); result.points.addAll(other.points); result.mergeMe(merge); @@ -348,9 +362,9 @@ public class Worm implements Iterable { change = change || removePattern5(); change = change || removePattern6(); change = change || removePattern7(); - if (merge == MergeStrategy.FULL) { + if (merge == MergeStrategy.FULL) change = change || removePattern8(); - } + } while (change); } @@ -510,4 +524,8 @@ public class Worm implements Iterable { return false; } + public Style getStyle() { + return style; + } + } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java index 47d64236c..c8fae6d6b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java @@ -188,7 +188,7 @@ public class WormMutation { } public Worm mute(Worm original) { - final Worm result = new Worm(); + final Worm result = new Worm(original.getStyle()); for (int i = 0; i < original.size(); i++) { result.addPoint(translations.get(i).getTranslated(original.get(i))); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormTexted.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormTexted.java index e9e31234d..942fd2d04 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormTexted.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormTexted.java @@ -44,6 +44,7 @@ import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -53,8 +54,8 @@ public class WormTexted implements Iterable { private final Worm worm; private TextBlock textBlock; - public WormTexted() { - this(new Worm()); + private WormTexted(Style style) { + this(new Worm(style)); } private WormTexted(Worm worm) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java index 877bd8eca..e68981db2 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java @@ -67,11 +67,11 @@ public abstract class AbstractParallelFtilesBuilder { private final StringBounder stringBounder; protected final List list99 = new ArrayList<>(); - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final public StyleSignature getDefaultStyleDefinitionArrow() { + final public StyleSignature getStyleSignatureArrow() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @@ -136,7 +136,7 @@ public abstract class AbstractParallelFtilesBuilder { } final FontConfiguration fontConfiguration; if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); } else { fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java index 300dbfdd9..67ecd4ea9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java @@ -76,7 +76,8 @@ public class ConnectionVerticalDown extends AbstractConnection implements Connec } private Snake getSimpleSnake() { - final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, arrowHorizontalAlignment()); + final Snake snake = Snake.create(getFtile1().skinParam(), color, Arrows.asToDown()).withLabel(textBlock, + arrowHorizontalAlignment()); snake.addPoint(p1); snake.addPoint(p2); return snake; @@ -84,7 +85,8 @@ public class ConnectionVerticalDown extends AbstractConnection implements Connec @Override public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { - final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, arrowHorizontalAlignment()); + final Snake snake = Snake.create(getFtile1().skinParam(), color, Arrows.asToDown()).withLabel(textBlock, + arrowHorizontalAlignment()); final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java index eebac6f2c..4e7232423 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java @@ -55,7 +55,10 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.skin.rose.Rose; +import net.sourceforge.plantuml.style.PName; +import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; +import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -65,33 +68,40 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc private final Opale opale; - public FloatingNote(Display note, ISkinParam skinParam, Style style) { + public FloatingNote(Display note, ISkinParam skinParam) { final Rose rose = new Rose(); - final HColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); - final HColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); - - final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null); - + UStroke stroke = new UStroke(); + final HColor noteBackgroundColor; + final HColor borderColor; + final FontConfiguration fc; final LineBreakStrategy wrapWidth; - + final double shadowing; if (UseStyle.useBetaStyle()) { + final Style style = StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); wrapWidth = style.wrapWidth(); + fc = new FontConfiguration(skinParam, style); + noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); + stroke = style.getStroke(); + shadowing = style.value(PName.Shadowing).asDouble(); } else { + shadowing = skinParam.shadowing(null) ? 4 : 0; + noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); + borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); + fc = new FontConfiguration(skinParam, FontParam.NOTE, null); wrapWidth = skinParam.wrapWidth(); - } + final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .createSheet(note); final SheetBlock2 sheetBlock2 = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, - new UStroke(1)); - final double shadowing; - shadowing = skinParam.shadowing(null) ? 4 : 0; - this.opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheetBlock2, false); - - // this.text = sheetBlock2; + stroke); + this.opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheetBlock2, false, stroke); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java index 0b8ce2049..27d327158 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java @@ -136,7 +136,7 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator { final UTranslate tr2 = genealogy.getTranslate(diamondBreak, ug.getStringBounder()); final Dimension2D dimDiamond = diamondBreak.calculateDimension(ug.getStringBounder()); - final Snake snake = Snake.create(arrowColor, Arrows.asToRight()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToRight()); snake.addPoint(tr1.getDx(), tr1.getDy()); snake.addPoint(0, tr1.getDy()); snake.addPoint(0, tr2.getDy() + dimDiamond.getHeight() / 2); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java index 367cc6f5f..f80ba7dc0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java @@ -122,7 +122,7 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator { public void drawU(UGraphic ug) { final UTranslate tr1 = genealogy.getTranslate(ftileBreak, ug.getStringBounder()); - final Snake snake = Snake.create(arrowColor, Arrows.asToLeft()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft()); snake.addPoint(tr1.getDx(), tr1.getDy()); snake.addPoint(Hexagon.hexagonHalfSize, tr1.getDy()); ug.draw(snake); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java index 789e24a38..2b21876fb 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java @@ -87,7 +87,7 @@ public class FtileGroup extends AbstractFtile { private final USymbol type; private final double roundCorner; - final public StyleSignature getDefaultStyleDefinitionPartition() { + final public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition); } @@ -100,8 +100,9 @@ public class FtileGroup extends AbstractFtile { final FontConfiguration fc; final Style style; + final UStroke thickness; if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder()); + style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); this.shadowing = style.value(PName.Shadowing).asDouble(); this.backColor = backColor == null @@ -110,6 +111,7 @@ public class FtileGroup extends AbstractFtile { this.borderColor = borderColor == null ? style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) : borderColor; + thickness = style.getStroke(); } else { this.backColor = backColor == null ? HColorUtils.WHITE : backColor; this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor; @@ -119,6 +121,7 @@ public class FtileGroup extends AbstractFtile { fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); this.shadowing = skinParam().shadowing(null) ? 3 : 0; + thickness = skinParam.getThickness(LineParam.partitionBorder, null); } if (title == null) this.name = TextBlockUtils.empty(0, 0); @@ -128,9 +131,8 @@ public class FtileGroup extends AbstractFtile { if (Display.isNull(displayNote)) this.headerNote = TextBlockUtils.empty(0, 0); else - this.headerNote = new FloatingNote(displayNote, skinParam, style); + this.headerNote = new FloatingNote(displayNote, skinParam); - final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null); this.stroke = thickness == null ? new UStroke(2) : thickness; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java index 86b2969ab..74e5ade0e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java @@ -46,16 +46,17 @@ import java.util.Set; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; @@ -71,8 +72,11 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; +import net.sourceforge.plantuml.style.Style; +import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.ugraphic.UGraphic; +import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -115,75 +119,44 @@ class FtileIfAndStop extends AbstractFtile { FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop, ISkinParam skinParam, StringBounder stringBounder, Display labelTest) { - // backColor = HtmlColorUtils.BLUE; - - // final Ftile tileNonStop = new FtileMinWidth(nonStop.getFtile(), 30); final Ftile tileNonStop = nonStop.getFtile(); - final FontConfiguration fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null); - final Ftile stopFtile = ftileFactory.stop(swimlane); - // final TextBlock tb1 = Display.create(branch1.getLabelPositive(), fcArrow, - // HorizontalAlignment.LEFT, - // ftileFactory); - // final TextBlock tb2 = Display.create(branch2.getLabelPositive(), fcArrow, - // HorizontalAlignment.LEFT, - // ftileFactory); - - final Sheet sheet = Parser.build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) - .createSheet(labelTest); - final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()); - final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), - tileNonStop.getThickness()); - - final Ftile diamond1; - if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) { - diamond1 = new FtileDiamondInside(tbTest, tileNonStop.skinParam(), backColor, borderColor, swimlane); - // .withWest(tb1).withEast(tb2); - } else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) { - diamond1 = new FtileDiamond(tileNonStop.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest); - // .withWest(tb1).withEast(tb2).withNorth(tbTest); + final UStroke thickness; + final FontConfiguration fcTest; + if (UseStyle.useBetaStyle()) { + final Style style = StyleSignature.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); + thickness = tileNonStop.getThickness(style); + fcTest = new FontConfiguration(skinParam, style); } else { - throw new IllegalStateException(); + thickness = tileNonStop.getThickness(null); + fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null); } - // final Ftile diamond2; - // if (tile1.calculateDimension(stringBounder).hasPointOut() - // && tile2.calculateDimension(stringBounder).hasPointOut()) { - // diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, - // swimlane); - // } else { - // diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2, - // Diamond.diamondHalfSize * 2, - // swimlane, swimlane); - // } + final Sheet sheet = Parser + .build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) + .createSheet(labelTest); + final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()); + + final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), thickness); + + final Ftile diamond1; + if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) + diamond1 = new FtileDiamondInside(tbTest, tileNonStop.skinParam(), backColor, borderColor, swimlane); + else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) + diamond1 = new FtileDiamond(tileNonStop.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest); + else + throw new IllegalStateException(); + final FtileIfAndStop result = new FtileIfAndStop(diamond1, tileNonStop, arrowColor, stopFtile); final List conns = new ArrayList<>(); conns.add(result.new ConnectionHorizontal(arrowColor)); - // conns.add(result.new ConnectionHorizontalThenVertical(tile2)); - // if (tile1.calculateDimension(stringBounder).hasPointOut() - // && tile2.calculateDimension(stringBounder).hasPointOut()) { - // conns.add(result.new ConnectionVerticalThenHorizontal(tile1, - // branch1.getInlinkRenderingColor())); - // conns.add(result.new ConnectionVerticalThenHorizontal(tile2, - // branch2.getInlinkRenderingColor())); - // } else if (tile1.calculateDimension(stringBounder).hasPointOut() - // && tile2.calculateDimension(stringBounder).hasPointOut() == false) { - // conns.add(result.new ConnectionVerticalThenHorizontalDirect(tile1, - // branch1.getInlinkRenderingColor())); - // } else if (tile1.calculateDimension(stringBounder).hasPointOut() == false - // && tile2.calculateDimension(stringBounder).hasPointOut()) { - // conns.add(result.new ConnectionVerticalThenHorizontalDirect(tile2, - // branch2.getInlinkRenderingColor())); - // } return FtileUtils.addConnection(result, conns); - // return result; } private UTranslate getTranslate1(StringBounder stringBounder) { - // final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final FtileGeometry dimTotal = calculateDimension(stringBounder); final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); final FtileGeometry dim1 = tile1.calculateDimension(stringBounder); @@ -233,7 +206,7 @@ class FtileIfAndStop extends AbstractFtile { final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(color, Arrows.asToRight()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToRight()); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -256,18 +229,10 @@ class FtileIfAndStop extends AbstractFtile { @Override public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { - if (child == diamond1) { + if (child == diamond1) return getTranslateDiamond1(stringBounder); - } - if (child == tile1) { + if (child == tile1) return getTranslate1(stringBounder); - } - // if (child == tile2) { - // return getTranslate2(stringBounder); - // } - // if (child == diamond2) { - // return getTranslateDiamond2(stringBounder); - // } throw new UnsupportedOperationException(); } @@ -287,45 +252,6 @@ class FtileIfAndStop extends AbstractFtile { final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); return dimDiamond1.appendBottom(dim1).addDim(0, getSuppHeight()); - // final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); - // if (tile1.calculateDimension(stringBounder).hasPointOut()) { - // return new FtileGeometry(dimTotal, getLeft(stringBounder), 0, - // dimTotal.getHeight()); - // } - // return new FtileGeometry(dimTotal, getLeft(stringBounder), 0); } - // private Dimension2D calculateDimensionInternal; - // - // private Dimension2D calculateDimensionInternal(StringBounder stringBounder) { - // if (calculateDimensionInternal == null) { - // calculateDimensionInternal = calculateDimensionInternalSlow(stringBounder); - // } - // return calculateDimensionInternal; - // } - // - // private Dimension2D calculateDimensionInternalSlow(StringBounder - // stringBounder) { - // final Dimension2D dim1 = tile1.calculateDimension(stringBounder); - // final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder); - // final Dimension2D dimStop2 = stop2.calculateDimension(stringBounder); - // final double width = Math.max(dim1.getWidth(), - // dimDiamond1.getWidth() + getDiamondStopDistance() + dimStop2.getWidth()); - // return new Dimension2DDouble(width + 30, dim1.getHeight() + - // dimDiamond1.getHeight() + 40); - // } - // - // private double getLeft(StringBounder stringBounder) { - // // return calculateDimension(stringBounder).getLeft(); - // return - // tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft(); - // // final double left1 = - // tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft(); - // // // final double left2 = - // // // - // tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft(); - // // // return (left1 + left2) / 2; - // // return left1; - // } - } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java index 1bdb50b1c..5a683d700 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java @@ -50,12 +50,12 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; @@ -155,7 +155,7 @@ public class FtileIfDown extends AbstractFtile { final Point2D p2 = getP2(stringBounder); // p2 = new Point2D.Double(p2.getX(), p1.getY()); - final Snake snake = Snake.create(color, Arrows.asToRight()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToRight()); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -198,7 +198,7 @@ public class FtileIfDown extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); snake.addPoint(getP1(stringBounder)); snake.addPoint(getP2(stringBounder)); @@ -210,7 +210,7 @@ public class FtileIfDown extends AbstractFtile { final StringBounder stringBounder = ug.getStringBounder(); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; @@ -255,7 +255,7 @@ public class FtileIfDown extends AbstractFtile { return; } - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); snake.addPoint(getP1(stringBounder)); if (conditionEndStyle == ConditionEndStyle.DIAMOND) { @@ -277,7 +277,7 @@ public class FtileIfDown extends AbstractFtile { final StringBounder stringBounder = ug.getStringBounder(); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; @@ -331,7 +331,7 @@ public class FtileIfDown extends AbstractFtile { final double xmax = Math.max(x1 + Hexagon.hexagonHalfSize, getTranslateForThen(stringBounder).getDx() + thenGeom.getWidth()); - final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.DOWN); + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.DOWN); snake.addPoint(x1, y1); snake.addPoint(xmax, y1); snake.addPoint(xmax, y2); @@ -378,7 +378,7 @@ public class FtileIfDown extends AbstractFtile { * ug.apply(new UTranslate(x2, y2 - Diamond.diamondHalfSize)).draw(new UEmpty(5, * Diamond.diamondHalfSize)); ug.draw(snake); } */ - final Snake snake = Snake.create(endInlinkColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToDown()); snake.addPoint(x1, y1); snake.addPoint(xmax, y1); snake.addPoint(xmax, y2); @@ -461,7 +461,7 @@ public class FtileIfDown extends AbstractFtile { final double xmax = Math.max(x1 + Hexagon.hexagonHalfSize, getTranslateForThen(stringBounder).getDx() + thenGeom.getWidth()); - final Snake snake = Snake.create(endInlinkColor).withMerge(MergeStrategy.NONE); + final Snake snake = Snake.create(skinParam(), endInlinkColor).withMerge(MergeStrategy.NONE); snake.addPoint(xmax, y2); // ug.apply(new UTranslate(xmax, y2 - Diamond.diamondHalfSize)).draw(new // UEmpty(5, diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java index 2307a2837..f3c9cca14 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java @@ -258,7 +258,7 @@ class FtileIfLongHorizontal extends AbstractFtile { final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(color, Arrows.asToRight()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToRight()); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -296,7 +296,7 @@ class FtileIfLongHorizontal extends AbstractFtile { public void drawU(UGraphic ug) { final UTranslate tr = getTranslateDiamond1(getFtile2(), ug.getStringBounder()); final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn()); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn(); snake.addPoint(p1); @@ -320,7 +320,7 @@ class FtileIfLongHorizontal extends AbstractFtile { final Point2D p1 = getP1(ug.getStringBounder()); final UTranslate tr2 = getTranslate2(ug.getStringBounder()); final Point2D p2 = tr2.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn()); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); snake.addPoint(p1); snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2); @@ -361,7 +361,7 @@ class FtileIfLongHorizontal extends AbstractFtile { final double totalHeight = full.getHeight(); final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment()); snake.addPoint(p1); snake.addPoint(p2); if (nbOut == 0) { @@ -386,7 +386,7 @@ class FtileIfLongHorizontal extends AbstractFtile { final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(color, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -407,7 +407,7 @@ class FtileIfLongHorizontal extends AbstractFtile { final Point2D p1 = getP1(ug.getStringBounder()); final Point2D p2 = getP2(ug.getStringBounder()); - final Snake snake = Snake.create(color, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()); final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); @@ -441,7 +441,7 @@ class FtileIfLongHorizontal extends AbstractFtile { } final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight); - final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment()); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -490,7 +490,7 @@ class FtileIfLongHorizontal extends AbstractFtile { return; } - final Snake s = Snake.create(arrowColor).withMerge(MergeStrategy.NONE); + final Snake s = Snake.create(skinParam(), arrowColor).withMerge(MergeStrategy.NONE); s.addPoint(minX, totalDim.getHeight()); s.addPoint(maxX, totalDim.getHeight()); ug.draw(s); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java index 6234a025d..4a48bd62e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java @@ -211,7 +211,7 @@ class FtileIfLongVertical extends AbstractFtile { public void drawU(UGraphic ug) { final UTranslate tr = getTranslateDiamond(getFtile2(), ug.getStringBounder()); final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn()); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn(); snake.addPoint(p1); @@ -237,7 +237,7 @@ class FtileIfLongVertical extends AbstractFtile { final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(color, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()); snake.addPoint(p1); snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2); @@ -274,7 +274,8 @@ class FtileIfLongVertical extends AbstractFtile { final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(label, VerticalAlignment.CENTER); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()).withLabel(label, + VerticalAlignment.CENTER); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -312,7 +313,8 @@ class FtileIfLongVertical extends AbstractFtile { final Point2D p2 = getTranslate2(stringBounder) .getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn()); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withLabel(label, VerticalAlignment.CENTER); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(label, + VerticalAlignment.CENTER); snake.addPoint(p1); snake.addPoint(p1.getX(), p2.getY() - 15); snake.addPoint(p2.getX(), p2.getY() - 15); @@ -341,7 +343,7 @@ class FtileIfLongVertical extends AbstractFtile { final Point2D p2 = getTranslateLastDiamond(stringBounder) .getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn()); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); snake.addPoint(p1); snake.addPoint(p1.getX(), p2.getY() - 15); snake.addPoint(p2.getX(), p2.getY() - 15); @@ -375,7 +377,7 @@ class FtileIfLongVertical extends AbstractFtile { final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); - final Snake snake = Snake.create(arrowColor, Arrows.asToLeft()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft()); snake.addPoint(p1); snake.addPoint(p1.getX(), p1.getY() + 15); snake.addPoint(dimTotal.getWidth(), p1.getY() + 15); @@ -406,7 +408,7 @@ class FtileIfLongVertical extends AbstractFtile { final Point2D p2 = new Point2D.Double(dimTotal.getWidth(), p1.getY() + 15); - final Snake snake = Snake.create(arrowColor, Arrows.asToRight()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToRight()); snake.addPoint(p1); snake.addPoint(p1.getX(), p2.getY()); snake.addPoint(p2); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java index d608c7760..f1eb8163e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java @@ -77,7 +77,7 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable private final boolean withOutPoint; private final Swimlane swimlane; - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); } @@ -111,13 +111,15 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable final HColor borderColor; final double shadowing; final LineBreakStrategy wrapWidth; + UStroke stroke = new UStroke(); if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); shadowing = style.value(PName.Shadowing).asDouble(); wrapWidth = style.wrapWidth(); + stroke = style.getStroke(); } else { noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); @@ -130,9 +132,8 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .createSheet(note); - final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, - new UStroke(1)); - opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, false); + final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, stroke); + opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, false, stroke); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java index 2e4379e08..88b22c9a9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java @@ -54,11 +54,11 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; @@ -74,7 +74,6 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -219,7 +218,8 @@ class FtileRepeat extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withLabel(tbin, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(tbin, + arrowHorizontalAlignment()); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); snake.addPoint(p1); @@ -259,7 +259,7 @@ class FtileRepeat extends AbstractFtile { if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false) return; - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withLabel(tbout, + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(tbout, arrowHorizontalAlignment()); snake.addPoint(getP1(stringBounder)); snake.addPoint(getP2(stringBounder)); @@ -273,7 +273,7 @@ class FtileRepeat extends AbstractFtile { if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false) return; - final Snake snake = Snake.create(arrowColor); + final Snake snake = Snake.create(skinParam(), arrowColor); final Point2D mp1a = translate1.getTranslated(getP1(stringBounder)); final Point2D mp2b = translate2.getTranslated(getP2(stringBounder)); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; @@ -282,7 +282,7 @@ class FtileRepeat extends AbstractFtile { snake.addPoint(mp2b.getX(), middle); ug.draw(snake); - final Snake small = Snake.create(arrowColor, Arrows.asToDown()).withLabel(tbout, + final Snake small = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(tbout, arrowHorizontalAlignment()); small.addPoint(mp2b.getX(), middle); small.addPoint(mp2b); @@ -333,7 +333,7 @@ class FtileRepeat extends AbstractFtile { final Snake snake; if (x2 < x1_a) { - snake = Snake.create(arrowColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP); + snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP); snake.addPoint(x1_a, y1); if (x1_a < x1_b) { snake.addPoint(x1_b, y1); @@ -344,7 +344,7 @@ class FtileRepeat extends AbstractFtile { } } else { x2 = p2.getX(); - snake = Snake.create(arrowColor, Arrows.asToRight()).emphasizeDirection(Direction.UP); + snake = Snake.create(skinParam(), arrowColor, Arrows.asToRight()).emphasizeDirection(Direction.UP); snake.addPoint(x1_a, y1); final double middle = x1_a / 4 + x2 * 3 / 4; snake.addPoint(middle, y1); @@ -386,7 +386,8 @@ class FtileRepeat extends AbstractFtile { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(arrowColor, Arrows.asToUp()).withLabel(tbback, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToUp()).withLabel(tbback, + arrowHorizontalAlignment()); snake.addPoint(x1, y1); snake.addPoint(x2, y1); @@ -410,7 +411,8 @@ class FtileRepeat extends AbstractFtile { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(arrowColor, Arrows.asToUp()).withLabel(tbback, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToUp()).withLabel(tbback, + arrowHorizontalAlignment()); snake.addPoint(x1, y1); snake.addPoint(x2, y1); @@ -458,7 +460,7 @@ class FtileRepeat extends AbstractFtile { x2 += dimDiamond1.getWidth(); final double y2 = p2.getY() + dimDiamond1.getHeight() / 2; - Snake snake = Snake.create(arrowColor, x2 < x1 ? Arrows.asToLeft() : Arrows.asToRight()); + Snake snake = Snake.create(skinParam(), arrowColor, x2 < x1 ? Arrows.asToLeft() : Arrows.asToRight()); if (label != null) { snake = snake.withLabel(label, arrowHorizontalAlignment()); } @@ -474,7 +476,7 @@ class FtileRepeat extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - Snake snake = Snake.create(arrowColor, Arrows.asToLeft()); + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft()); if (label != null) { snake = snake.withLabel(label, arrowHorizontalAlignment()); } @@ -516,8 +518,8 @@ class FtileRepeat extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(arrowColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP) - .withLabel(tbback, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft()) + .emphasizeDirection(Direction.UP).withLabel(tbback, arrowHorizontalAlignment()); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); @@ -540,8 +542,8 @@ class FtileRepeat extends AbstractFtile { @Override public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(arrowColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP) - .withLabel(tbback, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft()) + .emphasizeDirection(Direction.UP).withLabel(tbback, arrowHorizontalAlignment()); final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder); Point2D p1 = getP1(stringBounder); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java index be9a20aa3..323718c39 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java @@ -52,11 +52,11 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; @@ -189,7 +189,7 @@ class FtileWhile extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); snake.addPoint(getP1(stringBounder)); snake.addPoint(getP2(stringBounder)); @@ -201,7 +201,8 @@ class FtileWhile extends AbstractFtile { final StringBounder stringBounder = ug.getStringBounder(); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); - final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()) + .withMerge(MergeStrategy.LIMITED); final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; @@ -257,8 +258,8 @@ class FtileWhile extends AbstractFtile { final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2; final double y2 = p2.getY() + dimDiamond1.getInY() + half; - final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP) - .withLabel(back, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()) + .emphasizeDirection(Direction.UP).withLabel(back, arrowHorizontalAlignment()); snake.addPoint(x1, y1); final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize; snake.addPoint(x1, y1bis); @@ -275,7 +276,8 @@ class FtileWhile extends AbstractFtile { @Override public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()) + .withMerge(MergeStrategy.LIMITED); final Dimension2D dimTotal = calculateDimension(stringBounder); final Point2D ap1 = getP1(stringBounder); final Point2D ap2 = getP2(stringBounder); @@ -349,7 +351,7 @@ class FtileWhile extends AbstractFtile { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(endInlinkColor, Arrows.asToUp()).withLabel(back, + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToUp()).withLabel(back, arrowHorizontalAlignment()); snake.addPoint(x1, y1); final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize; @@ -384,7 +386,7 @@ class FtileWhile extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).withLabel(back, + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()).withLabel(back, arrowHorizontalAlignment()); final Point2D p1 = getP1(stringBounder); @@ -430,7 +432,8 @@ class FtileWhile extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP); + final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()) + .emphasizeDirection(Direction.UP); final Dimension2D dimTotal = calculateDimension(stringBounder); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); @@ -479,7 +482,7 @@ class FtileWhile extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(afterEndwhileColor).withMerge(MergeStrategy.LIMITED) + final Snake snake = Snake.create(skinParam(), afterEndwhileColor).withMerge(MergeStrategy.LIMITED) .emphasizeDirection(Direction.DOWN); final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); @@ -498,7 +501,7 @@ class FtileWhile extends AbstractFtile { ug.draw(snake); - final Snake snake2 = Snake.create(afterEndwhileColor); + final Snake snake2 = Snake.create(skinParam(), afterEndwhileColor); snake2.addPoint(Hexagon.hexagonHalfSize, y2); snake2.addPoint(x2, y2); // snake2.goUnmergeable(MergeStrategy.LIMITED); @@ -527,7 +530,7 @@ class FtileWhile extends AbstractFtile { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); - final Snake snake = Snake.create(afterEndwhileColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), afterEndwhileColor, Arrows.asToDown()); final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); final Point2D p1 = getP1(stringBounder); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java index be311770e..9d3a765f9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java @@ -88,7 +88,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea private final double suppSpace = 20; private final Swimlane swimlaneNote; - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); } @@ -141,11 +141,12 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea final HColor noteBackgroundColor; final HColor borderColor; final FontConfiguration fc; + UStroke stroke = new UStroke(); final double shadowing; final LineBreakStrategy wrapWidth; if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) .eventuallyOverride(note.getColors()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); @@ -153,6 +154,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); shadowing = style.value(PName.Shadowing).asDouble(); wrapWidth = style.wrapWidth(); + stroke = style.getStroke(); } else { noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); @@ -164,9 +166,8 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false, null); final Sheet sheet = Parser.build(fc, align, skinParam, CreoleMode.FULL).createSheet(note.getDisplay()); - final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, - new UStroke(1)); - opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, withLink); + final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, stroke); + opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, withLink, stroke); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java index 0417e21d7..95e1d7c2d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java @@ -83,7 +83,7 @@ public class FtileWithNotes extends AbstractFtile { private final double suppSpace = 20; - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); } @@ -107,17 +107,18 @@ public class FtileWithNotes extends AbstractFtile { for (PositionedNote note : notes) { ISkinParam skinParam2 = skinParam; - if (note.getColors() != null) { + if (note.getColors() != null) skinParam2 = note.getColors().mute(skinParam2); - } + final HColor noteBackgroundColor; final HColor borderColor; final FontConfiguration fc; final double shadowing; + UStroke stroke = new UStroke(); final LineBreakStrategy wrapWidth; if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) .eventuallyOverride(note.getColors()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); @@ -125,6 +126,7 @@ public class FtileWithNotes extends AbstractFtile { fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); shadowing = style.value(PName.Shadowing).asDouble(); wrapWidth = style.wrapWidth(); + stroke = style.getStroke(); } else { noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); @@ -148,7 +150,7 @@ public class FtileWithNotes extends AbstractFtile { } }, new UStroke()); - final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheet2, false); + final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheet2, false, stroke); final TextBlock opaleMarged = TextBlockUtils.withMargin(opale, 10, 10); if (note.getNotePosition() == NotePosition.LEFT) { if (left == null) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java index 7c4a5b4e7..6ff61c3f8 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java @@ -63,6 +63,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; +import net.sourceforge.plantuml.ugraphic.color.HColor; public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { @@ -108,15 +109,15 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { private double getXSuppForDisplay(Ftile ftile, Display label) { final TextBlock text = getTextBlock(label); - if (text == null) { + if (text == null) return 0; - } + final double textWidth = text.calculateDimension(getStringBounder()).getWidth(); final FtileGeometry ftileDim = ftile.calculateDimension(getStringBounder()); final double pos2 = ftileDim.getLeft() + textWidth; - if (pos2 > ftileDim.getWidth()) { + if (pos2 > ftileDim.getWidth()) return pos2 - ftileDim.getWidth(); - } + return 0; } @@ -130,18 +131,17 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { Ftile result = middle; final List conns = new ArrayList<>(); final Swimlane swimlaneBlack = in; - final Ftile black = new FtileBlackBlock(skinParam(), - getRose().getHtmlColor(skinParam(), ColorParam.activityBar), swimlaneBlack); + final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Ftile black = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack); double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Rainbow def; - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { + else def = Rainbow.build(skinParam()); - } + final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def); conns.add(new ConnectionIn(black, tmp, x, rainbow)); x += dim.getWidth(); @@ -158,9 +158,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { double result = 0; for (Ftile child : all) { final TextBlock text = getTextBlock(child.getInLinkRendering().getDisplay()); - if (text == null) { + if (text == null) continue; - } + final Dimension2D dim = text.calculateDimension(stringBounder); result = Math.max(result, dim.getHeight()); @@ -172,9 +172,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { double result = 0; for (Ftile child : all) { final TextBlock text = getTextBlock(child.getOutLinkRendering().getDisplay()); - if (text == null) { + if (text == null) continue; - } + final Dimension2D dim = text.calculateDimension(stringBounder); result = Math.max(result, dim.getHeight()); } @@ -188,35 +188,38 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { @Override protected Ftile doStep2(Ftile middle, Ftile result) { final Swimlane swimlaneBlack = out; - final Ftile out = new FtileBlackBlock(skinParam(), getRose().getHtmlColor(skinParam(), ColorParam.activityBar), - swimlaneBlack); + final Ftile out = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack); ((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), barHeight); - if (label != null) { + if (label != null) ((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(label))); - } + result = new FtileAssemblySimple(result, out); final List conns = new ArrayList<>(); + final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Rainbow def; - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { + else def = Rainbow.build(skinParam()); - } + final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); - if (tmp.calculateDimension(getStringBounder()).hasPointOut()) { + if (tmp.calculateDimension(getStringBounder()).hasPointOut()) conns.add(new ConnectionOut(tmp, out, x, rainbow, getJustBeforeBar2(middle, getStringBounder()))); - } + x += dim.getWidth(); } result = FtileUtils.addConnection(result, conns); return result; } + private HColor barColor() { + return getRose().getHtmlColor(skinParam(), ColorParam.activityBar); + } + class ConnectionIn extends AbstractConnection implements ConnectionTranslatable { private final double x; @@ -233,10 +236,10 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { public void drawU(UGraphic ug) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo2 = getFtile2().calculateDimension(getStringBounder()); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0); final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY()); snake.addPoint(p1); @@ -251,10 +254,10 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0); final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY()); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()).ignoreForCompression(); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).ignoreForCompression(); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = mp1a.getY() + 4; @@ -284,13 +287,13 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { public void drawU(UGraphic ug) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo1 = getFtile1().calculateDimension(getStringBounder()); - if (geo1.hasPointOut() == false) { + if (geo1.hasPointOut() == false) return; - } - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D p1 = new Point2D.Double(geo1.getLeft(), barHeight + geo1.getOutY()); final Point2D p2 = new Point2D.Double(geo1.getLeft(), justBeforeBar2); snake.addPoint(p1); @@ -302,16 +305,16 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder()); - if (geo.hasPointOut() == false) { + if (geo.hasPointOut() == false) return; - } + final Point2D p1 = new Point2D.Double(geo.getLeft(), barHeight + geo.getOutY()); final Point2D p2 = new Point2D.Double(geo.getLeft(), justBeforeBar2); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()).ignoreForCompression(); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).ignoreForCompression(); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = mp2b.getY() - 14; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java index 68c087466..366894cf9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java @@ -57,6 +57,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; @@ -81,7 +82,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Rainbow def; if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); } else { def = Rainbow.build(skinParam()); @@ -100,8 +101,20 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { @Override protected Ftile doStep2(Ftile inner, Ftile result) { - final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - final HColor backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground); + final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final HColor borderColor; + final HColor backColor; + + if (UseStyle.useBetaStyle()) { + borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + backColor = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + } else { + borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); + backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground); + + } final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2()); result = new FtileAssemblySimple(result, out); final List conns = new ArrayList<>(); @@ -112,16 +125,15 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final UTranslate translate0 = new UTranslate(x, barHeight); final Rainbow def; - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { + else def = Rainbow.build(skinParam()); - } + final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); - if (tmp.calculateDimension(getStringBounder()).hasPointOut()) { + if (tmp.calculateDimension(getStringBounder()).hasPointOut()) conns.add(new ConnectionHorizontalThenVertical(tmp, out, rainbow, translate0, diamondTranslate)); - } + x += dim.getWidth(); } @@ -153,14 +165,14 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { final UTranslate arrival = arrivalOnDiamond(stringBounder, p1.getX()); final UPolygon endDecoration; - if (arrival.getDx() < 0) { + if (arrival.getDx() < 0) endDecoration = Arrows.asToRight(); - } else if (arrival.getDx() > 0) { + else if (arrival.getDx() > 0) endDecoration = Arrows.asToLeft(); - } else { + else endDecoration = Arrows.asToDown(); - } - final Snake snake = Snake.create(arrowColor, endDecoration); + + final Snake snake = Snake.create(skinParam(), arrowColor, endDecoration); snake.addPoint(x1, y1); snake.addPoint(x1, y2); snake.addPoint(x2, y2); @@ -188,13 +200,13 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { final double b = result.getX() + dim.getWidth() / 2; final UTranslate arrival; - if (startX < a) { + if (startX < a) arrival = new UTranslate(-dim.getWidth() / 2, -dim.getHeight() / 2); - } else if (startX > b) { + else if (startX > b) arrival = new UTranslate(dim.getWidth() / 2, -dim.getHeight() / 2); - } else { + else arrival = new UTranslate(0, -dim.getHeight()); - } + return arrival; } @@ -216,10 +228,10 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { public void drawU(UGraphic ug) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder()); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + snake.addPoint(geo.getLeft(), 0); snake.addPoint(geo.getLeft(), geo.getInY()); ug.draw(snake); @@ -232,10 +244,10 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { final Point2D p1 = new Point2D.Double(geo.getLeft(), 0); final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY()); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = mp1a.getY() + 4; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java index 2f3c0794e..b5a013391 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java @@ -70,7 +70,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { } @Override - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @@ -79,32 +79,30 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { Ftile result = inner; final List conns = new ArrayList<>(); final Rainbow thinColor; - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { + else thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam())); - } + final Ftile thin = new FtileThinSplit(skinParam(), getThin1Color(thinColor), list99.get(0).getSwimlaneIn()); double x = 0; double first = 0; double last = 0; for (Ftile tmp : list99) { final FtileGeometry dim = tmp.calculateDimension(getStringBounder()); - if (first == 0) { + if (first == 0) first = x + dim.getLeft(); - } + last = x + dim.getLeft(); final LinkRendering inLinkRendering = tmp.getInLinkRendering(); final Rainbow rainbow; - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) rainbow = inLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - } else { + else rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); - } conns.add(new ConnectionIn(thin, tmp, x, rainbow)); x += dim.getWidth(); @@ -112,42 +110,40 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { result = FtileUtils.addConnection(result, conns); final FtileGeometry geom = result.calculateDimension(getStringBounder()); - if (last < geom.getLeft()) { + if (last < geom.getLeft()) last = geom.getLeft(); - } - if (first > geom.getLeft()) { + + if (first > geom.getLeft()) first = geom.getLeft(); - } + ((FtileThinSplit) thin).setGeom(first, last, result.calculateDimension(getStringBounder()).getWidth()); return new FtileAssemblySimple(thin, result); } private HColor getThin1Color(final Rainbow thinColor) { + final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); for (Ftile tmp : list99) { final Rainbow rainbow; final LinkRendering inLinkRendering = tmp.getInLinkRendering(); - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) rainbow = inLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - } else { + else rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); - } - if (rainbow.isInvisible() == false) { + + if (rainbow.isInvisible() == false) return thinColor.getColor(); - } + } return null; } private boolean hasOut() { - for (Ftile tmp : list99) { - final boolean hasOutTmp = tmp.calculateDimension(getStringBounder()).hasPointOut(); - if (hasOutTmp) { + for (Ftile tmp : list99) + if (tmp.calculateDimension(getStringBounder()).hasPointOut()) return true; - } - } + return false; } @@ -155,19 +151,17 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { protected Ftile doStep2(Ftile inner, Ftile result) { final FtileGeometry geom = result.calculateDimension(getStringBounder()); - if (hasOut() == false) { + if (hasOut() == false) return new FtileKilled(result); - } + final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Rainbow thinColor; final LinkRendering inLinkRendering = result.getInLinkRendering(); - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) thinColor = inLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - } else { + else thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam())); - } final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2()); result = new FtileAssemblySimple(result, out); @@ -179,33 +173,31 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { final UTranslate translate0 = UTranslate.dy(1.5); final FtileGeometry dim = tmp.calculateDimension(getStringBounder()); if (dim.hasPointOut()) { - if (first == 0) { + if (first == 0) first = x + dim.getLeft(); - } + last = x + dim.getLeft(); } final Rainbow rainbow; final LinkRendering outLinkRendering = tmp.getOutLinkRendering(); - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); + if (UseStyle.useBetaStyle()) rainbow = outLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - } else { + else rainbow = outLinkRendering.getRainbow(Rainbow.build(skinParam())); - } - if (tmp.calculateDimension(getStringBounder()).hasPointOut()) { + if (tmp.calculateDimension(getStringBounder()).hasPointOut()) conns.add(new ConnectionOut(translate0, tmp, out, x, rainbow, getHeightOfMiddle(inner))); - } + x += dim.getWidth(); } - if (last < geom.getLeft()) { + if (last < geom.getLeft()) last = geom.getLeft(); - } - if (first > geom.getLeft()) { + + if (first > geom.getLeft()) first = geom.getLeft(); - } + ((FtileThinSplit) out).setGeom(first, last, geom.getWidth()); result = FtileUtils.addConnection(result, conns); return result; @@ -227,10 +219,10 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { public void drawU(UGraphic ug) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder()); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + snake.addPoint(geo.getLeft(), 0); snake.addPoint(geo.getLeft(), geo.getInY()); ug.draw(snake); @@ -243,10 +235,10 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { final Point2D p1 = new Point2D.Double(geo.getLeft(), 0); final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY()); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = mp1a.getY() + 4; @@ -279,13 +271,13 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { public void drawU(UGraphic ug) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder()); - if (geo.hasPointOut() == false) { + if (geo.hasPointOut() == false) return; - } - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY())); final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height)); snake.addPoint(p1); @@ -297,16 +289,16 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { ug = ug.apply(UTranslate.dx(x)); final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder()); - if (geo.hasPointOut() == false) { + if (geo.hasPointOut() == false) return; - } + final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY())); final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height)); - Snake snake = Snake.create(arrowColor, Arrows.asToDown()); - if (Display.isNull(label) == false) { + Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); + if (Display.isNull(label) == false) snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); - } + final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); final double middle = mp2b.getY() - 14; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java index d39b09629..aa936f32f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java @@ -102,6 +102,10 @@ public class VCompactFactory implements FtileFactory { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.stop); } + private StyleSignature getSignatureCircleSpot() { + return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.spot); + } + private StyleSignature getSignatureCircleStart() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.start); } @@ -135,7 +139,11 @@ public class VCompactFactory implements FtileFactory { public Ftile spot(Swimlane swimlane, String spot, HColor color) { final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY); - return new FtileCircleSpot(skinParam(), swimlane, spot, font, color); + Style style = null; + if (UseStyle.useBetaStyle()) { + style = getSignatureCircleSpot().getMergedStyle(skinParam.getCurrentStyleBuilder()); + } + return new FtileCircleSpot(skinParam(), swimlane, spot, font, color, style); } public Ftile end(Swimlane swimlane) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java index 87448b96f..68936b259 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java @@ -71,6 +71,7 @@ import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.ConditionEndStyle; import net.sourceforge.plantuml.svek.ConditionStyle; +import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.color.HColor; public class ConditionalBuilder { @@ -95,11 +96,11 @@ public class ConditionalBuilder { private final Ftile tile2; private final Url url; - public StyleSignature getDefaultStyleDefinitionDiamond() { + private StyleSignature getStyleSignatureDiamond() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - public StyleSignature getDefaultStyleDefinitionArrow() { + private StyleSignature getStyleSignatureArrow() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @@ -114,19 +115,24 @@ public class ConditionalBuilder { throw new IllegalArgumentException(); if (arrowColor == null) throw new IllegalArgumentException(); - final Style styleArrow = getDefaultStyleDefinitionArrow() - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - final Style styleDiamond = getDefaultStyleDefinitionDiamond() - .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleDiamond = getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.diamondLineBreak = styleDiamond.wrapWidth(); this.labelLineBreak = styleArrow.wrapWidth(); - this.borderColor = borderColor; /*styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet());*/ - this.backColor = backColor;/*styleDiamond.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet())*/; - this.arrowColor = arrowColor;/* Rainbow.fromColor( - styleArrow.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), - null);*/ + this.borderColor = borderColor; /* + * styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + * skinParam.getIHtmlColorSet()); + */ + this.backColor = backColor; + /* + * styleDiamond.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + * skinParam.getIHtmlColorSet()) + */; + this.arrowColor = arrowColor;/* + * Rainbow.fromColor( + * styleArrow.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + * skinParam.getIHtmlColorSet()), null); + */ this.fontTest = styleDiamond.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); } else { @@ -255,7 +261,10 @@ public class ConditionalBuilder { final Sheet sheet = Parser.build(fontTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL).createSheet(labelTest); final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, diamondLineBreak, skinParam.getPadding()); - final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), tile1.getThickness()); + + final UStroke thickness = tile1 + .getThickness(getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder())); + final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), thickness); final Ftile shape1; if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java index 939248473..1d5c3dfcf 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java @@ -46,10 +46,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; @@ -100,7 +100,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(color, usingArrow); + final Snake snake = Snake.create(skinParam(), color, usingArrow); snake.addPoint(x1, y1); snake.addPoint(x2, y1); snake.addPoint(x2, y2); @@ -147,14 +147,14 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { if (originalDirection != newDirection) { final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Hexagon.hexagonHalfSize; final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder); - final Snake small = Snake.create(color); + final Snake small = Snake.create(skinParam(), color); small.addPoint(p1); small.addPoint(p1.getX() + delta, p1.getY()); small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75); ug.draw(small); p1 = small.getLast(); } - final Snake snake = Snake.create(color, usingArrow).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), color, usingArrow).withMerge(MergeStrategy.LIMITED); snake.addPoint(p1); snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2); @@ -190,7 +190,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { final double y2 = p2.getY(); final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft(); - Snake snake = Snake.create(myArrowColor, arrow); + Snake snake = Snake.create(skinParam(), myArrowColor, arrow); if (branchEmpty) { snake = snake.emphasizeDirection(Direction.DOWN); } @@ -244,14 +244,14 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { if (originalDirection == newDirection) { final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY()); - final Snake snake = Snake.create(myArrowColor).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; snake.addPoint(mp1a); snake.addPoint(mp1a.getX(), middle); snake.addPoint(mp2bc.getX(), middle); snake.addPoint(mp2bc); ug.draw(snake); - final Snake small = Snake.create(myArrowColor, arrow).withMerge(MergeStrategy.LIMITED); + final Snake small = Snake.create(skinParam(), myArrowColor, arrow).withMerge(MergeStrategy.LIMITED); small.addPoint(mp2bc); small.addPoint(mp2bc.getX(), mp2b.getY()); small.addPoint(mp2b); @@ -260,12 +260,12 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize); - final Snake snake = Snake.create(myArrowColor).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED); snake.addPoint(mp1a); snake.addPoint(mp1a.getX(), mp2bb.getY()); snake.addPoint(mp2bb); ug.draw(snake); - final Snake small = Snake.create(myArrowColor, arrow).withMerge(MergeStrategy.LIMITED); + final Snake small = Snake.create(skinParam(), myArrowColor, arrow).withMerge(MergeStrategy.LIMITED); small.addPoint(mp2bb); small.addPoint(mp2bb.getX(), mp2b.getY()); small.addPoint(mp2b); @@ -303,7 +303,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - Snake snake = Snake.create(myArrowColor); + Snake snake = Snake.create(skinParam(), myArrowColor); if (branchEmpty) { snake = snake.emphasizeDirection(Direction.DOWN); } @@ -330,7 +330,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp2b = translate2.getTranslated(p2); - final Snake snake = Snake.create(myArrowColor).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED); // snake.emphasizeDirection(Direction.DOWN); final double x1 = mp1a.getX(); @@ -386,7 +386,8 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { } final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight); - final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment()); + final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()).withLabel(out2, + arrowHorizontalAlignment()); snake.addPoint(p1); snake.addPoint(p2); ug.draw(snake); @@ -444,7 +445,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds { return; } - final Snake s = Snake.create(arrowColor).withMerge(MergeStrategy.NONE); + final Snake s = Snake.create(skinParam(), arrowColor).withMerge(MergeStrategy.NONE); s.addPoint(minX, totalDim.getHeight()); s.addPoint(maxX, totalDim.getHeight()); ug.draw(s); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java index 19b993d76..82e387e86 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java @@ -86,7 +86,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown()) + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()) .withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment()); snake.addPoint(x1, y1); snake.addPoint(x2, y1); @@ -158,7 +158,8 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(arrowColor, arrow).withLabel(outLabel, VerticalAlignment.CENTER); + final Snake snake = Snake.create(skinParam(), arrowColor, arrow).withLabel(outLabel, + VerticalAlignment.CENTER); snake.addPoint(x1, y1); if (direction == Direction.LEFT && x2 > x1 - 10) { snake.addPoint(x1, y2 - 8); @@ -199,7 +200,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown()) + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()) .withLabel(branch.getTextBlockPositive(), VerticalAlignment.CENTER); if (x2 < p1d.getX() - margin || x2 > p1b.getX() + margin) { snake.addPoint(x2, p1d.getY()); @@ -255,7 +256,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final double ym = (y1 + y2) / 2; - final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown()).withLabel(outLabel, + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(outLabel, VerticalAlignment.CENTER); if (x1 < p1d.getX() - margin || x1 > p1b.getX() + margin) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithOneLink.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithOneLink.java index 34e1e7d31..cd667b9c8 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithOneLink.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithOneLink.java @@ -80,7 +80,7 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown()) + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()) .withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment()); // snake.addPoint(x1, y1); snake.addPoint(x2, y1); @@ -115,7 +115,7 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds { final double x2 = p2.getX(); final double y2 = p2.getY(); - final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown()); + final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()); // snake.addPoint(x1, y1); snake.addPoint(x2, y1); snake.addPoint(x2, y2); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java index 7e113cb27..59017338a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java @@ -99,11 +99,11 @@ public class FtileBox extends AbstractFtile { private final HColor backColor; private final Style style; - static public StyleSignature getDefaultStyleDefinitionActivity() { + static public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - static public StyleSignature getDefaultStyleDefinitionArrow() { + static public StyleSignature getStyleSignatureArrow() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @@ -144,9 +144,9 @@ public class FtileBox extends AbstractFtile { Style style = null; Style styleArrow = null; if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().with(stereotype) + style = getStyleSignature().with(stereotype) .getMergedStyle(skinParam.getCurrentStyleBuilder()); - styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); } return new FtileBox(skinParam, label, swimlane, boxStyle, style, styleArrow); } @@ -215,7 +215,7 @@ public class FtileBox extends AbstractFtile { if (UseStyle.useBetaStyle()) { thickness = style.getStroke(); } else { - thickness = getThickness(); + thickness = getThickness(style); } if (borderColor == null) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java index e4ab32bfb..5e6698652 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java @@ -219,7 +219,7 @@ public class FtileBox2 extends AbstractFtile { if (UseStyle.useBetaStyle()) { thickness = style.getStroke(); } else { - thickness = getThickness(); + thickness = getThickness(style); } if (borderColor == null) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java index fc7d9e43a..e4bb16d81 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java @@ -239,7 +239,7 @@ public class FtileBoxOld extends AbstractFtile { if (UseStyle.useBetaStyle()) { thickness = style.getStroke(); } else { - thickness = getThickness(); + thickness = getThickness(style); } if (borderColor == null) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java index c5baddb03..390ab624d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java @@ -43,12 +43,15 @@ import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamUtils; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.style.PName; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UFont; @@ -64,13 +67,19 @@ public class FtileCircleSpot extends AbstractFtile { private final String spot; private final FontConfiguration fc; private final HColor backColor; + private final Style style; - public FtileCircleSpot(ISkinParam skinParam, Swimlane swimlane, String spot, UFont font, HColor backColor) { + public FtileCircleSpot(ISkinParam skinParam, Swimlane swimlane, String spot, UFont font, HColor backColor, + Style style) { super(skinParam); + this.style = style; this.spot = spot; this.swimlane = swimlane; this.backColor = backColor; - this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + if (UseStyle.useBetaStyle()) + this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + else + this.fc = new FontConfiguration(skinParam, style); } @Override @@ -94,17 +103,30 @@ public class FtileCircleSpot extends AbstractFtile { } public void drawU(UGraphic ug) { - - final HColor borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); - final HColor backColor = this.backColor == null ? SkinParamUtils.getColor(skinParam(), null, - ColorParam.activityBackground) : this.backColor; - final UEllipse circle = new UEllipse(SIZE, SIZE); - if (skinParam().shadowing(null)) { - circle.setDeltaShadow(3); + + final HColor borderColor; + final HColor backColor; + double shadow = 0; + + if (UseStyle.useBetaStyle()) { + backColor = this.backColor == null + ? style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()) + : this.backColor; + borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()); + shadow = style.value(PName.Shadowing).asDouble(); + } else { + borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); + backColor = this.backColor == null + ? SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground) + : this.backColor; + + if (skinParam().shadowing(null)) + shadow = 3; } - ug.apply(borderColor).apply(backColor.bg()).apply(getThickness()) - .draw(circle); + + circle.setDeltaShadow(shadow); + ug.apply(borderColor).apply(backColor.bg()).apply(getThickness(style)).draw(circle); ug.apply(fc.getColor()).apply(new UTranslate(SIZE / 2, SIZE / 2)) .draw(new UCenteredCharacter(spot.charAt(0), fc.getFont())); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java index 3839c71b2..485ceac61 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java @@ -50,6 +50,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -67,71 +68,84 @@ public abstract class FtileDecorate extends AbstractTextBlock implements Ftile { return "" + getClass() + " " + ftile; } + @Override public LinkRendering getOutLinkRendering() { return ftile.getOutLinkRendering(); } + @Override public LinkRendering getInLinkRendering() { return ftile.getInLinkRendering(); } + @Override public void drawU(UGraphic ug) { ftile.drawU(ug); } + @Override public FtileGeometry calculateDimension(StringBounder stringBounder) { return ftile.calculateDimension(stringBounder); } + @Override public Collection getInnerConnections() { return ftile.getInnerConnections(); } + @Override public Set getSwimlanes() { return ftile.getSwimlanes(); } + @Override public Swimlane getSwimlaneIn() { return ftile.getSwimlaneIn(); } + @Override public Swimlane getSwimlaneOut() { return ftile.getSwimlaneOut(); } + @Override public ISkinParam skinParam() { return ftile.skinParam(); } - public UStroke getThickness() { - return ftile.getThickness(); + @Override + public UStroke getThickness(Style style) { + return ftile.getThickness(style); } protected final Ftile getFtileDelegated() { return ftile; } + @Override public List getWeldingPoints() { return ftile.getWeldingPoints(); } + @Override public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { - if (child == ftile) { + if (child == ftile) return new UTranslate(); - } + return ftile.getTranslateFor(child, stringBounder); } + @Override public Collection getMyChildren() { - if (this == ftile) { + if (this == ftile) throw new IllegalStateException(); - } + return Collections.singleton(ftile); } - + + @Override public HorizontalAlignment arrowHorizontalAlignment() { return ftile.arrowHorizontalAlignment(); } - } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java index dfefb03c8..e4579cf16 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java @@ -88,7 +88,7 @@ public class FtileDiamond extends FtileDiamondWIP { final double suppY1 = north.calculateDimension(ug.getStringBounder()).getHeight(); ug = ug.apply(UTranslate.dy(suppY1)); - ug.apply(borderColor).apply(getThickness()).apply(backColor.bg()).draw(Hexagon.asPolygon(shadowing)); + ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg()).draw(Hexagon.asPolygon(shadowing)); // final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder()); north.drawU(ug.apply(new UTranslate(Hexagon.hexagonHalfSize * 1.5, -suppY1))); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java index 3c4a0fab7..90a795bed 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java @@ -87,7 +87,7 @@ public class FtileDiamondInside extends FtileDiamondWIP { final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimTotal = calculateDimensionAlone(stringBounder); - ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg()); + ug = ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg()); ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight())); north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight()))); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java index 3f8d25a5e..f93018036 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java @@ -82,7 +82,7 @@ public class FtileDiamondInside2 extends FtileDiamondWIP { final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimTotal = calculateDimensionAlone(stringBounder); - ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg()); + ug = ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg()); ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight())); north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight()))); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java index df3d2577d..0b781325e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java @@ -87,7 +87,7 @@ public class FtileDiamondSquare extends FtileDiamondWIP { final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); - ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg()); + ug = ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg()); ug.draw(Hexagon.asPolygonSquare(shadowing, dimTotal.getWidth(), dimTotal.getHeight())); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java index d8a1d977c..e7dcecd7e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java @@ -67,9 +67,13 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable { protected final double shadowing; - final public StyleSignature getDefaultStyleDefinition() { + final public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } + + final public Style getStyle() { + return getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); + } @Override final public Collection getMyChildren() { @@ -80,7 +84,7 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable { Swimlane swimlane, TextBlock north, TextBlock south, TextBlock east, TextBlock west) { super(skinParam); if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); + Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.borderColor = borderColor; //style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.backColor = backColor; //style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.shadowing = style.value(PName.Shadowing).asDouble(); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java index 548ad88b6..bbc98fa7f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java @@ -91,6 +91,10 @@ public abstract class GAbstractConnection implements GConnection { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } + protected ISkinParam skinParam() { + throw new UnsupportedOperationException("wip"); + } + // DUPLICATE 4561 final protected Rainbow getInLinkRenderingColor() { Rainbow color; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java index f6a7fbefb..472755b9f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java @@ -84,7 +84,7 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection { // final Dimension2D dimDiamond1 = // diamond1.calculateDimension(ug.getStringBounder()); final Dimension2D dimDiamond1 = new Dimension2DDouble(0, 0); - final Snake small = Snake.create(getInLinkRenderingColor()).withLabel(textBlock, HorizontalAlignment.LEFT); + final Snake small = Snake.create(skinParam(), getInLinkRenderingColor()).withLabel(textBlock, HorizontalAlignment.LEFT); small.addPoint(p1); small.addPoint(p1.getX() + delta, p1.getY()); small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75); @@ -93,7 +93,7 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection { } UPolygon usingArrow = /* branch.isEmpty() ? null : */ Arrows.asToDown(); - final Snake snake = Snake.create(getInLinkRenderingColor(), usingArrow) + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), usingArrow) .withLabel(textBlock, HorizontalAlignment.LEFT).withMerge(MergeStrategy.LIMITED); snake.addPoint(p1); snake.addPoint(p2.getX(), p1.getY()); @@ -104,7 +104,7 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection { @Override public void drawU(UGraphic ug) { - final Snake snake = Snake.create(getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock, + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionSideThenVerticalThenSide.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionSideThenVerticalThenSide.java index 510466f87..970331808 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionSideThenVerticalThenSide.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionSideThenVerticalThenSide.java @@ -76,7 +76,7 @@ public class GConnectionSideThenVerticalThenSide extends GAbstractConnection { final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Direction direction = p1.getY() < p2.getY() ? Direction.DOWN : Direction.UP; final UPolygon tmp = p1.getX() < p2.getX() ? Arrows.asToRight() : Arrows.asToLeft(); - final Snake snake = Snake.create(getInLinkRenderingColor(), tmp).emphasizeDirection(direction) + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), tmp).emphasizeDirection(direction) .withLabel(textBlock, HorizontalAlignment.LEFT); // final double maxX = Math.max(p1.getX(), p2.getX()); final double maxX = xpos; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDown.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDown.java index 89a3ee357..ec79bb727 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDown.java @@ -61,7 +61,7 @@ public class GConnectionVerticalDown extends GAbstractConnection { @Override public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { - final Snake snake = Snake.create(getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock, + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); @@ -78,7 +78,7 @@ public class GConnectionVerticalDown extends GAbstractConnection { @Override public void drawU(UGraphic ug) { - final Snake snake = Snake.create(getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock, + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenBack.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenBack.java index 014178b6b..a81afca1a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenBack.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenBack.java @@ -68,7 +68,7 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection { final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final UPolygon arrow = Arrows.asToLeft(); - final Snake snake = Snake.create(getInLinkRenderingColor(), arrow) + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), arrow) .withLabel(textBlock, HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP); snake.addPoint(p1); @@ -94,7 +94,7 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection { p2 = translate2.getTranslated(p2); final UPolygon arrow = Arrows.asToLeft(); - final Snake snake = Snake.create(getInLinkRenderingColor(), arrow) + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), arrow) .withLabel(textBlock, HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP); snake.addPoint(p1); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenHorizontal.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenHorizontal.java index bc3a3d34c..84505b07a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenHorizontal.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionVerticalDownThenHorizontal.java @@ -82,14 +82,14 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection { if (originalDirection == newDirection) { final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY()); - final Snake snake = Snake.create(getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED); final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; snake.addPoint(mp1a); snake.addPoint(mp1a.getX(), middle); snake.addPoint(mp2bc.getX(), middle); snake.addPoint(mp2bc); ug.draw(snake); - final Snake small = Snake.create(getInLinkRenderingColor(), arrow).withMerge(MergeStrategy.LIMITED); + final Snake small = Snake.create(skinParam(), getInLinkRenderingColor(), arrow).withMerge(MergeStrategy.LIMITED); small.addPoint(mp2bc); small.addPoint(mp2bc.getX(), mp2b.getY()); small.addPoint(mp2b); @@ -97,12 +97,12 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection { } else { final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize); - final Snake snake = Snake.create(getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED); + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED); snake.addPoint(mp1a); snake.addPoint(mp1a.getX(), mp2bb.getY()); snake.addPoint(mp2bb); ug.draw(snake); - final Snake small = Snake.create(getInLinkRenderingColor(), arrow).withMerge(MergeStrategy.LIMITED); + final Snake small = Snake.create(skinParam(), getInLinkRenderingColor(), arrow).withMerge(MergeStrategy.LIMITED); small.addPoint(mp2bb); small.addPoint(mp2bb.getX(), mp2b.getY()); small.addPoint(mp2b); @@ -117,7 +117,7 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection { final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final UPolygon arrow = p1.getX() < p2.getX() ? Arrows.asToRight() : Arrows.asToLeft(); - final Snake snake = Snake.create(getInLinkRenderingColor(), arrow).withLabel(textBlock, + final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), arrow).withLabel(textBlock, HorizontalAlignment.LEFT); snake.addPoint(p1); snake.addPoint(new Point2D.Double(p1.getX(), p2.getY())); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java index 4cf1502e6..00289a975 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java @@ -126,7 +126,7 @@ public class GtileGroup extends AbstractGtileRoot { if (Display.isNull(displayNote)) { this.headerNote = TextBlockUtils.empty(0, 0); } else { - this.headerNote = new FloatingNote(displayNote, skinParam, style); + this.headerNote = new FloatingNote(displayNote, skinParam); } final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java index 0d7bb1c97..e025609bd 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java @@ -86,15 +86,15 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea private final Dimension2D dimNote; private final Dimension2D dimTile; - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); } - + @Override public Swimlane getSwimlane(String point) { return tile.getSwimlane(point); } - + @Override public Set getSwimlanes() { return tile.getSwimlanes(); @@ -105,12 +105,11 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea this.swimlaneNote = note.getSwimlaneNote(); if (note.getColors() != null) skinParam = note.getColors().mute(skinParam); - + this.tile = tile; this.notePosition = note.getNotePosition(); if (note.getType() == NoteType.FLOATING_NOTE) withLink = false; - final Rose rose = new Rose(); @@ -120,8 +119,9 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea final double shadowing; final LineBreakStrategy wrapWidth; + UStroke stroke = new UStroke(); if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) .eventuallyOverride(note.getColors()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); @@ -129,6 +129,7 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); shadowing = style.value(PName.Shadowing).asDouble(); wrapWidth = style.wrapWidth(); + stroke = style.getStroke(); } else { noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); @@ -142,7 +143,7 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea final Sheet sheet = Parser.build(fc, align, skinParam, CreoleMode.FULL).createSheet(note.getDisplay()); final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, new UStroke(1)); - this.opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, withLink); + this.opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, withLink, stroke); this.dimNote = opale.calculateDimension(stringBounder); this.dimTile = tile.calculateDimension(stringBounder); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java index db4ae0a8d..f0ff92de7 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java @@ -118,6 +118,7 @@ public class GtileWithNotes extends AbstractGtile { final HColor borderColor; final FontConfiguration fc; final double shadowing; + UStroke stroke = new UStroke(); final LineBreakStrategy wrapWidth; if (UseStyle.useBetaStyle()) { @@ -129,6 +130,7 @@ public class GtileWithNotes extends AbstractGtile { fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); shadowing = style.value(PName.Shadowing).asDouble(); wrapWidth = style.wrapWidth(); + stroke = style.getStroke(); } else { noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); @@ -150,9 +152,9 @@ public class GtileWithNotes extends AbstractGtile { public double getEndingX(StringBounder stringBounder, double y) { return sheet1.getEndingX(stringBounder, y) + 15; } - }, new UStroke()); + }, stroke); - final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheet2, false); + final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheet2, false, stroke); final TextBlock opaleMarged = TextBlockUtils.withMargin(opale, 10, 10); if (note.getNotePosition() == NotePosition.LEFT) { if (left == null) { diff --git a/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java b/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java index 65ca48d06..45bc2a758 100644 --- a/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java +++ b/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java @@ -55,7 +55,7 @@ public abstract class AbstractComponentText implements Component { throw new UnsupportedOperationException(); } - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java b/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java index 91b97bab7..8babf6326 100644 --- a/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java +++ b/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java @@ -59,6 +59,8 @@ public class CreoleHorizontalLine extends AbstractAtom implements Atom { private final char style; private final ISkinSimple skinParam; + private final static double defaultThickness = 1; + public static CreoleHorizontalLine create(FontConfiguration fontConfiguration, String line, char style, ISkinSimple skinParam) { return new CreoleHorizontalLine(fontConfiguration, line, style, skinParam); @@ -73,10 +75,10 @@ public class CreoleHorizontalLine extends AbstractAtom implements Atom { private UHorizontalLine getHorizontalLine() { if (line.length() == 0) { - return UHorizontalLine.infinite(0, 0, style); + return UHorizontalLine.infinite(defaultThickness, 0, 0, style); } final TextBlock tb = getTitle(); - return UHorizontalLine.infinite(0, 0, tb, style); + return UHorizontalLine.infinite(defaultThickness, 0, 0, tb, style); } private TextBlock getTitle() { diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java b/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java index 75c91d50e..a5218d6eb 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java @@ -52,6 +52,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.skin.VisibilityModifier; +import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; public class BodierLikeClassOrObject implements Bodier { @@ -228,7 +229,7 @@ public class BodierLikeClassOrObject implements Bodier { } if (type == LeafType.OBJECT) { if (showFields == false) { - return new TextBlockLineBefore(TextBlockUtils.empty(0, 0)); + return new TextBlockLineBefore(style.value(PName.LineThickness).asDouble(), TextBlockUtils.empty(0, 0)); } return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), rawBodyWithoutHidden(), fontParam, skinParam, stereotype, leaf, style); diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java index aefc070a4..9ff867c1e 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java @@ -48,6 +48,7 @@ import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.legacy.CreoleParser; @@ -76,7 +77,8 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi BodyEnhanced1(HorizontalAlignment align, List rawBody, FontParam fontParam, ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { - super(align, new FontConfiguration(skinParam, fontParam, stereotype)); + super(align, UseStyle.useBetaStyle() == false ? new FontConfiguration(skinParam, fontParam, stereotype) + : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); this.style = style; this.rawBody2 = Display.create(rawBody); this.stereotype = stereotype; @@ -92,7 +94,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { super(align, style == null ? new FontConfiguration(skinParam, fontParam, stereotype) - : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet())); + : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); this.style = style; this.entity = entity; @@ -104,9 +106,9 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi this.inEllipse = fontParam == FontParam.USECASE; - if (inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString())) { + if (inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString())) display = display.add(""); - } + this.rawBody2 = display; } @@ -123,9 +125,9 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi @Override final protected TextBlock getArea(StringBounder stringBounder) { - if (area != null) { + if (area != null) return area; - } + urls.clear(); final List blocks = new ArrayList<>(); @@ -155,25 +157,25 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi display = Display.empty(); } else if (isTreeOrTable(s)) { final boolean isTable = CreoleParser.isTableLine(s); - if (display.size() > 0) { + if (display.size() > 0) blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), separator, title)); - } + separator = 0; title = null; display = Display.empty(); final List allTree = buildTreeOrTable(s, it); TextBlock bloc = Display.create(allTree).create7(fontParam.getFontConfiguration(skinParam), align, skinParam, CreoleMode.FULL); - if (isTable) { + if (isTable) bloc = TextBlockUtils.withMargin(bloc, 10, 10, 0, 5); - } + blocks.add(bloc); } else { display = display.add(cs); - if (cs instanceof Member && ((Member) cs).getUrl() != null) { + if (cs instanceof Member && ((Member) cs).getUrl() != null) urls.add(((Member) cs).getUrl()); - } + } } } @@ -184,15 +186,13 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), separator, title)); - if (blocks.size() == 1) { + if (blocks.size() == 1) this.area = blocks.get(0); - } else { + else this.area = new TextBlockVertical2(blocks, align); - } - if (skinParam.minClassWidth() > 0) { + if (skinParam.minClassWidth() > 0) this.area = TextBlockUtils.withMinWidth(this.area, skinParam.minClassWidth(), align); - } return area; } @@ -202,9 +202,9 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi final Pattern p = Pattern.compile("^(\\s+)"); final Matcher m = p.matcher(init); String start = ""; - if (m.find()) { + if (m.find()) start = m.group(1); - } + result.add(purge(init, start)); while (it.hasNext()) { String s = it.next().toString(); @@ -220,18 +220,18 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi } private static String purge(String s, String start) { - if (s.startsWith(start)) { + if (s.startsWith(start)) return s.substring(start.length()); - } + return s; } @Override public Ports getPorts(StringBounder stringBounder) { final TextBlock area = getArea(stringBounder); - if (area instanceof WithPorts) { + if (area instanceof WithPorts) return ((WithPorts) area).getPorts(stringBounder); - } + return new Ports(); } diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java index 4d6e24b17..b98dd774d 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java @@ -48,6 +48,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockVertical2; +import net.sourceforge.plantuml.style.Style; public class BodyEnhanced2 extends BodyEnhancedAbstract { @@ -57,8 +58,8 @@ public class BodyEnhanced2 extends BodyEnhancedAbstract { private final LineBreakStrategy lineBreakStrategy; BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple skinParam, HorizontalAlignment align, - FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy) { - super(align, titleConfig); + FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) { + super(align, titleConfig, style); this.rawBody = rawBody; this.lineBreakStrategy = lineBreakStrategy; this.skinParam = skinParam; diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java index 419145d31..4a36925ca 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java @@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.StringUtils; +import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -46,6 +47,8 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockUtils; +import net.sourceforge.plantuml.style.PName; +import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.ugraphic.UGraphic; public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements TextBlock { @@ -53,10 +56,12 @@ public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements protected final HorizontalAlignment align; protected final FontConfiguration titleConfig; protected TextBlock area; + private final Style style; - BodyEnhancedAbstract(HorizontalAlignment align, FontConfiguration titleConfig) { + BodyEnhancedAbstract(HorizontalAlignment align, FontConfiguration titleConfig, Style style) { this.align = align; this.titleConfig = titleConfig; + this.style = style; } public static boolean isBlockSeparator(CharSequence cs) { @@ -85,9 +90,9 @@ public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements } final protected TextBlock getTitle(String s, ISkinSimple spriteContainer) { - if (s.length() <= 4) { + if (s.length() <= 4) return null; - } + s = StringUtils.trin(s.substring(2, s.length() - 2)); return Display.getWithNewlines(s).create(titleConfig, HorizontalAlignment.LEFT, spriteContainer); } @@ -98,16 +103,22 @@ public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements final protected TextBlock decorate(StringBounder stringBounder, TextBlock b, char separator, TextBlock title) { final double marginX = getMarginX(); - if (separator == 0) { + if (separator == 0) return TextBlockUtils.withMargin(b, marginX, 0); - } - if (title == null) { - return new TextBlockLineBefore(TextBlockUtils.withMargin(b, marginX, 4), separator); - } + + if (title == null) + return new TextBlockLineBefore(getDefaultThickness(), TextBlockUtils.withMargin(b, marginX, 4), separator); + final Dimension2D dimTitle = title.calculateDimension(stringBounder); - final TextBlock raw = new TextBlockLineBefore( + final TextBlock raw = new TextBlockLineBefore(getDefaultThickness(), TextBlockUtils.withMargin(b, marginX, 6, dimTitle.getHeight() / 2, 4), separator, title); return TextBlockUtils.withMargin(raw, 0, 0, dimTitle.getHeight() / 2, 0); } + final protected double getDefaultThickness() { + if (UseStyle.useBetaStyle()) + return style.value(PName.LineThickness).asDouble(); + return 1.5; + } + } diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java b/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java index 8a0cfe046..8513efc4f 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java @@ -74,8 +74,9 @@ public class BodyFactory { } public static TextBlock create3(Display rawBody, FontParam fontParam, ISkinSimple skinParam, - HorizontalAlignment align, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy) { - return new BodyEnhanced2(rawBody, fontParam, skinParam, align, titleConfig, lineBreakStrategy); + HorizontalAlignment align, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, + Style style) { + return new BodyEnhanced2(rawBody, fontParam, skinParam, align, titleConfig, lineBreakStrategy, style); } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java index e7ab06ade..e8c94f441 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java +++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java @@ -56,13 +56,10 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockWithUrl; -import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; -import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.Ports; import net.sourceforge.plantuml.svek.WithPorts; import net.sourceforge.plantuml.ugraphic.PlacementStrategy; @@ -73,13 +70,13 @@ import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2Right; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULayoutGroup; import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.utils.CharHidder; public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, WithPorts { public TextBlock asBlockMemberImpl() { - return new TextBlockLineBefore(TextBlockUtils.withMargin(this, 6, 4)); + return new TextBlockLineBefore(style.value(PName.LineThickness).asDouble(), + TextBlockUtils.withMargin(this, 6, 4)); } private final FontParam fontParam; diff --git a/src/net/sourceforge/plantuml/graphic/Rainbow.java b/src/net/sourceforge/plantuml/graphic/Rainbow.java index 8dc5f93dc..1267c751b 100644 --- a/src/net/sourceforge/plantuml/graphic/Rainbow.java +++ b/src/net/sourceforge/plantuml/graphic/Rainbow.java @@ -78,6 +78,7 @@ public class Rainbow { return Rainbow.build(new HtmlColorAndStyle(arrowColor, arrowHeadColor)); } + @Deprecated public static Rainbow build(ISkinParam skinParam) { if (UseStyle.useBetaStyle()) { throw new IllegalStateException(); diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java index 9c5fa695c..47f6e4b92 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java @@ -51,19 +51,21 @@ public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock, private final TextBlock textBlock; private final char separator; private final TextBlock title; + private final double defaultThickness; - public TextBlockLineBefore(TextBlock textBlock, char separator, TextBlock title) { + public TextBlockLineBefore(double defaultThickness, TextBlock textBlock, char separator, TextBlock title) { this.textBlock = textBlock; this.separator = separator; this.title = title; + this.defaultThickness = defaultThickness; } - public TextBlockLineBefore(TextBlock textBlock, char separator) { - this(textBlock, separator, null); + public TextBlockLineBefore(double defaultThickness, TextBlock textBlock, char separator) { + this(defaultThickness, textBlock, separator, null); } - public TextBlockLineBefore(TextBlock textBlock) { - this(textBlock, '\0'); + public TextBlockLineBefore(double defaultThickness, TextBlock textBlock) { + this(defaultThickness, textBlock, '\0'); } public Dimension2D calculateDimension(StringBounder stringBounder) { @@ -77,18 +79,18 @@ public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock, public void drawU(UGraphic ug) { final HColor color = ug.getParam().getColor(); - if (title == null) { - UHorizontalLine.infinite(1, 1, separator).drawMe(ug); - } + if (title == null) + UHorizontalLine.infinite(defaultThickness, 1, 1, separator).drawMe(ug); + textBlock.drawU(ug); - if (color == null) { + if (color == null) ug = ug.apply(new HColorNone()); - } else { + else ug = ug.apply(color); - } - if (title != null) { - UHorizontalLine.infinite(1, 1, title, separator).drawMe(ug); - } + + if (title != null) + UHorizontalLine.infinite(defaultThickness, 1, 1, title, separator).drawMe(ug); + } @Override diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java index 71f3f227c..0514b2240 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java @@ -102,10 +102,10 @@ public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, final Dimension2D dimb = block.calculateDimension(ug.getStringBounder()); if (block instanceof TextBlockBackcolored) { final HColor back = ((TextBlockBackcolored) block).getBackcolor(); - if (back != null) { + if (back != null) ug.apply(UTranslate.dy(y)).apply(back).apply(back.bg()) .draw(new URectangle(dimtotal.getWidth(), dimb.getHeight())); - } + } if (horizontalAlignment == HorizontalAlignment.LEFT) { block.drawU(ug.apply(UTranslate.dy(y))); diff --git a/src/net/sourceforge/plantuml/posimo/Frame.java b/src/net/sourceforge/plantuml/posimo/Frame.java index a334dfd05..282a4a504 100644 --- a/src/net/sourceforge/plantuml/posimo/Frame.java +++ b/src/net/sourceforge/plantuml/posimo/Frame.java @@ -65,7 +65,7 @@ public class Frame implements Component { throw new UnsupportedOperationException(); } - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java index 466493b5e..cb7f6e19f 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java @@ -223,7 +223,7 @@ public class TaskDrawRegular extends AbstractTaskDraw { final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getColorSet()); final double shadowing = style.value(PName.Shadowing).asDouble(); - return new Opale(shadowing, borderColor, noteBackgroundColor, sheet1, false); + return new Opale(shadowing, borderColor, noteBackgroundColor, sheet1, false, style.getStroke()); } public FingerPrint getFingerPrint(StringBounder stringBounder) { diff --git a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java index 74f3973e1..b41515d9a 100644 --- a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java +++ b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java @@ -133,7 +133,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { public void drawU(UGraphic ug) { if (minMax != null) { - // Matches the adjustment in SvekResult.calculateDimension() except no need to adjust for minY because + // Matches the adjustment in SvekResult.calculateDimension() except no need to + // adjust for minY because // mirroring takes care of that ug = ug.apply(new UTranslate(6 - minMax.getMinX(), 6)); } @@ -158,8 +159,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { continue; } final ST_Agedge_s edge = ent.getValue(); - new SmetanaPath(link, edge, ymirror, diagram, getLabel(link), getQualifier(link, 1), getQualifier(link, 2)) - .drawU(ug); + new SmetanaPath(link, edge, ymirror, diagram, getLabel(link), getQualifier(link, 1), + getQualifier(link, 2)).drawU(ug); } } @@ -221,7 +222,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { // ug.apply(new UTranslate(llx, lly)).apply(new // UChangeColor(HtmlColorUtils.BLUE)) // .draw(new URectangle(urx - llx, ury - lly)); - cluster.drawU(ug, new UStroke(1.5), diagram.getUmlDiagramType(), diagram.getSkinParam()); + cluster.drawU(ug, diagram.getUmlDiagramType(), diagram.getSkinParam()); } catch (Exception e) { System.err.println("CANNOT DRAW GROUP"); } @@ -324,7 +325,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { throw new IllegalStateException(); } final IEntityImage image = printEntityInternal(ent); - final SvekNode node = getBibliotekon().createNode(ent, image, dotStringFactory.getColorSequence(), stringBounder); + final SvekNode node = getBibliotekon().createNode(ent, image, dotStringFactory.getColorSequence(), + stringBounder); dotStringFactory.addNode(node); } @@ -449,9 +451,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { // imageBuilder.setUDrawable(new Drawing(new YMirror(dim.getHeight()))); final TextBlock drawable = new Drawing(new YMirror(minMax.getMaxY()), minMax); - return diagram.createImageBuilder(fileFormatOption) - .drawable(drawable) - .write(os); + return diagram.createImageBuilder(fileFormatOption).drawable(drawable).write(os); } catch (Throwable e) { SmetanaDebug.printMe(); UmlDiagram.exportDiagramError(os, e, fileFormatOption, diagram.seed(), diagram.getMetadata(), @@ -620,7 +620,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { return; } final IEntityImage image = printEntityInternal(ent); - final SvekNode shape = getBibliotekon().createNode(ent, image, dotStringFactory.getColorSequence(), stringBounder); + final SvekNode shape = getBibliotekon().createNode(ent, image, dotStringFactory.getColorSequence(), + stringBounder); // dotStringFactory.addShape(shape); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java index a31464772..a71778778 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java +++ b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java @@ -54,14 +54,14 @@ import net.sourceforge.plantuml.style.WithStyle; public abstract class AbstractMessage implements EventWithDeactivate, WithStyle { public Style[] getUsedStyles() { - Style style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); + Style style = getStyleSignature().getMergedStyle(styleBuilder); if (style != null && arrowConfiguration.getColor() != null) { style = style.eventuallyOverride(PName.LineColor, arrowConfiguration.getColor()); } return new Style[] { style }; } - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/Delay.java b/src/net/sourceforge/plantuml/sequencediagram/Delay.java index ea9f4d419..c020a1beb 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Delay.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Delay.java @@ -48,8 +48,8 @@ public class Delay extends AbstractEvent implements Event, WithStyle { final private Style style; - public StyleSignature getDefaultStyleDefinition() { - return ComponentType.DELAY_TEXT.getDefaultStyleDefinition(); + public StyleSignature getStyleSignature() { + return ComponentType.DELAY_TEXT.getStyleSignature(); } public Style[] getUsedStyles() { @@ -58,7 +58,7 @@ public class Delay extends AbstractEvent implements Event, WithStyle { public Delay(Display text, StyleBuilder styleBuilder) { this.text = text; - this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); + this.style = getStyleSignature().getMergedStyle(styleBuilder); } public final Display getText() { diff --git a/src/net/sourceforge/plantuml/sequencediagram/Divider.java b/src/net/sourceforge/plantuml/sequencediagram/Divider.java index 67f8f85e3..26c79566f 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Divider.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Divider.java @@ -48,8 +48,8 @@ public class Divider extends AbstractEvent implements Event, WithStyle { final private Style style; - public StyleSignature getDefaultStyleDefinition() { - return ComponentType.DIVIDER.getDefaultStyleDefinition(); + public StyleSignature getStyleSignature() { + return ComponentType.DIVIDER.getStyleSignature(); } public Style[] getUsedStyles() { @@ -58,7 +58,7 @@ public class Divider extends AbstractEvent implements Event, WithStyle { public Divider(Display text, StyleBuilder styleBuilder) { this.text = text; - this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); + this.style = getStyleSignature().getMergedStyle(styleBuilder); } public final Display getText() { diff --git a/src/net/sourceforge/plantuml/sequencediagram/Doll.java b/src/net/sourceforge/plantuml/sequencediagram/Doll.java index b47548e5e..110531771 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Doll.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Doll.java @@ -94,12 +94,12 @@ public class Doll implements WithStyle { } - final public StyleSignature getDefaultStyleDefinition() { - return ComponentType.ENGLOBER.getDefaultStyleDefinition(); + final public StyleSignature getStyleSignature() { + return ComponentType.ENGLOBER.getStyleSignature(); } final public Style[] getUsedStyles() { - Style tmp = getDefaultStyleDefinition().with(englober.getStereotype()).getMergedStyle(styleBuilder); + Style tmp = getStyleSignature().with(englober.getStereotype()).getMergedStyle(styleBuilder); final HColor backColor = englober.getBoxColor(); if (tmp != null) tmp = tmp.eventuallyOverride(PName.BackGroundColor, backColor); diff --git a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java index e4a0447e5..7c0cad09d 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java @@ -55,7 +55,7 @@ public abstract class Grouping implements Event, WithStyle { final private Style style; final private Style styleHeader; - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.group); } @@ -76,7 +76,7 @@ public abstract class Grouping implements Event, WithStyle { this.comment = comment; this.type = type; this.backColorElement = backColorElement; - this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); + this.style = getStyleSignature().getMergedStyle(styleBuilder); this.styleHeader = getHeaderStyleDefinition().getMergedStyle(styleBuilder); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java index fa18c2ca6..5bf9490b6 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java +++ b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java @@ -112,7 +112,7 @@ public class LinkAnchor { final Display display = Display.getWithNewlines(message); final TextBlock title = display.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam); - final Snake snake = Snake.create(Arrows.asToUp(), rainbow, Arrows.asToDown()).withLabel(title, + final Snake snake = Snake.create(skinParam, Arrows.asToUp(), rainbow, Arrows.asToDown()).withLabel(title, HorizontalAlignment.CENTER); snake.addPoint(x, ymin + 2); diff --git a/src/net/sourceforge/plantuml/sequencediagram/Note.java b/src/net/sourceforge/plantuml/sequencediagram/Note.java index d32c14076..c5fa1acbf 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Note.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Note.java @@ -72,7 +72,7 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo private Style style; - public StyleSignature getDefaultStyleDefinition() { + public StyleSignature getStyleSignature() { return noteStyle.getDefaultStyleDefinition(); } @@ -103,14 +103,14 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo this.position = position; this.strings = strings; if (UseStyle.useBetaStyle()) { - this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); + this.style = getStyleSignature().getMergedStyle(styleBuilder); } } public void setStereotype(Stereotype stereotype) { if (UseStyle.useBetaStyle()) { final List