1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-05-29 14:40:47 +00:00

Style improvement

This commit is contained in:
Arnaud Roques 2022-02-12 18:27:51 +01:00
parent 45e89d12a8
commit 2761d1e922
122 changed files with 1473 additions and 1067 deletions

View File

@ -1,4 +1,8 @@
root { root {
--common-background: #f1f1f1;
--note-background: #FEFFDD;
--grey-blue: #e2e2f0;
FontName SansSerif FontName SansSerif
HyperLinkColor blue HyperLinkColor blue
FontColor black FontColor black
@ -9,8 +13,8 @@ root {
DiagonalCorner 0 DiagonalCorner 0
LineThickness 1.0 LineThickness 1.0
LineColor #181818 LineColor #181818
BackGroundColor #f8f8f8 BackGroundColor: var(--common-background);
Shadowing 0.0 Shadowing: 0.0;
} }
document { document {
@ -73,7 +77,13 @@ element {
} }
} }
element {
LineThickness 0.5
}
group { group {
BackGroundColor transparent
LineThickness 1.0
package { package {
LineThickness 1.5 LineThickness 1.5
LineColor black LineColor black
@ -84,38 +94,32 @@ group {
} }
} }
group {
BackGroundColor transparent
}
sequenceDiagram { sequenceDiagram {
group { group {
LineColor black LineColor black
LineThickness 2.0 LineThickness 1.5
FontSize 11 FontSize 11
FontStyle bold FontStyle bold
}
groupHeader {
BackGroundColor #e
LineColor black
FontSize 13
FontStyle bold
}
lifeLine {
BackGroundColor white
LineStyle 5
}
destroy {
} }
groupHeader {
LineThickness 1.5
BackGroundColor #e
LineColor black
FontSize 13
FontStyle bold
}
lifeLine {
BackGroundColor white
LineStyle 5
}
reference { reference {
FontSize 12 FontSize 12
LineColor black LineColor black
BackGroundColor transparent BackGroundColor transparent
LineThickness 2.0 LineThickness 1.5
HorizontalAlignment center HorizontalAlignment center
} }
@ -143,9 +147,20 @@ sequenceDiagram {
FontSize 13 FontSize 13
FontStyle bold 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 { visibilityIcon {
@ -202,6 +217,9 @@ stateDiagram {
FontStyle plain FontStyle plain
} }
} }
group {
LineThickness 0.5
}
} }
@ -211,59 +229,24 @@ delay {
HorizontalAlignment center 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 { swimlane {
BackGroundColor none BackGroundColor none
LineColor black LineColor black
LineThickness 2 LineThickness 1.5
FontSize 18 FontSize 18
} }
arrow { arrow {
FontSize 13 FontSize 13
LineThickness 1.0
} }
note { note {
FontSize 13 FontSize 13
BackGroundColor #ebebeb BackGroundColor: var(--note-background);
LineThickness 0.5
} }
partition { partition {
@ -298,7 +281,6 @@ wbsDiagram {
activityDiagram { activityDiagram {
activity { activity {
LineThickness 1.5
Padding 10 Padding 10
FontSize 12 FontSize 12
RoundCorner 25 RoundCorner 25
@ -306,12 +288,14 @@ activityDiagram {
partition { partition {
LineColor black LineColor black
BackgroundColor none BackgroundColor none
LineThickness 1.5
} }
diamond { diamond {
FontSize 11 FontSize 11
} }
arrow { arrow {
FontSize 11 FontSize 11
LineThickness 1
} }
circle { circle {
start { start {
@ -362,10 +346,11 @@ ganttDiagram {
LineColor #C0C0C0 LineColor #C0C0C0
} }
closed { closed {
BackGroundColor #E0E0E0 BackGroundColor #F1E5E5
FontColor #989898 FontColor #989898
} }
task { task {
BackGroundColor: var(--grey-blue);
RoundCorner 0 RoundCorner 0
Margin 2 2 2 2 Margin 2 2 2 2
Padding 0 Padding 0
@ -385,7 +370,6 @@ usecase {
} }
yamlDiagram,jsonDiagram { yamlDiagram,jsonDiagram {
BackGroundColor white
FontColor black FontColor black
LineColor black LineColor black
arrow { arrow {
@ -412,10 +396,13 @@ timingDiagram {
LineColor #3 LineColor #3
FontColor #3 FontColor #3
FontStyle bold FontStyle bold
LineThickness 1.5 LineThickness 0.5
timeline { timeline {
FontStyle plain FontStyle plain
FontSize 11 FontSize 11
}
note {
LineThickness 0.5
} }
arrow { arrow {
LineColor darkblue LineColor darkblue
@ -430,18 +417,20 @@ timingDiagram {
} }
clock { clock {
LineColor darkgreen LineColor darkgreen
LineThickness 1.5
} }
concise { concise {
FontSize 12 FontSize 12
LineColor darkgreen LineColor darkgreen
BackgroundColor #c BackgroundColor: var(--grey-blue);
LineThickness 2
} }
robust { robust {
FontStyle plain FontStyle plain
FontSize 12 FontSize 12
LineColor darkgreen LineColor darkgreen
LineThickness 2 LineThickness 2
BackgroundColor #c BackgroundColor: var(--grey-blue);
} }
highlight { highlight {
BackgroundColor #e BackgroundColor #e
@ -452,6 +441,7 @@ timingDiagram {
nwdiagDiagram { nwdiagDiagram {
network { network {
BackgroundColor: var(--grey-blue);
FontSize 12 FontSize 12
} }
server { server {
@ -459,7 +449,7 @@ nwdiagDiagram {
} }
group { group {
FontSize 12 FontSize 12
BackGroundColor #d BackGroundColor #e7e7e7
} }
arrow { arrow {
FontSize 11 FontSize 11
@ -638,7 +628,6 @@ ganttDiagram {
yamlDiagram,jsonDiagram { yamlDiagram,jsonDiagram {
BackGroundColor black
FontColor white FontColor white
LineColor white LineColor white
node { node {

View File

@ -231,8 +231,8 @@ public final class BitArray {
private static int[] makeArray(int size) { private static int[] makeArray(int size) {
final int tmp = (size + 31) >> 5; final int tmp = (size + 31) >> 5;
if (tmp>1000) if (tmp > 1000)
throw new IllegalArgumentException("Memory error"); throw new IllegalArgumentException("Not even an issue :-) We just cancel flashcode generation.");
return new int[tmp]; return new int[tmp];
} }

View File

@ -42,10 +42,12 @@ import java.util.List;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -86,7 +88,10 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
throw new UnsupportedOperationException("" + getClass()); 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); UStroke thickness = skinParam.getThickness(LineParam.activityBorder, null);
if (thickness == null) { if (thickness == null) {
thickness = new UStroke(1.5); thickness = new UStroke(1.5);

View File

@ -43,12 +43,13 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
public interface Ftile extends Swimable, TextBlock { public interface Ftile extends Swimable, TextBlock {
public UStroke getThickness(); public UStroke getThickness(Style style);
public ISkinParam skinParam(); public ISkinParam skinParam();

View File

@ -51,6 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -146,6 +147,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
return Collections.emptyList(); return Collections.emptyList();
} }
@Override
public Set<Swimlane> getSwimlanes() { public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<>(); final Set<Swimlane> result = new HashSet<>();
result.addAll(tile1.getSwimlanes()); result.addAll(tile1.getSwimlanes());
@ -153,14 +155,17 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
return Collections.unmodifiableSet(result); return Collections.unmodifiableSet(result);
} }
@Override
public ISkinParam skinParam() { public ISkinParam skinParam() {
return tile1.skinParam(); return tile1.skinParam();
} }
public UStroke getThickness() { @Override
return tile1.getThickness(); public UStroke getThickness(Style style) {
return tile1.getThickness(style);
} }
@Override
public List<WeldingPoint> getWeldingPoints() { public List<WeldingPoint> getWeldingPoints() {
final List<WeldingPoint> result = new ArrayList<>(tile1.getWeldingPoints()); final List<WeldingPoint> result = new ArrayList<>(tile1.getWeldingPoints());
result.addAll(tile2.getWeldingPoints()); result.addAll(tile2.getWeldingPoints());
@ -171,6 +176,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
return Arrays.asList(tile1, tile2); return Arrays.asList(tile1, tile2);
} }
@Override
public HorizontalAlignment arrowHorizontalAlignment() { public HorizontalAlignment arrowHorizontalAlignment() {
return tile1.arrowHorizontalAlignment(); return tile1.arrowHorizontalAlignment();
} }

View File

@ -44,6 +44,7 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
import net.sourceforge.plantuml.graphic.Rainbow; 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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.VerticalAlignment; 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.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -85,6 +88,7 @@ public class Snake implements UShape {
private final List<Text> texts; private final List<Text> texts;
private final MergeStrategy mergeable; private final MergeStrategy mergeable;
private final Direction emphasizeDirection; private final Direction emphasizeDirection;
private final ISkinParam skinParam;
public Snake transformX(PiecewiseAffineTransform compressionTransform) { public Snake transformX(PiecewiseAffineTransform compressionTransform) {
final Snake result = cloneEmpty(); final Snake result = cloneEmpty();
@ -98,15 +102,15 @@ public class Snake implements UShape {
public Snake move(double dx, double dy) { public Snake move(double dx, double dy) {
final Snake result = cloneEmpty(); final Snake result = cloneEmpty();
for (Point2D pt : worm) { for (Point2D pt : worm)
result.addPoint(pt.getX() + dx, pt.getY() + dy); result.addPoint(pt.getX() + dx, pt.getY() + dy);
}
return result; return result;
} }
private Snake cloneEmpty() { private Snake cloneEmpty() {
return new Snake(startDecoration, color, endDecoration, worm.cloneEmpty(), mergeable, emphasizeDirection, return new Snake(skinParam, startDecoration, color, endDecoration, worm.cloneEmpty(), mergeable,
texts); emphasizeDirection, texts);
} }
public final Snake ignoreForCompression() { public final Snake ignoreForCompression() {
@ -115,53 +119,59 @@ public class Snake implements UShape {
} }
public Snake emphasizeDirection(Direction emphasizeDirection) { 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() { 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) { 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) { public Snake withLabel(TextBlock textBlock, HorizontalAlignment horizontalAlignment) {
if (textBlock != null) { if (textBlock != null)
this.texts.add(new Text(textBlock, null, horizontalAlignment)); this.texts.add(new Text(textBlock, null, horizontalAlignment));
}
return this; return this;
} }
public Snake withLabel(TextBlock textBlock, VerticalAlignment verticalAlignment) { 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)); this.texts.add(new Text(textBlock, verticalAlignment, null));
}
if (verticalAlignment != VerticalAlignment.CENTER) { if (verticalAlignment != VerticalAlignment.CENTER)
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
}
return this; return this;
} }
public static Snake create(Rainbow color) { public static Snake create(ISkinParam skinParam, Rainbow color) {
return new Snake(null, color, null, new Worm(), MergeStrategy.FULL, null, new ArrayList<Text>()); final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
} return new Snake(skinParam, null, color, null, new Worm(style), MergeStrategy.FULL, null,
public static Snake create(Rainbow color, UPolygon endDecoration) {
return new Snake(null, color, endDecoration, new Worm(), MergeStrategy.FULL, null, new ArrayList<Text>());
}
public static Snake create(UPolygon startDecoration, Rainbow color, UPolygon endDecoration) {
return new Snake(startDecoration, color, endDecoration, new Worm(), MergeStrategy.FULL, null,
new ArrayList<Text>()); new ArrayList<Text>());
} }
private Snake(UPolygon startDecoration, Rainbow color, UPolygon endDecoration, Worm worm, MergeStrategy mergeable, public static Snake create(ISkinParam skinParam, Rainbow color, UPolygon endDecoration) {
Direction emphasizeDirection, List<Text> texts) { final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
return new Snake(skinParam, null, color, endDecoration, new Worm(style), MergeStrategy.FULL, null,
new ArrayList<Text>());
}
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<Text>());
}
private Snake(ISkinParam skinParam, UPolygon startDecoration, Rainbow color, UPolygon endDecoration, Worm worm,
MergeStrategy mergeable, Direction emphasizeDirection, List<Text> texts) {
if (Objects.requireNonNull(color).size() == 0)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
this.skinParam = skinParam;
this.worm = worm; this.worm = worm;
this.texts = Objects.requireNonNull(texts); this.texts = Objects.requireNonNull(texts);
this.emphasizeDirection = emphasizeDirection; this.emphasizeDirection = emphasizeDirection;
@ -210,14 +220,14 @@ public class Snake implements UShape {
} }
final double globalMove = -1.0 * (colors.size() - 1) / 2.0; final double globalMove = -1.0 * (colors.size() - 1) / 2.0;
Worm current = worm.moveFirstPoint(mutation.getFirst().multiplyBy(globalMove)); Worm current = worm.moveFirstPoint(mutation.getFirst().multiplyBy(globalMove));
if (mutation.size() > 2) { if (mutation.size() > 2)
current = current.moveLastPoint(mutation.getLast().multiplyBy(globalMove)); current = current.moveLastPoint(mutation.getLast().multiplyBy(globalMove));
}
for (int i = 0; i < colors.size(); i++) { for (int i = 0; i < colors.size(); i++) {
double stroke = 1.5; double stroke = 1.5;
if (colorArrowSeparationSpace == 0) { if (colorArrowSeparationSpace == 0)
stroke = i == colors.size() - 1 ? 2.0 : 3.0; stroke = i == colors.size() - 1 ? 2.0 : 3.0;
}
current.drawInternalOneColor(startDecoration, ug, colors.get(i), stroke, emphasizeDirection, endDecoration); current.drawInternalOneColor(startDecoration, ug, colors.get(i), stroke, emphasizeDirection, endDecoration);
current = mutation.mute(current); current = mutation.mute(current);
} }
@ -235,9 +245,9 @@ public class Snake implements UShape {
public double getMaxX(StringBounder stringBounder) { public double getMaxX(StringBounder stringBounder) {
double result = -Double.MAX_VALUE; double result = -Double.MAX_VALUE;
for (Point2D pt : worm) { for (Point2D pt : worm)
result = Math.max(result, pt.getX()); result = Math.max(result, pt.getX());
}
for (Text text : texts) { for (Text text : texts) {
final Point2D position = getTextBlockPosition(stringBounder, text); final Point2D position = getTextBlockPosition(stringBounder, text);
final Dimension2D dim = text.textBlock.calculateDimension(stringBounder); final Dimension2D dim = text.textBlock.calculateDimension(stringBounder);
@ -302,14 +312,13 @@ public class Snake implements UShape {
public Snake merge(Snake other, StringBounder stringBounder) { public Snake merge(Snake other, StringBounder stringBounder) {
final MergeStrategy strategy = this.mergeable.max(other.mergeable); final MergeStrategy strategy = this.mergeable.max(other.mergeable);
if (strategy == MergeStrategy.NONE) { if (strategy == MergeStrategy.NONE)
return null; return null;
}
for (Text text : other.texts) { for (Text text : other.texts)
if (text.hasText(stringBounder)) { if (text.hasText(stringBounder))
return null; return null;
}
}
if (same(this.getLast(), other.getFirst())) { if (same(this.getLast(), other.getFirst())) {
final UPolygon oneOf = other.endDecoration == null ? endDecoration : other.endDecoration; final UPolygon oneOf = other.endDecoration == null ? endDecoration : other.endDecoration;
if (this.startDecoration != null || other.startDecoration != null) { if (this.startDecoration != null || other.startDecoration != null) {
@ -317,23 +326,23 @@ public class Snake implements UShape {
} }
final ArrayList<Text> mergeTexts = new ArrayList<Text>(this.texts); final ArrayList<Text> mergeTexts = new ArrayList<Text>(this.texts);
mergeTexts.addAll(other.texts); mergeTexts.addAll(other.texts);
final Snake result = new Snake(null, color, oneOf, this.worm.merge(other.worm, strategy), strategy, final Snake result = new Snake(skinParam, null, color, oneOf, this.worm.merge(other.worm, strategy),
emphasizeDirection == null ? other.emphasizeDirection : emphasizeDirection, mergeTexts); strategy, emphasizeDirection == null ? other.emphasizeDirection : emphasizeDirection, mergeTexts);
return result; return result;
} }
if (same(this.getFirst(), other.getLast())) { if (same(this.getFirst(), other.getLast()))
return other.merge(this, stringBounder); return other.merge(this, stringBounder);
}
return null; return null;
} }
public boolean touches(Snake other) { public boolean touches(Snake other) {
if (other.mergeable != MergeStrategy.FULL) { if (other.mergeable != MergeStrategy.FULL)
return false; return false;
}
if (other.worm.isPureHorizontal()) { if (other.worm.isPureHorizontal())
return false; return false;
}
return same(this.getLast(), other.getFirst()); return same(this.getLast(), other.getFirst());
} }

View File

@ -120,7 +120,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
return Collections.unmodifiableList(swimlanesSpecial); return Collections.unmodifiableList(swimlanesSpecial);
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.swimlane); 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() { protected Style getStyle() {
if (style == null) { if (style == null) {
this.style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
} }
return style; return style;
} }

View File

@ -45,8 +45,12 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.Direction; 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.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; 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.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
@ -59,6 +63,11 @@ import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
public class Worm implements Iterable<Point2D.Double> { public class Worm implements Iterable<Point2D.Double> {
private final List<Point2D.Double> points = new ArrayList<Point2D.Double>(); private final List<Point2D.Double> points = new ArrayList<Point2D.Double>();
private final Style style;
public Worm(Style style) {
this.style = style;
}
public boolean isPureHorizontal() { public boolean isPureHorizontal() {
return points.size() == 2 && points.get(0).getY() == points.get(1).getY(); return points.size() == 2 && points.get(0).getY() == points.get(1).getY();
@ -67,32 +76,37 @@ public class Worm implements Iterable<Point2D.Double> {
private boolean ignoreForCompression; private boolean ignoreForCompression;
public Worm cloneEmpty() { public Worm cloneEmpty() {
final Worm result = new Worm(); final Worm result = new Worm(style);
result.ignoreForCompression = this.ignoreForCompression; result.ignoreForCompression = this.ignoreForCompression;
return result; return result;
} }
public final void setIgnoreForCompression() { public final void setIgnoreForCompression() {
if (points.size() > 0) { if (points.size() > 0)
throw new IllegalStateException(); throw new IllegalStateException();
}
this.ignoreForCompression = true; this.ignoreForCompression = true;
} }
public void drawInternalOneColor(UPolygon startDecoration, UGraphic ug, HtmlColorAndStyle colorAndStyle, 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 HColor arrowColor = Objects.requireNonNull(colorAndStyle.getArrowColor());
final LinkStyle style = colorAndStyle.getStyle(); final LinkStyle linkStyle = colorAndStyle.getStyle();
if (style.isInvisible()) { if (linkStyle.isInvisible())
return; return;
}
ug = ug.apply(arrowColor); ug = ug.apply(arrowColor);
ug = ug.apply(arrowColor.bg()); ug = ug.apply(arrowColor.bg());
if (style.isNormal()) { if (linkStyle.isNormal()) {
ug = ug.apply(new UStroke(stroke)); UStroke stroke = new UStroke(strokeValue);
if (UseStyle.useBetaStyle()) {
stroke = style.getStroke();
}
ug = ug.apply(stroke);
} else { } else {
ug = ug.apply(style.goThickness(stroke).getStroke3()); ug = ug.apply(linkStyle.goThickness(strokeValue).getStroke3());
} }
boolean drawn = false; boolean drawn = false;
for (int i = 0; i < points.size() - 1; i++) { for (int i = 0; i < points.size() - 1; i++) {
final java.awt.geom.Point2D.Double p1 = points.get(i); final java.awt.geom.Point2D.Double p1 = points.get(i);
@ -107,9 +121,9 @@ public class Worm implements Iterable<Point2D.Double> {
} }
final HColor arrowHeadColor = colorAndStyle.getArrowHeadColor(); final HColor arrowHeadColor = colorAndStyle.getArrowHeadColor();
if (arrowHeadColor == null) { if (arrowHeadColor == null)
throw new IllegalStateException(); throw new IllegalStateException();
}
// if (arrowHeadColor == null || arrowHeadColor.equals(HColorUtils.transparent())) { // if (arrowHeadColor == null || arrowHeadColor.equals(HColorUtils.transparent())) {
// return; // return;
// } // }
@ -119,17 +133,17 @@ public class Worm implements Iterable<Point2D.Double> {
if (startDecoration != null) { if (startDecoration != null) {
ug = ug.apply(new UStroke(1.5)); ug = ug.apply(new UStroke(1.5));
final Point2D start = points.get(0); final Point2D start = points.get(0);
if (ignoreForCompression) { if (ignoreForCompression)
startDecoration.setCompressionMode(CompressionMode.ON_X); startDecoration.setCompressionMode(CompressionMode.ON_X);
}
ug.apply(new UTranslate(start)).apply(new UStroke()).draw(startDecoration); ug.apply(new UTranslate(start)).apply(new UStroke()).draw(startDecoration);
} }
if (endDecoration != null) { if (endDecoration != null) {
ug = ug.apply(new UStroke(1.5)); ug = ug.apply(new UStroke(1.5));
final Point2D end = points.get(points.size() - 1); final Point2D end = points.get(points.size() - 1);
if (ignoreForCompression) { if (ignoreForCompression)
endDecoration.setCompressionMode(CompressionMode.ON_X); endDecoration.setCompressionMode(CompressionMode.ON_X);
}
ug.apply(new UTranslate(end)).apply(new UStroke()).draw(endDecoration); ug.apply(new UTranslate(end)).apply(new UStroke()).draw(endDecoration);
} }
} }
@ -140,73 +154,73 @@ public class Worm implements Iterable<Point2D.Double> {
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2, Direction direction) { private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2, Direction direction) {
ug = ug.apply(new UTranslate(x1, y1)); 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.apply(new UTranslate((x2 - x1) / 2, (y2 - y1) / 2)).draw(Arrows.asTo(direction));
}
ug.draw(new ULine(x2 - x1, y2 - y1)); ug.draw(new ULine(x2 - x1, y2 - y1));
} }
public Worm move(double dx, double dy) { public Worm move(double dx, double dy) {
final Worm result = new Worm(); final Worm result = new Worm(style);
for (Point2D pt : points) { for (Point2D pt : points)
result.addPoint(pt.getX() + dx, pt.getY() + dy); result.addPoint(pt.getX() + dx, pt.getY() + dy);
}
return result; return result;
} }
public Worm moveFirstPoint(UTranslate move) { public Worm moveFirstPoint(UTranslate move) {
final double dx = move.getDx(); final double dx = move.getDx();
final double dy = move.getDy(); final double dy = move.getDy();
if (dx != 0 && dy != 0) { if (dx != 0 && dy != 0)
throw new IllegalArgumentException("move=" + move); throw new IllegalArgumentException("move=" + move);
}
final Worm result = new Worm(); final Worm result = new Worm(style);
double x0 = this.points.get(0).getX(); double x0 = this.points.get(0).getX();
double y0 = this.points.get(0).getY(); double y0 = this.points.get(0).getY();
double x1 = this.points.get(1).getX(); double x1 = this.points.get(1).getX();
double y1 = this.points.get(1).getY(); double y1 = this.points.get(1).getY();
if (dx != 0 && x0 == x1) { if (dx != 0 && x0 == x1)
x1 += dx; x1 += dx;
}
if (dy != 0 && y0 == y1) { if (dy != 0 && y0 == y1)
y1 += dy; y1 += dy;
}
x0 += dx; x0 += dx;
y0 += dy; y0 += dy;
result.addPoint(x0, y0); result.addPoint(x0, y0);
result.addPoint(x1, y1); 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)); result.addPoint(this.points.get(i));
}
return result; return result;
} }
public Worm moveLastPoint(UTranslate move) { public Worm moveLastPoint(UTranslate move) {
final double dx = move.getDx(); final double dx = move.getDx();
final double dy = move.getDy(); final double dy = move.getDy();
if (dx != 0 && dy != 0) { if (dx != 0 && dy != 0)
throw new IllegalArgumentException("move=" + move); 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 x8 = this.points.get(this.points.size() - 2).getX();
double y8 = this.points.get(this.points.size() - 2).getY(); double y8 = this.points.get(this.points.size() - 2).getY();
double x9 = this.points.get(this.points.size() - 1).getX(); double x9 = this.points.get(this.points.size() - 1).getX();
double y9 = this.points.get(this.points.size() - 1).getY(); double y9 = this.points.get(this.points.size() - 1).getY();
if (dx != 0 && x8 == x9) { if (dx != 0 && x8 == x9)
x8 += dx; x8 += dx;
}
if (dy != 0 && y8 == y9) { if (dy != 0 && y8 == y9)
y8 += dy; y8 += dy;
}
x9 += dx; x9 += dx;
y9 += dy; 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(this.points.get(i));
}
result.addPoint(x8, y8); result.addPoint(x8, y8);
result.addPoint(x9, y9); result.addPoint(x9, y9);
return result; return result;
@ -215,24 +229,24 @@ public class Worm implements Iterable<Point2D.Double> {
@Override @Override
public String toString() { public String toString() {
final StringBuilder result = new StringBuilder(); 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) + " "); result.append(getDirectionAtPoint(i) + " ");
}
return result + points.toString(); return result + points.toString();
} }
public void addPoint(double x, double y) { public void addPoint(double x, double y) {
if (Double.isNaN(x)) { if (Double.isNaN(x))
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
if (Double.isNaN(y)) { if (Double.isNaN(y))
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
if (points.size() > 0) { if (points.size() > 0) {
final Point2D last = getLast(); final Point2D last = getLast();
if (last.getX() == x && last.getY() == y) { if (last.getX() == x && last.getY() == y)
return; return;
}
} }
this.points.add(new Point2D.Double(x, y)); this.points.add(new Point2D.Double(x, y));
} }
@ -246,9 +260,9 @@ public class Worm implements Iterable<Point2D.Double> {
} }
SnakeDirection getDirection() { SnakeDirection getDirection() {
if (points.size() < 2) { if (points.size() < 2)
throw new IllegalStateException(); throw new IllegalStateException();
}
return SnakeDirection.getDirection(points.get(0), points.get(1)); return SnakeDirection.getDirection(points.get(0), points.get(1));
} }
@ -282,9 +296,9 @@ public class Worm implements Iterable<Point2D.Double> {
for (int i = 0; i < points.size() - 1; i++) { for (int i = 0; i < points.size() - 1; i++) {
final Point2D.Double pt1 = get(i); final Point2D.Double pt1 = get(i);
final Point2D.Double pt2 = get(i + 1); 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 true;
}
} }
return false; return false;
} }
@ -325,10 +339,10 @@ public class Worm implements Iterable<Point2D.Double> {
} }
public Worm merge(Worm other, MergeStrategy merge) { 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(); throw new IllegalArgumentException();
}
final Worm result = new Worm(); final Worm result = new Worm(style);
result.points.addAll(this.points); result.points.addAll(this.points);
result.points.addAll(other.points); result.points.addAll(other.points);
result.mergeMe(merge); result.mergeMe(merge);
@ -348,9 +362,9 @@ public class Worm implements Iterable<Point2D.Double> {
change = change || removePattern5(); change = change || removePattern5();
change = change || removePattern6(); change = change || removePattern6();
change = change || removePattern7(); change = change || removePattern7();
if (merge == MergeStrategy.FULL) { if (merge == MergeStrategy.FULL)
change = change || removePattern8(); change = change || removePattern8();
}
} while (change); } while (change);
} }
@ -510,4 +524,8 @@ public class Worm implements Iterable<Point2D.Double> {
return false; return false;
} }
public Style getStyle() {
return style;
}
} }

View File

@ -188,7 +188,7 @@ public class WormMutation {
} }
public Worm mute(Worm original) { 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++) { for (int i = 0; i < original.size(); i++) {
result.addPoint(translations.get(i).getTranslated(original.get(i))); result.addPoint(translations.get(i).getTranslated(original.get(i)));
} }

View File

@ -44,6 +44,7 @@ import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -53,8 +54,8 @@ public class WormTexted implements Iterable<Point2D.Double> {
private final Worm worm; private final Worm worm;
private TextBlock textBlock; private TextBlock textBlock;
public WormTexted() { private WormTexted(Style style) {
this(new Worm()); this(new Worm(style));
} }
private WormTexted(Worm worm) { private WormTexted(Worm worm) {

View File

@ -67,11 +67,11 @@ public abstract class AbstractParallelFtilesBuilder {
private final StringBounder stringBounder; private final StringBounder stringBounder;
protected final List<Ftile> list99 = new ArrayList<>(); protected final List<Ftile> list99 = new ArrayList<>();
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); 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); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
} }
@ -136,7 +136,7 @@ public abstract class AbstractParallelFtilesBuilder {
} }
final FontConfiguration fontConfiguration; final FontConfiguration fontConfiguration;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);

View File

@ -76,7 +76,8 @@ public class ConnectionVerticalDown extends AbstractConnection implements Connec
} }
private Snake getSimpleSnake() { 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(p1);
snake.addPoint(p2); snake.addPoint(p2);
return snake; return snake;
@ -84,7 +85,8 @@ public class ConnectionVerticalDown extends AbstractConnection implements Connec
@Override @Override
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { 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 mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;

View File

@ -55,7 +55,10 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose; 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.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.svek.image.Opale;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
@ -65,33 +68,40 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
private final Opale opale; private final Opale opale;
public FloatingNote(Display note, ISkinParam skinParam, Style style) { public FloatingNote(Display note, ISkinParam skinParam) {
final Rose rose = new Rose(); final Rose rose = new Rose();
final HColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); UStroke stroke = new UStroke();
final HColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); final HColor noteBackgroundColor;
final HColor borderColor;
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null); final FontConfiguration fc;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
final double shadowing;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
wrapWidth = style.wrapWidth(); 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 { } 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(); wrapWidth = skinParam.wrapWidth();
} }
final Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)
.createSheet(note); .createSheet(note);
final SheetBlock2 sheetBlock2 = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, final SheetBlock2 sheetBlock2 = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this,
new UStroke(1)); stroke);
final double shadowing; this.opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheetBlock2, false, stroke);
shadowing = skinParam.shadowing(null) ? 4 : 0;
this.opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheetBlock2, false);
// this.text = sheetBlock2;
} }

View File

@ -136,7 +136,7 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
final UTranslate tr2 = genealogy.getTranslate(diamondBreak, ug.getStringBounder()); final UTranslate tr2 = genealogy.getTranslate(diamondBreak, ug.getStringBounder());
final Dimension2D dimDiamond = diamondBreak.calculateDimension(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(tr1.getDx(), tr1.getDy());
snake.addPoint(0, tr1.getDy()); snake.addPoint(0, tr1.getDy());
snake.addPoint(0, tr2.getDy() + dimDiamond.getHeight() / 2); snake.addPoint(0, tr2.getDy() + dimDiamond.getHeight() / 2);

View File

@ -122,7 +122,7 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UTranslate tr1 = genealogy.getTranslate(ftileBreak, ug.getStringBounder()); 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(tr1.getDx(), tr1.getDy());
snake.addPoint(Hexagon.hexagonHalfSize, tr1.getDy()); snake.addPoint(Hexagon.hexagonHalfSize, tr1.getDy());
ug.draw(snake); ug.draw(snake);

View File

@ -87,7 +87,7 @@ public class FtileGroup extends AbstractFtile {
private final USymbol type; private final USymbol type;
private final double roundCorner; private final double roundCorner;
final public StyleSignature getDefaultStyleDefinitionPartition() { final public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition);
} }
@ -100,8 +100,9 @@ public class FtileGroup extends AbstractFtile {
final FontConfiguration fc; final FontConfiguration fc;
final Style style; final Style style;
final UStroke thickness;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder()); style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
this.shadowing = style.value(PName.Shadowing).asDouble(); this.shadowing = style.value(PName.Shadowing).asDouble();
this.backColor = backColor == null this.backColor = backColor == null
@ -110,6 +111,7 @@ public class FtileGroup extends AbstractFtile {
this.borderColor = borderColor == null this.borderColor = borderColor == null
? style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) ? style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet())
: borderColor; : borderColor;
thickness = style.getStroke();
} else { } else {
this.backColor = backColor == null ? HColorUtils.WHITE : backColor; this.backColor = backColor == null ? HColorUtils.WHITE : backColor;
this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor; this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor;
@ -119,6 +121,7 @@ public class FtileGroup extends AbstractFtile {
fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(), fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(),
skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
this.shadowing = skinParam().shadowing(null) ? 3 : 0; this.shadowing = skinParam().shadowing(null) ? 3 : 0;
thickness = skinParam.getThickness(LineParam.partitionBorder, null);
} }
if (title == null) if (title == null)
this.name = TextBlockUtils.empty(0, 0); this.name = TextBlockUtils.empty(0, 0);
@ -128,9 +131,8 @@ public class FtileGroup extends AbstractFtile {
if (Display.isNull(displayNote)) if (Display.isNull(displayNote))
this.headerNote = TextBlockUtils.empty(0, 0); this.headerNote = TextBlockUtils.empty(0, 0);
else 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; this.stroke = thickness == null ? new UStroke(2) : thickness;
} }

View File

@ -46,16 +46,17 @@ import java.util.Set;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; 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.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; 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.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; 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.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -115,75 +119,44 @@ class FtileIfAndStop extends AbstractFtile {
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop, ISkinParam skinParam, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop, ISkinParam skinParam,
StringBounder stringBounder, Display labelTest) { StringBounder stringBounder, Display labelTest) {
// backColor = HtmlColorUtils.BLUE;
// final Ftile tileNonStop = new FtileMinWidth(nonStop.getFtile(), 30);
final Ftile tileNonStop = nonStop.getFtile(); final Ftile tileNonStop = nonStop.getFtile();
final FontConfiguration fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null);
final Ftile stopFtile = ftileFactory.stop(swimlane); final Ftile stopFtile = ftileFactory.stop(swimlane);
// final TextBlock tb1 = Display.create(branch1.getLabelPositive(), fcArrow, final UStroke thickness;
// HorizontalAlignment.LEFT, final FontConfiguration fcTest;
// ftileFactory); if (UseStyle.useBetaStyle()) {
// final TextBlock tb2 = Display.create(branch2.getLabelPositive(), fcArrow, final Style style = StyleSignature.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder());
// HorizontalAlignment.LEFT, thickness = tileNonStop.getThickness(style);
// ftileFactory); fcTest = new FontConfiguration(skinParam, style);
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);
} else { } else {
throw new IllegalStateException(); thickness = tileNonStop.getThickness(null);
fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null);
} }
// final Ftile diamond2; final Sheet sheet = Parser
// if (tile1.calculateDimension(stringBounder).hasPointOut() .build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)
// && tile2.calculateDimension(stringBounder).hasPointOut()) { .createSheet(labelTest);
// diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding());
// swimlane);
// } else { final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), thickness);
// diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2,
// Diamond.diamondHalfSize * 2, final Ftile diamond1;
// swimlane, swimlane); 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 FtileIfAndStop result = new FtileIfAndStop(diamond1, tileNonStop, arrowColor, stopFtile);
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
conns.add(result.new ConnectionHorizontal(arrowColor)); 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 FtileUtils.addConnection(result, conns);
// return result;
} }
private UTranslate getTranslate1(StringBounder stringBounder) { private UTranslate getTranslate1(StringBounder stringBounder) {
// final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry dimTotal = calculateDimension(stringBounder); final FtileGeometry dimTotal = calculateDimension(stringBounder);
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
final FtileGeometry dim1 = tile1.calculateDimension(stringBounder); final FtileGeometry dim1 = tile1.calculateDimension(stringBounder);
@ -233,7 +206,7 @@ class FtileIfAndStop extends AbstractFtile {
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -256,18 +229,10 @@ class FtileIfAndStop extends AbstractFtile {
@Override @Override
public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
if (child == diamond1) { if (child == diamond1)
return getTranslateDiamond1(stringBounder); return getTranslateDiamond1(stringBounder);
} if (child == tile1)
if (child == tile1) {
return getTranslate1(stringBounder); return getTranslate1(stringBounder);
}
// if (child == tile2) {
// return getTranslate2(stringBounder);
// }
// if (child == diamond2) {
// return getTranslateDiamond2(stringBounder);
// }
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -287,45 +252,6 @@ class FtileIfAndStop extends AbstractFtile {
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
return dimDiamond1.appendBottom(dim1).addDim(0, getSuppHeight()); 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;
// }
} }

View File

@ -50,12 +50,12 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; 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.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
@ -155,7 +155,7 @@ public class FtileIfDown extends AbstractFtile {
final Point2D p2 = getP2(stringBounder); final Point2D p2 = getP2(stringBounder);
// p2 = new Point2D.Double(p2.getX(), p1.getY()); // 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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -198,7 +198,7 @@ public class FtileIfDown extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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(getP1(stringBounder));
snake.addPoint(getP2(stringBounder)); snake.addPoint(getP2(stringBounder));
@ -210,7 +210,7 @@ public class FtileIfDown extends AbstractFtile {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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 mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
@ -255,7 +255,7 @@ public class FtileIfDown extends AbstractFtile {
return; return;
} }
final Snake snake = Snake.create(arrowColor, Arrows.asToDown()); final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
snake.addPoint(getP1(stringBounder)); snake.addPoint(getP1(stringBounder));
if (conditionEndStyle == ConditionEndStyle.DIAMOND) { if (conditionEndStyle == ConditionEndStyle.DIAMOND) {
@ -277,7 +277,7 @@ public class FtileIfDown extends AbstractFtile {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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 mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; 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, final double xmax = Math.max(x1 + Hexagon.hexagonHalfSize,
getTranslateForThen(stringBounder).getDx() + thenGeom.getWidth()); 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(x1, y1);
snake.addPoint(xmax, y1); snake.addPoint(xmax, y1);
snake.addPoint(xmax, y2); 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, * ug.apply(new UTranslate(x2, y2 - Diamond.diamondHalfSize)).draw(new UEmpty(5,
* Diamond.diamondHalfSize)); ug.draw(snake); } * 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(x1, y1);
snake.addPoint(xmax, y1); snake.addPoint(xmax, y1);
snake.addPoint(xmax, y2); snake.addPoint(xmax, y2);
@ -461,7 +461,7 @@ public class FtileIfDown extends AbstractFtile {
final double xmax = Math.max(x1 + Hexagon.hexagonHalfSize, final double xmax = Math.max(x1 + Hexagon.hexagonHalfSize,
getTranslateForThen(stringBounder).getDx() + thenGeom.getWidth()); 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); snake.addPoint(xmax, y2);
// ug.apply(new UTranslate(xmax, y2 - Diamond.diamondHalfSize)).draw(new // ug.apply(new UTranslate(xmax, y2 - Diamond.diamondHalfSize)).draw(new
// UEmpty(5, // UEmpty(5,

View File

@ -258,7 +258,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -296,7 +296,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UTranslate tr = getTranslateDiamond1(getFtile2(), ug.getStringBounder()); final UTranslate tr = getTranslateDiamond1(getFtile2(), ug.getStringBounder());
final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn()); 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(); final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
snake.addPoint(p1); snake.addPoint(p1);
@ -320,7 +320,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final Point2D p1 = getP1(ug.getStringBounder()); final Point2D p1 = getP1(ug.getStringBounder());
final UTranslate tr2 = getTranslate2(ug.getStringBounder()); final UTranslate tr2 = getTranslate2(ug.getStringBounder());
final Point2D p2 = tr2.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn()); 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(p1);
snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2.getX(), p1.getY());
snake.addPoint(p2); snake.addPoint(p2);
@ -361,7 +361,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final double totalHeight = full.getHeight(); final double totalHeight = full.getHeight();
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight); 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(p1);
snake.addPoint(p2); snake.addPoint(p2);
if (nbOut == 0) { if (nbOut == 0) {
@ -386,7 +386,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -407,7 +407,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final Point2D p1 = getP1(ug.getStringBounder()); final Point2D p1 = getP1(ug.getStringBounder());
final Point2D p2 = getP2(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 mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
@ -441,7 +441,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
} }
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight); 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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -490,7 +490,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
return; 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(minX, totalDim.getHeight());
s.addPoint(maxX, totalDim.getHeight()); s.addPoint(maxX, totalDim.getHeight());
ug.draw(s); ug.draw(s);

View File

@ -211,7 +211,7 @@ class FtileIfLongVertical extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UTranslate tr = getTranslateDiamond(getFtile2(), ug.getStringBounder()); final UTranslate tr = getTranslateDiamond(getFtile2(), ug.getStringBounder());
final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn()); 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(); final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
snake.addPoint(p1); snake.addPoint(p1);
@ -237,7 +237,7 @@ class FtileIfLongVertical extends AbstractFtile {
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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(p1);
snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2.getX(), p1.getY());
snake.addPoint(p2); snake.addPoint(p2);
@ -274,7 +274,8 @@ class FtileIfLongVertical extends AbstractFtile {
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -312,7 +313,8 @@ class FtileIfLongVertical extends AbstractFtile {
final Point2D p2 = getTranslate2(stringBounder) final Point2D p2 = getTranslate2(stringBounder)
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn()); .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);
snake.addPoint(p1.getX(), p2.getY() - 15); snake.addPoint(p1.getX(), p2.getY() - 15);
snake.addPoint(p2.getX(), p2.getY() - 15); snake.addPoint(p2.getX(), p2.getY() - 15);
@ -341,7 +343,7 @@ class FtileIfLongVertical extends AbstractFtile {
final Point2D p2 = getTranslateLastDiamond(stringBounder) final Point2D p2 = getTranslateLastDiamond(stringBounder)
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn()); .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);
snake.addPoint(p1.getX(), p2.getY() - 15); snake.addPoint(p1.getX(), p2.getY() - 15);
snake.addPoint(p2.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 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);
snake.addPoint(p1.getX(), p1.getY() + 15); snake.addPoint(p1.getX(), p1.getY() + 15);
snake.addPoint(dimTotal.getWidth(), 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 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);
snake.addPoint(p1.getX(), p2.getY()); snake.addPoint(p1.getX(), p2.getY());
snake.addPoint(p2); snake.addPoint(p2);

View File

@ -77,7 +77,7 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
private final boolean withOutPoint; private final boolean withOutPoint;
private final Swimlane swimlane; private final Swimlane swimlane;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); 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 HColor borderColor;
final double shadowing; final double shadowing;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
UStroke stroke = new UStroke();
if (UseStyle.useBetaStyle()) { 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(), noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet()); getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
stroke = style.getStroke();
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
@ -130,9 +132,8 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
final Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)
.createSheet(note); .createSheet(note);
final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, stroke);
new UStroke(1)); opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, false, stroke);
opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, false);
} }

View File

@ -54,11 +54,11 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; 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.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; 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.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -219,7 +218,8 @@ class FtileRepeat extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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 p1 = getP1(stringBounder);
final Point2D p2 = getP2(stringBounder); final Point2D p2 = getP2(stringBounder);
snake.addPoint(p1); snake.addPoint(p1);
@ -259,7 +259,7 @@ class FtileRepeat extends AbstractFtile {
if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false) if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false)
return; return;
final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withLabel(tbout, final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(tbout,
arrowHorizontalAlignment()); arrowHorizontalAlignment());
snake.addPoint(getP1(stringBounder)); snake.addPoint(getP1(stringBounder));
snake.addPoint(getP2(stringBounder)); snake.addPoint(getP2(stringBounder));
@ -273,7 +273,7 @@ class FtileRepeat extends AbstractFtile {
if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false) if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false)
return; return;
final Snake snake = Snake.create(arrowColor); final Snake snake = Snake.create(skinParam(), arrowColor);
final Point2D mp1a = translate1.getTranslated(getP1(stringBounder)); final Point2D mp1a = translate1.getTranslated(getP1(stringBounder));
final Point2D mp2b = translate2.getTranslated(getP2(stringBounder)); final Point2D mp2b = translate2.getTranslated(getP2(stringBounder));
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
@ -282,7 +282,7 @@ class FtileRepeat extends AbstractFtile {
snake.addPoint(mp2b.getX(), middle); snake.addPoint(mp2b.getX(), middle);
ug.draw(snake); 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()); arrowHorizontalAlignment());
small.addPoint(mp2b.getX(), middle); small.addPoint(mp2b.getX(), middle);
small.addPoint(mp2b); small.addPoint(mp2b);
@ -333,7 +333,7 @@ class FtileRepeat extends AbstractFtile {
final Snake snake; final Snake snake;
if (x2 < x1_a) { 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); snake.addPoint(x1_a, y1);
if (x1_a < x1_b) { if (x1_a < x1_b) {
snake.addPoint(x1_b, y1); snake.addPoint(x1_b, y1);
@ -344,7 +344,7 @@ class FtileRepeat extends AbstractFtile {
} }
} else { } else {
x2 = p2.getX(); 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); snake.addPoint(x1_a, y1);
final double middle = x1_a / 4 + x2 * 3 / 4; final double middle = x1_a / 4 + x2 * 3 / 4;
snake.addPoint(middle, y1); snake.addPoint(middle, y1);
@ -386,7 +386,8 @@ class FtileRepeat extends AbstractFtile {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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(x1, y1);
snake.addPoint(x2, y1); snake.addPoint(x2, y1);
@ -410,7 +411,8 @@ class FtileRepeat extends AbstractFtile {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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(x1, y1);
snake.addPoint(x2, y1); snake.addPoint(x2, y1);
@ -458,7 +460,7 @@ class FtileRepeat extends AbstractFtile {
x2 += dimDiamond1.getWidth(); x2 += dimDiamond1.getWidth();
final double y2 = p2.getY() + dimDiamond1.getHeight() / 2; 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) { if (label != null) {
snake = snake.withLabel(label, arrowHorizontalAlignment()); snake = snake.withLabel(label, arrowHorizontalAlignment());
} }
@ -474,7 +476,7 @@ class FtileRepeat extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
Snake snake = Snake.create(arrowColor, Arrows.asToLeft()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft());
if (label != null) { if (label != null) {
snake = snake.withLabel(label, arrowHorizontalAlignment()); snake = snake.withLabel(label, arrowHorizontalAlignment());
} }
@ -516,8 +518,8 @@ class FtileRepeat extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Snake snake = Snake.create(arrowColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP) final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft())
.withLabel(tbback, arrowHorizontalAlignment()); .emphasizeDirection(Direction.UP).withLabel(tbback, arrowHorizontalAlignment());
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(stringBounder); final Point2D p2 = getP2(stringBounder);
@ -540,8 +542,8 @@ class FtileRepeat extends AbstractFtile {
@Override @Override
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Snake snake = Snake.create(arrowColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP) final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft())
.withLabel(tbback, arrowHorizontalAlignment()); .emphasizeDirection(Direction.UP).withLabel(tbback, arrowHorizontalAlignment());
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder); final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
Point2D p1 = getP1(stringBounder); Point2D p1 = getP1(stringBounder);

View File

@ -52,11 +52,11 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; 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.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
@ -189,7 +189,7 @@ class FtileWhile extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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(getP1(stringBounder));
snake.addPoint(getP2(stringBounder)); snake.addPoint(getP2(stringBounder));
@ -201,7 +201,8 @@ class FtileWhile extends AbstractFtile {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(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 mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0; 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 half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
final double y2 = p2.getY() + dimDiamond1.getInY() + half; final double y2 = p2.getY() + dimDiamond1.getInY() + half;
final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP) final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft())
.withLabel(back, arrowHorizontalAlignment()); .emphasizeDirection(Direction.UP).withLabel(back, arrowHorizontalAlignment());
snake.addPoint(x1, y1); snake.addPoint(x1, y1);
final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize; final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize;
snake.addPoint(x1, y1bis); snake.addPoint(x1, y1bis);
@ -275,7 +276,8 @@ class FtileWhile extends AbstractFtile {
@Override @Override
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
final StringBounder stringBounder = ug.getStringBounder(); 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 Dimension2D dimTotal = calculateDimension(stringBounder);
final Point2D ap1 = getP1(stringBounder); final Point2D ap1 = getP1(stringBounder);
final Point2D ap2 = getP2(stringBounder); final Point2D ap2 = getP2(stringBounder);
@ -349,7 +351,7 @@ class FtileWhile extends AbstractFtile {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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()); arrowHorizontalAlignment());
snake.addPoint(x1, y1); snake.addPoint(x1, y1);
final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize; final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize;
@ -384,7 +386,7 @@ class FtileWhile extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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()); arrowHorizontalAlignment());
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
@ -430,7 +432,8 @@ class FtileWhile extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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 Dimension2D dimTotal = calculateDimension(stringBounder);
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(stringBounder); final Point2D p2 = getP2(stringBounder);
@ -479,7 +482,7 @@ class FtileWhile extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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); .emphasizeDirection(Direction.DOWN);
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
@ -498,7 +501,7 @@ class FtileWhile extends AbstractFtile {
ug.draw(snake); ug.draw(snake);
final Snake snake2 = Snake.create(afterEndwhileColor); final Snake snake2 = Snake.create(skinParam(), afterEndwhileColor);
snake2.addPoint(Hexagon.hexagonHalfSize, y2); snake2.addPoint(Hexagon.hexagonHalfSize, y2);
snake2.addPoint(x2, y2); snake2.addPoint(x2, y2);
// snake2.goUnmergeable(MergeStrategy.LIMITED); // snake2.goUnmergeable(MergeStrategy.LIMITED);
@ -527,7 +530,7 @@ class FtileWhile extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); 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 FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);

View File

@ -88,7 +88,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
private final double suppSpace = 20; private final double suppSpace = 20;
private final Swimlane swimlaneNote; private final Swimlane swimlaneNote;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); 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 noteBackgroundColor;
final HColor borderColor; final HColor borderColor;
final FontConfiguration fc; final FontConfiguration fc;
UStroke stroke = new UStroke();
final double shadowing; final double shadowing;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors()); .eventuallyOverride(note.getColors());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet()); getIHtmlColorSet());
@ -153,6 +154,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
stroke = style.getStroke();
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); 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, final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null,
false, null); false, null);
final Sheet sheet = Parser.build(fc, align, skinParam, CreoleMode.FULL).createSheet(note.getDisplay()); 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, final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, stroke);
new UStroke(1)); opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, withLink, stroke);
opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, withLink);
} }

View File

@ -83,7 +83,7 @@ public class FtileWithNotes extends AbstractFtile {
private final double suppSpace = 20; private final double suppSpace = 20;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note);
} }
@ -107,17 +107,18 @@ public class FtileWithNotes extends AbstractFtile {
for (PositionedNote note : notes) { for (PositionedNote note : notes) {
ISkinParam skinParam2 = skinParam; ISkinParam skinParam2 = skinParam;
if (note.getColors() != null) { if (note.getColors() != null)
skinParam2 = note.getColors().mute(skinParam2); skinParam2 = note.getColors().mute(skinParam2);
}
final HColor noteBackgroundColor; final HColor noteBackgroundColor;
final HColor borderColor; final HColor borderColor;
final FontConfiguration fc; final FontConfiguration fc;
final double shadowing; final double shadowing;
UStroke stroke = new UStroke();
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors()); .eventuallyOverride(note.getColors());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet()); getIHtmlColorSet());
@ -125,6 +126,7 @@ public class FtileWithNotes extends AbstractFtile {
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
stroke = style.getStroke();
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
@ -148,7 +150,7 @@ public class FtileWithNotes extends AbstractFtile {
} }
}, new UStroke()); }, 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); final TextBlock opaleMarged = TextBlockUtils.withMargin(opale, 10, 10);
if (note.getNotePosition() == NotePosition.LEFT) { if (note.getNotePosition() == NotePosition.LEFT) {
if (left == null) { if (left == null) {

View File

@ -63,6 +63,7 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
@ -108,15 +109,15 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
private double getXSuppForDisplay(Ftile ftile, Display label) { private double getXSuppForDisplay(Ftile ftile, Display label) {
final TextBlock text = getTextBlock(label); final TextBlock text = getTextBlock(label);
if (text == null) { if (text == null)
return 0; return 0;
}
final double textWidth = text.calculateDimension(getStringBounder()).getWidth(); final double textWidth = text.calculateDimension(getStringBounder()).getWidth();
final FtileGeometry ftileDim = ftile.calculateDimension(getStringBounder()); final FtileGeometry ftileDim = ftile.calculateDimension(getStringBounder());
final double pos2 = ftileDim.getLeft() + textWidth; final double pos2 = ftileDim.getLeft() + textWidth;
if (pos2 > ftileDim.getWidth()) { if (pos2 > ftileDim.getWidth())
return pos2 - ftileDim.getWidth(); return pos2 - ftileDim.getWidth();
}
return 0; return 0;
} }
@ -130,18 +131,17 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
Ftile result = middle; Ftile result = middle;
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
final Swimlane swimlaneBlack = in; final Swimlane swimlaneBlack = in;
final Ftile black = new FtileBlackBlock(skinParam(), final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
getRose().getHtmlColor(skinParam(), ColorParam.activityBar), swimlaneBlack); final Ftile black = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack);
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { else
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
}
final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def); final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def);
conns.add(new ConnectionIn(black, tmp, x, rainbow)); conns.add(new ConnectionIn(black, tmp, x, rainbow));
x += dim.getWidth(); x += dim.getWidth();
@ -158,9 +158,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
double result = 0; double result = 0;
for (Ftile child : all) { for (Ftile child : all) {
final TextBlock text = getTextBlock(child.getInLinkRendering().getDisplay()); final TextBlock text = getTextBlock(child.getInLinkRendering().getDisplay());
if (text == null) { if (text == null)
continue; continue;
}
final Dimension2D dim = text.calculateDimension(stringBounder); final Dimension2D dim = text.calculateDimension(stringBounder);
result = Math.max(result, dim.getHeight()); result = Math.max(result, dim.getHeight());
@ -172,9 +172,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
double result = 0; double result = 0;
for (Ftile child : all) { for (Ftile child : all) {
final TextBlock text = getTextBlock(child.getOutLinkRendering().getDisplay()); final TextBlock text = getTextBlock(child.getOutLinkRendering().getDisplay());
if (text == null) { if (text == null)
continue; continue;
}
final Dimension2D dim = text.calculateDimension(stringBounder); final Dimension2D dim = text.calculateDimension(stringBounder);
result = Math.max(result, dim.getHeight()); result = Math.max(result, dim.getHeight());
} }
@ -188,35 +188,38 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
@Override @Override
protected Ftile doStep2(Ftile middle, Ftile result) { protected Ftile doStep2(Ftile middle, Ftile result) {
final Swimlane swimlaneBlack = out; final Swimlane swimlaneBlack = out;
final Ftile out = new FtileBlackBlock(skinParam(), getRose().getHtmlColor(skinParam(), ColorParam.activityBar), final Ftile out = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack);
swimlaneBlack);
((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), ((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(),
barHeight); barHeight);
if (label != null) { if (label != null)
((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(label))); ((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(label)));
}
result = new FtileAssemblySimple(result, out); result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { else
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
}
final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); 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()))); conns.add(new ConnectionOut(tmp, out, x, rainbow, getJustBeforeBar2(middle, getStringBounder())));
}
x += dim.getWidth(); x += dim.getWidth();
} }
result = FtileUtils.addConnection(result, conns); result = FtileUtils.addConnection(result, conns);
return result; return result;
} }
private HColor barColor() {
return getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
}
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable { class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
private final double x; private final double x;
@ -233,10 +236,10 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo2 = getFtile2().calculateDimension(getStringBounder()); final FtileGeometry geo2 = getFtile2().calculateDimension(getStringBounder());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0); final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY()); final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY());
snake.addPoint(p1); snake.addPoint(p1);
@ -251,10 +254,10 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0); final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY()); final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()).ignoreForCompression(); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).ignoreForCompression();
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp1a.getY() + 4; final double middle = mp1a.getY() + 4;
@ -284,13 +287,13 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo1 = getFtile1().calculateDimension(getStringBounder()); final FtileGeometry geo1 = getFtile1().calculateDimension(getStringBounder());
if (geo1.hasPointOut() == false) { if (geo1.hasPointOut() == false)
return; return;
}
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D p1 = new Point2D.Double(geo1.getLeft(), barHeight + geo1.getOutY()); final Point2D p1 = new Point2D.Double(geo1.getLeft(), barHeight + geo1.getOutY());
final Point2D p2 = new Point2D.Double(geo1.getLeft(), justBeforeBar2); final Point2D p2 = new Point2D.Double(geo1.getLeft(), justBeforeBar2);
snake.addPoint(p1); snake.addPoint(p1);
@ -302,16 +305,16 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder()); final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) { if (geo.hasPointOut() == false)
return; return;
}
final Point2D p1 = new Point2D.Double(geo.getLeft(), barHeight + geo.getOutY()); final Point2D p1 = new Point2D.Double(geo.getLeft(), barHeight + geo.getOutY());
final Point2D p2 = new Point2D.Double(geo.getLeft(), justBeforeBar2); final Point2D p2 = new Point2D.Double(geo.getLeft(), justBeforeBar2);
Snake snake = Snake.create(arrowColor, Arrows.asToDown()).ignoreForCompression(); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).ignoreForCompression();
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp2b.getY() - 14; final double middle = mp2b.getY() - 14;

View File

@ -57,6 +57,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -81,7 +82,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
@ -100,8 +101,20 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
@Override @Override
protected Ftile doStep2(Ftile inner, Ftile result) { protected Ftile doStep2(Ftile inner, Ftile result) {
final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final HColor backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground); 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()); final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out); result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
@ -112,16 +125,15 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final UTranslate translate0 = new UTranslate(x, barHeight); final UTranslate translate0 = new UTranslate(x, barHeight);
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { else
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
}
final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); 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)); conns.add(new ConnectionHorizontalThenVertical(tmp, out, rainbow, translate0, diamondTranslate));
}
x += dim.getWidth(); x += dim.getWidth();
} }
@ -153,14 +165,14 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final UTranslate arrival = arrivalOnDiamond(stringBounder, p1.getX()); final UTranslate arrival = arrivalOnDiamond(stringBounder, p1.getX());
final UPolygon endDecoration; final UPolygon endDecoration;
if (arrival.getDx() < 0) { if (arrival.getDx() < 0)
endDecoration = Arrows.asToRight(); endDecoration = Arrows.asToRight();
} else if (arrival.getDx() > 0) { else if (arrival.getDx() > 0)
endDecoration = Arrows.asToLeft(); endDecoration = Arrows.asToLeft();
} else { else
endDecoration = Arrows.asToDown(); 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, y1);
snake.addPoint(x1, y2); snake.addPoint(x1, y2);
snake.addPoint(x2, y2); snake.addPoint(x2, y2);
@ -188,13 +200,13 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final double b = result.getX() + dim.getWidth() / 2; final double b = result.getX() + dim.getWidth() / 2;
final UTranslate arrival; final UTranslate arrival;
if (startX < a) { if (startX < a)
arrival = new UTranslate(-dim.getWidth() / 2, -dim.getHeight() / 2); 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); arrival = new UTranslate(dim.getWidth() / 2, -dim.getHeight() / 2);
} else { else
arrival = new UTranslate(0, -dim.getHeight()); arrival = new UTranslate(0, -dim.getHeight());
}
return arrival; return arrival;
} }
@ -216,10 +228,10 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder()); final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
snake.addPoint(geo.getLeft(), 0); snake.addPoint(geo.getLeft(), 0);
snake.addPoint(geo.getLeft(), geo.getInY()); snake.addPoint(geo.getLeft(), geo.getInY());
ug.draw(snake); ug.draw(snake);
@ -232,10 +244,10 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0); final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY()); final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp1a.getY() + 4; final double middle = mp1a.getY() + 4;

View File

@ -70,7 +70,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
} }
@Override @Override
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
} }
@ -79,32 +79,30 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
Ftile result = inner; Ftile result = inner;
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
final Rainbow thinColor; final Rainbow thinColor;
if (UseStyle.useBetaStyle()) { final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); if (UseStyle.useBetaStyle())
thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { else
thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam())); thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam()));
}
final Ftile thin = new FtileThinSplit(skinParam(), getThin1Color(thinColor), list99.get(0).getSwimlaneIn()); final Ftile thin = new FtileThinSplit(skinParam(), getThin1Color(thinColor), list99.get(0).getSwimlaneIn());
double x = 0; double x = 0;
double first = 0; double first = 0;
double last = 0; double last = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final FtileGeometry dim = tmp.calculateDimension(getStringBounder()); final FtileGeometry dim = tmp.calculateDimension(getStringBounder());
if (first == 0) { if (first == 0)
first = x + dim.getLeft(); first = x + dim.getLeft();
}
last = x + dim.getLeft(); last = x + dim.getLeft();
final LinkRendering inLinkRendering = tmp.getInLinkRendering(); final LinkRendering inLinkRendering = tmp.getInLinkRendering();
final Rainbow rainbow; final Rainbow rainbow;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
rainbow = inLinkRendering rainbow = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { else
rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
}
conns.add(new ConnectionIn(thin, tmp, x, rainbow)); conns.add(new ConnectionIn(thin, tmp, x, rainbow));
x += dim.getWidth(); x += dim.getWidth();
@ -112,42 +110,40 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
result = FtileUtils.addConnection(result, conns); result = FtileUtils.addConnection(result, conns);
final FtileGeometry geom = result.calculateDimension(getStringBounder()); final FtileGeometry geom = result.calculateDimension(getStringBounder());
if (last < geom.getLeft()) { if (last < geom.getLeft())
last = geom.getLeft(); last = geom.getLeft();
}
if (first > geom.getLeft()) { if (first > geom.getLeft())
first = geom.getLeft(); first = geom.getLeft();
}
((FtileThinSplit) thin).setGeom(first, last, result.calculateDimension(getStringBounder()).getWidth()); ((FtileThinSplit) thin).setGeom(first, last, result.calculateDimension(getStringBounder()).getWidth());
return new FtileAssemblySimple(thin, result); return new FtileAssemblySimple(thin, result);
} }
private HColor getThin1Color(final Rainbow thinColor) { private HColor getThin1Color(final Rainbow thinColor) {
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Rainbow rainbow; final Rainbow rainbow;
final LinkRendering inLinkRendering = tmp.getInLinkRendering(); final LinkRendering inLinkRendering = tmp.getInLinkRendering();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
rainbow = inLinkRendering rainbow = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { else
rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
}
if (rainbow.isInvisible() == false) { if (rainbow.isInvisible() == false)
return thinColor.getColor(); return thinColor.getColor();
}
} }
return null; return null;
} }
private boolean hasOut() { private boolean hasOut() {
for (Ftile tmp : list99) { for (Ftile tmp : list99)
final boolean hasOutTmp = tmp.calculateDimension(getStringBounder()).hasPointOut(); if (tmp.calculateDimension(getStringBounder()).hasPointOut())
if (hasOutTmp) {
return true; return true;
}
}
return false; return false;
} }
@ -155,19 +151,17 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
protected Ftile doStep2(Ftile inner, Ftile result) { protected Ftile doStep2(Ftile inner, Ftile result) {
final FtileGeometry geom = result.calculateDimension(getStringBounder()); final FtileGeometry geom = result.calculateDimension(getStringBounder());
if (hasOut() == false) { if (hasOut() == false)
return new FtileKilled(result); return new FtileKilled(result);
}
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Rainbow thinColor; final Rainbow thinColor;
final LinkRendering inLinkRendering = result.getInLinkRendering(); final LinkRendering inLinkRendering = result.getInLinkRendering();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
thinColor = inLinkRendering thinColor = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { else
thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam())); thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
}
final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2()); final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out); result = new FtileAssemblySimple(result, out);
@ -179,33 +173,31 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final UTranslate translate0 = UTranslate.dy(1.5); final UTranslate translate0 = UTranslate.dy(1.5);
final FtileGeometry dim = tmp.calculateDimension(getStringBounder()); final FtileGeometry dim = tmp.calculateDimension(getStringBounder());
if (dim.hasPointOut()) { if (dim.hasPointOut()) {
if (first == 0) { if (first == 0)
first = x + dim.getLeft(); first = x + dim.getLeft();
}
last = x + dim.getLeft(); last = x + dim.getLeft();
} }
final Rainbow rainbow; final Rainbow rainbow;
final LinkRendering outLinkRendering = tmp.getOutLinkRendering(); final LinkRendering outLinkRendering = tmp.getOutLinkRendering();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle())
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
rainbow = outLinkRendering rainbow = outLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { else
rainbow = outLinkRendering.getRainbow(Rainbow.build(skinParam())); 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))); conns.add(new ConnectionOut(translate0, tmp, out, x, rainbow, getHeightOfMiddle(inner)));
}
x += dim.getWidth(); x += dim.getWidth();
} }
if (last < geom.getLeft()) { if (last < geom.getLeft())
last = geom.getLeft(); last = geom.getLeft();
}
if (first > geom.getLeft()) { if (first > geom.getLeft())
first = geom.getLeft(); first = geom.getLeft();
}
((FtileThinSplit) out).setGeom(first, last, geom.getWidth()); ((FtileThinSplit) out).setGeom(first, last, geom.getWidth());
result = FtileUtils.addConnection(result, conns); result = FtileUtils.addConnection(result, conns);
return result; return result;
@ -227,10 +219,10 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder()); final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
snake.addPoint(geo.getLeft(), 0); snake.addPoint(geo.getLeft(), 0);
snake.addPoint(geo.getLeft(), geo.getInY()); snake.addPoint(geo.getLeft(), geo.getInY());
ug.draw(snake); ug.draw(snake);
@ -243,10 +235,10 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0); final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY()); final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp1a.getY() + 4; final double middle = mp1a.getY() + 4;
@ -279,13 +271,13 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder()); final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) { if (geo.hasPointOut() == false)
return; return;
}
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY())); final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY()));
final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height)); final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height));
snake.addPoint(p1); snake.addPoint(p1);
@ -297,16 +289,16 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
ug = ug.apply(UTranslate.dx(x)); ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder()); final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) { if (geo.hasPointOut() == false)
return; return;
}
final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY())); final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY()));
final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height)); final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height));
Snake snake = Snake.create(arrowColor, Arrows.asToDown()); Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) { if (Display.isNull(label) == false)
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
}
final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp2b.getY() - 14; final double middle = mp2b.getY() - 14;

View File

@ -102,6 +102,10 @@ public class VCompactFactory implements FtileFactory {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.stop); 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() { private StyleSignature getSignatureCircleStart() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.start); 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) { public Ftile spot(Swimlane swimlane, String spot, HColor color) {
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY); 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) { public Ftile end(Swimlane swimlane) {

View File

@ -71,6 +71,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.ConditionEndStyle; import net.sourceforge.plantuml.svek.ConditionEndStyle;
import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ConditionalBuilder { public class ConditionalBuilder {
@ -95,11 +96,11 @@ public class ConditionalBuilder {
private final Ftile tile2; private final Ftile tile2;
private final Url url; private final Url url;
public StyleSignature getDefaultStyleDefinitionDiamond() { private StyleSignature getStyleSignatureDiamond() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); 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); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
} }
@ -114,19 +115,24 @@ public class ConditionalBuilder {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
if (arrowColor == null) if (arrowColor == null)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
final Style styleArrow = getDefaultStyleDefinitionArrow() final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
.getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style styleDiamond = getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style styleDiamond = getDefaultStyleDefinitionDiamond()
.getMergedStyle(skinParam.getCurrentStyleBuilder());
this.diamondLineBreak = styleDiamond.wrapWidth(); this.diamondLineBreak = styleDiamond.wrapWidth();
this.labelLineBreak = styleArrow.wrapWidth(); this.labelLineBreak = styleArrow.wrapWidth();
this.borderColor = borderColor; /*styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(), this.borderColor = borderColor; /*
skinParam.getIHtmlColorSet());*/ * styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
this.backColor = backColor;/*styleDiamond.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), * skinParam.getIHtmlColorSet());
skinParam.getIHtmlColorSet())*/; */
this.arrowColor = arrowColor;/* Rainbow.fromColor( this.backColor = backColor;
styleArrow.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), /*
null);*/ * 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.fontTest = styleDiamond.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else { } else {
@ -255,7 +261,10 @@ public class ConditionalBuilder {
final Sheet sheet = Parser.build(fontTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), final Sheet sheet = Parser.build(fontTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
skinParam, CreoleMode.FULL).createSheet(labelTest); skinParam, CreoleMode.FULL).createSheet(labelTest);
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, diamondLineBreak, skinParam.getPadding()); 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; final Ftile shape1;
if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) { if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) {

View File

@ -46,10 +46,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; 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.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
@ -100,7 +100,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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(x1, y1);
snake.addPoint(x2, y1); snake.addPoint(x2, y1);
snake.addPoint(x2, y2); snake.addPoint(x2, y2);
@ -147,14 +147,14 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
if (originalDirection != newDirection) { if (originalDirection != newDirection) {
final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Hexagon.hexagonHalfSize; final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Hexagon.hexagonHalfSize;
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder); 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);
small.addPoint(p1.getX() + delta, p1.getY()); small.addPoint(p1.getX() + delta, p1.getY());
small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75); small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75);
ug.draw(small); ug.draw(small);
p1 = small.getLast(); 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(p1);
snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2.getX(), p1.getY());
snake.addPoint(p2); snake.addPoint(p2);
@ -190,7 +190,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
final double y2 = p2.getY(); final double y2 = p2.getY();
final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft(); final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft();
Snake snake = Snake.create(myArrowColor, arrow); Snake snake = Snake.create(skinParam(), myArrowColor, arrow);
if (branchEmpty) { if (branchEmpty) {
snake = snake.emphasizeDirection(Direction.DOWN); snake = snake.emphasizeDirection(Direction.DOWN);
} }
@ -244,14 +244,14 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
if (originalDirection == newDirection) { if (originalDirection == newDirection) {
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY()); 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; final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
snake.addPoint(mp1a); snake.addPoint(mp1a);
snake.addPoint(mp1a.getX(), middle); snake.addPoint(mp1a.getX(), middle);
snake.addPoint(mp2bc.getX(), middle); snake.addPoint(mp2bc.getX(), middle);
snake.addPoint(mp2bc); snake.addPoint(mp2bc);
ug.draw(snake); 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);
small.addPoint(mp2bc.getX(), mp2b.getY()); small.addPoint(mp2bc.getX(), mp2b.getY());
small.addPoint(mp2b); small.addPoint(mp2b);
@ -260,12 +260,12 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta,
mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize); 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);
snake.addPoint(mp1a.getX(), mp2bb.getY()); snake.addPoint(mp1a.getX(), mp2bb.getY());
snake.addPoint(mp2bb); snake.addPoint(mp2bb);
ug.draw(snake); 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);
small.addPoint(mp2bb.getX(), mp2b.getY()); small.addPoint(mp2bb.getX(), mp2b.getY());
small.addPoint(mp2b); small.addPoint(mp2b);
@ -303,7 +303,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); final double y2 = p2.getY();
Snake snake = Snake.create(myArrowColor); Snake snake = Snake.create(skinParam(), myArrowColor);
if (branchEmpty) { if (branchEmpty) {
snake = snake.emphasizeDirection(Direction.DOWN); snake = snake.emphasizeDirection(Direction.DOWN);
} }
@ -330,7 +330,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
final Point2D mp1a = translate1.getTranslated(p1); final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2); 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); // snake.emphasizeDirection(Direction.DOWN);
final double x1 = mp1a.getX(); final double x1 = mp1a.getX();
@ -386,7 +386,8 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
} }
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight); 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(p1);
snake.addPoint(p2); snake.addPoint(p2);
ug.draw(snake); ug.draw(snake);
@ -444,7 +445,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
return; 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(minX, totalDim.getHeight());
s.addPoint(maxX, totalDim.getHeight()); s.addPoint(maxX, totalDim.getHeight());
ug.draw(s); ug.draw(s);

View File

@ -86,7 +86,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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()); .withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment());
snake.addPoint(x1, y1); snake.addPoint(x1, y1);
snake.addPoint(x2, y1); snake.addPoint(x2, y1);
@ -158,7 +158,8 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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); snake.addPoint(x1, y1);
if (direction == Direction.LEFT && x2 > x1 - 10) { if (direction == Direction.LEFT && x2 > x1 - 10) {
snake.addPoint(x1, y2 - 8); snake.addPoint(x1, y2 - 8);
@ -199,7 +200,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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); .withLabel(branch.getTextBlockPositive(), VerticalAlignment.CENTER);
if (x2 < p1d.getX() - margin || x2 > p1b.getX() + margin) { if (x2 < p1d.getX() - margin || x2 > p1b.getX() + margin) {
snake.addPoint(x2, p1d.getY()); snake.addPoint(x2, p1d.getY());
@ -255,7 +256,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final double ym = (y1 + y2) / 2; 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); VerticalAlignment.CENTER);
if (x1 < p1d.getX() - margin || x1 > p1b.getX() + margin) { if (x1 < p1d.getX() - margin || x1 > p1b.getX() + margin) {

View File

@ -80,7 +80,7 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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()); .withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment());
// snake.addPoint(x1, y1); // snake.addPoint(x1, y1);
snake.addPoint(x2, y1); snake.addPoint(x2, y1);
@ -115,7 +115,7 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
final double x2 = p2.getX(); final double x2 = p2.getX();
final double y2 = p2.getY(); 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(x1, y1);
snake.addPoint(x2, y1); snake.addPoint(x2, y1);
snake.addPoint(x2, y2); snake.addPoint(x2, y2);

View File

@ -99,11 +99,11 @@ public class FtileBox extends AbstractFtile {
private final HColor backColor; private final HColor backColor;
private final Style style; private final Style style;
static public StyleSignature getDefaultStyleDefinitionActivity() { static public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); 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); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
} }
@ -144,9 +144,9 @@ public class FtileBox extends AbstractFtile {
Style style = null; Style style = null;
Style styleArrow = null; Style styleArrow = null;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
style = getDefaultStyleDefinitionActivity().with(stereotype) style = getStyleSignature().with(stereotype)
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
} }
return new FtileBox(skinParam, label, swimlane, boxStyle, style, styleArrow); return new FtileBox(skinParam, label, swimlane, boxStyle, style, styleArrow);
} }
@ -215,7 +215,7 @@ public class FtileBox extends AbstractFtile {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
thickness = style.getStroke(); thickness = style.getStroke();
} else { } else {
thickness = getThickness(); thickness = getThickness(style);
} }
if (borderColor == null) { if (borderColor == null) {

View File

@ -219,7 +219,7 @@ public class FtileBox2 extends AbstractFtile {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
thickness = style.getStroke(); thickness = style.getStroke();
} else { } else {
thickness = getThickness(); thickness = getThickness(style);
} }
if (borderColor == null) { if (borderColor == null) {

View File

@ -239,7 +239,7 @@ public class FtileBoxOld extends AbstractFtile {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
thickness = style.getStroke(); thickness = style.getStroke();
} else { } else {
thickness = getThickness(); thickness = getThickness(style);
} }
if (borderColor == null) { if (borderColor == null) {

View File

@ -43,12 +43,15 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder; 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.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
@ -64,13 +67,19 @@ public class FtileCircleSpot extends AbstractFtile {
private final String spot; private final String spot;
private final FontConfiguration fc; private final FontConfiguration fc;
private final HColor backColor; 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); super(skinParam);
this.style = style;
this.spot = spot; this.spot = spot;
this.swimlane = swimlane; this.swimlane = swimlane;
this.backColor = backColor; 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 @Override
@ -94,17 +103,30 @@ public class FtileCircleSpot extends AbstractFtile {
} }
public void drawU(UGraphic ug) { 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); 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)) ug.apply(fc.getColor()).apply(new UTranslate(SIZE / 2, SIZE / 2))
.draw(new UCenteredCharacter(spot.charAt(0), fc.getFont())); .draw(new UCenteredCharacter(spot.charAt(0), fc.getFont()));

View File

@ -50,6 +50,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -67,71 +68,84 @@ public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
return "" + getClass() + " " + ftile; return "" + getClass() + " " + ftile;
} }
@Override
public LinkRendering getOutLinkRendering() { public LinkRendering getOutLinkRendering() {
return ftile.getOutLinkRendering(); return ftile.getOutLinkRendering();
} }
@Override
public LinkRendering getInLinkRendering() { public LinkRendering getInLinkRendering() {
return ftile.getInLinkRendering(); return ftile.getInLinkRendering();
} }
@Override
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ftile.drawU(ug); ftile.drawU(ug);
} }
@Override
public FtileGeometry calculateDimension(StringBounder stringBounder) { public FtileGeometry calculateDimension(StringBounder stringBounder) {
return ftile.calculateDimension(stringBounder); return ftile.calculateDimension(stringBounder);
} }
@Override
public Collection<Connection> getInnerConnections() { public Collection<Connection> getInnerConnections() {
return ftile.getInnerConnections(); return ftile.getInnerConnections();
} }
@Override
public Set<Swimlane> getSwimlanes() { public Set<Swimlane> getSwimlanes() {
return ftile.getSwimlanes(); return ftile.getSwimlanes();
} }
@Override
public Swimlane getSwimlaneIn() { public Swimlane getSwimlaneIn() {
return ftile.getSwimlaneIn(); return ftile.getSwimlaneIn();
} }
@Override
public Swimlane getSwimlaneOut() { public Swimlane getSwimlaneOut() {
return ftile.getSwimlaneOut(); return ftile.getSwimlaneOut();
} }
@Override
public ISkinParam skinParam() { public ISkinParam skinParam() {
return ftile.skinParam(); return ftile.skinParam();
} }
public UStroke getThickness() { @Override
return ftile.getThickness(); public UStroke getThickness(Style style) {
return ftile.getThickness(style);
} }
protected final Ftile getFtileDelegated() { protected final Ftile getFtileDelegated() {
return ftile; return ftile;
} }
@Override
public List<WeldingPoint> getWeldingPoints() { public List<WeldingPoint> getWeldingPoints() {
return ftile.getWeldingPoints(); return ftile.getWeldingPoints();
} }
@Override
public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
if (child == ftile) { if (child == ftile)
return new UTranslate(); return new UTranslate();
}
return ftile.getTranslateFor(child, stringBounder); return ftile.getTranslateFor(child, stringBounder);
} }
@Override
public Collection<Ftile> getMyChildren() { public Collection<Ftile> getMyChildren() {
if (this == ftile) { if (this == ftile)
throw new IllegalStateException(); throw new IllegalStateException();
}
return Collections.singleton(ftile); return Collections.singleton(ftile);
} }
@Override
public HorizontalAlignment arrowHorizontalAlignment() { public HorizontalAlignment arrowHorizontalAlignment() {
return ftile.arrowHorizontalAlignment(); return ftile.arrowHorizontalAlignment();
} }
} }

View File

@ -88,7 +88,7 @@ public class FtileDiamond extends FtileDiamondWIP {
final double suppY1 = north.calculateDimension(ug.getStringBounder()).getHeight(); final double suppY1 = north.calculateDimension(ug.getStringBounder()).getHeight();
ug = ug.apply(UTranslate.dy(suppY1)); 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()); // final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder());
north.drawU(ug.apply(new UTranslate(Hexagon.hexagonHalfSize * 1.5, -suppY1))); north.drawU(ug.apply(new UTranslate(Hexagon.hexagonHalfSize * 1.5, -suppY1)));

View File

@ -87,7 +87,7 @@ public class FtileDiamondInside extends FtileDiamondWIP {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimTotal = calculateDimensionAlone(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())); ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight()))); north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));

View File

@ -82,7 +82,7 @@ public class FtileDiamondInside2 extends FtileDiamondWIP {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimTotal = calculateDimensionAlone(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())); ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight()))); north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));

View File

@ -87,7 +87,7 @@ public class FtileDiamondSquare extends FtileDiamondWIP {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimTotal = calculateDimensionInternal(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())); ug.draw(Hexagon.asPolygonSquare(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));

View File

@ -67,9 +67,13 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable {
protected final double shadowing; 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); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
} }
final public Style getStyle() {
return getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
}
@Override @Override
final public Collection<Ftile> getMyChildren() { final public Collection<Ftile> getMyChildren() {
@ -80,7 +84,7 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable {
Swimlane swimlane, TextBlock north, TextBlock south, TextBlock east, TextBlock west) { Swimlane swimlane, TextBlock north, TextBlock south, TextBlock east, TextBlock west) {
super(skinParam); super(skinParam);
if (UseStyle.useBetaStyle()) { 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.borderColor = borderColor; //style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = backColor; //style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.backColor = backColor; //style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.shadowing = style.value(PName.Shadowing).asDouble(); this.shadowing = style.value(PName.Shadowing).asDouble();

View File

@ -91,6 +91,10 @@ public abstract class GAbstractConnection implements GConnection {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
} }
protected ISkinParam skinParam() {
throw new UnsupportedOperationException("wip");
}
// DUPLICATE 4561 // DUPLICATE 4561
final protected Rainbow getInLinkRenderingColor() { final protected Rainbow getInLinkRenderingColor() {
Rainbow color; Rainbow color;

View File

@ -84,7 +84,7 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
// final Dimension2D dimDiamond1 = // final Dimension2D dimDiamond1 =
// diamond1.calculateDimension(ug.getStringBounder()); // diamond1.calculateDimension(ug.getStringBounder());
final Dimension2D dimDiamond1 = new Dimension2DDouble(0, 0); 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);
small.addPoint(p1.getX() + delta, p1.getY()); small.addPoint(p1.getX() + delta, p1.getY());
small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75); 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(); 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); .withLabel(textBlock, HorizontalAlignment.LEFT).withMerge(MergeStrategy.LIMITED);
snake.addPoint(p1); snake.addPoint(p1);
snake.addPoint(p2.getX(), p1.getY()); snake.addPoint(p2.getX(), p1.getY());
@ -104,7 +104,7 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
@Override @Override
public void drawU(UGraphic ug) { 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); HorizontalAlignment.LEFT);
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());

View File

@ -76,7 +76,7 @@ public class GConnectionSideThenVerticalThenSide extends GAbstractConnection {
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
final Direction direction = p1.getY() < p2.getY() ? Direction.DOWN : Direction.UP; final Direction direction = p1.getY() < p2.getY() ? Direction.DOWN : Direction.UP;
final UPolygon tmp = p1.getX() < p2.getX() ? Arrows.asToRight() : Arrows.asToLeft(); 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); .withLabel(textBlock, HorizontalAlignment.LEFT);
// final double maxX = Math.max(p1.getX(), p2.getX()); // final double maxX = Math.max(p1.getX(), p2.getX());
final double maxX = xpos; final double maxX = xpos;

View File

@ -61,7 +61,7 @@ public class GConnectionVerticalDown extends GAbstractConnection {
@Override @Override
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { 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); HorizontalAlignment.LEFT);
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
@ -78,7 +78,7 @@ public class GConnectionVerticalDown extends GAbstractConnection {
@Override @Override
public void drawU(UGraphic ug) { 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); HorizontalAlignment.LEFT);
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());

View File

@ -68,7 +68,7 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
final UPolygon arrow = Arrows.asToLeft(); 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); .withLabel(textBlock, HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP);
snake.addPoint(p1); snake.addPoint(p1);
@ -94,7 +94,7 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
p2 = translate2.getTranslated(p2); p2 = translate2.getTranslated(p2);
final UPolygon arrow = Arrows.asToLeft(); 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); .withLabel(textBlock, HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP);
snake.addPoint(p1); snake.addPoint(p1);

View File

@ -82,14 +82,14 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
if (originalDirection == newDirection) { if (originalDirection == newDirection) {
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY()); 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; final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
snake.addPoint(mp1a); snake.addPoint(mp1a);
snake.addPoint(mp1a.getX(), middle); snake.addPoint(mp1a.getX(), middle);
snake.addPoint(mp2bc.getX(), middle); snake.addPoint(mp2bc.getX(), middle);
snake.addPoint(mp2bc); snake.addPoint(mp2bc);
ug.draw(snake); 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);
small.addPoint(mp2bc.getX(), mp2b.getY()); small.addPoint(mp2bc.getX(), mp2b.getY());
small.addPoint(mp2b); small.addPoint(mp2b);
@ -97,12 +97,12 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
} else { } else {
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize; 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 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);
snake.addPoint(mp1a.getX(), mp2bb.getY()); snake.addPoint(mp1a.getX(), mp2bb.getY());
snake.addPoint(mp2bb); snake.addPoint(mp2bb);
ug.draw(snake); 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);
small.addPoint(mp2bb.getX(), mp2b.getY()); small.addPoint(mp2bb.getX(), mp2b.getY());
small.addPoint(mp2b); small.addPoint(mp2b);
@ -117,7 +117,7 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D()); final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D()); final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
final UPolygon arrow = p1.getX() < p2.getX() ? Arrows.asToRight() : Arrows.asToLeft(); 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); HorizontalAlignment.LEFT);
snake.addPoint(p1); snake.addPoint(p1);
snake.addPoint(new Point2D.Double(p1.getX(), p2.getY())); snake.addPoint(new Point2D.Double(p1.getX(), p2.getY()));

View File

@ -126,7 +126,7 @@ public class GtileGroup extends AbstractGtileRoot {
if (Display.isNull(displayNote)) { if (Display.isNull(displayNote)) {
this.headerNote = TextBlockUtils.empty(0, 0); this.headerNote = TextBlockUtils.empty(0, 0);
} else { } else {
this.headerNote = new FloatingNote(displayNote, skinParam, style); this.headerNote = new FloatingNote(displayNote, skinParam);
} }
final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null); final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null);

View File

@ -86,15 +86,15 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
private final Dimension2D dimNote; private final Dimension2D dimNote;
private final Dimension2D dimTile; private final Dimension2D dimTile;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note);
} }
@Override @Override
public Swimlane getSwimlane(String point) { public Swimlane getSwimlane(String point) {
return tile.getSwimlane(point); return tile.getSwimlane(point);
} }
@Override @Override
public Set<Swimlane> getSwimlanes() { public Set<Swimlane> getSwimlanes() {
return tile.getSwimlanes(); return tile.getSwimlanes();
@ -105,12 +105,11 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
this.swimlaneNote = note.getSwimlaneNote(); this.swimlaneNote = note.getSwimlaneNote();
if (note.getColors() != null) if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam); skinParam = note.getColors().mute(skinParam);
this.tile = tile; this.tile = tile;
this.notePosition = note.getNotePosition(); this.notePosition = note.getNotePosition();
if (note.getType() == NoteType.FLOATING_NOTE) if (note.getType() == NoteType.FLOATING_NOTE)
withLink = false; withLink = false;
final Rose rose = new Rose(); final Rose rose = new Rose();
@ -120,8 +119,9 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
final double shadowing; final double shadowing;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
UStroke stroke = new UStroke();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors()); .eventuallyOverride(note.getColors());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet()); getIHtmlColorSet());
@ -129,6 +129,7 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
stroke = style.getStroke();
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); 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 Sheet sheet = Parser.build(fc, align, skinParam, CreoleMode.FULL).createSheet(note.getDisplay());
final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this, final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this,
new UStroke(1)); 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.dimNote = opale.calculateDimension(stringBounder);
this.dimTile = tile.calculateDimension(stringBounder); this.dimTile = tile.calculateDimension(stringBounder);

View File

@ -118,6 +118,7 @@ public class GtileWithNotes extends AbstractGtile {
final HColor borderColor; final HColor borderColor;
final FontConfiguration fc; final FontConfiguration fc;
final double shadowing; final double shadowing;
UStroke stroke = new UStroke();
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
@ -129,6 +130,7 @@ public class GtileWithNotes extends AbstractGtile {
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
stroke = style.getStroke();
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
@ -150,9 +152,9 @@ public class GtileWithNotes extends AbstractGtile {
public double getEndingX(StringBounder stringBounder, double y) { public double getEndingX(StringBounder stringBounder, double y) {
return sheet1.getEndingX(stringBounder, y) + 15; 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); final TextBlock opaleMarged = TextBlockUtils.withMargin(opale, 10, 10);
if (note.getNotePosition() == NotePosition.LEFT) { if (note.getNotePosition() == NotePosition.LEFT) {
if (left == null) { if (left == null) {

View File

@ -55,7 +55,7 @@ public abstract class AbstractComponentText implements Component {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -59,6 +59,8 @@ public class CreoleHorizontalLine extends AbstractAtom implements Atom {
private final char style; private final char style;
private final ISkinSimple skinParam; private final ISkinSimple skinParam;
private final static double defaultThickness = 1;
public static CreoleHorizontalLine create(FontConfiguration fontConfiguration, String line, char style, public static CreoleHorizontalLine create(FontConfiguration fontConfiguration, String line, char style,
ISkinSimple skinParam) { ISkinSimple skinParam) {
return new CreoleHorizontalLine(fontConfiguration, line, style, skinParam); return new CreoleHorizontalLine(fontConfiguration, line, style, skinParam);
@ -73,10 +75,10 @@ public class CreoleHorizontalLine extends AbstractAtom implements Atom {
private UHorizontalLine getHorizontalLine() { private UHorizontalLine getHorizontalLine() {
if (line.length() == 0) { if (line.length() == 0) {
return UHorizontalLine.infinite(0, 0, style); return UHorizontalLine.infinite(defaultThickness, 0, 0, style);
} }
final TextBlock tb = getTitle(); final TextBlock tb = getTitle();
return UHorizontalLine.infinite(0, 0, tb, style); return UHorizontalLine.infinite(defaultThickness, 0, 0, tb, style);
} }
private TextBlock getTitle() { private TextBlock getTitle() {

View File

@ -52,6 +52,7 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
public class BodierLikeClassOrObject implements Bodier { public class BodierLikeClassOrObject implements Bodier {
@ -228,7 +229,7 @@ public class BodierLikeClassOrObject implements Bodier {
} }
if (type == LeafType.OBJECT) { if (type == LeafType.OBJECT) {
if (showFields == false) { 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), return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
rawBodyWithoutHidden(), fontParam, skinParam, stereotype, leaf, style); rawBodyWithoutHidden(), fontParam, skinParam, stereotype, leaf, style);

View File

@ -48,6 +48,7 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.legacy.CreoleParser; import net.sourceforge.plantuml.creole.legacy.CreoleParser;
@ -76,7 +77,8 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam,
Stereotype stereotype, ILeaf entity, Style style) { 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.style = style;
this.rawBody2 = Display.create(rawBody); this.rawBody2 = Display.create(rawBody);
this.stereotype = stereotype; this.stereotype = stereotype;
@ -92,7 +94,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam,
Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
super(align, style == null ? new FontConfiguration(skinParam, fontParam, stereotype) 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.style = style;
this.entity = entity; this.entity = entity;
@ -104,9 +106,9 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
this.inEllipse = fontParam == FontParam.USECASE; 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(""); display = display.add("");
}
this.rawBody2 = display; this.rawBody2 = display;
} }
@ -123,9 +125,9 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
@Override @Override
final protected TextBlock getArea(StringBounder stringBounder) { final protected TextBlock getArea(StringBounder stringBounder) {
if (area != null) { if (area != null)
return area; return area;
}
urls.clear(); urls.clear();
final List<TextBlock> blocks = new ArrayList<>(); final List<TextBlock> blocks = new ArrayList<>();
@ -155,25 +157,25 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
display = Display.empty(); display = Display.empty();
} else if (isTreeOrTable(s)) { } else if (isTreeOrTable(s)) {
final boolean isTable = CreoleParser.isTableLine(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, blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(display, fontParam, skinParam, align,
stereotype, entity, style), separator, title)); stereotype, entity, style), separator, title));
}
separator = 0; separator = 0;
title = null; title = null;
display = Display.empty(); display = Display.empty();
final List<CharSequence> allTree = buildTreeOrTable(s, it); final List<CharSequence> allTree = buildTreeOrTable(s, it);
TextBlock bloc = Display.create(allTree).create7(fontParam.getFontConfiguration(skinParam), align, TextBlock bloc = Display.create(allTree).create7(fontParam.getFontConfiguration(skinParam), align,
skinParam, CreoleMode.FULL); skinParam, CreoleMode.FULL);
if (isTable) { if (isTable)
bloc = TextBlockUtils.withMargin(bloc, 10, 10, 0, 5); bloc = TextBlockUtils.withMargin(bloc, 10, 10, 0, 5);
}
blocks.add(bloc); blocks.add(bloc);
} else { } else {
display = display.add(cs); 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()); 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, new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), separator,
title)); title));
if (blocks.size() == 1) { if (blocks.size() == 1)
this.area = blocks.get(0); this.area = blocks.get(0);
} else { else
this.area = new TextBlockVertical2(blocks, align); this.area = new TextBlockVertical2(blocks, align);
}
if (skinParam.minClassWidth() > 0) { if (skinParam.minClassWidth() > 0)
this.area = TextBlockUtils.withMinWidth(this.area, skinParam.minClassWidth(), align); this.area = TextBlockUtils.withMinWidth(this.area, skinParam.minClassWidth(), align);
}
return area; return area;
} }
@ -202,9 +202,9 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
final Pattern p = Pattern.compile("^(\\s+)"); final Pattern p = Pattern.compile("^(\\s+)");
final Matcher m = p.matcher(init); final Matcher m = p.matcher(init);
String start = ""; String start = "";
if (m.find()) { if (m.find())
start = m.group(1); start = m.group(1);
}
result.add(purge(init, start)); result.add(purge(init, start));
while (it.hasNext()) { while (it.hasNext()) {
String s = it.next().toString(); 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) { private static String purge(String s, String start) {
if (s.startsWith(start)) { if (s.startsWith(start))
return s.substring(start.length()); return s.substring(start.length());
}
return s; return s;
} }
@Override @Override
public Ports getPorts(StringBounder stringBounder) { public Ports getPorts(StringBounder stringBounder) {
final TextBlock area = getArea(stringBounder); final TextBlock area = getArea(stringBounder);
if (area instanceof WithPorts) { if (area instanceof WithPorts)
return ((WithPorts) area).getPorts(stringBounder); return ((WithPorts) area).getPorts(stringBounder);
}
return new Ports(); return new Ports();
} }

View File

@ -48,6 +48,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockVertical2; import net.sourceforge.plantuml.graphic.TextBlockVertical2;
import net.sourceforge.plantuml.style.Style;
public class BodyEnhanced2 extends BodyEnhancedAbstract { public class BodyEnhanced2 extends BodyEnhancedAbstract {
@ -57,8 +58,8 @@ public class BodyEnhanced2 extends BodyEnhancedAbstract {
private final LineBreakStrategy lineBreakStrategy; private final LineBreakStrategy lineBreakStrategy;
BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple skinParam, HorizontalAlignment align, BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple skinParam, HorizontalAlignment align,
FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy) { FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) {
super(align, titleConfig); super(align, titleConfig, style);
this.rawBody = rawBody; this.rawBody = rawBody;
this.lineBreakStrategy = lineBreakStrategy; this.lineBreakStrategy = lineBreakStrategy;
this.skinParam = skinParam; this.skinParam = skinParam;

View File

@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; 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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements TextBlock { 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 HorizontalAlignment align;
protected final FontConfiguration titleConfig; protected final FontConfiguration titleConfig;
protected TextBlock area; protected TextBlock area;
private final Style style;
BodyEnhancedAbstract(HorizontalAlignment align, FontConfiguration titleConfig) { BodyEnhancedAbstract(HorizontalAlignment align, FontConfiguration titleConfig, Style style) {
this.align = align; this.align = align;
this.titleConfig = titleConfig; this.titleConfig = titleConfig;
this.style = style;
} }
public static boolean isBlockSeparator(CharSequence cs) { 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) { final protected TextBlock getTitle(String s, ISkinSimple spriteContainer) {
if (s.length() <= 4) { if (s.length() <= 4)
return null; return null;
}
s = StringUtils.trin(s.substring(2, s.length() - 2)); s = StringUtils.trin(s.substring(2, s.length() - 2));
return Display.getWithNewlines(s).create(titleConfig, HorizontalAlignment.LEFT, spriteContainer); 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 protected TextBlock decorate(StringBounder stringBounder, TextBlock b, char separator, TextBlock title) {
final double marginX = getMarginX(); final double marginX = getMarginX();
if (separator == 0) { if (separator == 0)
return TextBlockUtils.withMargin(b, marginX, 0); return TextBlockUtils.withMargin(b, marginX, 0);
}
if (title == null) { if (title == null)
return new TextBlockLineBefore(TextBlockUtils.withMargin(b, marginX, 4), separator); return new TextBlockLineBefore(getDefaultThickness(), TextBlockUtils.withMargin(b, marginX, 4), separator);
}
final Dimension2D dimTitle = title.calculateDimension(stringBounder); 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); TextBlockUtils.withMargin(b, marginX, 6, dimTitle.getHeight() / 2, 4), separator, title);
return TextBlockUtils.withMargin(raw, 0, 0, dimTitle.getHeight() / 2, 0); 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;
}
} }

View File

@ -74,8 +74,9 @@ public class BodyFactory {
} }
public static TextBlock create3(Display rawBody, FontParam fontParam, ISkinSimple skinParam, public static TextBlock create3(Display rawBody, FontParam fontParam, ISkinSimple skinParam,
HorizontalAlignment align, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy) { HorizontalAlignment align, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy,
return new BodyEnhanced2(rawBody, fontParam, skinParam, align, titleConfig, lineBreakStrategy); Style style) {
return new BodyEnhanced2(rawBody, fontParam, skinParam, align, titleConfig, lineBreakStrategy, style);
} }
} }

View File

@ -56,13 +56,10 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockWithUrl; import net.sourceforge.plantuml.graphic.TextBlockWithUrl;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.Ports; import net.sourceforge.plantuml.svek.Ports;
import net.sourceforge.plantuml.svek.WithPorts; import net.sourceforge.plantuml.svek.WithPorts;
import net.sourceforge.plantuml.ugraphic.PlacementStrategy; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULayoutGroup; import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.utils.CharHidder; import net.sourceforge.plantuml.utils.CharHidder;
public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, WithPorts { public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, WithPorts {
public TextBlock asBlockMemberImpl() { 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; private final FontParam fontParam;

View File

@ -78,6 +78,7 @@ public class Rainbow {
return Rainbow.build(new HtmlColorAndStyle(arrowColor, arrowHeadColor)); return Rainbow.build(new HtmlColorAndStyle(arrowColor, arrowHeadColor));
} }
@Deprecated
public static Rainbow build(ISkinParam skinParam) { public static Rainbow build(ISkinParam skinParam) {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
throw new IllegalStateException(); throw new IllegalStateException();

View File

@ -51,19 +51,21 @@ public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock,
private final TextBlock textBlock; private final TextBlock textBlock;
private final char separator; private final char separator;
private final TextBlock title; 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.textBlock = textBlock;
this.separator = separator; this.separator = separator;
this.title = title; this.title = title;
this.defaultThickness = defaultThickness;
} }
public TextBlockLineBefore(TextBlock textBlock, char separator) { public TextBlockLineBefore(double defaultThickness, TextBlock textBlock, char separator) {
this(textBlock, separator, null); this(defaultThickness, textBlock, separator, null);
} }
public TextBlockLineBefore(TextBlock textBlock) { public TextBlockLineBefore(double defaultThickness, TextBlock textBlock) {
this(textBlock, '\0'); this(defaultThickness, textBlock, '\0');
} }
public Dimension2D calculateDimension(StringBounder stringBounder) { public Dimension2D calculateDimension(StringBounder stringBounder) {
@ -77,18 +79,18 @@ public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock,
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final HColor color = ug.getParam().getColor(); final HColor color = ug.getParam().getColor();
if (title == null) { if (title == null)
UHorizontalLine.infinite(1, 1, separator).drawMe(ug); UHorizontalLine.infinite(defaultThickness, 1, 1, separator).drawMe(ug);
}
textBlock.drawU(ug); textBlock.drawU(ug);
if (color == null) { if (color == null)
ug = ug.apply(new HColorNone()); ug = ug.apply(new HColorNone());
} else { else
ug = ug.apply(color); ug = ug.apply(color);
}
if (title != null) { if (title != null)
UHorizontalLine.infinite(1, 1, title, separator).drawMe(ug); UHorizontalLine.infinite(defaultThickness, 1, 1, title, separator).drawMe(ug);
}
} }
@Override @Override

View File

@ -102,10 +102,10 @@ public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock,
final Dimension2D dimb = block.calculateDimension(ug.getStringBounder()); final Dimension2D dimb = block.calculateDimension(ug.getStringBounder());
if (block instanceof TextBlockBackcolored) { if (block instanceof TextBlockBackcolored) {
final HColor back = ((TextBlockBackcolored) block).getBackcolor(); final HColor back = ((TextBlockBackcolored) block).getBackcolor();
if (back != null) { if (back != null)
ug.apply(UTranslate.dy(y)).apply(back).apply(back.bg()) ug.apply(UTranslate.dy(y)).apply(back).apply(back.bg())
.draw(new URectangle(dimtotal.getWidth(), dimb.getHeight())); .draw(new URectangle(dimtotal.getWidth(), dimb.getHeight()));
}
} }
if (horizontalAlignment == HorizontalAlignment.LEFT) { if (horizontalAlignment == HorizontalAlignment.LEFT) {
block.drawU(ug.apply(UTranslate.dy(y))); block.drawU(ug.apply(UTranslate.dy(y)));

View File

@ -65,7 +65,7 @@ public class Frame implements Component {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -223,7 +223,7 @@ public class TaskDrawRegular extends AbstractTaskDraw {
final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getColorSet()); final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getColorSet());
final double shadowing = style.value(PName.Shadowing).asDouble(); 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) { public FingerPrint getFingerPrint(StringBounder stringBounder) {

View File

@ -133,7 +133,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
if (minMax != null) { 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 // mirroring takes care of that
ug = ug.apply(new UTranslate(6 - minMax.getMinX(), 6)); ug = ug.apply(new UTranslate(6 - minMax.getMinX(), 6));
} }
@ -158,8 +159,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
continue; continue;
} }
final ST_Agedge_s edge = ent.getValue(); final ST_Agedge_s edge = ent.getValue();
new SmetanaPath(link, edge, ymirror, diagram, getLabel(link), getQualifier(link, 1), getQualifier(link, 2)) new SmetanaPath(link, edge, ymirror, diagram, getLabel(link), getQualifier(link, 1),
.drawU(ug); getQualifier(link, 2)).drawU(ug);
} }
} }
@ -221,7 +222,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
// ug.apply(new UTranslate(llx, lly)).apply(new // ug.apply(new UTranslate(llx, lly)).apply(new
// UChangeColor(HtmlColorUtils.BLUE)) // UChangeColor(HtmlColorUtils.BLUE))
// .draw(new URectangle(urx - llx, ury - lly)); // .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) { } catch (Exception e) {
System.err.println("CANNOT DRAW GROUP"); System.err.println("CANNOT DRAW GROUP");
} }
@ -324,7 +325,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
throw new IllegalStateException(); throw new IllegalStateException();
} }
final IEntityImage image = printEntityInternal(ent); 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); dotStringFactory.addNode(node);
} }
@ -449,9 +451,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
// imageBuilder.setUDrawable(new Drawing(new YMirror(dim.getHeight()))); // imageBuilder.setUDrawable(new Drawing(new YMirror(dim.getHeight())));
final TextBlock drawable = new Drawing(new YMirror(minMax.getMaxY()), minMax); final TextBlock drawable = new Drawing(new YMirror(minMax.getMaxY()), minMax);
return diagram.createImageBuilder(fileFormatOption) return diagram.createImageBuilder(fileFormatOption).drawable(drawable).write(os);
.drawable(drawable)
.write(os);
} catch (Throwable e) { } catch (Throwable e) {
SmetanaDebug.printMe(); SmetanaDebug.printMe();
UmlDiagram.exportDiagramError(os, e, fileFormatOption, diagram.seed(), diagram.getMetadata(), UmlDiagram.exportDiagramError(os, e, fileFormatOption, diagram.seed(), diagram.getMetadata(),
@ -620,7 +620,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
return; return;
} }
final IEntityImage image = printEntityInternal(ent); 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); // dotStringFactory.addShape(shape);
} }

View File

@ -54,14 +54,14 @@ import net.sourceforge.plantuml.style.WithStyle;
public abstract class AbstractMessage implements EventWithDeactivate, WithStyle { public abstract class AbstractMessage implements EventWithDeactivate, WithStyle {
public Style[] getUsedStyles() { public Style[] getUsedStyles() {
Style style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); Style style = getStyleSignature().getMergedStyle(styleBuilder);
if (style != null && arrowConfiguration.getColor() != null) { if (style != null && arrowConfiguration.getColor() != null) {
style = style.eventuallyOverride(PName.LineColor, arrowConfiguration.getColor()); style = style.eventuallyOverride(PName.LineColor, arrowConfiguration.getColor());
} }
return new Style[] { style }; return new Style[] { style };
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow); return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow);
} }

View File

@ -48,8 +48,8 @@ public class Delay extends AbstractEvent implements Event, WithStyle {
final private Style style; final private Style style;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return ComponentType.DELAY_TEXT.getDefaultStyleDefinition(); return ComponentType.DELAY_TEXT.getStyleSignature();
} }
public Style[] getUsedStyles() { public Style[] getUsedStyles() {
@ -58,7 +58,7 @@ public class Delay extends AbstractEvent implements Event, WithStyle {
public Delay(Display text, StyleBuilder styleBuilder) { public Delay(Display text, StyleBuilder styleBuilder) {
this.text = text; this.text = text;
this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); this.style = getStyleSignature().getMergedStyle(styleBuilder);
} }
public final Display getText() { public final Display getText() {

View File

@ -48,8 +48,8 @@ public class Divider extends AbstractEvent implements Event, WithStyle {
final private Style style; final private Style style;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return ComponentType.DIVIDER.getDefaultStyleDefinition(); return ComponentType.DIVIDER.getStyleSignature();
} }
public Style[] getUsedStyles() { public Style[] getUsedStyles() {
@ -58,7 +58,7 @@ public class Divider extends AbstractEvent implements Event, WithStyle {
public Divider(Display text, StyleBuilder styleBuilder) { public Divider(Display text, StyleBuilder styleBuilder) {
this.text = text; this.text = text;
this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); this.style = getStyleSignature().getMergedStyle(styleBuilder);
} }
public final Display getText() { public final Display getText() {

View File

@ -94,12 +94,12 @@ public class Doll implements WithStyle {
} }
final public StyleSignature getDefaultStyleDefinition() { final public StyleSignature getStyleSignature() {
return ComponentType.ENGLOBER.getDefaultStyleDefinition(); return ComponentType.ENGLOBER.getStyleSignature();
} }
final public Style[] getUsedStyles() { 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(); final HColor backColor = englober.getBoxColor();
if (tmp != null) if (tmp != null)
tmp = tmp.eventuallyOverride(PName.BackGroundColor, backColor); tmp = tmp.eventuallyOverride(PName.BackGroundColor, backColor);

View File

@ -55,7 +55,7 @@ public abstract class Grouping implements Event, WithStyle {
final private Style style; final private Style style;
final private Style styleHeader; final private Style styleHeader;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.group); 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.comment = comment;
this.type = type; this.type = type;
this.backColorElement = backColorElement; this.backColorElement = backColorElement;
this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); this.style = getStyleSignature().getMergedStyle(styleBuilder);
this.styleHeader = getHeaderStyleDefinition().getMergedStyle(styleBuilder); this.styleHeader = getHeaderStyleDefinition().getMergedStyle(styleBuilder);
} }

View File

@ -112,7 +112,7 @@ public class LinkAnchor {
final Display display = Display.getWithNewlines(message); final Display display = Display.getWithNewlines(message);
final TextBlock title = display.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam); 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); HorizontalAlignment.CENTER);
snake.addPoint(x, ymin + 2); snake.addPoint(x, ymin + 2);

View File

@ -72,7 +72,7 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo
private Style style; private Style style;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return noteStyle.getDefaultStyleDefinition(); return noteStyle.getDefaultStyleDefinition();
} }
@ -103,14 +103,14 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo
this.position = position; this.position = position;
this.strings = strings; this.strings = strings;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
this.style = getDefaultStyleDefinition().getMergedStyle(styleBuilder); this.style = getStyleSignature().getMergedStyle(styleBuilder);
} }
} }
public void setStereotype(Stereotype stereotype) { public void setStereotype(Stereotype stereotype) {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final List<Style> others = stereotype.getStyles(styleBuilder); final List<Style> others = stereotype.getStyles(styleBuilder);
this.style = getDefaultStyleDefinition().mergeWith(others).getMergedStyle(styleBuilder); this.style = getStyleSignature().mergeWith(others).getMergedStyle(styleBuilder);
} }
} }

View File

@ -72,18 +72,18 @@ public class Participant implements SpecificBackcolorable, WithStyle {
// private Style style; // private Style style;
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
return type.getDefaultStyleDefinition().addClickable(getUrl()); return type.getStyleSignature().addClickable(getUrl());
} }
public Style[] getUsedStyles() { public Style[] getUsedStyles() {
if (UseStyle.useBetaStyle() == false) { if (UseStyle.useBetaStyle() == false) {
return null; return null;
} }
final StyleSignature signature = getDefaultStyleDefinition().with(stereotype); final StyleSignature signature = getStyleSignature().with(stereotype);
Style tmp = signature.getMergedStyle(styleBuilder); Style tmp = signature.getMergedStyle(styleBuilder);
tmp = tmp.eventuallyOverride(getColors()); tmp = tmp.eventuallyOverride(getColors());
Style stereo = getDefaultStyleDefinition().forStereotypeItself(stereotype).getMergedStyle(styleBuilder); Style stereo = getStyleSignature().forStereotypeItself(stereotype).getMergedStyle(styleBuilder);
if (tmp != null) { if (tmp != null) {
stereo = tmp.mergeWith(stereo); stereo = tmp.mergeWith(stereo);
} }

View File

@ -60,7 +60,7 @@ public enum ParticipantType implements Styleable {
return background; return background;
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
if (this == PARTICIPANT) { if (this == PARTICIPANT) {
return StyleSignature.of(SName.root, SName.element, return StyleSignature.of(SName.root, SName.element,
SName.sequenceDiagram, SName.participant); SName.sequenceDiagram, SName.participant);

View File

@ -623,7 +623,7 @@ class DrawableSetInitializer {
participantDisplay); participantDisplay);
final Component tail = drawableSet.getSkin().createComponent(p.getUsedStyles(), tailType, null, skinParam, final Component tail = drawableSet.getSkin().createComponent(p.getUsedStyles(), tailType, null, skinParam,
participantDisplay); participantDisplay);
final Style style = this.defaultLineType.getDefaultStyleDefinition().with(p.getStereotype()) final Style style = this.defaultLineType.getStyleSignature().with(p.getStereotype())
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
final Component line = drawableSet.getSkin().createComponent(new Style[] { style }, this.defaultLineType, null, final Component line = drawableSet.getSkin().createComponent(new Style[] { style }, this.defaultLineType, null,
drawableSet.getSkinParam(), participantDisplay); drawableSet.getSkinParam(), participantDisplay);
@ -633,7 +633,7 @@ class DrawableSetInitializer {
skinParam.maxAsciiMessageLength() > 0 ? 1 : 5); skinParam.maxAsciiMessageLength() > 0 ? 1 : 5);
final Component comp = drawableSet.getSkin().createComponent( final Component comp = drawableSet.getSkin().createComponent(
new Style[] { ComponentType.ALIVE_BOX_CLOSE_CLOSE.getDefaultStyleDefinition() new Style[] { ComponentType.ALIVE_BOX_CLOSE_CLOSE.getStyleSignature()
.getMergedStyle(drawableSet.getSkinParam().getCurrentStyleBuilder()) }, .getMergedStyle(drawableSet.getSkinParam().getCurrentStyleBuilder()) },
ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, drawableSet.getSkinParam(), null); ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, drawableSet.getSkinParam(), null);

View File

@ -220,7 +220,7 @@ public class LifeLine {
type = type == ComponentType.ALIVE_BOX_CLOSE_OPEN ? ComponentType.ALIVE_BOX_CLOSE_CLOSE type = type == ComponentType.ALIVE_BOX_CLOSE_OPEN ? ComponentType.ALIVE_BOX_CLOSE_CLOSE
: ComponentType.ALIVE_BOX_OPEN_CLOSE; : ComponentType.ALIVE_BOX_OPEN_CLOSE;
} }
Style style = type.getDefaultStyleDefinition().getMergedStyle(skinParam2.getCurrentStyleBuilder()); Style style = type.getStyleSignature().getMergedStyle(skinParam2.getCurrentStyleBuilder());
if (style != null) { if (style != null) {
style = style.eventuallyOverride(PName.BackGroundColor, specificBackColor); style = style.eventuallyOverride(PName.BackGroundColor, specificBackColor);
style = style.eventuallyOverride(PName.LineColor, specificLineColor); style = style.eventuallyOverride(PName.LineColor, specificLineColor);

View File

@ -74,7 +74,7 @@ class Step1Message extends Step1Abstract {
final ArrowComponent comp = drawingSet.getSkin().createComponentArrow(message.getUsedStyles(), getConfig(), final ArrowComponent comp = drawingSet.getSkin().createComponentArrow(message.getUsedStyles(), getConfig(),
drawingSet.getSkinParam(), message.getLabelNumbered()); drawingSet.getSkinParam(), message.getLabelNumbered());
final Component compAliveBox = drawingSet.getSkin().createComponent( final Component compAliveBox = drawingSet.getSkin().createComponent(
new Style[] { ComponentType.ALIVE_BOX_OPEN_OPEN.getDefaultStyleDefinition() new Style[] { ComponentType.ALIVE_BOX_OPEN_OPEN.getStyleSignature()
.getMergedStyle(drawingSet.getSkinParam().getCurrentStyleBuilder()) }, .getMergedStyle(drawingSet.getSkinParam().getCurrentStyleBuilder()) },
ComponentType.ALIVE_BOX_OPEN_OPEN, null, drawingSet.getSkinParam(), null); ComponentType.ALIVE_BOX_OPEN_OPEN, null, drawingSet.getSkinParam(), null);
@ -224,7 +224,7 @@ class Step1Message extends Step1Abstract {
private double getHalfLifeWidth() { private double getHalfLifeWidth() {
return getDrawingSet().getSkin() return getDrawingSet().getSkin()
.createComponent( .createComponent(
new Style[] { ComponentType.ALIVE_BOX_OPEN_OPEN.getDefaultStyleDefinition() new Style[] { ComponentType.ALIVE_BOX_OPEN_OPEN.getStyleSignature()
.getMergedStyle(getDrawingSet().getSkinParam().getCurrentStyleBuilder()) }, .getMergedStyle(getDrawingSet().getSkinParam().getCurrentStyleBuilder()) },
ComponentType.ALIVE_BOX_OPEN_OPEN, null, getDrawingSet().getSkinParam(), Display.create("")) ComponentType.ALIVE_BOX_OPEN_OPEN, null, getDrawingSet().getSkinParam(), Display.create(""))
.getPreferredWidth(null) / 2; .getPreferredWidth(null) / 2;

View File

@ -37,66 +37,23 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Note; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommunicationTileNoteBottom extends AbstractTile { public class CommunicationTileNoteBottom extends CommunicationTileNoteBottomTopAbstract {
private final Tile tile;
private final AbstractMessage message;
private final Rose skin;
private final ISkinParam skinParam;
private final Note noteOnMessage;
public Event getEvent() {
return message;
}
@Override
public double getContactPointRelative() {
return tile.getContactPointRelative();
}
public CommunicationTileNoteBottom(Tile tile, AbstractMessage message, Rose skin, ISkinParam skinParam, public CommunicationTileNoteBottom(Tile tile, AbstractMessage message, Rose skin, ISkinParam skinParam,
Note noteOnMessage) { Note noteOnMessage) {
super(((AbstractTile) tile).getStringBounder()); super(tile, message, skin, skinParam, noteOnMessage);
this.tile = tile;
this.message = message;
this.skin = skin;
this.skinParam = skinParam;
this.noteOnMessage = noteOnMessage;
}
@Override
final protected void callbackY_internal(double y) {
tile.callbackY(y);
}
private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponentNote(noteOnMessage.getUsedStyles(), ComponentType.NOTE, noteOnMessage.getSkinParamBackcolored(skinParam),
noteOnMessage.getStrings());
return comp;
}
private Real getNotePosition(StringBounder stringBounder) {
final Real minX = tile.getMinX();
return minX;
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
@ -118,34 +75,4 @@ public class CommunicationTileNoteBottom extends AbstractTile {
} }
private final double spacey = 10;
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
final HColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
final double dx = x2 - x1;
final double dy = y2 - y1;
ug.apply(new UTranslate(x1, y1)).apply(color).apply(new UStroke(2, 2, 1)).draw(new ULine(dx, dy));
}
public double getPreferredHeight() {
final Component comp = getComponent(getStringBounder());
final Dimension2D dim = comp.getPreferredDimension(getStringBounder());
return tile.getPreferredHeight() + dim.getHeight() + spacey;
}
public void addConstraints() {
tile.addConstraints();
}
public Real getMinX() {
return tile.getMinX();
}
public Real getMaxX() {
return tile.getMaxX();
}
} }

View File

@ -0,0 +1,163 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
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.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public abstract class CommunicationTileNoteBottomTopAbstract extends AbstractTile {
protected final Tile tile;
protected final AbstractMessage message;
protected final Rose skin;
protected final ISkinParam skinParam;
protected final Note noteOnMessage;
final public Event getEvent() {
return message;
}
@Override
final public double getContactPointRelative() {
return tile.getContactPointRelative();
}
public CommunicationTileNoteBottomTopAbstract(Tile tile, AbstractMessage message, Rose skin, ISkinParam skinParam,
Note noteOnMessage) {
super(((AbstractTile) tile).getStringBounder());
this.tile = tile;
this.message = message;
this.skin = skin;
this.skinParam = skinParam;
this.noteOnMessage = noteOnMessage;
}
@Override
final protected void callbackY_internal(double y) {
tile.callbackY(y);
}
final protected Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponentNote(noteOnMessage.getUsedStyles(), ComponentType.NOTE,
noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp;
}
final protected Real getNotePosition(StringBounder stringBounder) {
final Real minX = tile.getMinX();
return minX;
}
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
final Area area = new Area(dim.getWidth(), dim.getHeight());
((UDrawable) tile).drawU(ug);
final double middleMsg = (tile.getMinX().getCurrentValue() + tile.getMaxX().getCurrentValue()) / 2;
final double xNote = getNotePosition(stringBounder).getCurrentValue();
final double yNote = tile.getPreferredHeight();
comp.drawU(ug.apply(new UTranslate(xNote, yNote + spacey)), area, (Context2D) ug);
drawLine(ug, middleMsg, tile.getContactPointRelative(), xNote + dim.getWidth() / 2,
yNote + spacey + Rose.paddingY);
}
protected final double spacey = 10;
protected final void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
final HColor color;
if (UseStyle.useBetaStyle()) {
final Style style = StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else
color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
final double dx = x2 - x1;
final double dy = y2 - y1;
ug.apply(new UTranslate(x1, y1)).apply(color).apply(new UStroke(2, 2, 1)).draw(new ULine(dx, dy));
}
public double getPreferredHeight() {
final Component comp = getComponent(getStringBounder());
final Dimension2D dim = comp.getPreferredDimension(getStringBounder());
return tile.getPreferredHeight() + dim.getHeight() + spacey;
}
public void addConstraints() {
tile.addConstraints();
}
public Real getMinX() {
return tile.getMinX();
}
public Real getMaxX() {
return tile.getMaxX();
}
}

View File

@ -37,66 +37,23 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Note; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommunicationTileNoteTop extends AbstractTile { public class CommunicationTileNoteTop extends CommunicationTileNoteBottomTopAbstract {
private final Tile tile;
private final AbstractMessage message;
private final Rose skin;
private final ISkinParam skinParam;
private final Note noteOnMessage;
public Event getEvent() {
return message;
}
@Override
public double getContactPointRelative() {
return tile.getContactPointRelative();
}
public CommunicationTileNoteTop(Tile tile, AbstractMessage message, Rose skin, ISkinParam skinParam, public CommunicationTileNoteTop(Tile tile, AbstractMessage message, Rose skin, ISkinParam skinParam,
Note noteOnMessage) { Note noteOnMessage) {
super(((AbstractTile) tile).getStringBounder()); super(tile, message, skin, skinParam, noteOnMessage);
this.tile = tile;
this.message = message;
this.skin = skin;
this.skinParam = skinParam;
this.noteOnMessage = noteOnMessage;
}
@Override
final protected void callbackY_internal(double y) {
tile.callbackY(y);
}
private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponentNote(noteOnMessage.getUsedStyles(), ComponentType.NOTE, noteOnMessage.getSkinParamBackcolored(skinParam),
noteOnMessage.getStrings());
return comp;
}
private Real getNotePosition(StringBounder stringBounder) {
final Real minX = tile.getMinX();
return minX;
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
@ -118,34 +75,4 @@ public class CommunicationTileNoteTop extends AbstractTile {
} }
private final double spacey = 10;
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
final HColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
final double dx = x2 - x1;
final double dy = y2 - y1;
ug.apply(new UTranslate(x1, y1)).apply(color).apply(new UStroke(2, 2, 1)).draw(new ULine(dx, dy));
}
public double getPreferredHeight() {
final Component comp = getComponent(getStringBounder());
final Dimension2D dim = comp.getPreferredDimension(getStringBounder());
return tile.getPreferredHeight() + dim.getHeight() + spacey;
}
public void addConstraints() {
tile.addConstraints();
}
public Real getMinX() {
return tile.getMinX();
}
public Real getMaxX() {
return tile.getMaxX();
}
} }

View File

@ -47,6 +47,8 @@ import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -84,9 +86,15 @@ public class LifeEventTile extends AbstractTile {
this.skinParam = skinParam; this.skinParam = skinParam;
} }
private StyleSignature getStyleSignature() {
return ComponentType.DESTROY.getStyleSignature();
}
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
if (isDestroyWithoutMessage()) { if (isDestroyWithoutMessage()) {
final Component cross = skin.createComponent(null, ComponentType.DESTROY, null, skinParam, null); final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
final Component cross = skin.createComponent(new Style[] { style }, ComponentType.DESTROY, null, skinParam,
null);
final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder()); final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder());
final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue(); final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue();
cross.drawU(ug.apply(UTranslate.dx(x - dimCross.getWidth() / 2)), null, (Context2D) ug); cross.drawU(ug.apply(UTranslate.dx(x - dimCross.getWidth() / 2)), null, (Context2D) ug);

View File

@ -70,11 +70,11 @@ public class LiveBoxesDrawer {
public LiveBoxesDrawer(Context2D context, Rose skin, ISkinParam skinParam, Map<Double, Double> delays) { public LiveBoxesDrawer(Context2D context, Rose skin, ISkinParam skinParam, Map<Double, Double> delays) {
this.cross = skin.createComponent( this.cross = skin.createComponent(
new Style[] { ComponentType.DESTROY.getDefaultStyleDefinition() new Style[] { ComponentType.DESTROY.getStyleSignature()
.getMergedStyle(skinParam.getCurrentStyleBuilder()) }, .getMergedStyle(skinParam.getCurrentStyleBuilder()) },
ComponentType.DESTROY, null, skinParam, null); ComponentType.DESTROY, null, skinParam, null);
this.compForWidth = skin.createComponent( this.compForWidth = skin.createComponent(
new Style[] { ComponentType.ALIVE_BOX_CLOSE_CLOSE.getDefaultStyleDefinition() new Style[] { ComponentType.ALIVE_BOX_CLOSE_CLOSE.getStyleSignature()
.getMergedStyle(skinParam.getCurrentStyleBuilder()) }, .getMergedStyle(skinParam.getCurrentStyleBuilder()) },
ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam, null); ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam, null);
this.context = context; this.context = context;
@ -126,7 +126,7 @@ public class LiveBoxesDrawer {
final Area area = new Area(width, yb - ya); final Area area = new Area(width, yb - ya);
SkinParamBackcolored skinParam2 = new SkinParamBackcolored(skinParam, SkinParamBackcolored skinParam2 = new SkinParamBackcolored(skinParam,
symbolContext == null ? null : symbolContext.getBackColor()); symbolContext == null ? null : symbolContext.getBackColor());
Style style = type.getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); Style style = type.getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
if (style == null) { if (style == null) {
if (symbolContext != null) if (symbolContext != null)
skinParam2.forceColor(ColorParam.sequenceLifeLineBorder, symbolContext.getForeColor()); skinParam2.forceColor(ColorParam.sequenceLifeLineBorder, symbolContext.getForeColor());

View File

@ -110,7 +110,7 @@ public class MutingLine {
if (y2 < y1) { if (y2 < y1) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
final Style style = defaultLineType.getDefaultStyleDefinition().getMergedStyle(styleBuilder); final Style style = defaultLineType.getStyleSignature().getMergedStyle(styleBuilder);
final Component comp = skin.createComponent(new Style[] { style }, defaultLineType, null, skinParam, final Component comp = skin.createComponent(new Style[] { style }, defaultLineType, null, skinParam,
participant.getDisplay(skinParam.forceSequenceParticipantUnderlined())); participant.getDisplay(skinParam.forceSequenceParticipantUnderlined()));
final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder()); final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());

View File

@ -50,7 +50,7 @@ public abstract class AbstractComponent implements Component {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -114,7 +114,7 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
textBlock = new TextBlockEmpty(); textBlock = new TextBlockEmpty();
} else if (enhanced) { } else if (enhanced) {
textBlock = BodyFactory.create3(this.display, FontParam.NOTE, spriteContainer, horizontalAlignment, fc, textBlock = BodyFactory.create3(this.display, FontParam.NOTE, spriteContainer, horizontalAlignment, fc,
maxMessageSize); maxMessageSize, style);
} else { } else {
textBlock = this.display.create0(fc, horizontalAlignment, spriteContainer, maxMessageSize, CreoleMode.FULL, textBlock = this.display.create0(fc, horizontalAlignment, spriteContainer, maxMessageSize, CreoleMode.FULL,
fontForStereotype, htmlColorForStereotype, marginX1, marginX2); fontForStereotype, htmlColorForStereotype, marginX1, marginX2);

View File

@ -70,7 +70,7 @@ public enum ComponentType implements Styleable {
return this == ARROW; return this == ARROW;
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
if (this == PARTICIPANT_HEAD || this == PARTICIPANT_TAIL) { if (this == PARTICIPANT_HEAD || this == PARTICIPANT_TAIL) {
return StyleSignature.of(SName.root, SName.element, return StyleSignature.of(SName.root, SName.element,
SName.sequenceDiagram, SName.participant); SName.sequenceDiagram, SName.participant);

View File

@ -35,9 +35,11 @@
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.AbstractComponent; import net.sourceforge.plantuml.skin.AbstractComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
@ -49,9 +51,13 @@ public class ComponentRoseDestroy extends AbstractComponent {
private final HColor foregroundColor; private final HColor foregroundColor;
public ComponentRoseDestroy(Style style, HColor foregroundColor) { public ComponentRoseDestroy(Style style, HColor foregroundColor, ISkinSimple spriteContainer) {
super(style); super(style);
this.foregroundColor = foregroundColor; if (style != null)
this.foregroundColor = style.value(PName.LineColor).asColor(spriteContainer.getThemeStyle(),
spriteContainer.getIHtmlColorSet());
else
this.foregroundColor = foregroundColor;
} }
private final int crossSize = 9; private final int crossSize = 9;

View File

@ -52,7 +52,7 @@ public class ComponentRoseGroupingSpace implements Component {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public StyleSignature getDefaultStyleDefinition() { public StyleSignature getStyleSignature() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -99,9 +99,9 @@ public class ComponentRoseReference extends AbstractTextualComponent {
URectangle rect = new URectangle(dimensionToUse.getWidth() - xMargin * 2 - symbolContextBody.getDeltaShadow(), URectangle rect = new URectangle(dimensionToUse.getWidth() - xMargin * 2 - symbolContextBody.getDeltaShadow(),
dimensionToUse.getHeight() - heightFooter); dimensionToUse.getHeight() - heightFooter);
if (this.roundCorner != 0) { if (this.roundCorner != 0)
rect = rect.rounded(this.roundCorner); rect = rect.rounded(this.roundCorner);
}
rect.setDeltaShadow(symbolContextBody.getDeltaShadow()); rect.setDeltaShadow(symbolContextBody.getDeltaShadow());
ug = symbolContextBody.apply(ug); ug = symbolContextBody.apply(ug);
ug.apply(UTranslate.dx(xMargin)).draw(rect); ug.apply(UTranslate.dx(xMargin)).draw(rect);

View File

@ -326,7 +326,8 @@ public class Rose {
getUFont2(param, FontParam.SEQUENCE_DELAY), stringsToDisplay, param); getUFont2(param, FontParam.SEQUENCE_DELAY), stringsToDisplay, param);
} }
if (type == ComponentType.DESTROY) { if (type == ComponentType.DESTROY) {
return new ComponentRoseDestroy(null, getHtmlColor(param, stereotype, ColorParam.sequenceLifeLineBorder)); return new ComponentRoseDestroy(styles == null ? null : styles[0],
getHtmlColor(param, stereotype, ColorParam.sequenceLifeLineBorder), param);
} }
if (type == ComponentType.NEWPAGE) { if (type == ComponentType.NEWPAGE) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View File

@ -0,0 +1,69 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.style;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CssVariables {
private final Map<String, String> variables = new HashMap<>();
private final Pattern learnPattern = Pattern.compile("^--([_\\w][-_\\w]+)[ :]+(.*?);?");
private final Pattern retrieve = Pattern.compile("var\\(-*([_\\w][-_\\w]+)\\)");
public void learn(String s) {
final Matcher m = learnPattern.matcher(s);
if (m.matches())
variables.put(m.group(1), m.group(2));
}
public String value(String v) {
if (v.startsWith("var(")) {
final Matcher m = retrieve.matcher(v);
if (m.matches()) {
final String varname = m.group(1);
final String result = variables.get(varname);
if (result != null)
return result;
}
}
return v;
}
}

View File

@ -118,6 +118,7 @@ public class StyleLoader {
public static Collection<Style> getDeclaredStyles(BlocLines lines, AutomaticCounter counter) { public static Collection<Style> getDeclaredStyles(BlocLines lines, AutomaticCounter counter) {
lines = lines.eventuallyMoveAllEmptyBracket(); lines = lines.eventuallyMoveAllEmptyBracket();
final List<Style> result = new ArrayList<>(); final List<Style> result = new ArrayList<>();
final CssVariables variables = new CssVariables();
StyleScheme scheme = StyleScheme.REGULAR; StyleScheme scheme = StyleScheme.REGULAR;
Context context = new Context(); Context context = new Context();
@ -125,6 +126,7 @@ public class StyleLoader {
boolean inComment = false; boolean inComment = false;
for (StringLocated s : lines) { for (StringLocated s : lines) {
String trimmed = s.getTrimmed().getString(); String trimmed = s.getTrimmed().getString();
if (trimmed.startsWith("/*") || trimmed.endsWith("*/")) if (trimmed.startsWith("/*") || trimmed.endsWith("*/"))
continue; continue;
if (trimmed.startsWith("/'") || trimmed.endsWith("'/")) if (trimmed.startsWith("/'") || trimmed.endsWith("'/"))
@ -146,6 +148,11 @@ public class StyleLoader {
continue; continue;
} }
if (trimmed.startsWith("--")) {
variables.learn(trimmed);
continue;
}
final int x = trimmed.lastIndexOf("//"); final int x = trimmed.lastIndexOf("//");
if (x != -1) if (x != -1)
trimmed = trimmed.substring(0, x).trim(); trimmed = trimmed.substring(0, x).trim();
@ -164,7 +171,7 @@ public class StyleLoader {
final Matcher2 mPropertyAndValue = propertyAndValue.matcher(trimmed); final Matcher2 mPropertyAndValue = propertyAndValue.matcher(trimmed);
if (mPropertyAndValue.find()) { if (mPropertyAndValue.find()) {
final PName key = PName.getFromName(mPropertyAndValue.group(1), scheme); final PName key = PName.getFromName(mPropertyAndValue.group(1), scheme);
final String value = mPropertyAndValue.group(2); final String value = variables.value(mPropertyAndValue.group(2));
if (key != null && maps.size() > 0) if (key != null && maps.size() > 0)
maps.get(maps.size() - 1).put(key, // maps.get(maps.size() - 1).put(key, //
scheme == StyleScheme.REGULAR ? // scheme == StyleScheme.REGULAR ? //

View File

@ -225,4 +225,18 @@ public class StyleSignature {
return withDot; return withDot;
} }
// Frequent use
public static StyleSignature activity() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity);
}
public static StyleSignature activityDiamond() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
}
public static StyleSignature activityArrow() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.arrow);
}
} }

View File

@ -37,6 +37,6 @@ package net.sourceforge.plantuml.style;
public interface Styleable { public interface Styleable {
public StyleSignature getDefaultStyleDefinition(); public StyleSignature getStyleSignature();
} }

View File

@ -304,7 +304,7 @@ public class Cluster implements Moveable {
.with(stereotype); .with(stereotype);
} }
public void drawU(UGraphic ug, UStroke strokeForState, UmlDiagramType umlDiagramType, ISkinParam skinParam2) { public void drawU(UGraphic ug, UmlDiagramType umlDiagramType, ISkinParam skinParam2) {
if (group.isHidden()) if (group.isHidden())
return; return;
@ -362,6 +362,8 @@ public class Cluster implements Moveable {
final boolean isState = umlDiagramType == UmlDiagramType.STATE; final boolean isState = umlDiagramType == UmlDiagramType.STATE;
if (isState && group.getUSymbol() == null) { if (isState && group.getUSymbol() == null) {
UStroke strokeForState = getDefaultStyleDefinition(SName.stateDiagram, null)
.getMergedStyle(skinParam.getCurrentStyleBuilder()).getStroke();
if (group.getColors().getSpecificLineStroke() != null) if (group.getColors().getSpecificLineStroke() != null)
strokeForState = group.getColors().getSpecificLineStroke(); strokeForState = group.getColors().getSpecificLineStroke();

View File

@ -41,10 +41,15 @@ import java.util.List;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.rose.Rose; 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.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
@ -62,27 +67,27 @@ public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBl
VERTICAL, HORIZONTAL; VERTICAL, HORIZONTAL;
static Separator fromChar(char sep) { static Separator fromChar(char sep) {
if (sep == '|') { if (sep == '|')
return VERTICAL; return VERTICAL;
}
if (sep == '-') { if (sep == '-')
return HORIZONTAL; return HORIZONTAL;
}
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
UTranslate move(Dimension2D dim) { UTranslate move(Dimension2D dim) {
if (this == VERTICAL) { if (this == VERTICAL)
return UTranslate.dx(dim.getWidth()); return UTranslate.dx(dim.getWidth());
}
return UTranslate.dy(dim.getHeight()); return UTranslate.dy(dim.getHeight());
} }
Dimension2D add(Dimension2D orig, Dimension2D other) { Dimension2D add(Dimension2D orig, Dimension2D other) {
if (this == VERTICAL) { if (this == VERTICAL)
return new Dimension2DDouble(orig.getWidth() + other.getWidth(), return new Dimension2DDouble(orig.getWidth() + other.getWidth(),
Math.max(orig.getHeight(), other.getHeight())); Math.max(orig.getHeight(), other.getHeight()));
}
return new Dimension2DDouble(Math.max(orig.getWidth(), other.getWidth()), return new Dimension2DDouble(Math.max(orig.getWidth(), other.getWidth()),
orig.getHeight() + other.getHeight()); orig.getHeight() + other.getHeight());
} }
@ -91,19 +96,14 @@ public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBl
final double THICKNESS_BORDER = 1.5; final double THICKNESS_BORDER = 1.5;
final int DASH = 8; final int DASH = 8;
ug = ug.apply(new UStroke(DASH, 10, THICKNESS_BORDER)); ug = ug.apply(new UStroke(DASH, 10, THICKNESS_BORDER));
if (this == VERTICAL) { if (this == VERTICAL)
ug.draw(ULine.vline(dimTotal.getHeight() + DASH)); ug.draw(ULine.vline(dimTotal.getHeight() + DASH));
} else { else
ug.draw(ULine.hline(dimTotal.getWidth() + DASH)); ug.draw(ULine.hline(dimTotal.getWidth() + DASH));
}
} }
} }
private HColor getColor(ColorParam colorParam, Stereotype stereotype) {
return new Rose().getHtmlColor(skinParam, stereotype, colorParam);
}
public CucaDiagramFileMakerSvek2InternalImage(List<IEntityImage> inners, char concurrentSeparator, public CucaDiagramFileMakerSvek2InternalImage(List<IEntityImage> inners, char concurrentSeparator,
ISkinParam skinParam, Stereotype stereotype) { ISkinParam skinParam, Stereotype stereotype) {
this.separator = Separator.fromChar(concurrentSeparator); this.separator = Separator.fromChar(concurrentSeparator);
@ -112,8 +112,21 @@ public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBl
this.inners = inners; this.inners = inners;
} }
private Style getStyle() {
return getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
}
private StyleSignature getStyleSignature() {
return StyleSignature.of(SName.root, SName.element, SName.stateDiagram, SName.state);
}
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final HColor dotColor = getColor(ColorParam.stateBorder, stereotype); final HColor borderColor;
if (UseStyle.useBetaStyle())
borderColor = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
else
borderColor = new Rose().getHtmlColor(skinParam, stereotype, ColorParam.stateBorder);
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimTotal = calculateDimension(stringBounder); final Dimension2D dimTotal = calculateDimension(stringBounder);
@ -122,9 +135,9 @@ public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBl
inner.drawU(ug); inner.drawU(ug);
final Dimension2D dim = inner.calculateDimension(stringBounder); final Dimension2D dim = inner.calculateDimension(stringBounder);
ug = ug.apply(separator.move(dim)); ug = ug.apply(separator.move(dim));
if (i < inners.size() - 1) { if (i < inners.size() - 1)
separator.drawSeparator(ug.apply(dotColor), dimTotal); separator.drawSeparator(ug.apply(borderColor), dimTotal);
}
} }
} }

View File

@ -185,7 +185,7 @@ public final class GeneralImageBuilder {
} }
if (leaf.getStereotype() != null if (leaf.getStereotype() != null
&& "<<sdlreceive>>".equals(leaf.getStereotype().getLabel(Guillemet.DOUBLE_COMPARATOR))) { && "<<sdlreceive>>".equals(leaf.getStereotype().getLabel(Guillemet.DOUBLE_COMPARATOR))) {
return new EntityImageState2(leaf, skinParam); return new EntityImageState2(leaf, skinParam, umlDiagramType.getStyleName());
} }
return new EntityImageState(leaf, skinParam); return new EntityImageState(leaf, skinParam);
@ -262,13 +262,13 @@ public final class GeneralImageBuilder {
return new EntityImageEmptyPackage(leaf, skinParam, portionShower, umlDiagramType.getStyleName()); return new EntityImageEmptyPackage(leaf, skinParam, portionShower, umlDiagramType.getStyleName());
} }
if (leaf.getLeafType() == LeafType.ASSOCIATION) { if (leaf.getLeafType() == LeafType.ASSOCIATION) {
return new EntityImageAssociation(leaf, skinParam); return new EntityImageAssociation(leaf, skinParam, umlDiagramType.getStyleName());
} }
if (leaf.getLeafType() == LeafType.PSEUDO_STATE) { if (leaf.getLeafType() == LeafType.PSEUDO_STATE) {
return new EntityImagePseudoState(leaf, skinParam); return new EntityImagePseudoState(leaf, skinParam, umlDiagramType.getStyleName());
} }
if (leaf.getLeafType() == LeafType.DEEP_HISTORY) { if (leaf.getLeafType() == LeafType.DEEP_HISTORY) {
return new EntityImageDeepHistory(leaf, skinParam); return new EntityImageDeepHistory(leaf, skinParam, umlDiagramType.getStyleName());
} }
if (leaf.getLeafType() == LeafType.TIPS) { if (leaf.getLeafType() == LeafType.TIPS) {

View File

@ -92,9 +92,9 @@ public final class GroupPngMakerState {
} }
public Collection<IGroup> getChildrenGroups(IGroup parent) { public Collection<IGroup> getChildrenGroups(IGroup parent) {
if (EntityUtils.groupRoot(parent)) { if (EntityUtils.groupRoot(parent))
return diagram.getChildrenGroups(group); return diagram.getChildrenGroups(group);
}
return diagram.getChildrenGroups(parent); return diagram.getChildrenGroups(parent);
} }
@ -108,18 +108,17 @@ public final class GroupPngMakerState {
this.diagram = diagram; this.diagram = diagram;
this.stringBounder = stringBounder; this.stringBounder = stringBounder;
this.group = group; this.group = group;
if (group.isGroup() == false) { if (group.isGroup() == false)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
} }
private List<Link> getPureInnerLinks() { private List<Link> getPureInnerLinks() {
final List<Link> result = new ArrayList<>(); final List<Link> result = new ArrayList<>();
for (Link link : diagram.getLinks()) { for (Link link : diagram.getLinks())
if (EntityUtils.isPureInnerLink12(group, link)) { if (EntityUtils.isPureInnerLink12(group, link))
result.add(link); result.add(link);
}
}
return result; return result;
} }
@ -155,9 +154,9 @@ public final class GroupPngMakerState {
final TextBlock title = display.create(fontConfiguration, HorizontalAlignment.CENTER, diagram.getSkinParam()); final TextBlock title = display.create(fontConfiguration, HorizontalAlignment.CENTER, diagram.getSkinParam());
if (group.size() == 0 && group.getChildren().size() == 0) { if (group.size() == 0 && group.getChildren().size() == 0)
return new EntityImageState(group, diagram.getSkinParam()); return new EntityImageState(group, diagram.getSkinParam());
}
final List<Link> links = getPureInnerLinks(); final List<Link> links = getPureInnerLinks();
final DotData dotData = new DotData(group, links, group.getLeafsDirect(), diagram.getUmlDiagramType(), final DotData dotData = new DotData(group, links, group.getLeafsDirect(), diagram.getUmlDiagramType(),
@ -168,37 +167,39 @@ public final class GroupPngMakerState {
final GeneralImageBuilder svek2 = new GeneralImageBuilder(false, dotData, diagram.getEntityFactory(), final GeneralImageBuilder svek2 = new GeneralImageBuilder(false, dotData, diagram.getEntityFactory(),
diagram.getSource(), diagram.getPragma(), stringBounder, SName.stateDiagram); diagram.getSource(), diagram.getPragma(), stringBounder, SName.stateDiagram);
if (group.getGroupType() == GroupType.CONCURRENT_STATE) { if (group.getGroupType() == GroupType.CONCURRENT_STATE)
// return new InnerStateConcurrent(svek2.createFile());
return svek2.buildImage(null, new String[0]); return svek2.buildImage(null, new String[0]);
}
if (group.getGroupType() != GroupType.STATE) { if (group.getGroupType() != GroupType.STATE)
throw new UnsupportedOperationException(group.getGroupType().toString()); throw new UnsupportedOperationException(group.getGroupType().toString());
}
HColor borderColor = group.getColors().getColor(ColorType.LINE); HColor borderColor = group.getColors().getColor(ColorType.LINE);
if (borderColor == null) { if (borderColor == null)
if (UseStyle.useBetaStyle()) if (UseStyle.useBetaStyle())
borderColor = getStyleState().value(PName.LineColor).asColor(skinParam.getThemeStyle(), borderColor = getStyleState().value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
else else
borderColor = getColor(ColorParam.stateBorder, group.getStereotype()); borderColor = getColor(ColorParam.stateBorder, group.getStereotype());
}
final Stereotype stereo = group.getStereotype(); final Stereotype stereo = group.getStereotype();
final HColor tmp = group.getColors().getColor(ColorType.BACK); final HColor tmp = group.getColors().getColor(ColorType.BACK);
final HColor backColor; final HColor backColor;
if (tmp == null) if (tmp == null)
if (UseStyle.useBetaStyle()) if (UseStyle.useBetaStyle())
backColor = backColor = getStyleState().value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
getStyleState().value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
else else
backColor = getColor(ColorParam.stateBackground, stereo); backColor = getColor(ColorParam.stateBackground, stereo);
else else
backColor = tmp; backColor = tmp;
UStroke stroke = group.getColors().getSpecificLineStroke();
if (stroke == null)
if (UseStyle.useBetaStyle())
stroke = getStyleState().getStroke();
else
stroke = new UStroke(1.5);
final TextBlock attribute = GeneralImageBuilder.stateHeader((IEntity) group, null, skinParam); final TextBlock attribute = GeneralImageBuilder.stateHeader((IEntity) group, null, skinParam);
final Stereotype stereotype = group.getStereotype(); final Stereotype stereotype = group.getStereotype();
@ -207,10 +208,7 @@ public final class GroupPngMakerState {
final boolean containsOnlyConcurrentStates = containsOnlyConcurrentStates(dotData); final boolean containsOnlyConcurrentStates = containsOnlyConcurrentStates(dotData);
final IEntityImage image = containsOnlyConcurrentStates ? buildImageForConcurrentState(dotData) final IEntityImage image = containsOnlyConcurrentStates ? buildImageForConcurrentState(dotData)
: svek2.buildImage(null, new String[0]); : svek2.buildImage(null, new String[0]);
UStroke stroke = group.getColors().getSpecificLineStroke();
if (stroke == null) {
stroke = new UStroke(1.5);
}
return new InnerStateAutonom(image, title, attribute, borderColor, backColor, group.getUrl99(), withSymbol, return new InnerStateAutonom(image, title, attribute, borderColor, backColor, group.getUrl99(), withSymbol,
stroke, rounded, shadowing); stroke, rounded, shadowing);
@ -218,9 +216,9 @@ public final class GroupPngMakerState {
private IEntityImage buildImageForConcurrentState(DotData dotData) { private IEntityImage buildImageForConcurrentState(DotData dotData) {
final List<IEntityImage> inners = new ArrayList<>(); final List<IEntityImage> inners = new ArrayList<>();
for (ILeaf inner : dotData.getLeafs()) { for (ILeaf inner : dotData.getLeafs())
inners.add(inner.getSvekImage()); inners.add(inner.getSvekImage());
}
return new CucaDiagramFileMakerSvek2InternalImage(inners, dotData.getTopParent().getConcurrentSeparator(), return new CucaDiagramFileMakerSvek2InternalImage(inners, dotData.getTopParent().getConcurrentSeparator(),
dotData.getSkinParam(), group.getStereotype()); dotData.getSkinParam(), group.getStereotype());
@ -228,12 +226,12 @@ public final class GroupPngMakerState {
private boolean containsOnlyConcurrentStates(DotData dotData) { private boolean containsOnlyConcurrentStates(DotData dotData) {
for (ILeaf leaf : dotData.getLeafs()) { for (ILeaf leaf : dotData.getLeafs()) {
if (leaf instanceof IGroup == false) { if (leaf instanceof IGroup == false)
return false; return false;
}
if (((IGroup) leaf).getLeafType() != LeafType.STATE_CONCURRENT) { if (((IGroup) leaf).getLeafType() != LeafType.STATE_CONCURRENT)
return false; return false;
}
} }
return true; return true;
} }

View File

@ -85,9 +85,8 @@ public final class InnerStateAutonom extends AbstractTextBlock implements IEntit
final RoundedContainer r = new RoundedContainer(total, titreHeight, attr.getHeight() + marginForFields, final RoundedContainer r = new RoundedContainer(total, titreHeight, attr.getHeight() + marginForFields,
borderColor, backColor, im.getBackcolor(), stroke, rounded, shadowing); borderColor, backColor, im.getBackcolor(), stroke, rounded, shadowing);
if (url != null) { if (url != null)
ug.startUrl(url); ug.startUrl(url);
}
r.drawU(ug); r.drawU(ug);
title.drawU(ug.apply(new UTranslate((total.getWidth() - text.getWidth()) / 2, IEntityImage.MARGIN))); title.drawU(ug.apply(new UTranslate((total.getWidth() - text.getWidth()) / 2, IEntityImage.MARGIN)));
@ -97,14 +96,12 @@ public final class InnerStateAutonom extends AbstractTextBlock implements IEntit
final double spaceYforURL = getSpaceYforURL(ug.getStringBounder()); final double spaceYforURL = getSpaceYforURL(ug.getStringBounder());
im.drawU(ug.apply(new UTranslate(IEntityImage.MARGIN, spaceYforURL))); im.drawU(ug.apply(new UTranslate(IEntityImage.MARGIN, spaceYforURL)));
if (withSymbol) { if (withSymbol)
EntityImageState.drawSymbol(ug.apply(borderColor), total.getWidth(), total.getHeight()); EntityImageState.drawSymbol(ug.apply(borderColor), total.getWidth(), total.getHeight());
} if (url != null)
if (url != null) {
ug.closeUrl(); ug.closeUrl();
}
} }
private double getSpaceYforURL(StringBounder stringBounder) { private double getSpaceYforURL(StringBounder stringBounder) {

Some files were not shown because too many files have changed in this diff Show More