diff --git a/src/net/sourceforge/plantuml/AnnotatedWorker.java b/src/net/sourceforge/plantuml/AnnotatedWorker.java index 742e2464a..080fbbfc4 100644 --- a/src/net/sourceforge/plantuml/AnnotatedWorker.java +++ b/src/net/sourceforge/plantuml/AnnotatedWorker.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.DisplayPositioned; import net.sourceforge.plantuml.cucadiagram.DisplaySection; @@ -61,7 +61,6 @@ import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class AnnotatedWorker { @@ -98,23 +97,13 @@ public class AnnotatedWorker { final double y1 = 10; final double y2 = 10; - final double deltaShadow; - final FontConfiguration fontConfiguration; - final UStroke stroke; - final HColor borderColor; - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - deltaShadow = style.value(PName.Shadowing).asDouble(); - fontConfiguration = FontConfiguration.create(getSkinParam(), style); - stroke = style.getStroke(); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - } else { - deltaShadow = getSkinParam().shadowing(null) ? 3 : 0; - fontConfiguration = FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null); - stroke = new UStroke(); - borderColor = HColorUtils.BLACK; - } + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final double deltaShadow = style.value(PName.Shadowing).asDouble(); + final FontConfiguration fontConfiguration = FontConfiguration.create(getSkinParam(), style); + final UStroke stroke = style.getStroke(); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); final SymbolContext symbolContext = new SymbolContext(getBackgroundColor(), borderColor).withShadow(deltaShadow) .withStroke(stroke); @@ -188,13 +177,10 @@ public class AnnotatedWorker { if (caption.isNull()) return TextBlockUtils.empty(0, 0); - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.caption) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); - } - return caption.getDisplay().create(FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null), - HorizontalAlignment.CENTER, getSkinParam()); + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.caption) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); + } private TextBlock addTitle(TextBlock original) { @@ -202,16 +188,10 @@ public class AnnotatedWorker { if (title.isNull()) return original; - final TextBlock block; - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); - } else { - final ISkinParam skinParam = getSkinParam(); - final FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.TITLE, null); - block = TextBlockUtils.title(fontConfiguration, title.getDisplay(), skinParam); - } + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final TextBlock block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(), + skinParam); return DecorateEntityImage.addTop(original, block, HorizontalAlignment.CENTER); } @@ -224,21 +204,15 @@ public class AnnotatedWorker { TextBlock textFooter = null; if (footer.isNull() == false) { - Style style = null; - if (UseStyle.useBetaStyle()) { - style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); textFooter = footer.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.FOOTER, null), getSkinParam(), style); } TextBlock textHeader = null; if (header.isNull() == false) { - Style style = null; - if (UseStyle.useBetaStyle()) { - style = StyleSignatureBasic.of(SName.root, SName.document, SName.header) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.header) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); textHeader = header.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.HEADER, null), getSkinParam(), style); } diff --git a/src/net/sourceforge/plantuml/EmbeddedDiagram.java b/src/net/sourceforge/plantuml/EmbeddedDiagram.java index b3494cb94..65ec8ca70 100644 --- a/src/net/sourceforge/plantuml/EmbeddedDiagram.java +++ b/src/net/sourceforge/plantuml/EmbeddedDiagram.java @@ -109,21 +109,17 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom { } private String getImageSvg() throws IOException, InterruptedException { - final boolean sav = UseStyle.useBetaStyle(); final Diagram system = getSystem(); final ByteArrayOutputStream os = new ByteArrayOutputStream(); system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG)); os.close(); - UseStyle.setBetaStyle(sav); return new String(os.toByteArray()); } private BufferedImage getImage() throws IOException, InterruptedException { - if (image == null) { - final boolean sav = UseStyle.useBetaStyle(); + if (image == null) image = getImageSlow(); - UseStyle.setBetaStyle(sav); - } + return image; } diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java index dc94b99d7..fdcc0c72b 100644 --- a/src/net/sourceforge/plantuml/SkinParam.java +++ b/src/net/sourceforge/plantuml/SkinParam.java @@ -105,46 +105,10 @@ public class SkinParam implements ISkinParam { private SkinParam(UmlDiagramType type, ThemeStyle style) { this.themeStyle = style; this.type = type; - UseStyle.setBetaStyle(false); - if (type == UmlDiagramType.MINDMAP) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.WBS) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.GANTT) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.JSON) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.GIT) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.BOARD) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.YAML) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.HCL) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.NWDIAG) - UseStyle.setBetaStyle(true); - - if (type == UmlDiagramType.SEQUENCE) { - // skin = "debug.skin"; - // USE_STYLE2.set(true); - } - // if (type == UmlDiagramType.ACTIVITY) { - // // skin = "debug.skin"; - // USE_STYLE2.set(true); - // } } public StyleBuilder getCurrentStyleBuilder() { - if (styleBuilder == null && UseStyle.useBetaStyle()) { + if (styleBuilder == null) { try { this.styleBuilder = getCurrentStyleBuilderInternal(); } catch (IOException e) { @@ -155,8 +119,7 @@ public class SkinParam implements ISkinParam { } public void muteStyle(Style modifiedStyle) { - if (UseStyle.useBetaStyle()) - styleBuilder = getCurrentStyleBuilder().muteStyle(modifiedStyle); + styleBuilder = getCurrentStyleBuilder().muteStyle(modifiedStyle); } public String getDefaultSkin() { @@ -201,31 +164,22 @@ public class SkinParam implements ISkinParam { public void setParam(String key, String value) { for (String key2 : cleanForKey(key)) { params.put(key2, StringUtils.trin(value)); - if (key2.startsWith("usebetastyle") && "true".equalsIgnoreCase(value)) - UseStyle.setBetaStyle(true); - - if (UseStyle.useBetaStyle()) { - applyPendingStyleMigration(); - final FromSkinparamToStyle convertor = new FromSkinparamToStyle(key2); - convertor.convertNow(value, getCurrentStyleBuilder()); - for (Style style : convertor.getStyles()) - muteStyle(style); - } else { - paramsPendingForStyleMigration.put(key, value); - } + applyPendingStyleMigration(); + final FromSkinparamToStyle convertor = new FromSkinparamToStyle(key2); + convertor.convertNow(value, getCurrentStyleBuilder()); + for (Style style : convertor.getStyles()) + muteStyle(style); } if ("style".equalsIgnoreCase(key) && "strictuml".equalsIgnoreCase(value)) { - if (UseStyle.useBetaStyle()) { - final InputStream internalIs = StyleLoader.class.getResourceAsStream("/skin/strictuml.skin"); - final StyleBuilder styleBuilder = this.getCurrentStyleBuilder(); - try { - final BlocLines lines = BlocLines.load(internalIs, null); - for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines, styleBuilder)) - this.muteStyle(modifiedStyle); + final InputStream internalIs = StyleLoader.class.getResourceAsStream("/skin/strictuml.skin"); + final StyleBuilder styleBuilder = this.getCurrentStyleBuilder(); + try { + final BlocLines lines = BlocLines.load(internalIs, null); + for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines, styleBuilder)) + this.muteStyle(modifiedStyle); - } catch (IOException e) { - e.printStackTrace(); - } + } catch (IOException e) { + e.printStackTrace(); } } } @@ -308,8 +262,7 @@ public class SkinParam implements ISkinParam { } public String getValue(String key) { - if (UseStyle.useBetaStyle()) - applyPendingStyleMigration(); + applyPendingStyleMigration(); for (String key2 : cleanForKey(key)) { final String result = params.get(key2); if (result != null) diff --git a/src/net/sourceforge/plantuml/TitledDiagram.java b/src/net/sourceforge/plantuml/TitledDiagram.java index 98cd0ea05..33e8425b3 100644 --- a/src/net/sourceforge/plantuml/TitledDiagram.java +++ b/src/net/sourceforge/plantuml/TitledDiagram.java @@ -275,20 +275,15 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram, } public HColor calculateBackColor() { - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic - .of(SName.root, SName.document, this.getUmlDiagramType().getStyleName()) - .getMergedStyle(this.getSkinParam().getCurrentStyleBuilder()); + final Style style = StyleSignatureBasic.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName()) + .getMergedStyle(this.getSkinParam().getCurrentStyleBuilder()); - HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(), - this.getSkinParam().getIHtmlColorSet()); - if (backgroundColor == null) { - backgroundColor = HColorUtils.transparent(); - } - return backgroundColor; + HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(), + this.getSkinParam().getIHtmlColorSet()); + if (backgroundColor == null) + backgroundColor = HColorUtils.transparent(); - } - return this.getSkinParam().getBackgroundColor(); + return backgroundColor; } } diff --git a/src/net/sourceforge/plantuml/UseStyle.java b/src/net/sourceforge/plantuml/UseStyle.java index cb925e498..0c56d3228 100644 --- a/src/net/sourceforge/plantuml/UseStyle.java +++ b/src/net/sourceforge/plantuml/UseStyle.java @@ -37,19 +37,8 @@ package net.sourceforge.plantuml; public class UseStyle { - private static final ThreadLocal useBeta = new ThreadLocal<>(); - static public boolean useBetaStyle() { -// final Boolean result = useBeta.get(); -// if (result == null) { -// return false; -// } -// return result; return true; } - static public void setBetaStyle(boolean betastyle) { - useBeta.set(betastyle); - } - } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java index d55b8536b..fd13f44af 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java @@ -38,10 +38,8 @@ package net.sourceforge.plantuml.activitydiagram3; import java.util.Collection; import java.util.Objects; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; @@ -99,15 +97,10 @@ public class Branch { this.inlabel = Objects.requireNonNull(inlabel); this.labelTest = Objects.requireNonNull(labelTest); this.labelPositive = Objects.requireNonNull(labelPositive); - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(styleBuilder); - this.color = color == null - ? style.value(PName.BackGroundColor).asColor(styleBuilder.getSkinParam().getThemeStyle(), - styleBuilder.getSkinParam().getIHtmlColorSet()) - : color; - } else { - this.color = color; - } + + final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(styleBuilder); + this.color = color == null ? style.value(PName.BackGroundColor).asColor( + styleBuilder.getSkinParam().getThemeStyle(), styleBuilder.getSkinParam().getIHtmlColorSet()) : color; this.list = new InstructionList(swimlane); } @@ -248,15 +241,10 @@ public class Branch { if (display == null) return TextBlockUtils.EMPTY_TEXT_BLOCK; - LineBreakStrategy lineBreak = LineBreakStrategy.NONE; - final FontConfiguration fcArrow; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); - lineBreak = style.wrapWidth(); - fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - } + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final LineBreakStrategy lineBreak = style.wrapWidth(); + final FontConfiguration fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); return display.create0(fcArrow, HorizontalAlignment.LEFT, skinParam(), lineBreak, CreoleMode.SIMPLE_LINE, null, null); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java index add5aa3b7..7573f93b6 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java @@ -138,39 +138,19 @@ public class CommandPartition3 extends SingleLineCommand2 { final String stereo = arg.get("STEREO", 0); final Stereotype stereotype = stereo == null ? null : Stereotype.build(stereo); - HColor backColor; // Warning : titleColor unused in FTileGroupW - HColor titleColor; - HColor borderColor; - double roundCorner; - if (UseStyle.useBetaStyle()) { - final Style stylePartition = getDefaultStyleDefinitionPartition(symbol).withTOBECHANGED(stereotype) - .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); - borderColor = stylePartition.value(PName.LineColor).asColor(diagram.getSkinParam().getThemeStyle(), + final Style stylePartition = getDefaultStyleDefinitionPartition(symbol).withTOBECHANGED(stereotype) + .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); + final HColor borderColor = stylePartition.value(PName.LineColor).asColor(diagram.getSkinParam().getThemeStyle(), + diagram.getSkinParam().getIHtmlColorSet()); + HColor backColor = colors.getColor(ColorType.BACK); + if (backColor == null) + backColor = stylePartition.value(PName.BackGroundColor).asColor(diagram.getSkinParam().getThemeStyle(), diagram.getSkinParam().getIHtmlColorSet()); - backColor = colors.getColor(ColorType.BACK); - if (backColor == null) - backColor = stylePartition.value(PName.BackGroundColor).asColor(diagram.getSkinParam().getThemeStyle(), - diagram.getSkinParam().getIHtmlColorSet()); - titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet()); - roundCorner = stylePartition.value(PName.RoundCorner).asDouble(); - } else { - final HColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol), - stereotype, false); - if (backColorInSkinparam == null) - backColor = colors.getColor(ColorType.BACK); - else - backColor = backColorInSkinparam; - - titleColor = colors.getColor(ColorType.HEADER); - - borderColor = diagram.getSkinParam().getHtmlColor(getColorParamBorder(symbol), stereotype, false); - if (borderColor == null) - borderColor = HColorUtils.BLACK; - roundCorner = symbol.getSkinParameter().getRoundCorner(diagram.getSkinParam(), stereotype); - } + final HColor titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet()); + final double roundCorner = stylePartition.value(PName.RoundCorner).asDouble(); diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, symbol, roundCorner); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java index fa8852922..d567d03d1 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java @@ -74,9 +74,8 @@ public class CommandSwitch extends SingleLineCommand2 { : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s); String test = arg.get("TEST", 0); - if (test.length() == 0) { + if (test.length() == 0) test = null; - } diagram.startSwitch(Display.getWithNewlines(test), color); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java index 9e36ed09e..56ea00369 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java @@ -41,8 +41,6 @@ import java.util.List; import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -89,14 +87,7 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile { } public final UStroke getThickness(Style style) { - if (UseStyle.useBetaStyle()) - return style.getStroke(); - - UStroke thickness = skinParam.getThickness(LineParam.activityBorder, null); - if (thickness == null) { - thickness = new UStroke(1.5); - } - return thickness; + return style.getStroke(); } public List getWeldingPoints() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java index b96c73e1b..d64176e79 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java @@ -35,45 +35,21 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.graphic.TextBlockUtils; -import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignatureBasic; -import net.sourceforge.plantuml.ugraphic.UStroke; -import net.sourceforge.plantuml.ugraphic.color.HColor; public class EntityImageLegend { public static TextBlock create(Display note, ISkinParam skinParam) { - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic.of(SName.root, SName.root, SName.document, - skinParam.getUmlDiagramType().getStyleName(), SName.legend) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam); - } - - final TextBlock textBlock = note.create(FontConfiguration.create(skinParam, FontParam.LEGEND, null), - HorizontalAlignment.LEFT, skinParam); - final Rose rose = new Rose(); - final HColor legendBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground); - final HColor legendColor = rose.getHtmlColor(skinParam, ColorParam.legendBorder); - final UStroke stroke = skinParam.getThickness(LineParam.legendBorder, null); - - final int cornersize = 10; - final TextBlock result = TextBlockUtils.bordered(textBlock, stroke, legendColor, legendBackgroundColor, - cornersize); - return TextBlockUtils.withMargin(result, 8, 8); + final Style style = StyleSignatureBasic + .of(SName.root, SName.root, SName.document, skinParam.getUmlDiagramType().getStyleName(), SName.legend) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam); } } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java index b1448a47a..c596058d5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java @@ -39,10 +39,8 @@ import java.util.Collection; import java.util.List; import java.util.Objects; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ForkStyle; import net.sourceforge.plantuml.activitydiagram3.Instruction; @@ -86,48 +84,35 @@ public class FtileFactoryDelegator implements FtileFactory { Rainbow color; final LinkRendering linkRendering = tile.getInLinkRendering(); if (linkRendering == null) { - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { - color = Rainbow.build(skinParam()); - } + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); } else { color = linkRendering.getRainbow(); } if (color.size() == 0) { - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { - color = Rainbow.build(skinParam()); - } + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); } return color; } protected final TextBlock getTextBlock(Display display) { // DUP3945 - if (Display.isNull(display)) { + if (Display.isNull(display)) return null; - } - final FontConfiguration fontConfiguration; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); - fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - } + + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); } protected Display getInLinkRenderingDisplay(Ftile tile) { final LinkRendering linkRendering = tile.getInLinkRendering(); - if (linkRendering == null) { + if (linkRendering == null) return Display.NULL; - } + return linkRendering.getDisplay(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java index 9ea7d5843..1c2b66227 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java @@ -35,16 +35,11 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; -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; @@ -94,15 +89,10 @@ public class LaneDivider extends AbstractTextBlock { final UShape back = new UEmpty(x1 + x2, 1); ug.draw(back); - HColor color = skinParam.getHtmlColor(ColorParam.swimlaneBorder, null, false); - if (color == null) { - color = ColorParam.swimlaneBorder.getDefaultValue(); - } - UStroke thickness = Rose.getStroke(skinParam, LineParam.swimlaneBorder, 2); - if (UseStyle.useBetaStyle()) { - color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - thickness = getStyle().getStroke(); - } + final HColor color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final UStroke thickness = getStyle().getStroke(); + ug.apply(UTranslate.dx(x1)).apply(thickness).apply(color).draw(ULine.vline(height)); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java index f25434dcd..a3b83e7dd 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java @@ -35,18 +35,14 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.Pragma; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Instruction; import net.sourceforge.plantuml.activitydiagram3.InstructionList; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; @@ -63,6 +59,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicIntercep import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.VCompactFactory; import net.sourceforge.plantuml.activitydiagram3.gtile.GConnection; import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.FontConfiguration; @@ -258,24 +255,21 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable private TextBlock getTitle(Swimlane swimlane) { final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; - FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.SWIMLANE_TITLE, null); - if (UseStyle.useBetaStyle()) { - fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet()); - } + final FontConfiguration fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + LineBreakStrategy wrap = getWrap(); - if (wrap.isAuto()) { + if (wrap.isAuto()) wrap = new LineBreakStrategy("" + ((int) swimlane.getActualWidth())); - } return swimlane.getDisplay().create9(fontConfiguration, horizontalAlignment, skinParam, wrap); } private LineBreakStrategy getWrap() { LineBreakStrategy wrap = skinParam.swimlaneWrapTitleWidth(); - if (wrap == LineBreakStrategy.NONE) { + if (wrap == LineBreakStrategy.NONE) wrap = skinParam.wrapWidth(); - } + return wrap; } @@ -333,11 +327,9 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable } private void drawTitlesBackground(UGraphic ug) { - HColor color = skinParam.getHtmlColor(ColorParam.swimlaneTitleBackground, null, false); - if (UseStyle.useBetaStyle()) { - color = getStyle().value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet()); - } + final HColor color = getStyle().value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + if (color != null) { final double titleHeight = getTitlesHeight(ug.getStringBounder()); double fullWidth = swimlanesSpecial().get(swimlanesSpecial().size() - 1).getTranslate().getDx() - 2 * 5 - 1; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java index fd59374b7..7e19656e0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java @@ -45,12 +45,9 @@ import java.util.List; import java.util.Objects; import net.sourceforge.plantuml.Direction; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; @@ -97,15 +94,10 @@ public class Worm implements Iterable { ug = ug.apply(arrowColor); ug = ug.apply(arrowColor.bg()); - if (linkStyle.isNormal()) { - UStroke stroke = new UStroke(strokeValue); - if (UseStyle.useBetaStyle()) { - stroke = style.getStroke(); - } - ug = ug.apply(stroke); - } else { + if (linkStyle.isNormal()) + ug = ug.apply(style.getStroke()); + else ug = ug.apply(linkStyle.goThickness(strokeValue).getStroke3()); - } boolean drawn = false; for (int i = 0; i < points.size() - 1; i++) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java index bcfe9252d..4bb902cc3 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java @@ -102,9 +102,9 @@ public abstract class AbstractParallelFtilesBuilder { final protected double computeMaxHeight(List all) { double height = 0; - for (Ftile tmp : all) { + for (Ftile tmp : all) height = Math.max(height, tmp.calculateDimension(getStringBounder()).getHeight()); - } + return height; } @@ -131,16 +131,13 @@ public abstract class AbstractParallelFtilesBuilder { protected final TextBlock getTextBlock(Display display) { // DUP3945 - if (Display.isNull(display)) { + if (Display.isNull(display)) return null; - } - final FontConfiguration fontConfiguration; - if (UseStyle.useBetaStyle()) { - final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); - fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - } + + final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java index c8773e316..6121813ea 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java @@ -35,13 +35,9 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -54,7 +50,6 @@ import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; @@ -70,31 +65,16 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc public FloatingNote(Display note, ISkinParam skinParam) { - final Rose rose = new Rose(); - - UStroke stroke = new UStroke(); - final HColor noteBackgroundColor; - final HColor borderColor; - final FontConfiguration fc; - final LineBreakStrategy wrapWidth; - final double shadowing; - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - wrapWidth = style.wrapWidth(); - fc = FontConfiguration.create(skinParam, style); - noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - stroke = style.getStroke(); - shadowing = style.value(PName.Shadowing).asDouble(); - } else { - shadowing = skinParam.shadowing(null) ? 4 : 0; - noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); - borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); - fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); - wrapWidth = skinParam.wrapWidth(); - } + final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + final FontConfiguration fc = FontConfiguration.create(skinParam, style); + final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final UStroke stroke = style.getStroke(); + final double shadowing = style.value(PName.Shadowing).asDouble(); final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java index b0617e91d..932224044 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java @@ -37,11 +37,9 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; import java.util.List; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.Pragma; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; @@ -74,35 +72,19 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator { final ConditionEndStyle conditionEndStyle = skinParam().getConditionEndStyle(); final Branch branch0 = thens.get(0); - final HColor borderColor; - final HColor backColor; - final Rainbow arrowColor; - final FontConfiguration fcTest; - final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND - : FontParam.ARROW; - final FontConfiguration fcArrow; - if (UseStyle.useBetaStyle()) { - final Style styleArrow = getDefaultStyleDefinitionArrow() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - final Style styleDiamond = getDefaultStyleDefinitionDiamond() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - backColor = branch0.getColor() == null ? styleDiamond.value(PName.BackGroundColor) - .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); - arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - backColor = branch0.getColor() == null - ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) - : branch0.getColor(); - arrowColor = Rainbow.build(skinParam()); - fcTest = FontConfiguration.create(skinParam(), testParam, null) - .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND)); - fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - } + final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Style styleDiamond = getDefaultStyleDefinitionDiamond() + .getMergedStyle(skinParam().getCurrentStyleBuilder()); + final HColor borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor backColor = branch0.getColor() == null ? styleDiamond.value(PName.BackGroundColor) + .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); + final Rainbow arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), + skinParam().getThemeStyle()); + final FontConfiguration fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final FontConfiguration fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); if (thens.size() > 1) { if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */) diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java index 926209f5d..098822bda 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java @@ -35,12 +35,8 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.List; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; @@ -55,10 +51,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.Rainbow; -import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; @@ -80,36 +76,19 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator { final ConditionStyle conditionStyle = skinParam().getConditionStyle(); - final HColor borderColor; - final HColor diamondColor; - final Rainbow arrowColor; - final FontConfiguration fcDiamond; - final FontConfiguration fcArrow; - if (UseStyle.useBetaStyle()) { - final Style styleArrow = getDefaultStyleDefinitionArrow() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - final Style styleDiamond = getDefaultStyleDefinitionDiamond() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - diamondColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - fcDiamond = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - // diamondColor = color == null ? getRose().getHtmlColor(skinParam(), - // ColorParam.activityDiamondBackground) : color; - if (colors.getColor(ColorType.BACK) != null && Display.isNull(startLabel)) { - diamondColor = colors.getColor(ColorType.BACK); - } else { - diamondColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground); - } - arrowColor = Rainbow.build(skinParam()); - fcDiamond = FontConfiguration.create(skinParam(), FontParam.ACTIVITY_DIAMOND, null); - fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - } + final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Style styleDiamond = getDefaultStyleDefinitionDiamond() + .getMergedStyle(skinParam().getCurrentStyleBuilder()); + final HColor borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor diamondColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final Rainbow arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), + skinParam().getThemeStyle()); + final FontConfiguration fcDiamond = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final FontConfiguration fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering(); final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getRainbow(); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java index 55d4ad8e8..945f3491f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java @@ -35,14 +35,10 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.List; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; @@ -57,6 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.FtileSwitch import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateInLabel; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOutLabel; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; @@ -112,13 +109,9 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator { ftiles.add(new FtileDecorateOutLabel(new FtileDecorateInLabel(branch.getFtile(), dimLabelIn), dimLabelOut)); } - final Rainbow arrowColor; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); - arrowColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { - arrowColor = Rainbow.build(skinParam()); - } + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Rainbow arrowColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); + if (ftiles.size() == 1) { final FtileSwitchWithOneLink result = new FtileSwitchWithOneLink(ftiles, branches, swimlane, diamond1, diamond2, getStringBounder(), arrowColor); @@ -133,24 +126,15 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator { private Ftile getDiamond1(Swimlane swimlane, Branch branch0, Display test) { LineBreakStrategy lineBreak = LineBreakStrategy.NONE; - final FontConfiguration fcDiamond; - final HColor borderColor; - final HColor backColor; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder()); - lineBreak = style.wrapWidth(); - fcDiamond = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor) - .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); - } else { - fcDiamond = FontConfiguration.create(skinParam(), FontParam.ACTIVITY_DIAMOND, null); - borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - backColor = branch0.getColor() == null - ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) - : branch0.getColor(); - } + + final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder()); + lineBreak = style.wrapWidth(); + final FontConfiguration fcDiamond = style.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor) + .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); final TextBlock tbTest; if (Display.isNull(test) || test.isWhite()) @@ -163,27 +147,15 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator { } private Ftile getDiamond2(Swimlane swimlane, Branch branch0) { - final HColor borderColor; - final HColor backColor; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder()); - borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor) - .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); - } else { - borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - backColor = branch0.getColor() == null - ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) - : branch0.getColor(); - } + + final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor) + .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); return new FtileDiamondInside(TextBlockUtils.empty(0, 0), branch0.skinParam(), backColor, borderColor, swimlane); } -// private HColor fontColor(FontParam param) { -// return skinParam().getFontHtmlColor(null, param); -// } - } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java index 8fee45da6..da5a8847f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java @@ -37,20 +37,17 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; import java.util.List; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Instruction; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileBreak; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.Genealogy; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint; @@ -74,34 +71,21 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator { public Ftile createWhile(LinkRendering outColor, Swimlane swimlane, Ftile whileBlock, Display test, Display yes, HColor color, Instruction specialOut, Ftile backward, LinkRendering incoming1, LinkRendering incoming2) { - final HColor borderColor; - final HColor backColor; - final Rainbow arrowColor; - final FontConfiguration fontArrow; - final FontConfiguration fcTest; final ConditionStyle conditionStyle = skinParam().getConditionStyle(); - final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND - : FontParam.ARROW; - if (UseStyle.useBetaStyle()) { - final Style styleArrow = getDefaultStyleDefinitionArrow() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - final Style styleDiamond = getDefaultStyleDefinitionDiamond() - .getMergedStyle(skinParam().getCurrentStyleBuilder()); - borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - fontArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) - : color; - arrowColor = Rainbow.build(skinParam()); - fontArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - fcTest = FontConfiguration.create(skinParam(), testParam, null); - } + + final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Style styleDiamond = getDefaultStyleDefinitionDiamond() + .getMergedStyle(skinParam().getCurrentStyleBuilder()); + final HColor borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final Rainbow arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), + skinParam().getThemeStyle()); + final FontConfiguration fontArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final FontConfiguration fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); incoming1 = ensureColor(incoming1, arrowColor); incoming2 = ensureColor(incoming2, arrowColor); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java index 89e2ee330..bf213bbfa 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java @@ -35,21 +35,18 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Set; import net.sourceforge.plantuml.AlignmentParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -66,12 +63,10 @@ import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.UGraphicForSnake; import net.sourceforge.plantuml.ugraphic.LimitFinder; import net.sourceforge.plantuml.ugraphic.MinMax; -import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.utils.MathUtils; public class FtileGroup extends AbstractFtile { @@ -98,31 +93,17 @@ public class FtileGroup extends AbstractFtile { this.type = type; this.inner = FtileUtils.addHorizontalMargin(inner, 10); - final FontConfiguration fc; - final Style style; - final UStroke thickness; - if (UseStyle.useBetaStyle()) { - style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.shadowing = style.value(PName.Shadowing).asDouble(); - this.backColor = backColor == null - ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) - : backColor; - this.borderColor = borderColor == null - ? style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) - : borderColor; - thickness = style.getStroke(); - } else { - this.backColor = backColor == null ? HColorUtils.WHITE : backColor; - this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor; - style = null; - final UFont font = skinParam.getFont(null, false, FontParam.PARTITION); - final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION); - fc = FontConfiguration.create(font, fontColor, skinParam.getHyperlinkColor(), - skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); - this.shadowing = skinParam().shadowing(null) ? 3 : 0; - thickness = skinParam.getThickness(LineParam.partitionBorder, null); - } + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.shadowing = style.value(PName.Shadowing).asDouble(); + this.backColor = backColor == null + ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) + : backColor; + this.borderColor = borderColor == null + ? style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) + : borderColor; + final UStroke thickness = style.getStroke(); + if (title == null) this.name = TextBlockUtils.empty(0, 0); else diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java index f9e3cfbce..e79cf199f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collections; @@ -43,10 +42,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; @@ -61,6 +58,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -123,16 +121,9 @@ class FtileIfAndStop extends AbstractFtile { final Ftile stopFtile = ftileFactory.stop(swimlane); - final UStroke thickness; - final FontConfiguration fcTest; - if (UseStyle.useBetaStyle()) { - final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); - thickness = tileNonStop.getThickness(style); - fcTest = FontConfiguration.create(skinParam, style); - } else { - thickness = tileNonStop.getThickness(null); - fcTest = FontConfiguration.create(skinParam, FontParam.ACTIVITY_DIAMOND, null); - } + final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final UStroke thickness = tileNonStop.getThickness(style); + final FontConfiguration fcTest = FontConfiguration.create(skinParam, style); final Sheet sheet = Parser .build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java index f37bbff54..820994640 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java @@ -35,20 +35,18 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -60,7 +58,6 @@ import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; @@ -105,27 +102,14 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable super(skinParam); this.swimlane = swimlane; this.withOutPoint = withOutPoint; - final Rose rose = new Rose(); - final HColor noteBackgroundColor; - final HColor borderColor; - final double shadowing; - final LineBreakStrategy wrapWidth; - UStroke stroke = new UStroke(); - if (UseStyle.useBetaStyle()) { - final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); - noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - stroke = style.getStroke(); - } else { - noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); - borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); - shadowing = skinParam.shadowing(null) ? 4 : 0; - wrapWidth = skinParam.wrapWidth(); - } + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + final UStroke stroke = style.getStroke(); final FontConfiguration fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java index fa6d812f3..703ba82fb 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.Collection; import java.util.Collections; @@ -43,18 +42,16 @@ import java.util.HashSet; import java.util.Set; import net.sourceforge.plantuml.AlignmentParam; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Direction; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -67,7 +64,6 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; -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; @@ -127,41 +123,23 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea private FtileWithNoteOpale(Ftile tile, PositionedNote note, ISkinParam skinParam, boolean withLink) { super(tile.skinParam()); this.swimlaneNote = note.getSwimlaneNote(); - if (note.getColors() != null) { + if (note.getColors() != null) skinParam = note.getColors().mute(skinParam); - } + this.tile = tile; this.notePosition = note.getNotePosition(); - if (note.getType() == NoteType.FLOATING_NOTE) { + if (note.getType() == NoteType.FLOATING_NOTE) withLink = false; - } - final Rose rose = new Rose(); - - final HColor noteBackgroundColor; - final HColor borderColor; - final FontConfiguration fc; - UStroke stroke = new UStroke(); - - final double shadowing; - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) - .eventuallyOverride(note.getColors()); - noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - stroke = style.getStroke(); - } else { - noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); - borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); - fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); - shadowing = skinParam.shadowing(null) ? 4 : 0; - wrapWidth = skinParam.wrapWidth(); - } + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) + .eventuallyOverride(note.getColors()); + final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + final UStroke stroke = style.getStroke(); final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false, null); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java index cbd213962..cdec49a0e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java @@ -35,21 +35,18 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -103,37 +100,21 @@ public class FtileWithNotes extends AbstractFtile { super(tile.skinParam()); this.tile = tile; - final Rose rose = new Rose(); - for (PositionedNote note : notes) { ISkinParam skinParam2 = skinParam; if (note.getColors() != null) skinParam2 = note.getColors().mute(skinParam2); - final HColor noteBackgroundColor; - final HColor borderColor; - final FontConfiguration fc; - final double shadowing; - UStroke stroke = new UStroke(); - - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) - .eventuallyOverride(note.getColors()); - noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - stroke = style.getStroke(); - } else { - noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); - borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); - fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); - shadowing = skinParam.shadowing(null) ? 4 : 0; - wrapWidth = skinParam.wrapWidth(); - } + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) + .eventuallyOverride(note.getColors()); + final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + final UStroke stroke = style.getStroke(); final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java index 2c3bac93f..6078aa2cc 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java @@ -35,14 +35,12 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; @@ -56,6 +54,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; @@ -136,12 +135,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); - final Rainbow def; - if (UseStyle.useBetaStyle()) - def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - else - def = Rainbow.build(skinParam()); - + final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def); conns.add(new ConnectionIn(black, tmp, x, rainbow)); x += dim.getWidth(); @@ -200,12 +194,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); - final Rainbow def; - if (UseStyle.useBetaStyle()) - def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - else - def = Rainbow.build(skinParam()); - + final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); if (tmp.calculateDimension(getStringBounder()).hasPointOut()) conns.add(new ConnectionOut(tmp, out, x, rainbow, getJustBeforeBar2(middle, getStringBounder()))); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java index 46f540f0c..824395818 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java @@ -35,14 +35,12 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; @@ -54,6 +52,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; @@ -80,13 +79,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); - final Rainbow def; - if (UseStyle.useBetaStyle()) { - Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); - def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - } else { - def = Rainbow.build(skinParam()); - } + Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def); conns.add(new ConnectionIn(black, tmp, x, rainbow)); x += dim.getWidth(); @@ -102,19 +96,12 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { @Override protected Ftile doStep2(Ftile inner, Ftile result) { final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); - final HColor borderColor; - final HColor backColor; - if (UseStyle.useBetaStyle()) { - borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - backColor = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), - skinParam().getIHtmlColorSet()); - } else { - borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); - backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); + final HColor backColor = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); - } final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2()); result = new FtileAssemblySimple(result, out); final List conns = new ArrayList<>(); @@ -124,12 +111,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final UTranslate translate0 = new UTranslate(x, barHeight); - final Rainbow def; - if (UseStyle.useBetaStyle()) - def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - else - def = Rainbow.build(skinParam()); - + final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); if (tmp.calculateDimension(getStringBounder()).hasPointOut()) conns.add(new ConnectionHorizontalThenVertical(tmp, out, rainbow, translate0, diamondTranslate)); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java index 445ce1d61..0fe26ed1f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java @@ -78,12 +78,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { protected Ftile doStep1(Ftile inner) { Ftile result = inner; final List conns = new ArrayList<>(); - final Rainbow thinColor; final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); - if (UseStyle.useBetaStyle()) - thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); - else - thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam())); + final Rainbow thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); final Ftile thin = new FtileThinSplit(skinParam(), getThin1Color(thinColor), list99.get(0).getSwimlaneIn()); double x = 0; @@ -97,12 +93,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { last = x + dim.getLeft(); final LinkRendering inLinkRendering = tmp.getInLinkRendering(); - final Rainbow rainbow; - if (UseStyle.useBetaStyle()) - rainbow = inLinkRendering - .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - else - rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); + final Rainbow rainbow = inLinkRendering + .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); conns.add(new ConnectionIn(thin, tmp, x, rainbow)); x += dim.getWidth(); @@ -124,13 +116,9 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { private HColor getThin1Color(final Rainbow thinColor) { final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); for (Ftile tmp : list99) { - final Rainbow rainbow; final LinkRendering inLinkRendering = tmp.getInLinkRendering(); - if (UseStyle.useBetaStyle()) - rainbow = inLinkRendering - .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - else - rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); + final Rainbow rainbow = inLinkRendering + .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); if (rainbow.isInvisible() == false) return thinColor.getColor(); @@ -155,13 +143,9 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { return new FtileKilled(result); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); - final Rainbow thinColor; final LinkRendering inLinkRendering = result.getInLinkRendering(); - if (UseStyle.useBetaStyle()) - thinColor = inLinkRendering - .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - else - thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam())); + final Rainbow thinColor = inLinkRendering + .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2()); result = new FtileAssemblySimple(result, out); @@ -179,13 +163,9 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { last = x + dim.getLeft(); } - final Rainbow rainbow; final LinkRendering outLinkRendering = tmp.getOutLinkRendering(); - if (UseStyle.useBetaStyle()) - rainbow = outLinkRendering - .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); - else - rainbow = outLinkRendering.getRainbow(Rainbow.build(skinParam())); + final Rainbow rainbow = outLinkRendering + .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle())); if (tmp.calculateDimension(getStringBounder()).hasPointOut()) conns.add(new ConnectionOut(translate0, tmp, out, x, rainbow, getHeightOfMiddle(inner))); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java index 08a02217d..c9d0fc27e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java @@ -39,11 +39,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ForkStyle; import net.sourceforge.plantuml.activitydiagram3.Instruction; @@ -111,53 +109,34 @@ public class VCompactFactory implements FtileFactory { } public Ftile start(Swimlane swimlane) { - final HColor color; - Style style = null; - if (UseStyle.useBetaStyle()) { - style = getSignatureCircleStart().getMergedStyle(skinParam.getCurrentStyleBuilder()); - color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - } else { - color = rose.getHtmlColor(skinParam, ColorParam.activityStart); - } + final Style style = getSignatureCircleStart().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + return new FtileCircleStart(skinParam(), color, swimlane, style); } public Ftile stop(Swimlane swimlane) { - final HColor borderColor; - Style style = null; - final HColor backgroundColor; - if (UseStyle.useBetaStyle()) { - style = getSignatureCircleStop().getMergedStyle(skinParam.getCurrentStyleBuilder()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - backgroundColor = skinParam.getBackgroundColor(); - } else { - borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd); - backgroundColor = skinParam.getBackgroundColor(); - } + final Style style = getSignatureCircleStop().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final HColor backgroundColor = skinParam.getBackgroundColor(); return new FtileCircleStop(skinParam(), backgroundColor, borderColor, swimlane, style); } public Ftile spot(Swimlane swimlane, String spot, HColor color) { final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY); - Style style = null; - if (UseStyle.useBetaStyle()) { - style = getSignatureCircleSpot().getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = getSignatureCircleSpot().getMergedStyle(skinParam.getCurrentStyleBuilder()); return new FtileCircleSpot(skinParam(), swimlane, spot, font, color, style); } public Ftile end(Swimlane swimlane) { - final HColor borderColor; - Style style = null; - final HColor backgroundColor; - if (UseStyle.useBetaStyle()) { - style = getSignatureCircleEnd().getMergedStyle(skinParam.getCurrentStyleBuilder()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - backgroundColor = skinParam.getBackgroundColor(); - } else { - borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd); - backgroundColor = skinParam.getBackgroundColor(); - } + + final Style style = getSignatureCircleEnd().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final HColor backgroundColor = skinParam.getBackgroundColor(); + return new FtileCircleEnd(skinParam(), backgroundColor, borderColor, swimlane, style); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java index 2cf327e1c..e0ae1d65e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java @@ -35,25 +35,23 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; -import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithUrl; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileIfDown; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -65,7 +63,6 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignatureBasic; @@ -108,42 +105,24 @@ public class ConditionalBuilder { FtileFactory ftileFactory, ConditionStyle conditionStyle, ConditionEndStyle conditionEndStyle, Branch branch1, Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow, FontConfiguration fontTest, Url url) { - if (UseStyle.useBetaStyle()) { - if (backColor == null) - throw new IllegalArgumentException(); - if (borderColor == null) - throw new IllegalArgumentException(); - if (arrowColor == null) - throw new IllegalArgumentException(); - final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - final Style styleDiamond = getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); - this.diamondLineBreak = styleDiamond.wrapWidth(); - this.labelLineBreak = styleArrow.wrapWidth(); - this.borderColor = borderColor; /* - * styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(), - * skinParam.getIHtmlColorSet()); - */ - this.backColor = backColor; - /* - * styleDiamond.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - * skinParam.getIHtmlColorSet()) - */; - this.arrowColor = arrowColor;/* - * Rainbow.fromColor( - * styleArrow.value(PName.LineColor).asColor(skinParam.getThemeStyle(), - * skinParam.getIHtmlColorSet()), null); - */ - this.fontTest = styleDiamond.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - } else { - this.diamondLineBreak = LineBreakStrategy.NONE; - this.labelLineBreak = LineBreakStrategy.NONE; - this.borderColor = borderColor; - this.backColor = backColor; - this.arrowColor = arrowColor; - this.fontTest = fontTest; - this.fontArrow = fontArrow; - } + + if (backColor == null) + throw new IllegalArgumentException(); + if (borderColor == null) + throw new IllegalArgumentException(); + if (arrowColor == null) + throw new IllegalArgumentException(); + + final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleDiamond = getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); + this.fontTest = styleDiamond.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); + this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); + this.diamondLineBreak = styleDiamond.wrapWidth(); + this.labelLineBreak = styleArrow.wrapWidth(); + this.borderColor = borderColor; + this.backColor = backColor; + this.arrowColor = arrowColor; + this.ftileFactory = ftileFactory; this.swimlane = swimlane; this.conditionStyle = conditionStyle; @@ -261,7 +240,7 @@ public class ConditionalBuilder { final Sheet sheet = Parser.build(fontTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL).createSheet(labelTest); final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, diamondLineBreak, skinParam.getPadding()); - + final UStroke thickness = tile1 .getThickness(getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder())); final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), thickness); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java index 1b0342492..7a19092dd 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -46,6 +45,7 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java index 17129dd5f..1038b1993 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java @@ -35,13 +35,13 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Arrays; import java.util.Collection; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java index ce51d6bd5..678b1356c 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.List; @@ -54,6 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorOneSwimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java index 13ca9fecb..6a7a1051f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -46,6 +45,7 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java index be58a8864..19f62970e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java @@ -40,22 +40,11 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; -import net.sourceforge.plantuml.creole.CreoleMode; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.style.PName; -import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java index a44a68d36..3dfa2b03d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithManyLinks.java @@ -47,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; +import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.graphic.Rainbow; @@ -81,6 +82,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final StringBounder stringBounder = ug.getStringBounder(); final Point2D p1 = getP1(stringBounder); final Point2D p2 = getP2(stringBounder); + final double x1 = p1.getX(); final double y1 = p1.getY(); final double x2 = p2.getX(); @@ -89,7 +91,16 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()) .withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment()); snake.addPoint(x1, y1); - snake.addPoint(x2, y1); + + if (isLast() && p1.getX() > p2.getX()) { + final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder); + snake.addPoint(x1 + Hexagon.hexagonHalfSize, y1); + snake.addPoint(x1 + Hexagon.hexagonHalfSize, y1 + dimDiamond1.getHeight()); + snake.addPoint(x2, y1 + dimDiamond1.getHeight()); + } else { + snake.addPoint(x2, y1); + } + snake.addPoint(x2, y2); ug.draw(snake); @@ -100,7 +111,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { final Point2D pt; if (getFtile2() == tiles.get(0)) pt = dimDiamond1.getPointD(); - else if (getFtile2() == tiles.get(tiles.size() - 1)) + else if (isLast()) pt = dimDiamond1.getPointB(); else throw new IllegalStateException(); @@ -108,6 +119,10 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds { return getTranslateDiamond1(stringBounder).getTranslated(pt); } + private boolean isLast() { + return getFtile2() == tiles.get(tiles.size() - 1); + } + private Point2D getP2(final StringBounder stringBounder) { return getTranslateOf(getFtile2(), stringBounder) .getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java index a863e4d91..fbedb3aaf 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java @@ -99,15 +99,11 @@ public class FtileBlackBlock extends AbstractFtile { public void drawU(UGraphic ug) { final URectangle rect = new URectangle(width, height).rounded(5).ignoreForCompressionOnX(); - if (UseStyle.useBetaStyle()) { - final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); - final double shadowing = style.value(PName.Shadowing).asDouble(); - rect.setDeltaShadow(shadowing); - colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()); - } else { - if (skinParam().shadowing(null)) - rect.setDeltaShadow(3); - } + + final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + rect.setDeltaShadow(shadowing); + colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()); ug.apply(colorBar).apply(colorBar.bg()).draw(rect); final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java index e17a9d13f..1e2d5465f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java @@ -35,25 +35,21 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SkinParamColors; -import net.sourceforge.plantuml.SkinParamUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -141,13 +137,9 @@ public class FtileBox extends AbstractFtile { public static FtileBox create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Stereotype stereotype) { - Style style = null; - Style styleArrow = null; - if (UseStyle.useBetaStyle()) { - style = getStyleSignature().withTOBECHANGED(stereotype) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = getStyleSignature().withTOBECHANGED(stereotype) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); return new FtileBox(skinParam, label, swimlane, boxStyle, style, styleArrow); } @@ -157,38 +149,28 @@ public class FtileBox extends AbstractFtile { this.style = style; this.boxStyle = boxStyle; this.swimlane = swimlane; - final FontConfiguration fc; - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - this.inRendering = LinkRendering.create( - Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); - Colors specBack = null; - if (skinParam instanceof SkinParamColors) { - specBack = ((SkinParamColors) skinParam).getColors(); - } - style = style.eventuallyOverride(specBack); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.horizontalAlignment = style.getHorizontalAlignment(); - this.padding = style.getPadding(); - this.margin = style.getMargin(); - this.roundCorner = style.value(PName.RoundCorner).asDouble(); - this.shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); - } else { - this.padding = ClockwiseTopRightBottomLeft.same(10); - this.margin = ClockwiseTopRightBottomLeft.same(0); - this.inRendering = LinkRendering.create(Rainbow.build(skinParam)); - this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); - this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); - fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); - this.horizontalAlignment = HorizontalAlignment.LEFT; - this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; - wrapWidth = skinParam.wrapWidth(); - } + this.inRendering = LinkRendering + .create(Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); + Colors specBack = null; + if (skinParam instanceof SkinParamColors) + specBack = ((SkinParamColors) skinParam).getColors(); + + style = style.eventuallyOverride(specBack); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + + this.horizontalAlignment = style.getHorizontalAlignment(); + this.padding = style.getPadding(); + this.margin = style.getMargin(); + this.roundCorner = style.value(PName.RoundCorner).asDouble(); + this.shadowing = style.value(PName.Shadowing).asDouble(); + + final LineBreakStrategy wrapWidth = style.wrapWidth(); + this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); + final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .createSheet(label); @@ -211,23 +193,17 @@ public class FtileBox extends AbstractFtile { final double heightTotal = dimTotal.getHeight(); final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner); - final UStroke thickness; - if (UseStyle.useBetaStyle()) { - thickness = style.getStroke(); - } else { - thickness = getThickness(style); - } + final UStroke thickness = style.getStroke(); - if (borderColor == null) { + if (borderColor == null) ug = ug.apply(new HColorNone()); - } else { + else ug = ug.apply(borderColor); - } - if (backColor == null) { + + if (backColor == null) ug = ug.apply(new HColorNone().bg()); - } else { + else ug = ug.apply(backColor.bg()); - } ug = ug.apply(thickness); shape.drawU(ug); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java index 1da173160..38f2a15ee 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java @@ -35,18 +35,14 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SkinParamColors; -import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; @@ -54,6 +50,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -142,54 +139,41 @@ public class FtileBox2 extends AbstractFtile { public static FtileBox2 create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Stereotype stereotype) { - Style style = null; - Style styleArrow = null; - if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); return new FtileBox2(skinParam, label, swimlane, boxStyle, style, styleArrow); } private FtileBox2(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Style style, Style styleArrow) { super(skinParam); + Colors specBack = null; + if (skinParam instanceof SkinParamColors) + specBack = ((SkinParamColors) skinParam).getColors(); + style = style.eventuallyOverride(specBack); + this.style = style; this.boxStyle = boxStyle; this.swimlane = swimlane; - final FontConfiguration fc; - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - this.inRendering = LinkRendering.create( - Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); - Colors specBack = null; - if (skinParam instanceof SkinParamColors) { - specBack = ((SkinParamColors) skinParam).getColors(); - } - style = style.eventuallyOverride(specBack); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.horizontalAlignment = style.getHorizontalAlignment(); - this.padding = style.getPadding(); - this.margin = style.getMargin(); - this.roundCorner = style.value(PName.RoundCorner).asDouble(); - this.shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); - } else { - this.padding = ClockwiseTopRightBottomLeft.same(10); - this.margin = ClockwiseTopRightBottomLeft.same(0); - this.inRendering = LinkRendering.create(Rainbow.build(skinParam)); - this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); - this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); - fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); - this.horizontalAlignment = HorizontalAlignment.LEFT; - this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; - wrapWidth = skinParam.wrapWidth(); - } + this.inRendering = LinkRendering + .create(Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + + this.horizontalAlignment = style.getHorizontalAlignment(); + this.padding = style.getPadding(); + this.margin = style.getMargin(); + this.roundCorner = style.value(PName.RoundCorner).asDouble(); + this.shadowing = style.value(PName.Shadowing).asDouble(); + + final LineBreakStrategy wrapWidth = style.wrapWidth(); + + this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); + final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .createSheet(label); @@ -215,23 +199,17 @@ public class FtileBox2 extends AbstractFtile { final Dimension2D dimTotal = calculateDimension(ug.getStringBounder()); ug.draw(new UEmpty(dimTotal)); - final UStroke thickness; - if (UseStyle.useBetaStyle()) { - thickness = style.getStroke(); - } else { - thickness = getThickness(style); - } + final UStroke thickness = style.getStroke(); - if (borderColor == null) { + if (borderColor == null) ug = ug.apply(new HColorNone()); - } else { + else ug = ug.apply(borderColor); - } - if (backColor == null) { + + if (backColor == null) ug = ug.apply(new HColorNone().bg()); - } else { + else ug = ug.apply(backColor.bg()); - } ug = ug.apply(thickness); ug = ug.apply(new UTranslate(margin.getLeft(), margin.getTop())); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java index abba5eb76..63c26e30e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java @@ -141,32 +141,23 @@ public class FtileBoxOld extends AbstractFtile { public static FtileBoxOld create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Stereotype stereotype) { - Style style = null; - Style styleArrow = null; - if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + return new FtileBoxOld(skinParam, label, swimlane, boxStyle, style, styleArrow); } public static TextBlock createWbs(StyleBuilder styleBuilder, ISkinParam skinParam, Display label, StyleSignatureBasic styleDefinition) { - Style style = null; - Style styleArrow = null; - if (UseStyle.useBetaStyle()) { - style = styleDefinition.getMergedStyle(styleBuilder); - styleArrow = style; - } + final Style style = styleDefinition.getMergedStyle(styleBuilder); + final Style styleArrow = style; + return new FtileBoxOld(skinParam, label, null, BoxStyle.PLAIN, style, styleArrow); } public static TextBlock createWbs(Style style, ISkinParam skinParam, Display label) { - Style styleArrow = null; - if (UseStyle.useBetaStyle()) - styleArrow = style; - + final Style styleArrow = style; return new FtileBoxOld(skinParam, label, null, BoxStyle.PLAIN, style, styleArrow); } @@ -180,39 +171,27 @@ public class FtileBoxOld extends AbstractFtile { private FtileBoxOld(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Style style, Style styleArrow) { super(skinParam); + Colors specBack = null; + if (skinParam instanceof SkinParamColors) + specBack = ((SkinParamColors) skinParam).getColors(); + + style = style.eventuallyOverride(specBack); this.style = style; this.boxStyle = boxStyle; this.swimlane = swimlane; - final FontConfiguration fc; - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - this.inRendering = LinkRendering.create( - Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); - Colors specBack = null; - if (skinParam instanceof SkinParamColors) - specBack = ((SkinParamColors) skinParam).getColors(); - style = style.eventuallyOverride(specBack); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.horizontalAlignment = style.getHorizontalAlignment(); - this.padding = style.getPadding(); - this.roundCorner = style.value(PName.RoundCorner).asDouble(); - this.shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); - } else { - this.padding = ClockwiseTopRightBottomLeft.same(10); - this.inRendering = LinkRendering.create(Rainbow.build(skinParam)); - this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); - this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); - fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); - this.horizontalAlignment = HorizontalAlignment.LEFT; - this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; - wrapWidth = skinParam.wrapWidth(); + this.inRendering = LinkRendering + .create(Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.horizontalAlignment = style.getHorizontalAlignment(); + this.padding = style.getPadding(); + this.roundCorner = style.value(PName.RoundCorner).asDouble(); + this.shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); - } final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .createSheet(label); @@ -236,11 +215,7 @@ public class FtileBoxOld extends AbstractFtile { final double heightTotal = dimTotal.getHeight(); final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner); - final UStroke thickness; - if (UseStyle.useBetaStyle()) - thickness = style.getStroke(); - else - thickness = getThickness(style); + final UStroke thickness = style.getStroke(); if (borderColor == null) ug = ug.apply(new HColorNone()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java index fbc6d473b..07659439f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java @@ -40,7 +40,6 @@ import java.util.Collections; import java.util.Set; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; @@ -74,13 +73,9 @@ public class FtileCircleEnd extends AbstractFtile { this.borderColor = borderColor; this.backColor = backColor; this.swimlane = swimlane; - if (UseStyle.useBetaStyle()) { - this.shadowing = style.value(PName.Shadowing).asDouble(); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - } else if (skinParam().shadowing(null)) { - this.shadowing = 3; - } + this.shadowing = style.value(PName.Shadowing).asDouble(); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java index 95ed6df77..5e14e0dd5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java @@ -39,10 +39,8 @@ import java.util.Collection; import java.util.Collections; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; @@ -76,10 +74,7 @@ public class FtileCircleSpot extends AbstractFtile { this.spot = spot; this.swimlane = swimlane; this.backColor = backColor; - if (UseStyle.useBetaStyle()) - this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); - else - this.fc = FontConfiguration.create(skinParam, style); + this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); } @Override @@ -88,9 +83,9 @@ public class FtileCircleSpot extends AbstractFtile { } public Set getSwimlanes() { - if (swimlane == null) { + if (swimlane == null) return Collections.emptySet(); - } + return Collections.singleton(swimlane); } @@ -105,25 +100,12 @@ public class FtileCircleSpot extends AbstractFtile { public void drawU(UGraphic ug) { final UEllipse circle = new UEllipse(SIZE, SIZE); - 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; - } + final HColor backColor = this.backColor == null + ? style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()) + : this.backColor; + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), + getIHtmlColorSet()); + final double shadow = style.value(PName.Shadowing).asDouble(); circle.setDeltaShadow(shadow); ug.apply(borderColor).apply(backColor.bg()).apply(getThickness(style)).draw(circle); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java index b95b841d2..a645a88da 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java @@ -67,13 +67,9 @@ public class FtileCircleStart extends AbstractFtile { this.swimlane = swimlane; this.backColor = backColor; this.borderColor = new HColorNone(); - if (UseStyle.useBetaStyle()) { - this.shadowing = style.value(PName.Shadowing).asDouble(); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - } else if (skinParam().shadowing(null)) { - this.shadowing = 3; - } + this.shadowing = style.value(PName.Shadowing).asDouble(); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java index a6946feb5..4921cecd0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java @@ -73,13 +73,9 @@ public class FtileCircleStop extends AbstractFtile { this.borderColor = borderColor; this.backColor = backColor; this.swimlane = swimlane; - if (UseStyle.useBetaStyle()) { - this.shadowing = style.value(PName.Shadowing).asDouble(); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - } else if (skinParam().shadowing(null)) { - this.shadowing = 3; - } + this.shadowing = style.value(PName.Shadowing).asDouble(); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java index 10fa40807..c4fb1f326 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java @@ -40,7 +40,6 @@ import java.util.Collections; import java.util.Set; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; @@ -70,7 +69,7 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable { final public StyleSignatureBasic getStyleSignature() { return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - + final public Style getStyle() { return getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); } @@ -83,16 +82,10 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable { protected FtileDiamondWIP(TextBlock label, ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane, TextBlock north, TextBlock south, TextBlock east, TextBlock west) { super(skinParam); - if (UseStyle.useBetaStyle()) { - Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); - this.borderColor = borderColor; //style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.backColor = backColor; //style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.shadowing = style.value(PName.Shadowing).asDouble(); - } else { - this.backColor = backColor; - this.borderColor = borderColor; - this.shadowing = skinParam().shadowing(null) ? 3 : 0; - } + Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); + this.borderColor = borderColor; + this.backColor = backColor; + this.shadowing = style.value(PName.Shadowing).asDouble(); this.swimlane = swimlane; @@ -104,9 +97,9 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable { } final public Set getSwimlanes() { - if (swimlane == null) { + if (swimlane == null) return Collections.emptySet(); - } + return Collections.singleton(swimlane); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java index eab503351..687d72427 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java @@ -39,7 +39,6 @@ import java.util.Arrays; import java.util.List; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.style.SName; @@ -86,24 +85,20 @@ public abstract class GAbstractConnection implements GConnection { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) { throw new UnsupportedOperationException(); } - + private final StyleSignatureBasic getDefaultStyleDefinitionArrow() { return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } - + protected ISkinParam skinParam() { throw new UnsupportedOperationException("wip"); } - + // DUPLICATE 4561 final protected Rainbow getInLinkRenderingColor() { - Rainbow color; final ISkinParam skinParam = gpoint1.getGtile().skinParam(); - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle()); - } else - color = Rainbow.build(skinParam); + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Rainbow color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle()); // final LinkRendering linkRendering = tile.getInLinkRendering(); // if (linkRendering == null) { // if (UseStyle.useBetaStyle()) { @@ -128,7 +123,4 @@ public abstract class GAbstractConnection implements GConnection { return color; } - - - } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java index b5b0efdef..ab6d34b74 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java @@ -85,16 +85,12 @@ public class GtileAssembly extends GtileTopDown { protected final TextBlock getTextBlock(Display display) { // DUP3945 - if (Display.isNull(display)) { + if (Display.isNull(display)) return TextBlockUtils.EMPTY_TEXT_BLOCK; - } - final FontConfiguration fontConfiguration; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); - fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); - } else { - fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null); - } + + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); + final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), + skinParam().getIHtmlColorSet()); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java index 2ad4811fe..381c9a851 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java @@ -35,20 +35,15 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SkinParamColors; -import net.sourceforge.plantuml.SkinParamUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -121,54 +116,37 @@ public class GtileBox extends AbstractGtile { public static GtileBox create(StringBounder stringBounder, ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Stereotype stereotype) { - Style style = null; - Style styleArrow = null; - if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - } + final Style style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + return new GtileBox(stringBounder, skinParam, label, swimlane, boxStyle, style, styleArrow); } private GtileBox(StringBounder stringBounder, ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Style style, Style styleArrow) { super(stringBounder, skinParam, swimlane); + Colors specBack = null; + if (skinParam instanceof SkinParamColors) + specBack = ((SkinParamColors) skinParam).getColors(); + + style = style.eventuallyOverride(specBack); this.style = style; this.boxStyle = boxStyle; - final FontConfiguration fc; - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - this.inRendering = LinkRendering.create( - Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); - Colors specBack = null; - if (skinParam instanceof SkinParamColors) { - specBack = ((SkinParamColors) skinParam).getColors(); - } - style = style.eventuallyOverride(specBack); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.horizontalAlignment = style.getHorizontalAlignment(); - this.padding = style.getPadding(); - this.margin = style.getMargin(); - this.roundCorner = style.value(PName.RoundCorner).asDouble(); - this.shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); - } else { - this.padding = ClockwiseTopRightBottomLeft.same(10); - this.margin = ClockwiseTopRightBottomLeft.same(0); - this.inRendering = LinkRendering.create(Rainbow.build(skinParam)); - this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); - this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); - fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); - this.horizontalAlignment = HorizontalAlignment.LEFT; - this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; - wrapWidth = skinParam.wrapWidth(); + this.inRendering = LinkRendering + .create(Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.horizontalAlignment = style.getHorizontalAlignment(); + this.padding = style.getPadding(); + this.margin = style.getMargin(); + this.roundCorner = style.value(PName.RoundCorner).asDouble(); + this.shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); - } final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .createSheet(label); @@ -192,23 +170,17 @@ public class GtileBox extends AbstractGtile { final double heightTotal = dimTotal.getHeight(); final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner); - final UStroke thickness; - if (UseStyle.useBetaStyle()) { - thickness = style.getStroke(); - } else { - thickness = getThickness(); - } + final UStroke thickness = style.getStroke(); - if (borderColor == null) { + if (borderColor == null) ug = ug.apply(new HColorNone()); - } else { + else ug = ug.apply(borderColor); - } - if (backColor == null) { + + if (backColor == null) ug = ug.apply(new HColorNone().bg()); - } else { + else ug = ug.apply(backColor.bg()); - } ug = ug.apply(thickness); shape.drawU(ug); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java index 289afc552..4f67a7535 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java @@ -35,15 +35,13 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.PName; @@ -76,11 +74,8 @@ public class GtileCircleSpot extends AbstractGtile { this.spot = spot; this.backColor = backColor; this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); - this.shadowing = style.value(PName.Shadowing).asDouble(); - } else if (skinParam().shadowing(null)) - this.shadowing = 3; + final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); + this.shadowing = style.value(PName.Shadowing).asDouble(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java index eb13f6fbd..7894e63dd 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java @@ -35,12 +35,10 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; @@ -65,11 +63,8 @@ public class GtileCircleStart extends AbstractGtile { public GtileCircleStart(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane) { super(stringBounder, skinParam, swimlane); this.backColor = backColor; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); - this.shadowing = style.value(PName.Shadowing).asDouble(); - } else if (skinParam().shadowing(null)) - this.shadowing = 3; + final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); + this.shadowing = style.value(PName.Shadowing).asDouble(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java index b60ee2553..1ae8a560a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java @@ -35,20 +35,17 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UseStyle; -import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FloatingNote; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -61,7 +58,6 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignatureBasic; -import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -104,30 +100,20 @@ public class GtileGroup extends AbstractGtileRoot { this.inner = inner; this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor; - final FontConfiguration fc; - final Style style; - if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - this.shadowing = style.value(PName.Shadowing).asDouble(); - } else { - style = null; - final UFont font = skinParam.getFont(null, false, FontParam.PARTITION); - final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION); - fc = FontConfiguration.create(font, fontColor, skinParam.getHyperlinkColor(), - skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); - this.shadowing = skinParam().shadowing(null) ? 3 : 0; - } - if (title == null) { + final Style style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + this.shadowing = style.value(PName.Shadowing).asDouble(); + + if (title == null) this.name = TextBlockUtils.empty(0, 0); - } else { + else this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam); - } - if (Display.isNull(displayNote)) { + + if (Display.isNull(displayNote)) this.headerNote = TextBlockUtils.empty(0, 0); - } else { + else this.headerNote = new FloatingNote(displayNote, skinParam); - } final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null); this.stroke = thickness == null ? new UStroke(2) : thickness; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java index 4a8126ba2..316157486 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java @@ -35,13 +35,11 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; @@ -87,16 +85,11 @@ public class GtileHexagonInside extends AbstractGtile { public GtileHexagonInside(StringBounder stringBounder, TextBlock label, ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane) { super(stringBounder, skinParam, swimlane); - if (UseStyle.useBetaStyle()) { - Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); - this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - this.shadowing = style.value(PName.Shadowing).asDouble(); - } else { - this.backColor = backColor; - this.borderColor = borderColor; - this.shadowing = skinParam().shadowing(null) ? 3 : 0; - } + + final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); + this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + this.shadowing = style.value(PName.Shadowing).asDouble(); this.label = label; this.dimLabel = label.calculateDimension(stringBounder); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java index 28760aab8..35b2e6746 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java @@ -111,32 +111,15 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea if (note.getType() == NoteType.FLOATING_NOTE) withLink = false; - final Rose rose = new Rose(); - - final HColor noteBackgroundColor; - final HColor borderColor; - final FontConfiguration fc; - - final double shadowing; - final LineBreakStrategy wrapWidth; - UStroke stroke = new UStroke(); - if (UseStyle.useBetaStyle()) { - final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) - .eventuallyOverride(note.getColors()); - noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - stroke = style.getStroke(); - } else { - noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); - borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); - fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); - shadowing = skinParam.shadowing(null) ? 4 : 0; - wrapWidth = skinParam.wrapWidth(); - } + final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) + .eventuallyOverride(note.getColors()); + final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + final UStroke stroke = style.getStroke(); final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false, null); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java index 42649892c..66de978a5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java @@ -35,18 +35,15 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -59,7 +56,6 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.sequencediagram.NotePosition; -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; @@ -107,37 +103,21 @@ public class GtileWithNotes extends AbstractGtile { super(tile.getStringBounder(), tile.skinParam()); this.tile = tile; - final Rose rose = new Rose(); - for (PositionedNote note : notes) { ISkinParam skinParam2 = skinParam; - if (note.getColors() != null) { + if (note.getColors() != null) skinParam2 = note.getColors().mute(skinParam2); - } - final HColor noteBackgroundColor; - final HColor borderColor; - final FontConfiguration fc; - final double shadowing; - UStroke stroke = new UStroke(); - final LineBreakStrategy wrapWidth; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) - .eventuallyOverride(note.getColors()); - noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - getIHtmlColorSet()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); - fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); - shadowing = style.value(PName.Shadowing).asDouble(); - wrapWidth = style.wrapWidth(); - stroke = style.getStroke(); - } else { - noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); - borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); - fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); - shadowing = skinParam.shadowing(null) ? 4 : 0; - wrapWidth = skinParam.wrapWidth(); - } + final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) + .eventuallyOverride(note.getColors()); + final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + getIHtmlColorSet()); + final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + final LineBreakStrategy wrapWidth = style.wrapWidth(); + final UStroke stroke = style.getStroke(); final Sheet sheet = Parser .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java index 7d7db85b3..5ec1e3d67 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java @@ -35,11 +35,9 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.creole.CreoleMode; @@ -53,41 +51,25 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; -import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignatureBasic; -import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.color.HColor; public class Gtiles { - private static final Rose rose = new Rose(); - static public GtileHexagonInside hexagonInside(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam, StyleSignatureBasic styleSignature, HColor color, Display label) { - final ConditionStyle conditionStyle = skinParam.getConditionStyle(); - final HColor borderColor; - final HColor backColor; - final FontConfiguration fcTest; - - if (UseStyle.useBetaStyle()) { - final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - backColor = color == null ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet()) : color; - fcTest = style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - } else { - final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND - : FontParam.ARROW; - - borderColor = rose.getHtmlColor(skinParam, ColorParam.activityDiamondBorder); - backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityDiamondBackground) : color; - fcTest = FontConfiguration.create(skinParam, testParam, null) - .changeColor(fontColor(skinParam, FontParam.ACTIVITY_DIAMOND)); - } + final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final HColor backColor = color == null + ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()) + : color; + final FontConfiguration fcTest = style.getFontConfiguration(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); final Sheet sheet = Parser .build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) @@ -100,18 +82,13 @@ public class Gtiles { static public AbstractGtileRoot diamondEmpty(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam, StyleSignatureBasic styleSignature, HColor color) { - final HColor borderColor; - final HColor backColor; - if (UseStyle.useBetaStyle()) { - final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - backColor = color == null ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet()) : color; - } else { - borderColor = rose.getHtmlColor(skinParam, ColorParam.activityDiamondBorder); - backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityDiamondBackground) : color; - } + final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final HColor backColor = color == null + ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()) + : color; return new GtileHexagonInside(stringBounder, TextBlockUtils.EMPTY_TEXT_BLOCK, skinParam, backColor, borderColor, swimlane); diff --git a/src/net/sourceforge/plantuml/bpm/BpmElement.java b/src/net/sourceforge/plantuml/bpm/BpmElement.java index 6f1b2b5c3..1b6e31a9b 100644 --- a/src/net/sourceforge/plantuml/bpm/BpmElement.java +++ b/src/net/sourceforge/plantuml/bpm/BpmElement.java @@ -34,26 +34,22 @@ */ package net.sourceforge.plantuml.bpm; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; -import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; -import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBox; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStart; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignatureBasic; @@ -147,10 +143,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz } private Style getStyle(ISkinParam skinParam) { - if (UseStyle.useBetaStyle()) - return getSignatureCircle().getMergedStyle(skinParam.getCurrentStyleBuilder()); - - return null; + return getSignatureCircle().getMergedStyle(skinParam.getCurrentStyleBuilder()); } public TextBlock toTextBlockInternal(ISkinParam skinParam) { diff --git a/src/net/sourceforge/plantuml/command/CommandFooter.java b/src/net/sourceforge/plantuml/command/CommandFooter.java index 2d235769a..5e1d5d515 100644 --- a/src/net/sourceforge/plantuml/command/CommandFooter.java +++ b/src/net/sourceforge/plantuml/command/CommandFooter.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.TitledDiagram; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexLeaf; @@ -73,10 +72,10 @@ public class CommandFooter extends SingleLineCommand2 { protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) { final String align = arg.get("POSITION", 0); HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER); - if (UseStyle.useBetaStyle() && align == null) { + if (align == null) ha = FontParam.FOOTER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder()) .getHorizontalAlignment(); - } + final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0)); diagram.getFooter().putDisplay(s, ha); diff --git a/src/net/sourceforge/plantuml/command/CommandHeader.java b/src/net/sourceforge/plantuml/command/CommandHeader.java index b95303114..b8d596f54 100644 --- a/src/net/sourceforge/plantuml/command/CommandHeader.java +++ b/src/net/sourceforge/plantuml/command/CommandHeader.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.TitledDiagram; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexLeaf; @@ -75,10 +74,10 @@ public class CommandHeader extends SingleLineCommand2 { protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) { final String align = arg.get("POSITION", 0); HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT); - if (UseStyle.useBetaStyle() && align == null) { + if (align == null) ha = FontParam.HEADER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder()) .getHorizontalAlignment(); - } + final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0)); diagram.getHeader().putDisplay(s, ha); return CommandExecutionResult.ok(); diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java index 17d4e8e45..cb609b5cb 100644 --- a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java +++ b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.UmlDiagram; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -66,11 +65,11 @@ public class CommandMultilinesFooter extends CommandMultilines { final Display strings = lines.toDisplay(); if (strings.size() > 0) { HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER); - if (UseStyle.useBetaStyle() && align == null) { + if (align == null) ha = FontParam.FOOTER.getStyleDefinition(null) .getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder()) .getHorizontalAlignment(); - } + diagram.getFooter().putDisplay(strings, ha); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java index 898079a38..20d78162b 100644 --- a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java +++ b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.UmlDiagram; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -66,11 +65,11 @@ public class CommandMultilinesHeader extends CommandMultilines { final Display strings = lines.toDisplay(); if (strings.size() > 0) { HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT); - if (UseStyle.useBetaStyle() && align == null) { + if (align == null) ha = FontParam.HEADER.getStyleDefinition(null) .getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder()) .getHorizontalAlignment(); - } + diagram.getHeader().putDisplay(strings, ha); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/cucadiagram/Bodier.java b/src/net/sourceforge/plantuml/cucadiagram/Bodier.java index 37265f04e..922ce596c 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/Bodier.java +++ b/src/net/sourceforge/plantuml/cucadiagram/Bodier.java @@ -52,7 +52,7 @@ public interface Bodier { public Display getMethodsToDisplay(); - public void addFieldOrMethod(String s) throws NoSuchColorException; + public boolean addFieldOrMethod(String s) throws NoSuchColorException; public TextBlock getBody(FontParam fontParam, ISkinParam skinParam, boolean showMethods, boolean showFields, Stereotype stereotype, Style style, FontConfiguration fontConfiguration); diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java b/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java index 456f68644..b31cb49e5 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java @@ -92,7 +92,7 @@ public class BodierJSon implements Bodier { } @Override - public void addFieldOrMethod(String s) throws NoSuchColorException { + public boolean addFieldOrMethod(String s) throws NoSuchColorException { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java b/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java index 9eabb7976..502ce76c0 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierLikeClassOrObject.java @@ -87,11 +87,12 @@ public class BodierLikeClassOrObject implements Bodier { } @Override - public void addFieldOrMethod(String s) { + public boolean addFieldOrMethod(String s) { // Empty cache methodsToDisplay = null; fieldsToDisplay = null; rawBody.add(s); + return true; } private boolean isBodyEnhanced() { diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierMap.java b/src/net/sourceforge/plantuml/cucadiagram/BodierMap.java index 81393ed3f..249a0b540 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodierMap.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierMap.java @@ -80,15 +80,18 @@ public class BodierMap implements Bodier { } @Override - public void addFieldOrMethod(String s) { + public boolean addFieldOrMethod(String s) { if (s.contains("=>")) { final int x = s.indexOf("=>"); map.put(s.substring(0, x).trim(), s.substring(x + 2).trim()); + return true; } else if (getLinkedEntry(s) != null) { final String link = getLinkedEntry(s); final int x = s.indexOf(link); map.put(s.substring(0, x).trim(), "\0"); + return true; } + return false; } @Override diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java b/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java index 5714488e1..bd01cd77c 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java @@ -67,9 +67,10 @@ public class BodierSimple implements Bodier { } @Override - public void addFieldOrMethod(String s) throws NoSuchColorException { + public boolean addFieldOrMethod(String s) throws NoSuchColorException { final Display display = Display.getWithNewlines2(s); rawBody.addAll(display.asList()); + return true; } @Override diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java index 640043019..930779b66 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced1.java @@ -48,7 +48,6 @@ import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.legacy.CreoleParser; @@ -77,8 +76,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi BodyEnhanced1(HorizontalAlignment align, List rawBody, FontParam fontParam, ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { - super(align, UseStyle.useBetaStyle() == false ? FontConfiguration.create(skinParam, fontParam, stereotype) - : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); + super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); this.style = style; this.rawBody2 = Display.create(rawBody); this.stereotype = stereotype; diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java index afc1b8c6a..cb827a24c 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java @@ -35,11 +35,9 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; @@ -116,9 +114,7 @@ public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements } final protected double getDefaultThickness() { - if (UseStyle.useBetaStyle()) - return style.value(PName.LineThickness).asDouble(); - return 1.5; + return style.value(PName.LineThickness).asDouble(); } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java index 03fa4c566..e3bd08d41 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java +++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import java.util.Collection; import java.util.HashSet; @@ -45,7 +44,7 @@ import net.sourceforge.plantuml.EmbeddedDiagram; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.FontConfiguration; @@ -57,7 +56,6 @@ import net.sourceforge.plantuml.graphic.TextBlockLineBefore; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockWithUrl; import net.sourceforge.plantuml.skin.VisibilityModifier; -import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.svek.Ports; @@ -81,7 +79,7 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, private final FontParam fontParam; private final ISkinParam skinParam; - private final Rose rose = new Rose(); + private final Display members; private final HorizontalAlignment align; private final Stereotype stereotype; @@ -264,20 +262,12 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, } }; } - final HColor backColor; - final HColor borderColor; - if (UseStyle.useBetaStyle()) { - final Style style = modifier.getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); - borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - final boolean isField = modifier.isField(); - backColor = isField ? null - : style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), - skinParam.getIHtmlColorSet()); - } else { - borderColor = rose.getHtmlColor(skinParam, modifier.getForeground()); - backColor = modifier.getBackground() == null ? null - : rose.getHtmlColor(skinParam, modifier.getBackground()); - } + final Style style = modifier.getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final boolean isField = modifier.isField(); + final HColor backColor = isField ? null + : style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); final TextBlock uBlock = modifier.getUBlock(skinParam.classAttributeIconSize(), borderColor, backColor, url != null); diff --git a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java index dc02cb473..038a28f50 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java +++ b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java @@ -67,7 +67,7 @@ public class Stereotype implements CharSequence { this.automaticPackageStyle = automaticPackageStyle; this.radius = radius; this.circledFont = circledFont; - this.decoration = decoration; + this.decoration = Objects.requireNonNull(decoration); } @@ -189,11 +189,7 @@ public class Stereotype implements CharSequence { } public List getStyleNames() { - final List labels = getLabels(Guillemet.NONE); - if (labels == null) - return Collections.emptyList(); - - return Collections.unmodifiableList(labels); + return decoration.getStyleNames(); } public PackageStyle getPackageStyle() { diff --git a/src/net/sourceforge/plantuml/cucadiagram/StereotypeDecoration.java b/src/net/sourceforge/plantuml/cucadiagram/StereotypeDecoration.java index 6ac77d4d2..2cdb4517b 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/StereotypeDecoration.java +++ b/src/net/sourceforge/plantuml/cucadiagram/StereotypeDecoration.java @@ -95,6 +95,22 @@ public class StereotypeDecoration { final String spriteName; final double spriteScale; + @Override + public String toString() { + return "label='" + label + "' spriteName='" + spriteName + "'"; + } + + public List getStyleNames() { + final List result = new ArrayList<>(cutLabels(label, Guillemet.NONE)); + if (spriteName == null) + return Collections.unmodifiableList(result); + + final int idx = spriteName.lastIndexOf('/'); + if (idx != -1) + result.add(spriteName.substring(idx + 1)); + return Collections.unmodifiableList(result); + } + private StereotypeDecoration(String label, HColor htmlColor, char character, String spriteName, double spriteScale) { this.label = label; diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java index 5d1aa3233..9e8e79994 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java @@ -126,20 +126,20 @@ public final class EntityFactory { folder.setUSymbol(symbol); folder.setStereotype(g.getStereotype()); folder.setColors(g.getColors()); - if (g.getUrl99() != null) { + if (g.getUrl99() != null) folder.addUrl(g.getUrl99()); - } - if (UseStyle.useBetaStyle()) { - // System.err.println("Backcolor ?"); - } else { - if (g.getColors().getColor(ColorType.BACK) == null) { - final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack(); - final HColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false); - folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? skinParam.getBackgroundColor() : c1); - } else { - folder.setSpecificColorTOBEREMOVED(ColorType.BACK, g.getColors().getColor(ColorType.BACK)); - } - } + +// if (UseStyle.useBetaStyle()) { +// // System.err.println("Backcolor ?"); +// } else { +// if (g.getColors().getColor(ColorType.BACK) == null) { +// final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack(); +// final HColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false); +// folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? skinParam.getBackgroundColor() : c1); +// } else { +// folder.setSpecificColorTOBEREMOVED(ColorType.BACK, g.getColors().getColor(ColorType.BACK)); +// } +// } emptyGroupsAsNode.put(g, folder); return folder; } diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java index d10d265cd..1688a95c6 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java @@ -35,11 +35,9 @@ */ package net.sourceforge.plantuml.descdiagram.command; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.regex.IRegex; @@ -120,95 +118,92 @@ public class CommandLinkElement extends SingleLineCommand2 { LinkDecor d1 = LinkDecor.NONE; LinkDecor d2 = LinkDecor.NONE; - if (head1.equals("(0")) { + if (head1.equals("(0")) d1 = LinkDecor.CIRCLE_CONNECT; - } else if (head1.equals("#")) { + else if (head1.equals("#")) d1 = LinkDecor.SQUARE; - } else if (head1.equals("0")) { + else if (head1.equals("0")) d1 = LinkDecor.CIRCLE; - } else if (head1.equals("@")) { + else if (head1.equals("@")) d1 = LinkDecor.CIRCLE_FILL; - } else if (head1.equals("(")) { + else if (head1.equals("(")) d1 = LinkDecor.PARENTHESIS; - } else if (head1.equals(">")) { + else if (head1.equals(">")) d1 = LinkDecor.ARROW; - } else if (head1.equals("*")) { + else if (head1.equals("*")) d1 = LinkDecor.COMPOSITION; - } else if (head1.equals("o")) { + else if (head1.equals("o")) d1 = LinkDecor.AGREGATION; - } else if (head1.equals("+")) { + else if (head1.equals("+")) d1 = LinkDecor.PLUS; - } else if (head1.equals("\\\\")) { + else if (head1.equals("\\\\")) d1 = LinkDecor.HALF_ARROW; - } else if (head1.equals(">>")) { + else if (head1.equals(">>")) d1 = LinkDecor.ARROW_TRIANGLE; - } else if (head1.equals("^")) { + else if (head1.equals("^")) d1 = LinkDecor.EXTENDS; - } else if (head1.equals(":|>")) { + else if (head1.equals(":|>")) d1 = LinkDecor.DEFINEDBY; - } else if (head1.equals("||>")) { + else if (head1.equals("||>")) d1 = LinkDecor.REDEFINES; - } else if (head1.equals("|>")) { + else if (head1.equals("|>")) d1 = LinkDecor.EXTENDS; - } - if (head2.equals("0)")) { + if (head2.equals("0)")) d2 = LinkDecor.CIRCLE_CONNECT; - } else if (head2.equals("#")) { + else if (head2.equals("#")) d2 = LinkDecor.SQUARE; - } else if (head2.equals("0")) { + else if (head2.equals("0")) d2 = LinkDecor.CIRCLE; - } else if (head2.equals("@")) { + else if (head2.equals("@")) d2 = LinkDecor.CIRCLE_FILL; - } else if (head2.equals(")")) { + else if (head2.equals(")")) d2 = LinkDecor.PARENTHESIS; - } else if (head2.equals("<")) { + else if (head2.equals("<")) d2 = LinkDecor.ARROW; - } else if (head2.equals("*")) { + else if (head2.equals("*")) d2 = LinkDecor.COMPOSITION; - } else if (head2.equals("o")) { + else if (head2.equals("o")) d2 = LinkDecor.AGREGATION; - } else if (head2.equals("+")) { + else if (head2.equals("+")) d2 = LinkDecor.PLUS; - } else if (head2.equals("<<")) { + else if (head2.equals("<<")) d2 = LinkDecor.ARROW_TRIANGLE; - } else if (head2.equals("^")) { + else if (head2.equals("^")) d2 = LinkDecor.EXTENDS; - } else if (head2.equals("<|:")) { + else if (head2.equals("<|:")) d2 = LinkDecor.DEFINEDBY; - } else if (head2.equals("<||")) { + else if (head2.equals("<||")) d2 = LinkDecor.REDEFINES; - } else if (head2.equals("<|")) { + else if (head2.equals("<|")) d2 = LinkDecor.EXTENDS; - } LinkType result = new LinkType(d1, d2); final String queue = getQueue(arg); - if (queue.contains(".")) { + if (queue.contains(".")) result = result.goDashed(); - } else if (queue.contains("~")) { + else if (queue.contains("~")) result = result.goDotted(); - } else if (queue.contains("=")) { + else if (queue.contains("=")) result = result.goBold(); - } final String middle = arg.get("INSIDE", 0); - if ("0".equals(middle)) { + if ("0".equals(middle)) result = result.withMiddleCircle(); - } else if ("0)".equals(middle)) { + else if ("0)".equals(middle)) result = result.withMiddleCircleCircled1(); - } else if ("(0".equals(middle)) { + else if ("(0".equals(middle)) result = result.withMiddleCircleCircled2(); - } else if ("(0)".equals(middle)) { + else if ("(0)".equals(middle)) result = result.withMiddleCircleCircled(); - } + return result; } private static String trimAndLowerCase(String s) { - if (s == null) { + if (s == null) return ""; - } + return StringUtils.goLowerCase(StringUtils.trin(s)); } @@ -245,11 +240,11 @@ public class CommandLinkElement extends SingleLineCommand2 { final LinkType linkType = getLinkType(arg); final Direction dir = getDirection(arg); final String queue; - if (dir == Direction.LEFT || dir == Direction.RIGHT) { + if (dir == Direction.LEFT || dir == Direction.RIGHT) queue = "-"; - } else { + else queue = getQueue(arg); - } + final Labels labels = new Labels(arg); final IEntity cl1; @@ -267,31 +262,27 @@ public class CommandLinkElement extends SingleLineCommand2 { labels.getFirstLabel(), labels.getSecondLabel(), diagram.getLabeldistance(), diagram.getLabelangle(), diagram.getSkinParam().getCurrentStyleBuilder()); link.setLinkArrow(labels.getLinkArrow()); - if (dir == Direction.LEFT || dir == Direction.UP) { + if (dir == Direction.LEFT || dir == Direction.UP) link = link.getInv(); - } + link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg, diagram.getSkinParam().getIHtmlColorSet())); link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0)); if (arg.get("STEREOTYPE", 0) != null) { final Stereotype stereotype = Stereotype.build(arg.get("STEREOTYPE", 0)); - if (UseStyle.useBetaStyle()) { - link.setStereotype(stereotype); - } else { - link.setColors(link.getColors().applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.arrow)); - } + link.setStereotype(stereotype); } diagram.addLink(link); return CommandExecutionResult.ok(); } private IEntity getFoo1(DescriptionDiagram diagram, Code code, Ident ident, Ident pure) { - if (!diagram.V1972() && diagram.isGroup(code)) { + if (!diagram.V1972() && diagram.isGroup(code)) return diagram.getGroup(code); - } - if (diagram.V1972() && diagram.isGroupStrict(ident)) { + + if (diagram.V1972() && diagram.isGroupStrict(ident)) return diagram.getGroupStrict(ident); - } + final String codeString = code.getName(); if (ident.getLast().startsWith("()")) { ident = ident.removeStartingParenthesis(); @@ -320,9 +311,9 @@ public class CommandLinkElement extends SingleLineCommand2 { if (diagram.V1972()) { final ILeaf result = pure.size() == 1 ? diagram.getLeafVerySmart(ident) : diagram.getLeafStrict(ident); // final ILeaf result = diagram.getLeafSmart(ident); - if (result != null) { + if (result != null) return result; - } + } return diagram.getOrCreateLeaf(ident, code, type, symbol); } diff --git a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java index f4b29f2df..8940842f5 100644 --- a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java +++ b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.elk; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.io.IOException; import java.io.OutputStream; @@ -54,8 +53,8 @@ import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagramType; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.api.ImageDataSimple; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.Display; @@ -111,7 +110,6 @@ import net.sourceforge.plantuml.graphic.QuoteUtils; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; -import net.sourceforge.plantuml.graphic.USymbols; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; @@ -169,24 +167,24 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null); final TextBlock label = link.getLabel().create(labelFont, skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); - if (TextBlockUtils.isEmpty(label, stringBounder)) { + if (TextBlockUtils.isEmpty(label, stringBounder)) return null; - } + return label; } private TextBlock getQualifier(Link link, int n) { final String tmp = n == 1 ? link.getQualifier1() : link.getQualifier2(); - if (tmp == null) { + if (tmp == null) return null; - } + final ISkinParam skinParam = diagram.getSkinParam(); final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null); final TextBlock label = Display.getWithNewlines(tmp).create(labelFont, skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); - if (TextBlockUtils.isEmpty(label, stringBounder)) { + if (TextBlockUtils.isEmpty(label, stringBounder)) return null; - } + return label; } @@ -225,23 +223,23 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { } private void drawAllClusters(UGraphic ug) { - for (Entry ent : clusters.entrySet()) { + for (Entry ent : clusters.entrySet()) drawSingleCluster(ug, ent.getKey(), ent.getValue()); - } + } private void drawAllNodes(UGraphic ug) { - for (Entry ent : nodes.entrySet()) { + for (Entry ent : nodes.entrySet()) drawSingleNode(ug, ent.getKey(), ent.getValue()); - } + } private void drawAllEdges(UGraphic ug) { for (Entry ent : edges.entrySet()) { final Link link = ent.getKey(); - if (link.isInvis()) { + if (link.isInvis()) continue; - } + drawSingleEdge(ug, link, ent.getValue()); } } @@ -252,28 +250,16 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { PackageStyle packageStyle = group.getPackageStyle(); final ISkinParam skinParam = diagram.getSkinParam(); - if (packageStyle == null) { + if (packageStyle == null) packageStyle = skinParam.packageStyle(); - } final UmlDiagramType umlDiagramType = diagram.getUmlDiagramType(); - final double shadowing; - final UStroke stroke; - if (UseStyle.useBetaStyle()) { - final Style style = Cluster.getDefaultStyleDefinition(umlDiagramType.getStyleName(), group.getUSymbol()) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - shadowing = style.value(PName.Shadowing).asDouble(); - stroke = Cluster.getStrokeInternal(group, skinParam, style); - } else { - if (group.getUSymbol() == null) { - shadowing = skinParam.shadowing2(group.getStereotype(), USymbols.PACKAGE.getSkinParameter()) ? 3 : 0; - } else { - shadowing = skinParam.shadowing2(group.getStereotype(), group.getUSymbol().getSkinParameter()) ? 3 - : 0; - } - stroke = Cluster.getStrokeInternal(group, skinParam, null); - } + final Style style = Cluster.getDefaultStyleDefinition(umlDiagramType.getStyleName(), group.getUSymbol()) + .getMergedStyle(skinParam.getCurrentStyleBuilder()); + final double shadowing = style.value(PName.Shadowing).asDouble(); + final UStroke stroke = Cluster.getStrokeInternal(group, skinParam, style); + HColor backColor = getBackColor(umlDiagramType); backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(), group.getUSymbol()); @@ -298,9 +284,8 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { private TextBlock getTitleBlock(IGroup g) { final Display label = g.getDisplay(); - if (label == null) { + if (label == null) return TextBlockUtils.empty(0, 0); - } final ISkinParam skinParam = diagram.getSkinParam(); final FontConfiguration fontConfiguration = g.getFontConfigurationForTitle(skinParam); @@ -330,9 +315,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { } public Dimension2D calculateDimension(StringBounder stringBounder) { - if (minMax == null) { + if (minMax == null) throw new UnsupportedOperationException(); - } + return minMax.getDimension(); } @@ -344,19 +329,18 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { private Collection getUnpackagedEntities() { final List result = new ArrayList<>(); - for (ILeaf ent : diagram.getLeafsvalues()) { - if (diagram.getEntityFactory().getRootGroup() == ent.getParentContainer()) { + for (ILeaf ent : diagram.getLeafsvalues()) + if (diagram.getEntityFactory().getRootGroup() == ent.getParentContainer()) result.add(ent); - } - } + return result; } private ElkNode getElkNode(final IEntity entity) { ElkNode node = nodes.get(entity); - if (node == null) { + if (node == null) node = clusters.get(entity); - } + return node; } @@ -423,9 +407,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { } private void printSingleGroup(IGroup g) { - if (g.getGroupType() == GroupType.CONCURRENT_STATE) { + if (g.getGroupType() == GroupType.CONCURRENT_STATE) return; - } + this.printEntities(clusters.get(g), g.getLeafsDirect()); printAllSubgroups(clusters.get(g), g); } @@ -433,18 +417,18 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { private void printEntities(ElkNode parent, Collection entities) { // Convert all "leaf" to ELK node for (ILeaf ent : entities) { - if (ent.isRemoved()) { + if (ent.isRemoved()) continue; - } + manageSingleNode(parent, ent); } } private void manageAllEdges() { // Convert all "link" to ELK edge - for (final Link link : diagram.getLinks()) { + for (final Link link : diagram.getLinks()) manageSingleEdge(link); - } + } private void manageSingleNode(final ElkNode root, ILeaf leaf) { @@ -548,14 +532,13 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { } private IEntityImage printEntityInternal(ILeaf ent) { - if (ent.isRemoved()) { + if (ent.isRemoved()) throw new IllegalStateException(); - } + if (ent.getSvekImage() == null) { final ISkinParam skinParam = diagram.getSkinParam(); - if (skinParam.sameClassWidth()) { + if (skinParam.sameClassWidth()) System.err.println("NOT YET IMPLEMENED"); - } return GeneralImageBuilder.createEntityImageBlock(ent, skinParam, diagram.isHideEmptyDescriptionForState(), diagram, getBibliotekon(), null, diagram.getUmlDiagramType(), diagram.getLinks()); diff --git a/src/net/sourceforge/plantuml/elk/ElkPath.java b/src/net/sourceforge/plantuml/elk/ElkPath.java index c1b6aba55..3e3fa0327 100644 --- a/src/net/sourceforge/plantuml/elk/ElkPath.java +++ b/src/net/sourceforge/plantuml/elk/ElkPath.java @@ -43,7 +43,6 @@ import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.UmlDiagramType; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.LinkDecor; @@ -138,13 +137,10 @@ public class ElkPath implements UDrawable { if (link.isHidden()) return; - HColor color; final ISkinParam skinParam = diagram.getSkinParam(); - if (UseStyle.useBetaStyle()) - color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - else - color = rose.getHtmlColor(skinParam, null, getArrowColorParam()); + HColor color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); if (this.link.getColors() != null) { final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE); diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java index 66400dc98..c8924afe5 100644 --- a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java +++ b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java @@ -86,29 +86,26 @@ public class HtmlColorAndStyle { } public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) throws NoSuchColorException { - HColor arrowColor; - HColor arrowHeadColor = null; - if (UseStyle.useBetaStyle()) { - final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); - arrowColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - } else { - arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowColor; - arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowHeadColor; - } - LinkStyle style = LinkStyle.NORMAL(); + + final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + HColor arrowColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final HColor arrowHeadColor = null; + + LinkStyle linkStyle = LinkStyle.NORMAL(); final HColorSet set = skinParam.getIHtmlColorSet(); for (String s : definition.split(",")) { final LinkStyle tmpStyle = LinkStyle.fromString1(s); if (tmpStyle.isNormal() == false) { - style = tmpStyle; + linkStyle = tmpStyle; continue; } final HColor tmpColor = s == null ? null : set.getColor(skinParam.getThemeStyle(), s); - if (tmpColor != null) { + if (tmpColor != null) arrowColor = tmpColor; - } + } - return new HtmlColorAndStyle(arrowColor, style, arrowHeadColor); + return new HtmlColorAndStyle(arrowColor, linkStyle, arrowHeadColor); } } diff --git a/src/net/sourceforge/plantuml/graphic/Rainbow.java b/src/net/sourceforge/plantuml/graphic/Rainbow.java index 8f3510fb0..76aabc9fe 100644 --- a/src/net/sourceforge/plantuml/graphic/Rainbow.java +++ b/src/net/sourceforge/plantuml/graphic/Rainbow.java @@ -40,9 +40,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; @@ -72,20 +70,15 @@ public class Rainbow { } public static Rainbow fromColor(HColor arrowColor, HColor arrowHeadColor) { - if (arrowColor == null) { + if (arrowColor == null) return Rainbow.none(); - } + return Rainbow.build(new HtmlColorAndStyle(arrowColor, arrowHeadColor)); } @Deprecated public static Rainbow build(ISkinParam skinParam) { - if (UseStyle.useBetaStyle()) { - throw new IllegalStateException(); - } - final HColor arrow = rose.getHtmlColor(skinParam, ColorParam.arrow); - final HColor arrowHead = rose.getHtmlColor(skinParam, null, ColorParam.arrowHead, ColorParam.arrow); - return fromColor(arrow, arrowHead); + throw new IllegalStateException(); } public static Rainbow build(Style style, HColorSet set, ThemeStyle themeStyle) { @@ -94,9 +87,9 @@ public class Rainbow { } public Rainbow withDefault(Rainbow defaultColor) { - if (this.size() == 0) { + if (this.size() == 0) return defaultColor; - } + return this; } @@ -108,22 +101,21 @@ public class Rainbow { public static Rainbow build(ISkinParam skinParam, String colorString, int colorArrowSeparationSpace) throws NoSuchColorException { - if (colorString == null) { + if (colorString == null) return Rainbow.none(); - } + final Rainbow result = new Rainbow(colorArrowSeparationSpace); - for (String s : colorString.split(";")) { + for (String s : colorString.split(";")) result.colors.add(HtmlColorAndStyle.build(skinParam, s)); - } + return result; } public boolean isInvisible() { - for (HtmlColorAndStyle style : colors) { - if (style.getStyle().isInvisible()) { + for (HtmlColorAndStyle style : colors) + if (style.getStyle().isInvisible()) return true; - } - } + return false; } diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java index 14e1bfa05..4d460d280 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java @@ -84,31 +84,13 @@ public class TextBlockUtils { } public static TextBlock title(FontConfiguration font, Display stringsToDisplay, ISkinParam skinParam) { - if (UseStyle.useBetaStyle()) { - throw new UnsupportedOperationException(); - } - UStroke stroke = skinParam.getThickness(LineParam.titleBorder, null); - final Rose rose = new Rose(); - HColor borderColor = rose.getHtmlColor(skinParam, ColorParam.titleBorder); - final HColor backgroundColor = rose.getHtmlColor(skinParam, ColorParam.titleBackground); - final TextBlockTitle result = new TextBlockTitle(font, stringsToDisplay, skinParam); - if (stroke == null && borderColor == null) { - return result; - } - if (stroke == null) { - stroke = new UStroke(1.5); - } - if (borderColor == null) { - borderColor = HColorUtils.BLACK; - } - final double corner = skinParam.getRoundCorner(CornerParam.titleBorder, null); - return withMargin(bordered(result, stroke, borderColor, backgroundColor, corner), 2, 2); + throw new UnsupportedOperationException(); } public static TextBlock withMargin(TextBlock textBlock, double marginX, double marginY) { - if (marginX == 0 && marginY == 0) { + if (marginX == 0 && marginY == 0) return textBlock; - } + return new TextBlockMarged(textBlock, marginY, marginX, marginY, marginX); } diff --git a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java index 7c72ed020..e9b381ba4 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java @@ -35,10 +35,9 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; import net.sourceforge.plantuml.ugraphic.UEmpty; @@ -76,12 +75,7 @@ class USymbolDatabase extends USymbol { final UPath closing = getClosingPath(width); ug.apply(new HColorNone().bg()).draw(closing); - - if (UseStyle.useBetaStyle()) { - ug.apply(new UTranslate(width, height)).draw(new UEmpty(10, 10)); - // ug.apply(HColorUtils.BLACK).apply(new UTranslate(width, height)).draw(new - // URectangle(10, 10)); - } + ug.apply(new UTranslate(width, height)).draw(new UEmpty(10, 10)); } diff --git a/src/net/sourceforge/plantuml/graphic/USymbolNode.java b/src/net/sourceforge/plantuml/graphic/USymbolNode.java index d64fc0b92..6b14a0e2e 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolNode.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolNode.java @@ -90,9 +90,8 @@ class USymbolNode extends USymbol { ug.apply(UTranslate.dy(10)).draw(ULine.hline(width - 10)); ug.apply(new UTranslate(width - 10, 10)).draw(ULine.vline(height - 10)); - if (UseStyle.useBetaStyle()) { - ug.apply(new UTranslate(0, height)).draw(new UEmpty(10, 10)); - } + + ug.apply(new UTranslate(0, height)).draw(new UEmpty(10, 10)); } diff --git a/src/net/sourceforge/plantuml/graphic/color/Colors.java b/src/net/sourceforge/plantuml/graphic/color/Colors.java index fbbc4e2d1..392938f55 100644 --- a/src/net/sourceforge/plantuml/graphic/color/Colors.java +++ b/src/net/sourceforge/plantuml/graphic/color/Colors.java @@ -45,7 +45,6 @@ import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamColors; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.cucadiagram.Stereotype; @@ -91,9 +90,9 @@ public class Colors { final String s = st.nextToken(); final int x = s.indexOf(':'); if (x == -1) { - if (s.contains(".") == false) { + if (s.contains(".") == false) map.put(mainType, set.getColor(themeStyle, s)); - } + } else { final String name = s.substring(0, x); final String value = s.substring(x + 1); @@ -106,13 +105,13 @@ public class Colors { } } } - if (data.contains("line.dashed")) { + if (data.contains("line.dashed")) lineStyle = LinkStyle.DASHED(); - } else if (data.contains("line.dotted")) { + else if (data.contains("line.dotted")) lineStyle = LinkStyle.DOTTED(); - } else if (data.contains("line.bold")) { + else if (data.contains("line.bold")) lineStyle = LinkStyle.BOLD(); - } + } public HColor getColor(ColorType key) { @@ -121,29 +120,23 @@ public class Colors { public HColor getColor(ColorType key1, ColorType key2) { final HColor result = getColor(key1); - if (result != null) { + if (result != null) return result; - } + return getColor(key2); } public UStroke getSpecificLineStroke() { - if (lineStyle == null) { + if (lineStyle == null) return null; - } + return lineStyle.getStroke3(); } - // public Colors addSpecificLineStroke(UStroke specificStroke) { - // final Colors result = copy(); - // result.specificStroke = specificStroke; - // return result; - // } - public Colors add(ColorType type, HColor color) { - if (color == null) { + if (color == null) return this; - } + final Colors result = copy(); result.map.put(type, color); return result; @@ -152,9 +145,9 @@ public class Colors { private Colors add(ColorType colorType, Colors other) { final Colors result = copy(); result.map.putAll(other.map); - if (other.lineStyle != null) { + if (other.lineStyle != null) result.lineStyle = other.lineStyle; - } + return result; } @@ -187,37 +180,20 @@ public class Colors { throws NoSuchColorException { Objects.requireNonNull(stereotype); final ColorType colorType = Objects.requireNonNull(Objects.requireNonNull(param).getColorType()); - if (getColor(colorType) != null) { + if (getColor(colorType) != null) return this; - } + final Colors colors = skinParam.getColors(param, stereotype); return add(colorType, colors); } - private Colors applyFontParamStereotype(Stereotype stereotype, ISkinParam skinParam, FontParam param) { - Objects.requireNonNull(stereotype); - if (param == null) { - return this; - } - final ColorType colorType = ColorType.TEXT; - if (getColor(colorType) != null) { - return this; - } - if (UseStyle.useBetaStyle()) { - return this; - } - final HColor col = skinParam.getFontHtmlColor(stereotype, param); - return add(colorType, col); - } - public Colors applyStereotypeForNote(Stereotype stereotype, ISkinParam skinParam, FontParam fontParam, ColorParam... params) throws NoSuchColorException { Objects.requireNonNull(stereotype); Colors result = this; - for (ColorParam param : Objects.requireNonNull(params)) { + for (ColorParam param : Objects.requireNonNull(params)) result = result.applyStereotype(stereotype, skinParam, param); - } - result = result.applyFontParamStereotype(stereotype, skinParam, fontParam); + result.shadowing = skinParam.shadowingForNote(stereotype); return result; } @@ -227,9 +203,9 @@ public class Colors { } public UStroke muteStroke(UStroke stroke) { - if (lineStyle == null) { + if (lineStyle == null) return stroke; - } + return lineStyle.muteStroke(stroke); } diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java index f8b9f7489..df695947e 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java @@ -102,7 +102,10 @@ public class CommandCreateMap extends CommandMultilines2 0; - entity1.getBodier().addFieldOrMethod(line); + final boolean ok = entity1.getBodier().addFieldOrMethod(line); + if (ok == false) + return CommandExecutionResult.error("Map definition should contains key => value"); + if (BodierMap.getLinkedEntry(line) != null) { final String linkStr = BodierMap.getLinkedEntry(line); final int x = line.indexOf(linkStr); @@ -135,11 +138,11 @@ public class CommandCreateMap extends CommandMultilines2 { @Override protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) { try { - UseStyle.setBetaStyle(true); return diagram.loadSkin(arg.get("SKIN", 0)); } catch (IOException e) { return CommandExecutionResult.error("Skin read error"); diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java index 535770c05..ad19b2a9d 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.sequencediagram.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; @@ -49,6 +48,7 @@ import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.DisplaySection; @@ -157,10 +157,9 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { compTitle = style.createTextBlockBordered(page.getTitle(), diagram.getSkinParam().getIHtmlColorSet(), diagram.getSkinParam()); } else { - compTitle = TextBlockUtils.withMargin( - TextBlockUtils.title(FontConfiguration.create(drawableSet.getSkinParam(), FontParam.TITLE, null), - page.getTitle(), drawableSet.getSkinParam()), - 7, 7); + compTitle = TextBlockUtils.withMargin(TextBlockUtils.title( + FontConfiguration.create(drawableSet.getSkinParam(), FontParam.TITLE, null), page.getTitle(), + drawableSet.getSkinParam()), 7, 7); } final Dimension2D dimTitle = compTitle.calculateDimension(stringBounder); area.setTitleArea(dimTitle.getWidth(), dimTitle.getHeight()); @@ -244,18 +243,11 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { private PngTitler getPngTitler(final FontParam fontParam, int page) { final ISkinParam skinParam = diagram.getSkinParam(); - final HColor hyperlinkColor = skinParam.getHyperlinkColor(); - final HColor titleColor = skinParam.getFontHtmlColor(null, fontParam); - final String fontFamily = skinParam.getFont(null, false, fontParam).getFamily(null); - final int fontSize = skinParam.getFont(null, false, fontParam).getSize(); final DisplaySection display = diagram.getFooterOrHeaderTeoz(fontParam).withPage(page + 1, pages.size()); - Style style = null; - if (UseStyle.useBetaStyle()) { - final StyleSignatureBasic def = fontParam.getStyleDefinition(null); - style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); - } - return new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor, - skinParam.useUnderlineForHyperlink(), style, skinParam.getIHtmlColorSet(), skinParam); + final StyleSignatureBasic def = fontParam.getStyleDefinition(null); + final Style style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); + + return new PngTitler(display, style, skinParam.getIHtmlColorSet(), skinParam); } private boolean isLegendTop() { diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java index 6be3eb325..df3f8b0f6 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.sequencediagram.teoz; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.io.OutputStream; @@ -46,6 +45,7 @@ import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.DisplaySection; @@ -70,7 +70,6 @@ import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.utils.MathUtils; public class SequenceDiagramFileMakerTeoz implements FileMaker { @@ -137,9 +136,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { if (this.index != index) { throw new IllegalStateException(); } - return diagram.createImageBuilder(fileFormatOption) - .drawable(new Foo(index)) - .write(os); + return diagram.createImageBuilder(fileFormatOption).drawable(new Foo(index)).write(os); } class Foo implements UDrawable { @@ -234,22 +231,16 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { } public TextBlock getFooterOrHeader(final FontParam param) { - if (diagram.getFooterOrHeaderTeoz(param).isNull()) { + if (diagram.getFooterOrHeaderTeoz(param).isNull()) return new TeozLayer(null, stringBounder, param); - } + final DisplaySection display = diagram.getFooterOrHeaderTeoz(param).withPage(index + 1, getNbPages()); - final HColor hyperlinkColor = getSkinParam().getHyperlinkColor(); - final HColor titleColor = getSkinParam().getFontHtmlColor(null, param); - final String fontFamily = getSkinParam().getFont(null, false, param).getFamily(null); - final int fontSize = getSkinParam().getFont(null, false, param).getSize(); - Style style = null; final ISkinParam skinParam = diagram.getSkinParam(); - if (UseStyle.useBetaStyle()) { - final StyleSignatureBasic def = param.getStyleDefinition(null); - style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); - } - final PngTitler pngTitler = new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor, - getSkinParam().useUnderlineForHyperlink(), style, skinParam.getIHtmlColorSet(), skinParam); + + final StyleSignatureBasic def = param.getStyleDefinition(null); + final Style style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); + + final PngTitler pngTitler = new PngTitler(display, style, skinParam.getIHtmlColorSet(), skinParam); return new TeozLayer(pngTitler, stringBounder, param); } diff --git a/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java b/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java index b3826ce7a..9461e2b1a 100644 --- a/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java +++ b/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java @@ -65,15 +65,11 @@ public class CommandStyleMultilinesCSS extends CommandMultilines2 } protected CommandExecutionResult executeNow(TitledDiagram diagram, BlocLines lines) { - UseStyle.setBetaStyle(true); - if (UseStyle.useBetaStyle() == false) { - return CommandExecutionResult.ok(); - } try { final StyleBuilder styleBuilder = diagram.getSkinParam().getCurrentStyleBuilder(); - for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines.subExtract(1, 1), styleBuilder)) { + for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines.subExtract(1, 1), styleBuilder)) diagram.getSkinParam().muteStyle(modifiedStyle); - } + ((SkinParam) diagram.getSkinParam()).applyPendingStyleMigration(); return CommandExecutionResult.ok(); } catch (NoStyleAvailableException e) { diff --git a/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java b/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java index c32b6ed82..9e68dd396 100644 --- a/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java +++ b/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java @@ -209,6 +209,7 @@ public class FromSkinparamToStyle { addMagic(SName.storage); addMagic(SName.usecase); addMagic(SName.map); + addMagic(SName.archimate); } @@ -233,7 +234,7 @@ public class FromSkinparamToStyle { if (key.contains("<<")) { final StringTokenizer st = new StringTokenizer(key, "<>"); this.key = st.nextToken(); - this.stereo = st.nextToken(); + this.stereo = st.hasMoreTokens() ? st.nextToken() : null; } else { this.key = key; this.stereo = null; diff --git a/src/net/sourceforge/plantuml/style/StyleSignatures.java b/src/net/sourceforge/plantuml/style/StyleSignatures.java index 1df0f847f..5950a5197 100644 --- a/src/net/sourceforge/plantuml/style/StyleSignatures.java +++ b/src/net/sourceforge/plantuml/style/StyleSignatures.java @@ -50,6 +50,11 @@ public class StyleSignatures implements StyleSignature { } + @Override + public String toString() { + return all.toString(); + } + @Override public Style getMergedStyle(StyleBuilder currentStyleBuilder) { if (all.size() == 0) diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java index a0acabb5b..24709d511 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java @@ -36,7 +36,6 @@ */ package net.sourceforge.plantuml.svek.image; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.EnumMap; import java.util.HashSet; @@ -47,9 +46,8 @@ import java.util.Set; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.BodyFactory; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.EntityPortion; @@ -116,7 +114,6 @@ public class EntityImageDescription extends AbstractEntityImage { this.fixCircleLabelOverlapping = getSkinParam().fixCircleLabelOverlapping(); this.links = links; - final Stereotype stereotype = entity.getStereotype(); USymbol symbol = getUSymbol(entity); if (symbol == USymbols.FOLDER) this.shapeType = ShapeType.FOLDER; @@ -134,50 +131,30 @@ public class EntityImageDescription extends AbstractEntityImage { final Colors colors = entity.getColors(); HColor backcolor = colors.getColor(ColorType.BACK); - final HColor forecolor; - final double roundCorner; - final double diagonalCorner; - final double deltaShadow; - final UStroke stroke; - final FontConfiguration fcTitle; - final FontConfiguration fcStereo; - Style style = null; - final HorizontalAlignment defaultAlign; - if (UseStyle.useBetaStyle()) { - final StyleSignatureBasic tmp = StyleSignatureBasic.of(SName.root, SName.element, styleName, - symbol.getSkinParameter().getStyleName()); - style = tmp.withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder()); - style = style.eventuallyOverride(colors); - final Style styleStereo = tmp.forStereotypeItself(stereotype) - .getMergedStyle(getSkinParam().getCurrentStyleBuilder()); - forecolor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), + final StyleSignatureBasic tmp = StyleSignatureBasic.of(SName.root, SName.element, styleName, + symbol.getSkinParameter().getStyleName()); + final Stereotype stereotype = entity.getStereotype(); + final Style style = tmp.withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder()) + .eventuallyOverride(colors); + + final Style styleStereo = tmp.forStereotypeItself(stereotype) + .getMergedStyle(getSkinParam().getCurrentStyleBuilder()); + final HColor forecolor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); + if (backcolor == null) + backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); - if (backcolor == null) - backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), - getSkinParam().getIHtmlColorSet()); - roundCorner = style.value(PName.RoundCorner).asDouble(); - diagonalCorner = style.value(PName.DiagonalCorner).asDouble(); - deltaShadow = style.value(PName.Shadowing).asDouble(); - stroke = style.getStroke(colors); - fcTitle = style.getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); - fcStereo = styleStereo.getFontConfiguration(getSkinParam().getThemeStyle(), - getSkinParam().getIHtmlColorSet()); - defaultAlign = style.getHorizontalAlignment(); - } else { - forecolor = SkinParamUtils.getColor(getSkinParam(), stereotype, symbol.getColorParamBorder()); - if (backcolor == null) - backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), symbol.getColorParamBack()); - - roundCorner = symbol.getSkinParameter().getRoundCorner(getSkinParam(), stereotype); - diagonalCorner = symbol.getSkinParameter().getDiagonalCorner(getSkinParam(), stereotype); - deltaShadow = getSkinParam().shadowing2(getEntity().getStereotype(), symbol.getSkinParameter()) ? 3 : 0; - stroke = colors.muteStroke(symbol.getSkinParameter().getStroke(getSkinParam(), stereotype)); - fcTitle = FontConfiguration.create(getSkinParam(), symbol.getFontParam(), stereotype); - fcStereo = FontConfiguration.create(getSkinParam(), symbol.getFontParamStereotype(), stereotype); - defaultAlign = HorizontalAlignment.LEFT; - } + final double roundCorner = style.value(PName.RoundCorner).asDouble(); + final double diagonalCorner = style.value(PName.DiagonalCorner).asDouble(); + final double deltaShadow = style.value(PName.Shadowing).asDouble(); + final UStroke stroke = style.getStroke(colors); + final FontConfiguration fcTitle = style.getFontConfiguration(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); + final FontConfiguration fcStereo = styleStereo.getFontConfiguration(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); + final HorizontalAlignment defaultAlign = style.getHorizontalAlignment(); assert getStereo() == stereotype; diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java index 42fc5ab37..af27409c3 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java @@ -35,21 +35,17 @@ */ package net.sourceforge.plantuml.svek.image; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.EnumMap; import java.util.Map; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.CornerParam; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineConfigurable; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.Stencil; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.EntityPortion; @@ -99,12 +95,8 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With final Stereotype stereotype = entity.getStereotype(); this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null); - final FontConfiguration fcHeader; - if (UseStyle.useBetaStyle()) - fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(), - getSkinParam().getIHtmlColorSet()); - else - fcHeader = FontConfiguration.create(getSkinParam(), FontParam.OBJECT, stereotype); + final FontConfiguration fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); this.name = TextBlockUtils .withMargin(entity.getDisplay().create(fcHeader, HorizontalAlignment.CENTER, skinParam), 2, 2); @@ -117,14 +109,10 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With FontConfiguration.create(getSkinParam(), FontParam.OBJECT_STEREOTYPE, stereotype), HorizontalAlignment.CENTER, skinParam); - if (UseStyle.useBetaStyle()) { - final FontConfiguration fontConfiguration = getStyleHeader() - .getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); - this.entries = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, false, - entity.getStereotype(), getStyle(), fontConfiguration); - } else - this.entries = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, false, - entity.getStereotype(), null, null); + final FontConfiguration fontConfiguration = getStyleHeader() + .getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); + this.entries = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, false, + entity.getStereotype(), getStyle(), fontConfiguration); this.url = entity.getUrl99(); @@ -168,27 +156,23 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With final double heightTotal = dimTotal.getHeight(); final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(roundCorner); - final HColor borderColor; - final UStroke stroke; HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); + HColor headerBackcolor = getEntity().getColors().getColor(ColorType.HEADER); - if (UseStyle.useBetaStyle()) { - final Style style = getStyle(); - borderColor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), + final Style style = getStyle(); + final HColor borderColor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); + + if (headerBackcolor == null) + headerBackcolor = backcolor == null ? getStyleHeader().value(PName.BackGroundColor) + .asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()) : backcolor; + + if (backcolor == null) + backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); - if (backcolor == null) - backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), - getSkinParam().getIHtmlColorSet()); - rect.setDeltaShadow(style.value(PName.Shadowing).asDouble()); - stroke = style.getStroke(); - } else { - if (getSkinParam().shadowing(getEntity().getStereotype())) - rect.setDeltaShadow(4); - borderColor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.objectBorder); - if (backcolor == null) - backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.objectBackground); - stroke = getStroke(); - } + + rect.setDeltaShadow(style.value(PName.Shadowing).asDouble()); + final UStroke stroke = style.getStroke(); ug = ug.apply(borderColor).apply(backcolor.bg()); @@ -200,6 +184,12 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); ug.apply(stroke).draw(rect); + + if (roundCorner == 0 && headerBackcolor != null && backcolor.equals(headerBackcolor) == false) { + final Shadowable rect2 = new URectangle(widthTotal, dimTitle.getHeight()); + final UGraphic ugHeader = ug.apply(headerBackcolor.bg()); + ugHeader.apply(stroke).draw(rect2); + } final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder())); if (stereo != null) @@ -218,17 +208,6 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With ug.closeGroup(); } - private UStroke getStroke() { - UStroke stroke = lineConfig.getColors().getSpecificLineStroke(); - if (stroke == null) - stroke = getSkinParam().getThickness(LineParam.objectBorder, getStereo()); - - if (stroke == null) - stroke = new UStroke(1.5); - - return stroke; - } - private double getMethodOrFieldHeight(final Dimension2D dim) { final double fieldsHeight = dim.getHeight(); if (fieldsHeight == 0 && this.getEntity().getLeafType() != LeafType.MAP) diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java index c182fa355..411028385 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java @@ -39,17 +39,13 @@ import java.awt.geom.Rectangle2D; import java.util.EnumMap; import java.util.Map; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.CornerParam; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineConfigurable; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.Stencil; import net.sourceforge.plantuml.cucadiagram.Display; @@ -101,12 +97,8 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W final Stereotype stereotype = entity.getStereotype(); this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null); - final FontConfiguration fcHeader; - if (UseStyle.useBetaStyle()) - fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(), - getSkinParam().getIHtmlColorSet()); - else - fcHeader = FontConfiguration.create(getSkinParam(), FontParam.OBJECT, stereotype); + final FontConfiguration fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); final TextBlock tmp = getUnderlinedName(entity).create(fcHeader, HorizontalAlignment.CENTER, skinParam); this.name = TextBlockUtils.withMargin(tmp, 2, 2); @@ -170,37 +162,23 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W final double heightTotal = dimTotal.getHeight(); final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(roundCorner); - final HColor borderColor; - final UStroke stroke; - HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor headerBackcolor = getEntity().getColors().getColor(ColorType.HEADER); - if (UseStyle.useBetaStyle()) { - final Style style = getStyle(); - borderColor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), + final Style style = getStyle(); + final HColor borderColor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), + getSkinParam().getIHtmlColorSet()); + + if (headerBackcolor == null) + headerBackcolor = backcolor == null ? getStyleHeader().value(PName.BackGroundColor) + .asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()) : backcolor; + + if (backcolor == null) + backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); - if (headerBackcolor == null) - headerBackcolor = backcolor == null ? getStyleHeader().value(PName.BackGroundColor) - .asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()) : backcolor; - - if (backcolor == null) - backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), - getSkinParam().getIHtmlColorSet()); - - rect.setDeltaShadow(style.value(PName.Shadowing).asDouble()); - stroke = style.getStroke(); - - } else { - if (getSkinParam().shadowing(getEntity().getStereotype())) - rect.setDeltaShadow(4); - borderColor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.objectBorder); - if (backcolor == null) - backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.objectBackground); - stroke = getStroke(); - - } + rect.setDeltaShadow(style.value(PName.Shadowing).asDouble()); + final UStroke stroke = style.getStroke(); ug = ug.apply(borderColor).apply(backcolor.bg()); @@ -213,11 +191,9 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W ug.startGroup(typeIDent); ug.apply(stroke).draw(rect); - UGraphic ugHeader = ug; if (roundCorner == 0 && headerBackcolor != null && backcolor.equals(headerBackcolor) == false) { final Shadowable rect2 = new URectangle(widthTotal, dimTitle.getHeight()); - rect2.setDeltaShadow(0); - ugHeader = ugHeader.apply(headerBackcolor.bg()); + final UGraphic ugHeader = ug.apply(headerBackcolor.bg()); ugHeader.apply(stroke).draw(rect2); } @@ -242,17 +218,6 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W return header; } - private UStroke getStroke() { - UStroke stroke = lineConfig.getColors().getSpecificLineStroke(); - if (stroke == null) - stroke = getSkinParam().getThickness(LineParam.objectBorder, getStereo()); - - if (stroke == null) - stroke = new UStroke(1.5); - - return stroke; - } - private double getMethodOrFieldHeight(final Dimension2D dim) { final double fieldsHeight = dim.getHeight(); if (fieldsHeight == 0) diff --git a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java index 1d487e07c..53f6272f0 100644 --- a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java +++ b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.tikz; @@ -120,6 +120,19 @@ public class TikzGraphics { return Objects.requireNonNull(result); } + private boolean mustApplyFillColor() { + if (fillcolor == null) + return false; + + if (HColorUtils.isTransparent(fillcolor)) + return false; + + if (mapper.toColor(fillcolor).getAlpha() == 0) + return false; + + return true; + } + private void appendFillColor(StringBuilder sb, boolean colorBackup) { if (fillcolor == null) return; @@ -467,18 +480,6 @@ public class TikzGraphics { } } - private boolean mustApplyFillColor() { - if (fillcolor == null) - return false; - - if (HColorUtils.isTransparent(fillcolor)) - return false; - - if (mapper.toColor(fillcolor).getAlpha() == 0) - return false; - return true; - } - public void rectangleRound(double x, double y, double width, double height, double r) { double[] points = new double[8 * 2]; points[0] = x; @@ -549,7 +550,7 @@ public class TikzGraphics { if (color != null) sb.append("color=" + getColorName(color) + ","); - if (fillcolor != null && !HColorUtils.isTransparent(fillcolor)) + if (mustApplyFillColor()) sb.append("fill=" + getColorName(fillcolor) + ","); sb.append("line width=" + thickness + "pt] " + couple(x, y) + " ellipse (" + format(width) + "pt and " @@ -563,7 +564,7 @@ public class TikzGraphics { if (color != null) sb.append("color=" + getColorName(color) + ","); - if (fillcolor != null) + if (mustApplyFillColor()) sb.append("fill=" + getColorName(fillcolor) + ","); sb.append("line width=" + thickness + "pt] " + couple(x, y) + " arc (" + angleStart + ":" + angleEnd + ":" diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index b2f8922d9..0fd338c21 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -44,7 +44,7 @@ public class Version { private static final int MAJOR_SEPARATOR = 1000000; public static int version() { - return 1202203; + return 1202204; } public static int versionPatched() { @@ -80,7 +80,7 @@ public class Version { } public static int beta() { - final int beta = 2; + final int beta = 0; return beta; } @@ -93,7 +93,7 @@ public class Version { } public static long compileTime() { - return 1648570257787L; + return 1649510957985L; } public static String compileTimeString() {