1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-03 09:00:48 +00:00

Import version 1.2022.4

This commit is contained in:
Arnaud Roques 2022-04-10 21:24:55 +02:00
parent dc18a98c57
commit bee4d458eb
93 changed files with 846 additions and 1789 deletions

View File

@ -35,10 +35,10 @@
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; 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.Display;
import net.sourceforge.plantuml.cucadiagram.DisplayPositioned; import net.sourceforge.plantuml.cucadiagram.DisplayPositioned;
import net.sourceforge.plantuml.cucadiagram.DisplaySection; 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.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class AnnotatedWorker { public class AnnotatedWorker {
@ -98,23 +97,13 @@ public class AnnotatedWorker {
final double y1 = 10; final double y1 = 10;
final double y2 = 10; final double y2 = 10;
final double deltaShadow; final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame)
final FontConfiguration fontConfiguration; .getMergedStyle(skinParam.getCurrentStyleBuilder());
final UStroke stroke; final double deltaShadow = style.value(PName.Shadowing).asDouble();
final HColor borderColor; final FontConfiguration fontConfiguration = FontConfiguration.create(getSkinParam(), style);
if (UseStyle.useBetaStyle()) { final UStroke stroke = style.getStroke();
final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame) final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
.getMergedStyle(skinParam.getCurrentStyleBuilder()); skinParam.getIHtmlColorSet());
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 SymbolContext symbolContext = new SymbolContext(getBackgroundColor(), borderColor).withShadow(deltaShadow) final SymbolContext symbolContext = new SymbolContext(getBackgroundColor(), borderColor).withShadow(deltaShadow)
.withStroke(stroke); .withStroke(stroke);
@ -188,13 +177,10 @@ public class AnnotatedWorker {
if (caption.isNull()) if (caption.isNull())
return TextBlockUtils.empty(0, 0); return TextBlockUtils.empty(0, 0);
if (UseStyle.useBetaStyle()) { final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.caption)
final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.caption) .getMergedStyle(skinParam.getCurrentStyleBuilder());
.getMergedStyle(skinParam.getCurrentStyleBuilder()); return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam);
return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam);
}
return caption.getDisplay().create(FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null),
HorizontalAlignment.CENTER, getSkinParam());
} }
private TextBlock addTitle(TextBlock original) { private TextBlock addTitle(TextBlock original) {
@ -202,16 +188,10 @@ public class AnnotatedWorker {
if (title.isNull()) if (title.isNull())
return original; return original;
final TextBlock block; final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title)
if (UseStyle.useBetaStyle()) { .getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title) final TextBlock block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(),
.getMergedStyle(skinParam.getCurrentStyleBuilder()); skinParam);
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);
}
return DecorateEntityImage.addTop(original, block, HorizontalAlignment.CENTER); return DecorateEntityImage.addTop(original, block, HorizontalAlignment.CENTER);
} }
@ -224,21 +204,15 @@ public class AnnotatedWorker {
TextBlock textFooter = null; TextBlock textFooter = null;
if (footer.isNull() == false) { if (footer.isNull() == false) {
Style style = null; final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer)
if (UseStyle.useBetaStyle()) { .getMergedStyle(skinParam.getCurrentStyleBuilder());
style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
}
textFooter = footer.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.FOOTER, null), textFooter = footer.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.FOOTER, null),
getSkinParam(), style); getSkinParam(), style);
} }
TextBlock textHeader = null; TextBlock textHeader = null;
if (header.isNull() == false) { if (header.isNull() == false) {
Style style = null; final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.header)
if (UseStyle.useBetaStyle()) { .getMergedStyle(skinParam.getCurrentStyleBuilder());
style = StyleSignatureBasic.of(SName.root, SName.document, SName.header)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
}
textHeader = header.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.HEADER, null), textHeader = header.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.HEADER, null),
getSkinParam(), style); getSkinParam(), style);
} }

View File

@ -109,21 +109,17 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom {
} }
private String getImageSvg() throws IOException, InterruptedException { private String getImageSvg() throws IOException, InterruptedException {
final boolean sav = UseStyle.useBetaStyle();
final Diagram system = getSystem(); final Diagram system = getSystem();
final ByteArrayOutputStream os = new ByteArrayOutputStream(); final ByteArrayOutputStream os = new ByteArrayOutputStream();
system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG)); system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG));
os.close(); os.close();
UseStyle.setBetaStyle(sav);
return new String(os.toByteArray()); return new String(os.toByteArray());
} }
private BufferedImage getImage() throws IOException, InterruptedException { private BufferedImage getImage() throws IOException, InterruptedException {
if (image == null) { if (image == null)
final boolean sav = UseStyle.useBetaStyle();
image = getImageSlow(); image = getImageSlow();
UseStyle.setBetaStyle(sav);
}
return image; return image;
} }

View File

@ -105,46 +105,10 @@ public class SkinParam implements ISkinParam {
private SkinParam(UmlDiagramType type, ThemeStyle style) { private SkinParam(UmlDiagramType type, ThemeStyle style) {
this.themeStyle = style; this.themeStyle = style;
this.type = type; 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() { public StyleBuilder getCurrentStyleBuilder() {
if (styleBuilder == null && UseStyle.useBetaStyle()) { if (styleBuilder == null) {
try { try {
this.styleBuilder = getCurrentStyleBuilderInternal(); this.styleBuilder = getCurrentStyleBuilderInternal();
} catch (IOException e) { } catch (IOException e) {
@ -155,8 +119,7 @@ public class SkinParam implements ISkinParam {
} }
public void muteStyle(Style modifiedStyle) { public void muteStyle(Style modifiedStyle) {
if (UseStyle.useBetaStyle()) styleBuilder = getCurrentStyleBuilder().muteStyle(modifiedStyle);
styleBuilder = getCurrentStyleBuilder().muteStyle(modifiedStyle);
} }
public String getDefaultSkin() { public String getDefaultSkin() {
@ -201,31 +164,22 @@ public class SkinParam implements ISkinParam {
public void setParam(String key, String value) { public void setParam(String key, String value) {
for (String key2 : cleanForKey(key)) { for (String key2 : cleanForKey(key)) {
params.put(key2, StringUtils.trin(value)); params.put(key2, StringUtils.trin(value));
if (key2.startsWith("usebetastyle") && "true".equalsIgnoreCase(value)) applyPendingStyleMigration();
UseStyle.setBetaStyle(true); final FromSkinparamToStyle convertor = new FromSkinparamToStyle(key2);
convertor.convertNow(value, getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { for (Style style : convertor.getStyles())
applyPendingStyleMigration(); muteStyle(style);
final FromSkinparamToStyle convertor = new FromSkinparamToStyle(key2);
convertor.convertNow(value, getCurrentStyleBuilder());
for (Style style : convertor.getStyles())
muteStyle(style);
} else {
paramsPendingForStyleMigration.put(key, value);
}
} }
if ("style".equalsIgnoreCase(key) && "strictuml".equalsIgnoreCase(value)) { if ("style".equalsIgnoreCase(key) && "strictuml".equalsIgnoreCase(value)) {
if (UseStyle.useBetaStyle()) { final InputStream internalIs = StyleLoader.class.getResourceAsStream("/skin/strictuml.skin");
final InputStream internalIs = StyleLoader.class.getResourceAsStream("/skin/strictuml.skin"); final StyleBuilder styleBuilder = this.getCurrentStyleBuilder();
final StyleBuilder styleBuilder = this.getCurrentStyleBuilder(); try {
try { final BlocLines lines = BlocLines.load(internalIs, null);
final BlocLines lines = BlocLines.load(internalIs, null); for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines, styleBuilder))
for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines, styleBuilder)) this.muteStyle(modifiedStyle);
this.muteStyle(modifiedStyle);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
}
} }
} }
} }
@ -308,8 +262,7 @@ public class SkinParam implements ISkinParam {
} }
public String getValue(String key) { public String getValue(String key) {
if (UseStyle.useBetaStyle()) applyPendingStyleMigration();
applyPendingStyleMigration();
for (String key2 : cleanForKey(key)) { for (String key2 : cleanForKey(key)) {
final String result = params.get(key2); final String result = params.get(key2);
if (result != null) if (result != null)

View File

@ -275,20 +275,15 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
} }
public HColor calculateBackColor() { public HColor calculateBackColor() {
if (UseStyle.useBetaStyle()) { final Style style = StyleSignatureBasic.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName())
final Style style = StyleSignatureBasic .getMergedStyle(this.getSkinParam().getCurrentStyleBuilder());
.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName())
.getMergedStyle(this.getSkinParam().getCurrentStyleBuilder());
HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(), HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(),
this.getSkinParam().getIHtmlColorSet()); this.getSkinParam().getIHtmlColorSet());
if (backgroundColor == null) { if (backgroundColor == null)
backgroundColor = HColorUtils.transparent(); backgroundColor = HColorUtils.transparent();
}
return backgroundColor;
} return backgroundColor;
return this.getSkinParam().getBackgroundColor();
} }
} }

View File

@ -37,19 +37,8 @@ package net.sourceforge.plantuml;
public class UseStyle { public class UseStyle {
private static final ThreadLocal<Boolean> useBeta = new ThreadLocal<>();
static public boolean useBetaStyle() { static public boolean useBetaStyle() {
// final Boolean result = useBeta.get();
// if (result == null) {
// return false;
// }
// return result;
return true; return true;
} }
static public void setBetaStyle(boolean betastyle) {
useBeta.set(betastyle);
}
} }

View File

@ -38,10 +38,8 @@ package net.sourceforge.plantuml.activitydiagram3;
import java.util.Collection; import java.util.Collection;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
@ -99,15 +97,10 @@ public class Branch {
this.inlabel = Objects.requireNonNull(inlabel); this.inlabel = Objects.requireNonNull(inlabel);
this.labelTest = Objects.requireNonNull(labelTest); this.labelTest = Objects.requireNonNull(labelTest);
this.labelPositive = Objects.requireNonNull(labelPositive); this.labelPositive = Objects.requireNonNull(labelPositive);
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(styleBuilder); final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(styleBuilder);
this.color = color == null this.color = color == null ? style.value(PName.BackGroundColor).asColor(
? style.value(PName.BackGroundColor).asColor(styleBuilder.getSkinParam().getThemeStyle(), styleBuilder.getSkinParam().getThemeStyle(), styleBuilder.getSkinParam().getIHtmlColorSet()) : color;
styleBuilder.getSkinParam().getIHtmlColorSet())
: color;
} else {
this.color = color;
}
this.list = new InstructionList(swimlane); this.list = new InstructionList(swimlane);
} }
@ -248,15 +241,10 @@ public class Branch {
if (display == null) if (display == null)
return TextBlockUtils.EMPTY_TEXT_BLOCK; return TextBlockUtils.EMPTY_TEXT_BLOCK;
LineBreakStrategy lineBreak = LineBreakStrategy.NONE; final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
final FontConfiguration fcArrow; final LineBreakStrategy lineBreak = style.wrapWidth();
if (UseStyle.useBetaStyle()) { final FontConfiguration fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(),
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); skinParam().getIHtmlColorSet());
lineBreak = style.wrapWidth();
fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create0(fcArrow, HorizontalAlignment.LEFT, skinParam(), lineBreak, CreoleMode.SIMPLE_LINE, null, return display.create0(fcArrow, HorizontalAlignment.LEFT, skinParam(), lineBreak, CreoleMode.SIMPLE_LINE, null,
null); null);

View File

@ -138,39 +138,19 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
final String stereo = arg.get("STEREO", 0); final String stereo = arg.get("STEREO", 0);
final Stereotype stereotype = stereo == null ? null : Stereotype.build(stereo); final Stereotype stereotype = stereo == null ? null : Stereotype.build(stereo);
HColor backColor;
// Warning : titleColor unused in FTileGroupW // Warning : titleColor unused in FTileGroupW
HColor titleColor;
HColor borderColor;
double roundCorner;
if (UseStyle.useBetaStyle()) { final Style stylePartition = getDefaultStyleDefinitionPartition(symbol).withTOBECHANGED(stereotype)
final Style stylePartition = getDefaultStyleDefinitionPartition(symbol).withTOBECHANGED(stereotype) .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder());
.getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); final HColor borderColor = stylePartition.value(PName.LineColor).asColor(diagram.getSkinParam().getThemeStyle(),
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()); 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()); final HColor titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet());
roundCorner = stylePartition.value(PName.RoundCorner).asDouble(); final double 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);
}
diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, symbol, diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, symbol,
roundCorner); roundCorner);

View File

@ -74,9 +74,8 @@ public class CommandSwitch extends SingleLineCommand2<ActivityDiagram3> {
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s); : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
String test = arg.get("TEST", 0); String test = arg.get("TEST", 0);
if (test.length() == 0) { if (test.length() == 0)
test = null; test = null;
}
diagram.startSwitch(Display.getWithNewlines(test), color); diagram.startSwitch(Display.getWithNewlines(test), color);

View File

@ -41,8 +41,6 @@ import java.util.List;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@ -89,14 +87,7 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
} }
public final UStroke getThickness(Style style) { public final UStroke getThickness(Style style) {
if (UseStyle.useBetaStyle()) return style.getStroke();
return style.getStroke();
UStroke thickness = skinParam.getThickness(LineParam.activityBorder, null);
if (thickness == null) {
thickness = new UStroke(1.5);
}
return thickness;
} }
public List<WeldingPoint> getWeldingPoints() { public List<WeldingPoint> getWeldingPoints() {

View File

@ -35,45 +35,21 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile; 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.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.Display; 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.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.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class EntityImageLegend { public class EntityImageLegend {
public static TextBlock create(Display note, ISkinParam skinParam) { public static TextBlock create(Display note, ISkinParam skinParam) {
if (UseStyle.useBetaStyle()) { final Style style = StyleSignatureBasic
final Style style = StyleSignatureBasic.of(SName.root, SName.root, SName.document, .of(SName.root, SName.root, SName.document, skinParam.getUmlDiagramType().getStyleName(), SName.legend)
skinParam.getUmlDiagramType().getStyleName(), SName.legend) .getMergedStyle(skinParam.getCurrentStyleBuilder());
.getMergedStyle(skinParam.getCurrentStyleBuilder()); return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam);
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);
} }
} }

View File

@ -39,10 +39,8 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.ForkStyle; import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
import net.sourceforge.plantuml.activitydiagram3.Instruction; import net.sourceforge.plantuml.activitydiagram3.Instruction;
@ -86,48 +84,35 @@ public class FtileFactoryDelegator implements FtileFactory {
Rainbow color; Rainbow color;
final LinkRendering linkRendering = tile.getInLinkRendering(); final LinkRendering linkRendering = tile.getInLinkRendering();
if (linkRendering == null) { if (linkRendering == null) {
if (UseStyle.useBetaStyle()) { final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style style = getDefaultStyleDefinitionArrow() return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
.getMergedStyle(skinParam().getCurrentStyleBuilder());
return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else {
color = Rainbow.build(skinParam());
}
} else { } else {
color = linkRendering.getRainbow(); color = linkRendering.getRainbow();
} }
if (color.size() == 0) { if (color.size() == 0) {
if (UseStyle.useBetaStyle()) { final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style style = getDefaultStyleDefinitionArrow() return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
.getMergedStyle(skinParam().getCurrentStyleBuilder());
return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else {
color = Rainbow.build(skinParam());
}
} }
return color; return color;
} }
protected final TextBlock getTextBlock(Display display) { protected final TextBlock getTextBlock(Display display) {
// DUP3945 // DUP3945
if (Display.isNull(display)) { if (Display.isNull(display))
return null; return null;
}
final FontConfiguration fontConfiguration; final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(),
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); skinParam().getIHtmlColorSet());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
} }
protected Display getInLinkRenderingDisplay(Ftile tile) { protected Display getInLinkRenderingDisplay(Ftile tile) {
final LinkRendering linkRendering = tile.getInLinkRendering(); final LinkRendering linkRendering = tile.getInLinkRendering();
if (linkRendering == null) { if (linkRendering == null)
return Display.NULL; return Display.NULL;
}
return linkRendering.getDisplay(); return linkRendering.getDisplay();
} }

View File

@ -35,16 +35,11 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile; 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.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
@ -94,15 +89,10 @@ public class LaneDivider extends AbstractTextBlock {
final UShape back = new UEmpty(x1 + x2, 1); final UShape back = new UEmpty(x1 + x2, 1);
ug.draw(back); ug.draw(back);
HColor color = skinParam.getHtmlColor(ColorParam.swimlaneBorder, null, false); final HColor color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(),
if (color == null) { skinParam.getIHtmlColorSet());
color = ColorParam.swimlaneBorder.getDefaultValue(); final UStroke thickness = getStyle().getStroke();
}
UStroke thickness = Rose.getStroke(skinParam, LineParam.swimlaneBorder, 2);
if (UseStyle.useBetaStyle()) {
color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
thickness = getStyle().getStroke();
}
ug.apply(UTranslate.dx(x1)).apply(thickness).apply(color).draw(ULine.vline(height)); ug.apply(UTranslate.dx(x1)).apply(thickness).apply(color).draw(ULine.vline(height));
} }

View File

@ -35,18 +35,14 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile; package net.sourceforge.plantuml.activitydiagram3.ftile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.Pragma; import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Instruction; import net.sourceforge.plantuml.activitydiagram3.Instruction;
import net.sourceforge.plantuml.activitydiagram3.InstructionList; import net.sourceforge.plantuml.activitydiagram3.InstructionList;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; 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.ftile.vcompact.VCompactFactory;
import net.sourceforge.plantuml.activitydiagram3.gtile.GConnection; import net.sourceforge.plantuml.activitydiagram3.gtile.GConnection;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
@ -258,24 +255,21 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private TextBlock getTitle(Swimlane swimlane) { private TextBlock getTitle(Swimlane swimlane) {
final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT;
FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.SWIMLANE_TITLE, null); final FontConfiguration fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(),
if (UseStyle.useBetaStyle()) { skinParam.getIHtmlColorSet());
fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
}
LineBreakStrategy wrap = getWrap(); LineBreakStrategy wrap = getWrap();
if (wrap.isAuto()) { if (wrap.isAuto())
wrap = new LineBreakStrategy("" + ((int) swimlane.getActualWidth())); wrap = new LineBreakStrategy("" + ((int) swimlane.getActualWidth()));
}
return swimlane.getDisplay().create9(fontConfiguration, horizontalAlignment, skinParam, wrap); return swimlane.getDisplay().create9(fontConfiguration, horizontalAlignment, skinParam, wrap);
} }
private LineBreakStrategy getWrap() { private LineBreakStrategy getWrap() {
LineBreakStrategy wrap = skinParam.swimlaneWrapTitleWidth(); LineBreakStrategy wrap = skinParam.swimlaneWrapTitleWidth();
if (wrap == LineBreakStrategy.NONE) { if (wrap == LineBreakStrategy.NONE)
wrap = skinParam.wrapWidth(); wrap = skinParam.wrapWidth();
}
return wrap; return wrap;
} }
@ -333,11 +327,9 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
} }
private void drawTitlesBackground(UGraphic ug) { private void drawTitlesBackground(UGraphic ug) {
HColor color = skinParam.getHtmlColor(ColorParam.swimlaneTitleBackground, null, false); final HColor color = getStyle().value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
if (UseStyle.useBetaStyle()) { skinParam.getIHtmlColorSet());
color = getStyle().value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
}
if (color != null) { if (color != null) {
final double titleHeight = getTitlesHeight(ug.getStringBounder()); final double titleHeight = getTitlesHeight(ug.getStringBounder());
double fullWidth = swimlanesSpecial().get(swimlanesSpecial().size() - 1).getTranslate().getDx() - 2 * 5 - 1; double fullWidth = swimlanesSpecial().get(swimlanesSpecial().size() - 1).getTranslate().getDx() - 2 * 5 - 1;

View File

@ -45,12 +45,9 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
@ -97,15 +94,10 @@ public class Worm implements Iterable<Point2D.Double> {
ug = ug.apply(arrowColor); ug = ug.apply(arrowColor);
ug = ug.apply(arrowColor.bg()); ug = ug.apply(arrowColor.bg());
if (linkStyle.isNormal()) { if (linkStyle.isNormal())
UStroke stroke = new UStroke(strokeValue); ug = ug.apply(style.getStroke());
if (UseStyle.useBetaStyle()) { else
stroke = style.getStroke();
}
ug = ug.apply(stroke);
} else {
ug = ug.apply(linkStyle.goThickness(strokeValue).getStroke3()); ug = ug.apply(linkStyle.goThickness(strokeValue).getStroke3());
}
boolean drawn = false; boolean drawn = false;
for (int i = 0; i < points.size() - 1; i++) { for (int i = 0; i < points.size() - 1; i++) {

View File

@ -102,9 +102,9 @@ public abstract class AbstractParallelFtilesBuilder {
final protected double computeMaxHeight(List<Ftile> all) { final protected double computeMaxHeight(List<Ftile> all) {
double height = 0; double height = 0;
for (Ftile tmp : all) { for (Ftile tmp : all)
height = Math.max(height, tmp.calculateDimension(getStringBounder()).getHeight()); height = Math.max(height, tmp.calculateDimension(getStringBounder()).getHeight());
}
return height; return height;
} }
@ -131,16 +131,13 @@ public abstract class AbstractParallelFtilesBuilder {
protected final TextBlock getTextBlock(Display display) { protected final TextBlock getTextBlock(Display display) {
// DUP3945 // DUP3945
if (Display.isNull(display)) { if (Display.isNull(display))
return null; return null;
}
final FontConfiguration fontConfiguration; final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(),
final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); skinParam().getIHtmlColorSet());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
} }

View File

@ -35,13 +35,9 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; 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.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; 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.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
@ -70,31 +65,16 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
public FloatingNote(Display note, ISkinParam skinParam) { public FloatingNote(Display note, ISkinParam skinParam) {
final Rose rose = new Rose(); final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
UStroke stroke = new UStroke(); final LineBreakStrategy wrapWidth = style.wrapWidth();
final HColor noteBackgroundColor; final FontConfiguration fc = FontConfiguration.create(skinParam, style);
final HColor borderColor; final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
final FontConfiguration fc; skinParam.getIHtmlColorSet());
final LineBreakStrategy wrapWidth; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
final double shadowing; skinParam.getIHtmlColorSet());
if (UseStyle.useBetaStyle()) { final UStroke stroke = style.getStroke();
final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note) final double shadowing = style.value(PName.Shadowing).asDouble();
.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 Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)

View File

@ -37,11 +37,9 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.Pragma; import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
@ -74,35 +72,19 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
final ConditionEndStyle conditionEndStyle = skinParam().getConditionEndStyle(); final ConditionEndStyle conditionEndStyle = skinParam().getConditionEndStyle();
final Branch branch0 = thens.get(0); final Branch branch0 = thens.get(0);
final HColor borderColor; final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
final HColor backColor; final Style styleDiamond = getDefaultStyleDefinitionDiamond()
final Rainbow arrowColor; .getMergedStyle(skinParam().getCurrentStyleBuilder());
final FontConfiguration fcTest; final HColor borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND skinParam().getIHtmlColorSet());
: FontParam.ARROW; final HColor backColor = branch0.getColor() == null ? styleDiamond.value(PName.BackGroundColor)
final FontConfiguration fcArrow; .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor();
if (UseStyle.useBetaStyle()) { final Rainbow arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(),
final Style styleArrow = getDefaultStyleDefinitionArrow() skinParam().getThemeStyle());
.getMergedStyle(skinParam().getCurrentStyleBuilder()); final FontConfiguration fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(),
final Style styleDiamond = getDefaultStyleDefinitionDiamond() skinParam().getIHtmlColorSet());
.getMergedStyle(skinParam().getCurrentStyleBuilder()); final FontConfiguration fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(),
borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
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);
}
if (thens.size() > 1) { if (thens.size() > 1) {
if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */) if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */)

View File

@ -35,12 +35,8 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.List; 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.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; 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.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint; import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; 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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
@ -80,36 +76,19 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
final ConditionStyle conditionStyle = skinParam().getConditionStyle(); final ConditionStyle conditionStyle = skinParam().getConditionStyle();
final HColor borderColor; final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
final HColor diamondColor; final Style styleDiamond = getDefaultStyleDefinitionDiamond()
final Rainbow arrowColor; .getMergedStyle(skinParam().getCurrentStyleBuilder());
final FontConfiguration fcDiamond; final HColor borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
final FontConfiguration fcArrow; skinParam().getIHtmlColorSet());
if (UseStyle.useBetaStyle()) { final HColor diamondColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(),
final Style styleArrow = getDefaultStyleDefinitionArrow() skinParam().getIHtmlColorSet());
.getMergedStyle(skinParam().getCurrentStyleBuilder()); final Rainbow arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(),
final Style styleDiamond = getDefaultStyleDefinitionDiamond() skinParam().getThemeStyle());
.getMergedStyle(skinParam().getCurrentStyleBuilder()); final FontConfiguration fcDiamond = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(),
borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
skinParam().getIHtmlColorSet()); final FontConfiguration fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(),
diamondColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
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 LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering(); final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getRainbow(); final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getRainbow();

View File

@ -35,14 +35,10 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; 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.FtileDecorateInLabel;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOutLabel; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOutLabel;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; 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.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; 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)); ftiles.add(new FtileDecorateOutLabel(new FtileDecorateInLabel(branch.getFtile(), dimLabelIn), dimLabelOut));
} }
final Rainbow arrowColor; final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Rainbow arrowColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
arrowColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else {
arrowColor = Rainbow.build(skinParam());
}
if (ftiles.size() == 1) { if (ftiles.size() == 1) {
final FtileSwitchWithOneLink result = new FtileSwitchWithOneLink(ftiles, branches, swimlane, diamond1, final FtileSwitchWithOneLink result = new FtileSwitchWithOneLink(ftiles, branches, swimlane, diamond1,
diamond2, getStringBounder(), arrowColor); diamond2, getStringBounder(), arrowColor);
@ -133,24 +126,15 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
private Ftile getDiamond1(Swimlane swimlane, Branch branch0, Display test) { private Ftile getDiamond1(Swimlane swimlane, Branch branch0, Display test) {
LineBreakStrategy lineBreak = LineBreakStrategy.NONE; LineBreakStrategy lineBreak = LineBreakStrategy.NONE;
final FontConfiguration fcDiamond;
final HColor borderColor; final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder());
final HColor backColor; lineBreak = style.wrapWidth();
if (UseStyle.useBetaStyle()) { final FontConfiguration fcDiamond = style.getFontConfiguration(skinParam().getThemeStyle(),
final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder()); skinParam().getIHtmlColorSet());
lineBreak = style.wrapWidth(); final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
fcDiamond = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); skinParam().getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), final HColor backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor)
skinParam().getIHtmlColorSet()); .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor();
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 TextBlock tbTest; final TextBlock tbTest;
if (Display.isNull(test) || test.isWhite()) if (Display.isNull(test) || test.isWhite())
@ -163,27 +147,15 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
} }
private Ftile getDiamond2(Swimlane swimlane, Branch branch0) { private Ftile getDiamond2(Swimlane swimlane, Branch branch0) {
final HColor borderColor;
final HColor backColor; final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
final Style style = getDefaultStyleDefinitionDiamond().getMergedStyle(skinParam().getCurrentStyleBuilder()); skinParam().getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), final HColor backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor)
skinParam().getIHtmlColorSet()); .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor();
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();
}
return new FtileDiamondInside(TextBlockUtils.empty(0, 0), branch0.skinParam(), backColor, borderColor, return new FtileDiamondInside(TextBlockUtils.empty(0, 0), branch0.skinParam(), backColor, borderColor,
swimlane); swimlane);
} }
// private HColor fontColor(FontParam param) {
// return skinParam().getFontHtmlColor(null, param);
// }
} }

View File

@ -37,20 +37,17 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.util.List; 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.Instruction;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileBreak; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileBreak;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Genealogy; 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.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint; 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, public Ftile createWhile(LinkRendering outColor, Swimlane swimlane, Ftile whileBlock, Display test, Display yes,
HColor color, Instruction specialOut, Ftile backward, LinkRendering incoming1, LinkRendering incoming2) { 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 ConditionStyle conditionStyle = skinParam().getConditionStyle();
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND
: FontParam.ARROW; final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Style styleDiamond = getDefaultStyleDefinitionDiamond()
final Style styleArrow = getDefaultStyleDefinitionArrow() .getMergedStyle(skinParam().getCurrentStyleBuilder());
.getMergedStyle(skinParam().getCurrentStyleBuilder()); final HColor borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
final Style styleDiamond = getDefaultStyleDefinitionDiamond() skinParam().getIHtmlColorSet());
.getMergedStyle(skinParam().getCurrentStyleBuilder()); final HColor backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(),
borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
skinParam().getIHtmlColorSet()); final Rainbow arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(),
backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), skinParam().getThemeStyle());
skinParam().getIHtmlColorSet()); final FontConfiguration fontArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(),
arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()); skinParam().getIHtmlColorSet());
fontArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); final FontConfiguration fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(),
fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); 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);
}
incoming1 = ensureColor(incoming1, arrowColor); incoming1 = ensureColor(incoming1, arrowColor);
incoming2 = ensureColor(incoming2, arrowColor); incoming2 = ensureColor(incoming2, arrowColor);

View File

@ -35,21 +35,18 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; 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.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; 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.svek.UGraphicForSnake;
import net.sourceforge.plantuml.ugraphic.LimitFinder; import net.sourceforge.plantuml.ugraphic.LimitFinder;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.utils.MathUtils; import net.sourceforge.plantuml.utils.MathUtils;
public class FtileGroup extends AbstractFtile { public class FtileGroup extends AbstractFtile {
@ -98,31 +93,17 @@ public class FtileGroup extends AbstractFtile {
this.type = type; this.type = type;
this.inner = FtileUtils.addHorizontalMargin(inner, 10); this.inner = FtileUtils.addHorizontalMargin(inner, 10);
final FontConfiguration fc; final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style style; final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
final UStroke thickness; this.shadowing = style.value(PName.Shadowing).asDouble();
if (UseStyle.useBetaStyle()) { this.backColor = backColor == null
style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet())
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); : backColor;
this.shadowing = style.value(PName.Shadowing).asDouble(); this.borderColor = borderColor == null
this.backColor = backColor == null ? style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet())
? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()) : borderColor;
: backColor; final UStroke thickness = style.getStroke();
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);
}
if (title == null) if (title == null)
this.name = TextBlockUtils.empty(0, 0); this.name = TextBlockUtils.empty(0, 0);
else else

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -43,10 +42,8 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
@ -61,6 +58,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; 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.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; import net.sourceforge.plantuml.creole.Sheet;
@ -123,16 +121,9 @@ class FtileIfAndStop extends AbstractFtile {
final Ftile stopFtile = ftileFactory.stop(swimlane); final Ftile stopFtile = ftileFactory.stop(swimlane);
final UStroke thickness; final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder());
final FontConfiguration fcTest; final UStroke thickness = tileNonStop.getThickness(style);
if (UseStyle.useBetaStyle()) { final FontConfiguration fcTest = FontConfiguration.create(skinParam, style);
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 Sheet sheet = Parser final Sheet sheet = Parser
.build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)

View File

@ -35,20 +35,18 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
@ -105,27 +102,14 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
super(skinParam); super(skinParam);
this.swimlane = swimlane; this.swimlane = swimlane;
this.withOutPoint = withOutPoint; this.withOutPoint = withOutPoint;
final Rose rose = new Rose();
final HColor noteBackgroundColor; final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
final HColor borderColor; final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
final double shadowing; getIHtmlColorSet());
final LineBreakStrategy wrapWidth; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
UStroke stroke = new UStroke(); final double shadowing = style.value(PName.Shadowing).asDouble();
if (UseStyle.useBetaStyle()) { final LineBreakStrategy wrapWidth = style.wrapWidth();
final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); final UStroke stroke = style.getStroke();
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 FontConfiguration fc = FontConfiguration.create(skinParam, FontParam.NOTE, null); final FontConfiguration fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -43,18 +42,16 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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.graphic.TextBlock;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; 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) { private FtileWithNoteOpale(Ftile tile, PositionedNote note, ISkinParam skinParam, boolean withLink) {
super(tile.skinParam()); super(tile.skinParam());
this.swimlaneNote = note.getSwimlaneNote(); this.swimlaneNote = note.getSwimlaneNote();
if (note.getColors() != null) { if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam); skinParam = note.getColors().mute(skinParam);
}
this.tile = tile; this.tile = tile;
this.notePosition = note.getNotePosition(); this.notePosition = note.getNotePosition();
if (note.getType() == NoteType.FLOATING_NOTE) { if (note.getType() == NoteType.FLOATING_NOTE)
withLink = false; withLink = false;
}
final Rose rose = new Rose(); final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors());
final HColor noteBackgroundColor; final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
final HColor borderColor; getIHtmlColorSet());
final FontConfiguration fc; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
UStroke stroke = new UStroke(); final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
final double shadowing = style.value(PName.Shadowing).asDouble();
final double shadowing; final LineBreakStrategy wrapWidth = style.wrapWidth();
final LineBreakStrategy wrapWidth; final UStroke stroke = style.getStroke();
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 HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null,
false, null); false, null);

View File

@ -35,21 +35,18 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; import net.sourceforge.plantuml.creole.Sheet;
@ -103,37 +100,21 @@ public class FtileWithNotes extends AbstractFtile {
super(tile.skinParam()); super(tile.skinParam());
this.tile = tile; this.tile = tile;
final Rose rose = new Rose();
for (PositionedNote note : notes) { for (PositionedNote note : notes) {
ISkinParam skinParam2 = skinParam; ISkinParam skinParam2 = skinParam;
if (note.getColors() != null) if (note.getColors() != null)
skinParam2 = note.getColors().mute(skinParam2); skinParam2 = note.getColors().mute(skinParam2);
final HColor noteBackgroundColor; final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder())
final HColor borderColor; .eventuallyOverride(note.getColors());
final FontConfiguration fc; final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
final double shadowing; getIHtmlColorSet());
UStroke stroke = new UStroke(); final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet());
final LineBreakStrategy wrapWidth; final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
if (UseStyle.useBetaStyle()) { final double shadowing = style.value(PName.Shadowing).asDouble();
final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()) final LineBreakStrategy wrapWidth = style.wrapWidth();
.eventuallyOverride(note.getColors()); final UStroke stroke = style.getStroke();
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 Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)

View File

@ -35,14 +35,12 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
@ -56,6 +54,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock; 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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
@ -136,12 +135,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def; final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
if (UseStyle.useBetaStyle())
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
else
def = Rainbow.build(skinParam());
final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def); final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def);
conns.add(new ConnectionIn(black, tmp, x, rainbow)); conns.add(new ConnectionIn(black, tmp, x, rainbow));
x += dim.getWidth(); x += dim.getWidth();
@ -200,12 +194,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def; final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
if (UseStyle.useBetaStyle())
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
else
def = Rainbow.build(skinParam());
final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def);
if (tmp.calculateDimension(getStringBounder()).hasPointOut()) if (tmp.calculateDimension(getStringBounder()).hasPointOut())
conns.add(new ConnectionOut(tmp, out, x, rainbow, getJustBeforeBar2(middle, getStringBounder()))); conns.add(new ConnectionOut(tmp, out, x, rainbow, getJustBeforeBar2(middle, getStringBounder())));

View File

@ -35,14 +35,12 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection; import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
@ -54,6 +52,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; 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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
@ -80,13 +79,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def; Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else {
def = Rainbow.build(skinParam());
}
final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def); final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def);
conns.add(new ConnectionIn(black, tmp, x, rainbow)); conns.add(new ConnectionIn(black, tmp, x, rainbow));
x += dim.getWidth(); x += dim.getWidth();
@ -102,19 +96,12 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
@Override @Override
protected Ftile doStep2(Ftile inner, Ftile result) { protected Ftile doStep2(Ftile inner, Ftile result) {
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final HColor borderColor;
final HColor backColor;
if (UseStyle.useBetaStyle()) { final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
skinParam().getIHtmlColorSet()); final HColor backColor = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(),
backColor = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
skinParam().getIHtmlColorSet());
} else {
borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground);
}
final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2()); final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out); result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
@ -124,12 +111,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final UTranslate translate0 = new UTranslate(x, barHeight); final UTranslate translate0 = new UTranslate(x, barHeight);
final Rainbow def; final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
if (UseStyle.useBetaStyle())
def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
else
def = Rainbow.build(skinParam());
final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def); final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def);
if (tmp.calculateDimension(getStringBounder()).hasPointOut()) if (tmp.calculateDimension(getStringBounder()).hasPointOut())
conns.add(new ConnectionHorizontalThenVertical(tmp, out, rainbow, translate0, diamondTranslate)); conns.add(new ConnectionHorizontalThenVertical(tmp, out, rainbow, translate0, diamondTranslate));

View File

@ -78,12 +78,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
protected Ftile doStep1(Ftile inner) { protected Ftile doStep1(Ftile inner) {
Ftile result = inner; Ftile result = inner;
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
final Rainbow thinColor;
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) final Rainbow thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
else
thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam()));
final Ftile thin = new FtileThinSplit(skinParam(), getThin1Color(thinColor), list99.get(0).getSwimlaneIn()); final Ftile thin = new FtileThinSplit(skinParam(), getThin1Color(thinColor), list99.get(0).getSwimlaneIn());
double x = 0; double x = 0;
@ -97,12 +93,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
last = x + dim.getLeft(); last = x + dim.getLeft();
final LinkRendering inLinkRendering = tmp.getInLinkRendering(); final LinkRendering inLinkRendering = tmp.getInLinkRendering();
final Rainbow rainbow; final Rainbow rainbow = inLinkRendering
if (UseStyle.useBetaStyle()) .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
rainbow = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
else
rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
conns.add(new ConnectionIn(thin, tmp, x, rainbow)); conns.add(new ConnectionIn(thin, tmp, x, rainbow));
x += dim.getWidth(); x += dim.getWidth();
@ -124,13 +116,9 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
private HColor getThin1Color(final Rainbow thinColor) { private HColor getThin1Color(final Rainbow thinColor) {
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Rainbow rainbow;
final LinkRendering inLinkRendering = tmp.getInLinkRendering(); final LinkRendering inLinkRendering = tmp.getInLinkRendering();
if (UseStyle.useBetaStyle()) final Rainbow rainbow = inLinkRendering
rainbow = inLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
else
rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
if (rainbow.isInvisible() == false) if (rainbow.isInvisible() == false)
return thinColor.getColor(); return thinColor.getColor();
@ -155,13 +143,9 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
return new FtileKilled(result); return new FtileKilled(result);
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Rainbow thinColor;
final LinkRendering inLinkRendering = result.getInLinkRendering(); final LinkRendering inLinkRendering = result.getInLinkRendering();
if (UseStyle.useBetaStyle()) final Rainbow thinColor = inLinkRendering
thinColor = inLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
else
thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2()); final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out); result = new FtileAssemblySimple(result, out);
@ -179,13 +163,9 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
last = x + dim.getLeft(); last = x + dim.getLeft();
} }
final Rainbow rainbow;
final LinkRendering outLinkRendering = tmp.getOutLinkRendering(); final LinkRendering outLinkRendering = tmp.getOutLinkRendering();
if (UseStyle.useBetaStyle()) final Rainbow rainbow = outLinkRendering
rainbow = outLinkRendering .getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
else
rainbow = outLinkRendering.getRainbow(Rainbow.build(skinParam()));
if (tmp.calculateDimension(getStringBounder()).hasPointOut()) if (tmp.calculateDimension(getStringBounder()).hasPointOut())
conns.add(new ConnectionOut(translate0, tmp, out, x, rainbow, getHeightOfMiddle(inner))); conns.add(new ConnectionOut(translate0, tmp, out, x, rainbow, getHeightOfMiddle(inner)));

View File

@ -39,11 +39,9 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.ForkStyle; import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
import net.sourceforge.plantuml.activitydiagram3.Instruction; import net.sourceforge.plantuml.activitydiagram3.Instruction;
@ -111,53 +109,34 @@ public class VCompactFactory implements FtileFactory {
} }
public Ftile start(Swimlane swimlane) { public Ftile start(Swimlane swimlane) {
final HColor color; final Style style = getSignatureCircleStart().getMergedStyle(skinParam.getCurrentStyleBuilder());
Style style = null; final HColor color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
if (UseStyle.useBetaStyle()) { skinParam.getIHtmlColorSet());
style = getSignatureCircleStart().getMergedStyle(skinParam.getCurrentStyleBuilder());
color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else {
color = rose.getHtmlColor(skinParam, ColorParam.activityStart);
}
return new FtileCircleStart(skinParam(), color, swimlane, style); return new FtileCircleStart(skinParam(), color, swimlane, style);
} }
public Ftile stop(Swimlane swimlane) { public Ftile stop(Swimlane swimlane) {
final HColor borderColor; final Style style = getSignatureCircleStop().getMergedStyle(skinParam.getCurrentStyleBuilder());
Style style = null; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
final HColor backgroundColor; skinParam.getIHtmlColorSet());
if (UseStyle.useBetaStyle()) { final HColor backgroundColor = skinParam.getBackgroundColor();
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();
}
return new FtileCircleStop(skinParam(), backgroundColor, borderColor, swimlane, style); return new FtileCircleStop(skinParam(), backgroundColor, borderColor, swimlane, style);
} }
public Ftile spot(Swimlane swimlane, String spot, HColor color) { public Ftile spot(Swimlane swimlane, String spot, HColor color) {
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY); final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
Style style = null; final Style style = getSignatureCircleSpot().getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) {
style = getSignatureCircleSpot().getMergedStyle(skinParam.getCurrentStyleBuilder());
}
return new FtileCircleSpot(skinParam(), swimlane, spot, font, color, style); return new FtileCircleSpot(skinParam(), swimlane, spot, font, color, style);
} }
public Ftile end(Swimlane swimlane) { public Ftile end(Swimlane swimlane) {
final HColor borderColor;
Style style = null; final Style style = getSignatureCircleEnd().getMergedStyle(skinParam.getCurrentStyleBuilder());
final HColor backgroundColor; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
if (UseStyle.useBetaStyle()) { skinParam.getIHtmlColorSet());
style = getSignatureCircleEnd().getMergedStyle(skinParam.getCurrentStyleBuilder()); final HColor backgroundColor = skinParam.getBackgroundColor();
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
backgroundColor = skinParam.getBackgroundColor();
} else {
borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
backgroundColor = skinParam.getBackgroundColor();
}
return new FtileCircleEnd(skinParam(), backgroundColor, borderColor, swimlane, style); return new FtileCircleEnd(skinParam(), backgroundColor, borderColor, swimlane, style);
} }

View File

@ -35,25 +35,23 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.Branch; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithUrl; 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.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileIfDown; import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileIfDown;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare; 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.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
@ -108,42 +105,24 @@ public class ConditionalBuilder {
FtileFactory ftileFactory, ConditionStyle conditionStyle, ConditionEndStyle conditionEndStyle, FtileFactory ftileFactory, ConditionStyle conditionStyle, ConditionEndStyle conditionEndStyle,
Branch branch1, Branch branch2, ISkinParam skinParam, StringBounder stringBounder, Branch branch1, Branch branch2, ISkinParam skinParam, StringBounder stringBounder,
FontConfiguration fontArrow, FontConfiguration fontTest, Url url) { FontConfiguration fontArrow, FontConfiguration fontTest, Url url) {
if (UseStyle.useBetaStyle()) {
if (backColor == null) if (backColor == null)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
if (borderColor == null) if (borderColor == null)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
if (arrowColor == null) if (arrowColor == null)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style styleDiamond = getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
this.diamondLineBreak = styleDiamond.wrapWidth(); final Style styleDiamond = getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder());
this.labelLineBreak = styleArrow.wrapWidth(); this.fontTest = styleDiamond.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
this.borderColor = borderColor; /* this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
* styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(), this.diamondLineBreak = styleDiamond.wrapWidth();
* skinParam.getIHtmlColorSet()); this.labelLineBreak = styleArrow.wrapWidth();
*/ this.borderColor = borderColor;
this.backColor = backColor; this.backColor = backColor;
/* this.arrowColor = arrowColor;
* 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;
}
this.ftileFactory = ftileFactory; this.ftileFactory = ftileFactory;
this.swimlane = swimlane; this.swimlane = swimlane;
this.conditionStyle = conditionStyle; this.conditionStyle = conditionStyle;
@ -261,7 +240,7 @@ public class ConditionalBuilder {
final Sheet sheet = Parser.build(fontTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), final Sheet sheet = Parser.build(fontTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
skinParam, CreoleMode.FULL).createSheet(labelTest); skinParam, CreoleMode.FULL).createSheet(labelTest);
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, diamondLineBreak, skinParam.getPadding()); final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, diamondLineBreak, skinParam.getPadding());
final UStroke thickness = tile1 final UStroke thickness = tile1
.getThickness(getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder())); .getThickness(getStyleSignatureDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()));
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), thickness); final TextBlock tbTest = new SheetBlock2(sheetBlock1, Hexagon.asStencil(sheetBlock1), thickness);

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,13 +35,13 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorOneSwimlane; 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.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -40,22 +40,11 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; 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.Branch;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.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.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.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -47,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
@ -81,6 +82,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Point2D p1 = getP1(stringBounder); final Point2D p1 = getP1(stringBounder);
final Point2D p2 = getP2(stringBounder); final Point2D p2 = getP2(stringBounder);
final double x1 = p1.getX(); final double x1 = p1.getX();
final double y1 = p1.getY(); final double y1 = p1.getY();
final double x2 = p2.getX(); final double x2 = p2.getX();
@ -89,7 +91,16 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()) final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown())
.withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment()); .withLabel(branch.getTextBlockPositive(), arrowHorizontalAlignment());
snake.addPoint(x1, y1); snake.addPoint(x1, y1);
snake.addPoint(x2, y1);
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); snake.addPoint(x2, y2);
ug.draw(snake); ug.draw(snake);
@ -100,7 +111,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
final Point2D pt; final Point2D pt;
if (getFtile2() == tiles.get(0)) if (getFtile2() == tiles.get(0))
pt = dimDiamond1.getPointD(); pt = dimDiamond1.getPointD();
else if (getFtile2() == tiles.get(tiles.size() - 1)) else if (isLast())
pt = dimDiamond1.getPointB(); pt = dimDiamond1.getPointB();
else else
throw new IllegalStateException(); throw new IllegalStateException();
@ -108,6 +119,10 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
return getTranslateDiamond1(stringBounder).getTranslated(pt); return getTranslateDiamond1(stringBounder).getTranslated(pt);
} }
private boolean isLast() {
return getFtile2() == tiles.get(tiles.size() - 1);
}
private Point2D getP2(final StringBounder stringBounder) { private Point2D getP2(final StringBounder stringBounder) {
return getTranslateOf(getFtile2(), stringBounder) return getTranslateOf(getFtile2(), stringBounder)
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn()); .getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());

View File

@ -99,15 +99,11 @@ public class FtileBlackBlock extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final URectangle rect = new URectangle(width, height).rounded(5).ignoreForCompressionOnX(); final URectangle rect = new URectangle(width, height).rounded(5).ignoreForCompressionOnX();
if (UseStyle.useBetaStyle()) {
final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final double shadowing = style.value(PName.Shadowing).asDouble(); final double shadowing = style.value(PName.Shadowing).asDouble();
rect.setDeltaShadow(shadowing); rect.setDeltaShadow(shadowing);
colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()); colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet());
} else {
if (skinParam().shadowing(null))
rect.setDeltaShadow(3);
}
ug.apply(colorBar).apply(colorBar.bg()).draw(rect); ug.apply(colorBar).apply(colorBar.bg()).draw(rect);
final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder()); final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder());

View File

@ -35,25 +35,21 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamColors; 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.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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, public static FtileBox create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle,
Stereotype stereotype) { Stereotype stereotype) {
Style style = null; final Style style = getStyleSignature().withTOBECHANGED(stereotype)
Style styleArrow = null; .getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Style styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
style = getStyleSignature().withTOBECHANGED(stereotype)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
}
return new FtileBox(skinParam, label, swimlane, boxStyle, style, styleArrow); return new FtileBox(skinParam, label, swimlane, boxStyle, style, styleArrow);
} }
@ -157,38 +149,28 @@ public class FtileBox extends AbstractFtile {
this.style = style; this.style = style;
this.boxStyle = boxStyle; this.boxStyle = boxStyle;
this.swimlane = swimlane; 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 final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL)
.createSheet(label); .createSheet(label);
@ -211,23 +193,17 @@ public class FtileBox extends AbstractFtile {
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner); final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
final UStroke thickness; final UStroke thickness = style.getStroke();
if (UseStyle.useBetaStyle()) {
thickness = style.getStroke();
} else {
thickness = getThickness(style);
}
if (borderColor == null) { if (borderColor == null)
ug = ug.apply(new HColorNone()); ug = ug.apply(new HColorNone());
} else { else
ug = ug.apply(borderColor); ug = ug.apply(borderColor);
}
if (backColor == null) { if (backColor == null)
ug = ug.apply(new HColorNone().bg()); ug = ug.apply(new HColorNone().bg());
} else { else
ug = ug.apply(backColor.bg()); ug = ug.apply(backColor.bg());
}
ug = ug.apply(thickness); ug = ug.apply(thickness);
shape.drawU(ug); shape.drawU(ug);

View File

@ -35,18 +35,14 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamColors; import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; 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.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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, public static FtileBox2 create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle,
Stereotype stereotype) { Stereotype stereotype) {
Style style = null; final Style style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype)
Style styleArrow = null; .getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
}
return new FtileBox2(skinParam, label, swimlane, boxStyle, style, styleArrow); return new FtileBox2(skinParam, label, swimlane, boxStyle, style, styleArrow);
} }
private FtileBox2(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Style style, private FtileBox2(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Style style,
Style styleArrow) { Style styleArrow) {
super(skinParam); super(skinParam);
Colors specBack = null;
if (skinParam instanceof SkinParamColors)
specBack = ((SkinParamColors) skinParam).getColors();
style = style.eventuallyOverride(specBack);
this.style = style; this.style = style;
this.boxStyle = boxStyle; this.boxStyle = boxStyle;
this.swimlane = swimlane; 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 final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL)
.createSheet(label); .createSheet(label);
@ -215,23 +199,17 @@ public class FtileBox2 extends AbstractFtile {
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder()); final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
ug.draw(new UEmpty(dimTotal)); ug.draw(new UEmpty(dimTotal));
final UStroke thickness; final UStroke thickness = style.getStroke();
if (UseStyle.useBetaStyle()) {
thickness = style.getStroke();
} else {
thickness = getThickness(style);
}
if (borderColor == null) { if (borderColor == null)
ug = ug.apply(new HColorNone()); ug = ug.apply(new HColorNone());
} else { else
ug = ug.apply(borderColor); ug = ug.apply(borderColor);
}
if (backColor == null) { if (backColor == null)
ug = ug.apply(new HColorNone().bg()); ug = ug.apply(new HColorNone().bg());
} else { else
ug = ug.apply(backColor.bg()); ug = ug.apply(backColor.bg());
}
ug = ug.apply(thickness); ug = ug.apply(thickness);
ug = ug.apply(new UTranslate(margin.getLeft(), margin.getTop())); ug = ug.apply(new UTranslate(margin.getLeft(), margin.getTop()));

View File

@ -141,32 +141,23 @@ public class FtileBoxOld extends AbstractFtile {
public static FtileBoxOld create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, public static FtileBoxOld create(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle,
Stereotype stereotype) { Stereotype stereotype) {
Style style = null; final Style style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype)
Style styleArrow = null; .getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
}
return new FtileBoxOld(skinParam, label, swimlane, boxStyle, style, styleArrow); return new FtileBoxOld(skinParam, label, swimlane, boxStyle, style, styleArrow);
} }
public static TextBlock createWbs(StyleBuilder styleBuilder, ISkinParam skinParam, Display label, public static TextBlock createWbs(StyleBuilder styleBuilder, ISkinParam skinParam, Display label,
StyleSignatureBasic styleDefinition) { StyleSignatureBasic styleDefinition) {
Style style = null; final Style style = styleDefinition.getMergedStyle(styleBuilder);
Style styleArrow = null; final Style styleArrow = style;
if (UseStyle.useBetaStyle()) {
style = styleDefinition.getMergedStyle(styleBuilder);
styleArrow = style;
}
return new FtileBoxOld(skinParam, label, null, BoxStyle.PLAIN, style, styleArrow); return new FtileBoxOld(skinParam, label, null, BoxStyle.PLAIN, style, styleArrow);
} }
public static TextBlock createWbs(Style style, ISkinParam skinParam, Display label) { public static TextBlock createWbs(Style style, ISkinParam skinParam, Display label) {
Style styleArrow = null; final Style styleArrow = style;
if (UseStyle.useBetaStyle())
styleArrow = style;
return new FtileBoxOld(skinParam, label, null, BoxStyle.PLAIN, style, styleArrow); 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, private FtileBoxOld(ISkinParam skinParam, Display label, Swimlane swimlane, BoxStyle boxStyle, Style style,
Style styleArrow) { Style styleArrow) {
super(skinParam); super(skinParam);
Colors specBack = null;
if (skinParam instanceof SkinParamColors)
specBack = ((SkinParamColors) skinParam).getColors();
style = style.eventuallyOverride(specBack);
this.style = style; this.style = style;
this.boxStyle = boxStyle; this.boxStyle = boxStyle;
this.swimlane = swimlane; 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.inRendering = LinkRendering
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); .create(Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.horizontalAlignment = style.getHorizontalAlignment(); final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
this.padding = style.getPadding(); this.horizontalAlignment = style.getHorizontalAlignment();
this.roundCorner = style.value(PName.RoundCorner).asDouble(); this.padding = style.getPadding();
this.shadowing = style.value(PName.Shadowing).asDouble(); this.roundCorner = style.value(PName.RoundCorner).asDouble();
wrapWidth = style.wrapWidth(); this.shadowing = style.value(PName.Shadowing).asDouble();
this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); final LineBreakStrategy wrapWidth = style.wrapWidth();
} else { this.minimumWidth = style.value(PName.MinimumWidth).asDouble();
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();
}
final Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL)
.createSheet(label); .createSheet(label);
@ -236,11 +215,7 @@ public class FtileBoxOld extends AbstractFtile {
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner); final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
final UStroke thickness; final UStroke thickness = style.getStroke();
if (UseStyle.useBetaStyle())
thickness = style.getStroke();
else
thickness = getThickness(style);
if (borderColor == null) if (borderColor == null)
ug = ug.apply(new HColorNone()); ug = ug.apply(new HColorNone());

View File

@ -40,7 +40,6 @@ import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
@ -74,13 +73,9 @@ public class FtileCircleEnd extends AbstractFtile {
this.borderColor = borderColor; this.borderColor = borderColor;
this.backColor = backColor; this.backColor = backColor;
this.swimlane = swimlane; this.swimlane = swimlane;
if (UseStyle.useBetaStyle()) { this.shadowing = style.value(PName.Shadowing).asDouble();
this.shadowing = style.value(PName.Shadowing).asDouble(); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
} else if (skinParam().shadowing(null)) {
this.shadowing = 3;
}
} }

View File

@ -39,10 +39,8 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
@ -76,10 +74,7 @@ public class FtileCircleSpot extends AbstractFtile {
this.spot = spot; this.spot = spot;
this.swimlane = swimlane; this.swimlane = swimlane;
this.backColor = backColor; this.backColor = backColor;
if (UseStyle.useBetaStyle()) this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
else
this.fc = FontConfiguration.create(skinParam, style);
} }
@Override @Override
@ -88,9 +83,9 @@ public class FtileCircleSpot extends AbstractFtile {
} }
public Set<Swimlane> getSwimlanes() { public Set<Swimlane> getSwimlanes() {
if (swimlane == null) { if (swimlane == null)
return Collections.emptySet(); return Collections.emptySet();
}
return Collections.singleton(swimlane); return Collections.singleton(swimlane);
} }
@ -105,25 +100,12 @@ public class FtileCircleSpot extends AbstractFtile {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = new UEllipse(SIZE, SIZE);
final HColor borderColor; final HColor backColor = this.backColor == null
final HColor backColor; ? style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet())
double shadow = 0; : this.backColor;
final HColor borderColor = style.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
if (UseStyle.useBetaStyle()) { getIHtmlColorSet());
backColor = this.backColor == null final double shadow = style.value(PName.Shadowing).asDouble();
? 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;
}
circle.setDeltaShadow(shadow); circle.setDeltaShadow(shadow);
ug.apply(borderColor).apply(backColor.bg()).apply(getThickness(style)).draw(circle); ug.apply(borderColor).apply(backColor.bg()).apply(getThickness(style)).draw(circle);

View File

@ -67,13 +67,9 @@ public class FtileCircleStart extends AbstractFtile {
this.swimlane = swimlane; this.swimlane = swimlane;
this.backColor = backColor; this.backColor = backColor;
this.borderColor = new HColorNone(); this.borderColor = new HColorNone();
if (UseStyle.useBetaStyle()) { this.shadowing = style.value(PName.Shadowing).asDouble();
this.shadowing = style.value(PName.Shadowing).asDouble(); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
} else if (skinParam().shadowing(null)) {
this.shadowing = 3;
}
} }
@Override @Override

View File

@ -73,13 +73,9 @@ public class FtileCircleStop extends AbstractFtile {
this.borderColor = borderColor; this.borderColor = borderColor;
this.backColor = backColor; this.backColor = backColor;
this.swimlane = swimlane; this.swimlane = swimlane;
if (UseStyle.useBetaStyle()) { this.shadowing = style.value(PName.Shadowing).asDouble();
this.shadowing = style.value(PName.Shadowing).asDouble(); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
} else if (skinParam().shadowing(null)) {
this.shadowing = 3;
}
} }

View File

@ -40,7 +40,6 @@ import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
@ -70,7 +69,7 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable {
final public StyleSignatureBasic getStyleSignature() { final public StyleSignatureBasic getStyleSignature() {
return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
} }
final public Style getStyle() { final public Style getStyle() {
return getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); 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, protected FtileDiamondWIP(TextBlock label, ISkinParam skinParam, HColor backColor, HColor borderColor,
Swimlane swimlane, TextBlock north, TextBlock south, TextBlock east, TextBlock west) { Swimlane swimlane, TextBlock north, TextBlock south, TextBlock east, TextBlock west) {
super(skinParam); super(skinParam);
if (UseStyle.useBetaStyle()) { Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.borderColor = borderColor;
this.borderColor = borderColor; //style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.backColor = backColor;
this.backColor = backColor; //style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.shadowing = style.value(PName.Shadowing).asDouble();
this.shadowing = style.value(PName.Shadowing).asDouble();
} else {
this.backColor = backColor;
this.borderColor = borderColor;
this.shadowing = skinParam().shadowing(null) ? 3 : 0;
}
this.swimlane = swimlane; this.swimlane = swimlane;
@ -104,9 +97,9 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable {
} }
final public Set<Swimlane> getSwimlanes() { final public Set<Swimlane> getSwimlanes() {
if (swimlane == null) { if (swimlane == null)
return Collections.emptySet(); return Collections.emptySet();
}
return Collections.singleton(swimlane); return Collections.singleton(swimlane);
} }

View File

@ -39,7 +39,6 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.style.SName; 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) { public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
private final StyleSignatureBasic getDefaultStyleDefinitionArrow() { private final StyleSignatureBasic getDefaultStyleDefinitionArrow() {
return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
} }
protected ISkinParam skinParam() { protected ISkinParam skinParam() {
throw new UnsupportedOperationException("wip"); throw new UnsupportedOperationException("wip");
} }
// DUPLICATE 4561 // DUPLICATE 4561
final protected Rainbow getInLinkRenderingColor() { final protected Rainbow getInLinkRenderingColor() {
Rainbow color;
final ISkinParam skinParam = gpoint1.getGtile().skinParam(); final ISkinParam skinParam = gpoint1.getGtile().skinParam();
if (UseStyle.useBetaStyle()) { final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Rainbow color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
} else
color = Rainbow.build(skinParam);
// final LinkRendering linkRendering = tile.getInLinkRendering(); // final LinkRendering linkRendering = tile.getInLinkRendering();
// if (linkRendering == null) { // if (linkRendering == null) {
// if (UseStyle.useBetaStyle()) { // if (UseStyle.useBetaStyle()) {
@ -128,7 +123,4 @@ public abstract class GAbstractConnection implements GConnection {
return color; return color;
} }
} }

View File

@ -85,16 +85,12 @@ public class GtileAssembly extends GtileTopDown {
protected final TextBlock getTextBlock(Display display) { protected final TextBlock getTextBlock(Display display) {
// DUP3945 // DUP3945
if (Display.isNull(display)) { if (Display.isNull(display))
return TextBlockUtils.EMPTY_TEXT_BLOCK; return TextBlockUtils.EMPTY_TEXT_BLOCK;
}
final FontConfiguration fontConfiguration; final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(),
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); skinParam().getIHtmlColorSet());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
} }

View File

@ -35,20 +35,15 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; 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.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamColors; 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.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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, public static GtileBox create(StringBounder stringBounder, ISkinParam skinParam, Display label, Swimlane swimlane,
BoxStyle boxStyle, Stereotype stereotype) { BoxStyle boxStyle, Stereotype stereotype) {
Style style = null; final Style style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype)
Style styleArrow = null; .getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
}
return new GtileBox(stringBounder, skinParam, label, swimlane, boxStyle, style, styleArrow); return new GtileBox(stringBounder, skinParam, label, swimlane, boxStyle, style, styleArrow);
} }
private GtileBox(StringBounder stringBounder, ISkinParam skinParam, Display label, Swimlane swimlane, private GtileBox(StringBounder stringBounder, ISkinParam skinParam, Display label, Swimlane swimlane,
BoxStyle boxStyle, Style style, Style styleArrow) { BoxStyle boxStyle, Style style, Style styleArrow) {
super(stringBounder, skinParam, swimlane); super(stringBounder, skinParam, swimlane);
Colors specBack = null;
if (skinParam instanceof SkinParamColors)
specBack = ((SkinParamColors) skinParam).getColors();
style = style.eventuallyOverride(specBack);
this.style = style; this.style = style;
this.boxStyle = boxStyle; this.boxStyle = boxStyle;
final FontConfiguration fc; this.inRendering = LinkRendering
final LineBreakStrategy wrapWidth; .create(Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
if (UseStyle.useBetaStyle()) { this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.inRendering = LinkRendering.create( this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
Colors specBack = null; this.horizontalAlignment = style.getHorizontalAlignment();
if (skinParam instanceof SkinParamColors) { this.padding = style.getPadding();
specBack = ((SkinParamColors) skinParam).getColors(); this.margin = style.getMargin();
} this.roundCorner = style.value(PName.RoundCorner).asDouble();
style = style.eventuallyOverride(specBack); this.shadowing = style.value(PName.Shadowing).asDouble();
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); final LineBreakStrategy wrapWidth = style.wrapWidth();
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.minimumWidth = style.value(PName.MinimumWidth).asDouble();
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();
}
final Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(horizontalAlignment), skinParam, CreoleMode.FULL)
.createSheet(label); .createSheet(label);
@ -192,23 +170,17 @@ public class GtileBox extends AbstractGtile {
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner); final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
final UStroke thickness; final UStroke thickness = style.getStroke();
if (UseStyle.useBetaStyle()) {
thickness = style.getStroke();
} else {
thickness = getThickness();
}
if (borderColor == null) { if (borderColor == null)
ug = ug.apply(new HColorNone()); ug = ug.apply(new HColorNone());
} else { else
ug = ug.apply(borderColor); ug = ug.apply(borderColor);
}
if (backColor == null) { if (backColor == null)
ug = ug.apply(new HColorNone().bg()); ug = ug.apply(new HColorNone().bg());
} else { else
ug = ug.apply(backColor.bg()); ug = ug.apply(backColor.bg());
}
ug = ug.apply(thickness); ug = ug.apply(thickness);
shape.drawU(ug); shape.drawU(ug);

View File

@ -35,15 +35,13 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; 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.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
@ -76,11 +74,8 @@ public class GtileCircleSpot extends AbstractGtile {
this.spot = spot; this.spot = spot;
this.backColor = backColor; this.backColor = backColor;
this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null); this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
if (UseStyle.useBetaStyle()) { final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); this.shadowing = style.value(PName.Shadowing).asDouble();
this.shadowing = style.value(PName.Shadowing).asDouble();
} else if (skinParam().shadowing(null))
this.shadowing = 3;
} }

View File

@ -35,12 +35,10 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; 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.StringBounder;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; 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) { public GtileCircleStart(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane) {
super(stringBounder, skinParam, swimlane); super(stringBounder, skinParam, swimlane);
this.backColor = backColor; this.backColor = backColor;
if (UseStyle.useBetaStyle()) { final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); this.shadowing = style.value(PName.Shadowing).asDouble();
this.shadowing = style.value(PName.Shadowing).asDouble();
} else if (skinParam().shadowing(null))
this.shadowing = 3;
} }

View File

@ -35,20 +35,17 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FloatingNote; 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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; 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.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -104,30 +100,20 @@ public class GtileGroup extends AbstractGtileRoot {
this.inner = inner; this.inner = inner;
this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor; this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor;
final FontConfiguration fc; final Style style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style style; final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(),
if (UseStyle.useBetaStyle()) { skinParam.getIHtmlColorSet());
style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder()); this.shadowing = style.value(PName.Shadowing).asDouble();
fc = style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
this.shadowing = style.value(PName.Shadowing).asDouble(); if (title == null)
} 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) {
this.name = TextBlockUtils.empty(0, 0); this.name = TextBlockUtils.empty(0, 0);
} else { else
this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam); this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam);
}
if (Display.isNull(displayNote)) { if (Display.isNull(displayNote))
this.headerNote = TextBlockUtils.empty(0, 0); this.headerNote = TextBlockUtils.empty(0, 0);
} else { else
this.headerNote = new FloatingNote(displayNote, skinParam); this.headerNote = new FloatingNote(displayNote, skinParam);
}
final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null); final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null);
this.stroke = thickness == null ? new UStroke(2) : thickness; this.stroke = thickness == null ? new UStroke(2) : thickness;

View File

@ -35,13 +35,11 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; 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.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
@ -87,16 +85,11 @@ public class GtileHexagonInside extends AbstractGtile {
public GtileHexagonInside(StringBounder stringBounder, TextBlock label, ISkinParam skinParam, HColor backColor, public GtileHexagonInside(StringBounder stringBounder, TextBlock label, ISkinParam skinParam, HColor backColor,
HColor borderColor, Swimlane swimlane) { HColor borderColor, Swimlane swimlane) {
super(stringBounder, skinParam, swimlane); super(stringBounder, skinParam, swimlane);
if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder());
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.shadowing = style.value(PName.Shadowing).asDouble(); this.shadowing = style.value(PName.Shadowing).asDouble();
} else {
this.backColor = backColor;
this.borderColor = borderColor;
this.shadowing = skinParam().shadowing(null) ? 3 : 0;
}
this.label = label; this.label = label;
this.dimLabel = label.calculateDimension(stringBounder); this.dimLabel = label.calculateDimension(stringBounder);

View File

@ -111,32 +111,15 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
if (note.getType() == NoteType.FLOATING_NOTE) if (note.getType() == NoteType.FLOATING_NOTE)
withLink = false; withLink = false;
final Rose rose = new Rose(); final Style style = getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors());
final HColor noteBackgroundColor; final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
final HColor borderColor; getIHtmlColorSet());
final FontConfiguration fc; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
final double shadowing; final double shadowing = style.value(PName.Shadowing).asDouble();
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth = style.wrapWidth();
UStroke stroke = new UStroke(); final UStroke stroke = style.getStroke();
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 HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null,
false, null); false, null);

View File

@ -35,18 +35,15 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; 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.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; 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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
@ -107,37 +103,21 @@ public class GtileWithNotes extends AbstractGtile {
super(tile.getStringBounder(), tile.skinParam()); super(tile.getStringBounder(), tile.skinParam());
this.tile = tile; this.tile = tile;
final Rose rose = new Rose();
for (PositionedNote note : notes) { for (PositionedNote note : notes) {
ISkinParam skinParam2 = skinParam; ISkinParam skinParam2 = skinParam;
if (note.getColors() != null) { if (note.getColors() != null)
skinParam2 = note.getColors().mute(skinParam2); skinParam2 = note.getColors().mute(skinParam2);
}
final HColor noteBackgroundColor;
final HColor borderColor;
final FontConfiguration fc;
final double shadowing;
UStroke stroke = new UStroke();
final LineBreakStrategy wrapWidth; final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder())
if (UseStyle.useBetaStyle()) { .eventuallyOverride(note.getColors());
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) final HColor noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
.eventuallyOverride(note.getColors()); getIHtmlColorSet());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet()); getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet()); final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet()); final double shadowing = style.value(PName.Shadowing).asDouble();
shadowing = style.value(PName.Shadowing).asDouble(); final LineBreakStrategy wrapWidth = style.wrapWidth();
wrapWidth = style.wrapWidth(); final UStroke stroke = style.getStroke();
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 Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)

View File

@ -35,11 +35,9 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.creole.CreoleMode; 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.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Gtiles { public class Gtiles {
private static final Rose rose = new Rose();
static public GtileHexagonInside hexagonInside(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam, static public GtileHexagonInside hexagonInside(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam,
StyleSignatureBasic styleSignature, HColor color, Display label) { StyleSignatureBasic styleSignature, HColor color, Display label) {
final ConditionStyle conditionStyle = skinParam.getConditionStyle();
final HColor borderColor; final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder());
final HColor backColor; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
final FontConfiguration fcTest; skinParam.getIHtmlColorSet());
final HColor backColor = color == null
if (UseStyle.useBetaStyle()) { ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet())
final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder()); : color;
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); final FontConfiguration fcTest = style.getFontConfiguration(skinParam.getThemeStyle(),
backColor = color == null ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
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 Sheet sheet = Parser final Sheet sheet = Parser
.build(fcTest, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .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, static public AbstractGtileRoot diamondEmpty(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam,
StyleSignatureBasic styleSignature, HColor color) { StyleSignatureBasic styleSignature, HColor color) {
final HColor borderColor;
final HColor backColor;
if (UseStyle.useBetaStyle()) { final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style style = styleSignature.getMergedStyle(skinParam.getCurrentStyleBuilder()); final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
backColor = color == null ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), final HColor backColor = color == null
skinParam.getIHtmlColorSet()) : color; ? style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet())
} else { : color;
borderColor = rose.getHtmlColor(skinParam, ColorParam.activityDiamondBorder);
backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityDiamondBackground) : color;
}
return new GtileHexagonInside(stringBounder, TextBlockUtils.EMPTY_TEXT_BLOCK, skinParam, backColor, borderColor, return new GtileHexagonInside(stringBounder, TextBlockUtils.EMPTY_TEXT_BLOCK, skinParam, backColor, borderColor,
swimlane); swimlane);

View File

@ -34,26 +34,22 @@
*/ */
package net.sourceforge.plantuml.bpm; package net.sourceforge.plantuml.bpm;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; 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.FtileBox;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStart; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStart;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; 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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
@ -147,10 +143,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
} }
private Style getStyle(ISkinParam skinParam) { private Style getStyle(ISkinParam skinParam) {
if (UseStyle.useBetaStyle()) return getSignatureCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
return getSignatureCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
return null;
} }
public TextBlock toTextBlockInternal(ISkinParam skinParam) { public TextBlock toTextBlockInternal(ISkinParam skinParam) {

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.TitledDiagram;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
@ -73,10 +72,10 @@ public class CommandFooter extends SingleLineCommand2<TitledDiagram> {
protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) {
final String align = arg.get("POSITION", 0); final String align = arg.get("POSITION", 0);
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER); HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER);
if (UseStyle.useBetaStyle() && align == null) { if (align == null)
ha = FontParam.FOOTER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder()) ha = FontParam.FOOTER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder())
.getHorizontalAlignment(); .getHorizontalAlignment();
}
final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0)); final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0));
diagram.getFooter().putDisplay(s, ha); diagram.getFooter().putDisplay(s, ha);

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.TitledDiagram;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
@ -75,10 +74,10 @@ public class CommandHeader extends SingleLineCommand2<TitledDiagram> {
protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) {
final String align = arg.get("POSITION", 0); final String align = arg.get("POSITION", 0);
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT); HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT);
if (UseStyle.useBetaStyle() && align == null) { if (align == null)
ha = FontParam.HEADER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder()) ha = FontParam.HEADER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder())
.getHorizontalAlignment(); .getHorizontalAlignment();
}
final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0)); final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0));
diagram.getHeader().putDisplay(s, ha); diagram.getHeader().putDisplay(s, ha);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.TitledDiagram;
import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@ -66,11 +65,11 @@ public class CommandMultilinesFooter extends CommandMultilines<TitledDiagram> {
final Display strings = lines.toDisplay(); final Display strings = lines.toDisplay();
if (strings.size() > 0) { if (strings.size() > 0) {
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER); HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER);
if (UseStyle.useBetaStyle() && align == null) { if (align == null)
ha = FontParam.FOOTER.getStyleDefinition(null) ha = FontParam.FOOTER.getStyleDefinition(null)
.getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder()) .getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder())
.getHorizontalAlignment(); .getHorizontalAlignment();
}
diagram.getFooter().putDisplay(strings, ha); diagram.getFooter().putDisplay(strings, ha);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.TitledDiagram;
import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@ -66,11 +65,11 @@ public class CommandMultilinesHeader extends CommandMultilines<TitledDiagram> {
final Display strings = lines.toDisplay(); final Display strings = lines.toDisplay();
if (strings.size() > 0) { if (strings.size() > 0) {
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT); HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT);
if (UseStyle.useBetaStyle() && align == null) { if (align == null)
ha = FontParam.HEADER.getStyleDefinition(null) ha = FontParam.HEADER.getStyleDefinition(null)
.getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder()) .getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder())
.getHorizontalAlignment(); .getHorizontalAlignment();
}
diagram.getHeader().putDisplay(strings, ha); diagram.getHeader().putDisplay(strings, ha);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -52,7 +52,7 @@ public interface Bodier {
public Display getMethodsToDisplay(); 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, public TextBlock getBody(FontParam fontParam, ISkinParam skinParam, boolean showMethods, boolean showFields,
Stereotype stereotype, Style style, FontConfiguration fontConfiguration); Stereotype stereotype, Style style, FontConfiguration fontConfiguration);

View File

@ -92,7 +92,7 @@ public class BodierJSon implements Bodier {
} }
@Override @Override
public void addFieldOrMethod(String s) throws NoSuchColorException { public boolean addFieldOrMethod(String s) throws NoSuchColorException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -87,11 +87,12 @@ public class BodierLikeClassOrObject implements Bodier {
} }
@Override @Override
public void addFieldOrMethod(String s) { public boolean addFieldOrMethod(String s) {
// Empty cache // Empty cache
methodsToDisplay = null; methodsToDisplay = null;
fieldsToDisplay = null; fieldsToDisplay = null;
rawBody.add(s); rawBody.add(s);
return true;
} }
private boolean isBodyEnhanced() { private boolean isBodyEnhanced() {

View File

@ -80,15 +80,18 @@ public class BodierMap implements Bodier {
} }
@Override @Override
public void addFieldOrMethod(String s) { public boolean addFieldOrMethod(String s) {
if (s.contains("=>")) { if (s.contains("=>")) {
final int x = s.indexOf("=>"); final int x = s.indexOf("=>");
map.put(s.substring(0, x).trim(), s.substring(x + 2).trim()); map.put(s.substring(0, x).trim(), s.substring(x + 2).trim());
return true;
} else if (getLinkedEntry(s) != null) { } else if (getLinkedEntry(s) != null) {
final String link = getLinkedEntry(s); final String link = getLinkedEntry(s);
final int x = s.indexOf(link); final int x = s.indexOf(link);
map.put(s.substring(0, x).trim(), "\0"); map.put(s.substring(0, x).trim(), "\0");
return true;
} }
return false;
} }
@Override @Override

View File

@ -67,9 +67,10 @@ public class BodierSimple implements Bodier {
} }
@Override @Override
public void addFieldOrMethod(String s) throws NoSuchColorException { public boolean addFieldOrMethod(String s) throws NoSuchColorException {
final Display display = Display.getWithNewlines2(s); final Display display = Display.getWithNewlines2(s);
rawBody.addAll(display.asList()); rawBody.addAll(display.asList());
return true;
} }
@Override @Override

View File

@ -48,7 +48,6 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.legacy.CreoleParser; import net.sourceforge.plantuml.creole.legacy.CreoleParser;
@ -77,8 +76,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam,
Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
super(align, UseStyle.useBetaStyle() == false ? FontConfiguration.create(skinParam, fontParam, stereotype) super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
: style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
this.style = style; this.style = style;
this.rawBody2 = Display.create(rawBody); this.rawBody2 = Display.create(rawBody);
this.stereotype = stereotype; this.stereotype = stereotype;

View File

@ -35,11 +35,9 @@
*/ */
package net.sourceforge.plantuml.cucadiagram; package net.sourceforge.plantuml.cucadiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@ -116,9 +114,7 @@ public abstract class BodyEnhancedAbstract extends AbstractTextBlock implements
} }
final protected double getDefaultThickness() { final protected double getDefaultThickness() {
if (UseStyle.useBetaStyle()) return style.value(PName.LineThickness).asDouble();
return style.value(PName.LineThickness).asDouble();
return 1.5;
} }
} }

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.cucadiagram; package net.sourceforge.plantuml.cucadiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -45,7 +44,7 @@ import net.sourceforge.plantuml.EmbeddedDiagram;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url; 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.creole.CreoleMode;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration; 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.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockWithUrl; import net.sourceforge.plantuml.graphic.TextBlockWithUrl;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.svek.Ports; import net.sourceforge.plantuml.svek.Ports;
@ -81,7 +79,7 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock,
private final FontParam fontParam; private final FontParam fontParam;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final Rose rose = new Rose();
private final Display members; private final Display members;
private final HorizontalAlignment align; private final HorizontalAlignment align;
private final Stereotype stereotype; private final Stereotype stereotype;
@ -264,20 +262,12 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock,
} }
}; };
} }
final HColor backColor; final Style style = modifier.getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder());
final HColor borderColor; final HColor borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
if (UseStyle.useBetaStyle()) { skinParam.getIHtmlColorSet());
final Style style = modifier.getStyleSignature().getMergedStyle(skinParam.getCurrentStyleBuilder()); final boolean isField = modifier.isField();
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); final HColor backColor = isField ? null
final boolean isField = modifier.isField(); : style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
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 TextBlock uBlock = modifier.getUBlock(skinParam.classAttributeIconSize(), borderColor, backColor, final TextBlock uBlock = modifier.getUBlock(skinParam.classAttributeIconSize(), borderColor, backColor,
url != null); url != null);

View File

@ -67,7 +67,7 @@ public class Stereotype implements CharSequence {
this.automaticPackageStyle = automaticPackageStyle; this.automaticPackageStyle = automaticPackageStyle;
this.radius = radius; this.radius = radius;
this.circledFont = circledFont; this.circledFont = circledFont;
this.decoration = decoration; this.decoration = Objects.requireNonNull(decoration);
} }
@ -189,11 +189,7 @@ public class Stereotype implements CharSequence {
} }
public List<String> getStyleNames() { public List<String> getStyleNames() {
final List<String> labels = getLabels(Guillemet.NONE); return decoration.getStyleNames();
if (labels == null)
return Collections.emptyList();
return Collections.unmodifiableList(labels);
} }
public PackageStyle getPackageStyle() { public PackageStyle getPackageStyle() {

View File

@ -95,6 +95,22 @@ public class StereotypeDecoration {
final String spriteName; final String spriteName;
final double spriteScale; final double spriteScale;
@Override
public String toString() {
return "label='" + label + "' spriteName='" + spriteName + "'";
}
public List<String> getStyleNames() {
final List<String> 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, private StereotypeDecoration(String label, HColor htmlColor, char character, String spriteName,
double spriteScale) { double spriteScale) {
this.label = label; this.label = label;

View File

@ -126,20 +126,20 @@ public final class EntityFactory {
folder.setUSymbol(symbol); folder.setUSymbol(symbol);
folder.setStereotype(g.getStereotype()); folder.setStereotype(g.getStereotype());
folder.setColors(g.getColors()); folder.setColors(g.getColors());
if (g.getUrl99() != null) { if (g.getUrl99() != null)
folder.addUrl(g.getUrl99()); folder.addUrl(g.getUrl99());
}
if (UseStyle.useBetaStyle()) { // if (UseStyle.useBetaStyle()) {
// System.err.println("Backcolor ?"); // // System.err.println("Backcolor ?");
} else { // } else {
if (g.getColors().getColor(ColorType.BACK) == null) { // if (g.getColors().getColor(ColorType.BACK) == null) {
final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack(); // final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack();
final HColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false); // final HColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false);
folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? skinParam.getBackgroundColor() : c1); // folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? skinParam.getBackgroundColor() : c1);
} else { // } else {
folder.setSpecificColorTOBEREMOVED(ColorType.BACK, g.getColors().getColor(ColorType.BACK)); // folder.setSpecificColorTOBEREMOVED(ColorType.BACK, g.getColors().getColor(ColorType.BACK));
} // }
} // }
emptyGroupsAsNode.put(g, folder); emptyGroupsAsNode.put(g, folder);
return folder; return folder;
} }

View File

@ -35,11 +35,9 @@
*/ */
package net.sourceforge.plantuml.descdiagram.command; package net.sourceforge.plantuml.descdiagram.command;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.IRegex;
@ -120,95 +118,92 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
LinkDecor d1 = LinkDecor.NONE; LinkDecor d1 = LinkDecor.NONE;
LinkDecor d2 = LinkDecor.NONE; LinkDecor d2 = LinkDecor.NONE;
if (head1.equals("(0")) { if (head1.equals("(0"))
d1 = LinkDecor.CIRCLE_CONNECT; d1 = LinkDecor.CIRCLE_CONNECT;
} else if (head1.equals("#")) { else if (head1.equals("#"))
d1 = LinkDecor.SQUARE; d1 = LinkDecor.SQUARE;
} else if (head1.equals("0")) { else if (head1.equals("0"))
d1 = LinkDecor.CIRCLE; d1 = LinkDecor.CIRCLE;
} else if (head1.equals("@")) { else if (head1.equals("@"))
d1 = LinkDecor.CIRCLE_FILL; d1 = LinkDecor.CIRCLE_FILL;
} else if (head1.equals("(")) { else if (head1.equals("("))
d1 = LinkDecor.PARENTHESIS; d1 = LinkDecor.PARENTHESIS;
} else if (head1.equals(">")) { else if (head1.equals(">"))
d1 = LinkDecor.ARROW; d1 = LinkDecor.ARROW;
} else if (head1.equals("*")) { else if (head1.equals("*"))
d1 = LinkDecor.COMPOSITION; d1 = LinkDecor.COMPOSITION;
} else if (head1.equals("o")) { else if (head1.equals("o"))
d1 = LinkDecor.AGREGATION; d1 = LinkDecor.AGREGATION;
} else if (head1.equals("+")) { else if (head1.equals("+"))
d1 = LinkDecor.PLUS; d1 = LinkDecor.PLUS;
} else if (head1.equals("\\\\")) { else if (head1.equals("\\\\"))
d1 = LinkDecor.HALF_ARROW; d1 = LinkDecor.HALF_ARROW;
} else if (head1.equals(">>")) { else if (head1.equals(">>"))
d1 = LinkDecor.ARROW_TRIANGLE; d1 = LinkDecor.ARROW_TRIANGLE;
} else if (head1.equals("^")) { else if (head1.equals("^"))
d1 = LinkDecor.EXTENDS; d1 = LinkDecor.EXTENDS;
} else if (head1.equals(":|>")) { else if (head1.equals(":|>"))
d1 = LinkDecor.DEFINEDBY; d1 = LinkDecor.DEFINEDBY;
} else if (head1.equals("||>")) { else if (head1.equals("||>"))
d1 = LinkDecor.REDEFINES; d1 = LinkDecor.REDEFINES;
} else if (head1.equals("|>")) { else if (head1.equals("|>"))
d1 = LinkDecor.EXTENDS; d1 = LinkDecor.EXTENDS;
}
if (head2.equals("0)")) { if (head2.equals("0)"))
d2 = LinkDecor.CIRCLE_CONNECT; d2 = LinkDecor.CIRCLE_CONNECT;
} else if (head2.equals("#")) { else if (head2.equals("#"))
d2 = LinkDecor.SQUARE; d2 = LinkDecor.SQUARE;
} else if (head2.equals("0")) { else if (head2.equals("0"))
d2 = LinkDecor.CIRCLE; d2 = LinkDecor.CIRCLE;
} else if (head2.equals("@")) { else if (head2.equals("@"))
d2 = LinkDecor.CIRCLE_FILL; d2 = LinkDecor.CIRCLE_FILL;
} else if (head2.equals(")")) { else if (head2.equals(")"))
d2 = LinkDecor.PARENTHESIS; d2 = LinkDecor.PARENTHESIS;
} else if (head2.equals("<")) { else if (head2.equals("<"))
d2 = LinkDecor.ARROW; d2 = LinkDecor.ARROW;
} else if (head2.equals("*")) { else if (head2.equals("*"))
d2 = LinkDecor.COMPOSITION; d2 = LinkDecor.COMPOSITION;
} else if (head2.equals("o")) { else if (head2.equals("o"))
d2 = LinkDecor.AGREGATION; d2 = LinkDecor.AGREGATION;
} else if (head2.equals("+")) { else if (head2.equals("+"))
d2 = LinkDecor.PLUS; d2 = LinkDecor.PLUS;
} else if (head2.equals("<<")) { else if (head2.equals("<<"))
d2 = LinkDecor.ARROW_TRIANGLE; d2 = LinkDecor.ARROW_TRIANGLE;
} else if (head2.equals("^")) { else if (head2.equals("^"))
d2 = LinkDecor.EXTENDS; d2 = LinkDecor.EXTENDS;
} else if (head2.equals("<|:")) { else if (head2.equals("<|:"))
d2 = LinkDecor.DEFINEDBY; d2 = LinkDecor.DEFINEDBY;
} else if (head2.equals("<||")) { else if (head2.equals("<||"))
d2 = LinkDecor.REDEFINES; d2 = LinkDecor.REDEFINES;
} else if (head2.equals("<|")) { else if (head2.equals("<|"))
d2 = LinkDecor.EXTENDS; d2 = LinkDecor.EXTENDS;
}
LinkType result = new LinkType(d1, d2); LinkType result = new LinkType(d1, d2);
final String queue = getQueue(arg); final String queue = getQueue(arg);
if (queue.contains(".")) { if (queue.contains("."))
result = result.goDashed(); result = result.goDashed();
} else if (queue.contains("~")) { else if (queue.contains("~"))
result = result.goDotted(); result = result.goDotted();
} else if (queue.contains("=")) { else if (queue.contains("="))
result = result.goBold(); result = result.goBold();
}
final String middle = arg.get("INSIDE", 0); final String middle = arg.get("INSIDE", 0);
if ("0".equals(middle)) { if ("0".equals(middle))
result = result.withMiddleCircle(); result = result.withMiddleCircle();
} else if ("0)".equals(middle)) { else if ("0)".equals(middle))
result = result.withMiddleCircleCircled1(); result = result.withMiddleCircleCircled1();
} else if ("(0".equals(middle)) { else if ("(0".equals(middle))
result = result.withMiddleCircleCircled2(); result = result.withMiddleCircleCircled2();
} else if ("(0)".equals(middle)) { else if ("(0)".equals(middle))
result = result.withMiddleCircleCircled(); result = result.withMiddleCircleCircled();
}
return result; return result;
} }
private static String trimAndLowerCase(String s) { private static String trimAndLowerCase(String s) {
if (s == null) { if (s == null)
return ""; return "";
}
return StringUtils.goLowerCase(StringUtils.trin(s)); return StringUtils.goLowerCase(StringUtils.trin(s));
} }
@ -245,11 +240,11 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg); final Direction dir = getDirection(arg);
final String queue; final String queue;
if (dir == Direction.LEFT || dir == Direction.RIGHT) { if (dir == Direction.LEFT || dir == Direction.RIGHT)
queue = "-"; queue = "-";
} else { else
queue = getQueue(arg); queue = getQueue(arg);
}
final Labels labels = new Labels(arg); final Labels labels = new Labels(arg);
final IEntity cl1; final IEntity cl1;
@ -267,31 +262,27 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
labels.getFirstLabel(), labels.getSecondLabel(), diagram.getLabeldistance(), diagram.getLabelangle(), labels.getFirstLabel(), labels.getSecondLabel(), diagram.getLabeldistance(), diagram.getLabelangle(),
diagram.getSkinParam().getCurrentStyleBuilder()); diagram.getSkinParam().getCurrentStyleBuilder());
link.setLinkArrow(labels.getLinkArrow()); link.setLinkArrow(labels.getLinkArrow());
if (dir == Direction.LEFT || dir == Direction.UP) { if (dir == Direction.LEFT || dir == Direction.UP)
link = link.getInv(); link = link.getInv();
}
link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg, link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet())); diagram.getSkinParam().getIHtmlColorSet()));
link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0)); link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0));
if (arg.get("STEREOTYPE", 0) != null) { if (arg.get("STEREOTYPE", 0) != null) {
final Stereotype stereotype = Stereotype.build(arg.get("STEREOTYPE", 0)); final Stereotype stereotype = Stereotype.build(arg.get("STEREOTYPE", 0));
if (UseStyle.useBetaStyle()) { link.setStereotype(stereotype);
link.setStereotype(stereotype);
} else {
link.setColors(link.getColors().applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.arrow));
}
} }
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
private IEntity getFoo1(DescriptionDiagram diagram, Code code, Ident ident, Ident pure) { 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); return diagram.getGroup(code);
}
if (diagram.V1972() && diagram.isGroupStrict(ident)) { if (diagram.V1972() && diagram.isGroupStrict(ident))
return diagram.getGroupStrict(ident); return diagram.getGroupStrict(ident);
}
final String codeString = code.getName(); final String codeString = code.getName();
if (ident.getLast().startsWith("()")) { if (ident.getLast().startsWith("()")) {
ident = ident.removeStartingParenthesis(); ident = ident.removeStartingParenthesis();
@ -320,9 +311,9 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (diagram.V1972()) { if (diagram.V1972()) {
final ILeaf result = pure.size() == 1 ? diagram.getLeafVerySmart(ident) : diagram.getLeafStrict(ident); final ILeaf result = pure.size() == 1 ? diagram.getLeafVerySmart(ident) : diagram.getLeafStrict(ident);
// final ILeaf result = diagram.getLeafSmart(ident); // final ILeaf result = diagram.getLeafSmart(ident);
if (result != null) { if (result != null)
return result; return result;
}
} }
return diagram.getOrCreateLeaf(ident, code, type, symbol); return diagram.getOrCreateLeaf(ident, code, type, symbol);
} }

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.elk; package net.sourceforge.plantuml.elk;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -54,8 +53,8 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Display; 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.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbols;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; 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 FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null);
final TextBlock label = link.getLabel().create(labelFont, final TextBlock label = link.getLabel().create(labelFont,
skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam);
if (TextBlockUtils.isEmpty(label, stringBounder)) { if (TextBlockUtils.isEmpty(label, stringBounder))
return null; return null;
}
return label; return label;
} }
private TextBlock getQualifier(Link link, int n) { private TextBlock getQualifier(Link link, int n) {
final String tmp = n == 1 ? link.getQualifier1() : link.getQualifier2(); final String tmp = n == 1 ? link.getQualifier1() : link.getQualifier2();
if (tmp == null) { if (tmp == null)
return null; return null;
}
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null); final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null);
final TextBlock label = Display.getWithNewlines(tmp).create(labelFont, final TextBlock label = Display.getWithNewlines(tmp).create(labelFont,
skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam);
if (TextBlockUtils.isEmpty(label, stringBounder)) { if (TextBlockUtils.isEmpty(label, stringBounder))
return null; return null;
}
return label; return label;
} }
@ -225,23 +223,23 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
} }
private void drawAllClusters(UGraphic ug) { private void drawAllClusters(UGraphic ug) {
for (Entry<IGroup, ElkNode> ent : clusters.entrySet()) { for (Entry<IGroup, ElkNode> ent : clusters.entrySet())
drawSingleCluster(ug, ent.getKey(), ent.getValue()); drawSingleCluster(ug, ent.getKey(), ent.getValue());
}
} }
private void drawAllNodes(UGraphic ug) { private void drawAllNodes(UGraphic ug) {
for (Entry<ILeaf, ElkNode> ent : nodes.entrySet()) { for (Entry<ILeaf, ElkNode> ent : nodes.entrySet())
drawSingleNode(ug, ent.getKey(), ent.getValue()); drawSingleNode(ug, ent.getKey(), ent.getValue());
}
} }
private void drawAllEdges(UGraphic ug) { private void drawAllEdges(UGraphic ug) {
for (Entry<Link, ElkEdge> ent : edges.entrySet()) { for (Entry<Link, ElkEdge> ent : edges.entrySet()) {
final Link link = ent.getKey(); final Link link = ent.getKey();
if (link.isInvis()) { if (link.isInvis())
continue; continue;
}
drawSingleEdge(ug, link, ent.getValue()); drawSingleEdge(ug, link, ent.getValue());
} }
} }
@ -252,28 +250,16 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
PackageStyle packageStyle = group.getPackageStyle(); PackageStyle packageStyle = group.getPackageStyle();
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
if (packageStyle == null) { if (packageStyle == null)
packageStyle = skinParam.packageStyle(); packageStyle = skinParam.packageStyle();
}
final UmlDiagramType umlDiagramType = diagram.getUmlDiagramType(); final UmlDiagramType umlDiagramType = diagram.getUmlDiagramType();
final double shadowing; final Style style = Cluster.getDefaultStyleDefinition(umlDiagramType.getStyleName(), group.getUSymbol())
final UStroke stroke; .getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { final double shadowing = style.value(PName.Shadowing).asDouble();
final Style style = Cluster.getDefaultStyleDefinition(umlDiagramType.getStyleName(), group.getUSymbol()) final UStroke stroke = Cluster.getStrokeInternal(group, skinParam, style);
.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);
}
HColor backColor = getBackColor(umlDiagramType); HColor backColor = getBackColor(umlDiagramType);
backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(), backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(),
group.getUSymbol()); group.getUSymbol());
@ -298,9 +284,8 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
private TextBlock getTitleBlock(IGroup g) { private TextBlock getTitleBlock(IGroup g) {
final Display label = g.getDisplay(); final Display label = g.getDisplay();
if (label == null) { if (label == null)
return TextBlockUtils.empty(0, 0); return TextBlockUtils.empty(0, 0);
}
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
final FontConfiguration fontConfiguration = g.getFontConfigurationForTitle(skinParam); final FontConfiguration fontConfiguration = g.getFontConfigurationForTitle(skinParam);
@ -330,9 +315,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
} }
public Dimension2D calculateDimension(StringBounder stringBounder) { public Dimension2D calculateDimension(StringBounder stringBounder) {
if (minMax == null) { if (minMax == null)
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
}
return minMax.getDimension(); return minMax.getDimension();
} }
@ -344,19 +329,18 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
private Collection<ILeaf> getUnpackagedEntities() { private Collection<ILeaf> getUnpackagedEntities() {
final List<ILeaf> result = new ArrayList<>(); final List<ILeaf> result = new ArrayList<>();
for (ILeaf ent : diagram.getLeafsvalues()) { for (ILeaf ent : diagram.getLeafsvalues())
if (diagram.getEntityFactory().getRootGroup() == ent.getParentContainer()) { if (diagram.getEntityFactory().getRootGroup() == ent.getParentContainer())
result.add(ent); result.add(ent);
}
}
return result; return result;
} }
private ElkNode getElkNode(final IEntity entity) { private ElkNode getElkNode(final IEntity entity) {
ElkNode node = nodes.get(entity); ElkNode node = nodes.get(entity);
if (node == null) { if (node == null)
node = clusters.get(entity); node = clusters.get(entity);
}
return node; return node;
} }
@ -423,9 +407,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
} }
private void printSingleGroup(IGroup g) { private void printSingleGroup(IGroup g) {
if (g.getGroupType() == GroupType.CONCURRENT_STATE) { if (g.getGroupType() == GroupType.CONCURRENT_STATE)
return; return;
}
this.printEntities(clusters.get(g), g.getLeafsDirect()); this.printEntities(clusters.get(g), g.getLeafsDirect());
printAllSubgroups(clusters.get(g), g); printAllSubgroups(clusters.get(g), g);
} }
@ -433,18 +417,18 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
private void printEntities(ElkNode parent, Collection<ILeaf> entities) { private void printEntities(ElkNode parent, Collection<ILeaf> entities) {
// Convert all "leaf" to ELK node // Convert all "leaf" to ELK node
for (ILeaf ent : entities) { for (ILeaf ent : entities) {
if (ent.isRemoved()) { if (ent.isRemoved())
continue; continue;
}
manageSingleNode(parent, ent); manageSingleNode(parent, ent);
} }
} }
private void manageAllEdges() { private void manageAllEdges() {
// Convert all "link" to ELK edge // Convert all "link" to ELK edge
for (final Link link : diagram.getLinks()) { for (final Link link : diagram.getLinks())
manageSingleEdge(link); manageSingleEdge(link);
}
} }
private void manageSingleNode(final ElkNode root, ILeaf leaf) { private void manageSingleNode(final ElkNode root, ILeaf leaf) {
@ -548,14 +532,13 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
} }
private IEntityImage printEntityInternal(ILeaf ent) { private IEntityImage printEntityInternal(ILeaf ent) {
if (ent.isRemoved()) { if (ent.isRemoved())
throw new IllegalStateException(); throw new IllegalStateException();
}
if (ent.getSvekImage() == null) { if (ent.getSvekImage() == null) {
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
if (skinParam.sameClassWidth()) { if (skinParam.sameClassWidth())
System.err.println("NOT YET IMPLEMENED"); System.err.println("NOT YET IMPLEMENED");
}
return GeneralImageBuilder.createEntityImageBlock(ent, skinParam, diagram.isHideEmptyDescriptionForState(), return GeneralImageBuilder.createEntityImageBlock(ent, skinParam, diagram.isHideEmptyDescriptionForState(),
diagram, getBibliotekon(), null, diagram.getUmlDiagramType(), diagram.getLinks()); diagram, getBibliotekon(), null, diagram.getUmlDiagramType(), diagram.getLinks());

View File

@ -43,7 +43,6 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor; import net.sourceforge.plantuml.cucadiagram.LinkDecor;
@ -138,13 +137,10 @@ public class ElkPath implements UDrawable {
if (link.isHidden()) if (link.isHidden())
return; return;
HColor color;
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
if (UseStyle.useBetaStyle()) HColor color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(),
color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
else
color = rose.getHtmlColor(skinParam, null, getArrowColorParam());
if (this.link.getColors() != null) { if (this.link.getColors() != null) {
final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE); final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE);

View File

@ -86,29 +86,26 @@ public class HtmlColorAndStyle {
} }
public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) throws NoSuchColorException { public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) throws NoSuchColorException {
HColor arrowColor;
HColor arrowHeadColor = null; final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
if (UseStyle.useBetaStyle()) { HColor arrowColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); skinParam.getIHtmlColorSet());
arrowColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); final HColor arrowHeadColor = null;
} else {
arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowColor; LinkStyle linkStyle = LinkStyle.NORMAL();
arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowHeadColor;
}
LinkStyle style = LinkStyle.NORMAL();
final HColorSet set = skinParam.getIHtmlColorSet(); final HColorSet set = skinParam.getIHtmlColorSet();
for (String s : definition.split(",")) { for (String s : definition.split(",")) {
final LinkStyle tmpStyle = LinkStyle.fromString1(s); final LinkStyle tmpStyle = LinkStyle.fromString1(s);
if (tmpStyle.isNormal() == false) { if (tmpStyle.isNormal() == false) {
style = tmpStyle; linkStyle = tmpStyle;
continue; continue;
} }
final HColor tmpColor = s == null ? null : set.getColor(skinParam.getThemeStyle(), s); final HColor tmpColor = s == null ? null : set.getColor(skinParam.getThemeStyle(), s);
if (tmpColor != null) { if (tmpColor != null)
arrowColor = tmpColor; arrowColor = tmpColor;
}
} }
return new HtmlColorAndStyle(arrowColor, style, arrowHeadColor); return new HtmlColorAndStyle(arrowColor, linkStyle, arrowHeadColor);
} }
} }

View File

@ -40,9 +40,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
@ -72,20 +70,15 @@ public class Rainbow {
} }
public static Rainbow fromColor(HColor arrowColor, HColor arrowHeadColor) { public static Rainbow fromColor(HColor arrowColor, HColor arrowHeadColor) {
if (arrowColor == null) { if (arrowColor == null)
return Rainbow.none(); return Rainbow.none();
}
return Rainbow.build(new HtmlColorAndStyle(arrowColor, arrowHeadColor)); return Rainbow.build(new HtmlColorAndStyle(arrowColor, arrowHeadColor));
} }
@Deprecated @Deprecated
public static Rainbow build(ISkinParam skinParam) { public static Rainbow build(ISkinParam skinParam) {
if (UseStyle.useBetaStyle()) { throw new IllegalStateException();
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);
} }
public static Rainbow build(Style style, HColorSet set, ThemeStyle themeStyle) { public static Rainbow build(Style style, HColorSet set, ThemeStyle themeStyle) {
@ -94,9 +87,9 @@ public class Rainbow {
} }
public Rainbow withDefault(Rainbow defaultColor) { public Rainbow withDefault(Rainbow defaultColor) {
if (this.size() == 0) { if (this.size() == 0)
return defaultColor; return defaultColor;
}
return this; return this;
} }
@ -108,22 +101,21 @@ public class Rainbow {
public static Rainbow build(ISkinParam skinParam, String colorString, int colorArrowSeparationSpace) public static Rainbow build(ISkinParam skinParam, String colorString, int colorArrowSeparationSpace)
throws NoSuchColorException { throws NoSuchColorException {
if (colorString == null) { if (colorString == null)
return Rainbow.none(); return Rainbow.none();
}
final Rainbow result = new Rainbow(colorArrowSeparationSpace); final Rainbow result = new Rainbow(colorArrowSeparationSpace);
for (String s : colorString.split(";")) { for (String s : colorString.split(";"))
result.colors.add(HtmlColorAndStyle.build(skinParam, s)); result.colors.add(HtmlColorAndStyle.build(skinParam, s));
}
return result; return result;
} }
public boolean isInvisible() { public boolean isInvisible() {
for (HtmlColorAndStyle style : colors) { for (HtmlColorAndStyle style : colors)
if (style.getStyle().isInvisible()) { if (style.getStyle().isInvisible())
return true; return true;
}
}
return false; return false;
} }

View File

@ -84,31 +84,13 @@ public class TextBlockUtils {
} }
public static TextBlock title(FontConfiguration font, Display stringsToDisplay, ISkinParam skinParam) { public static TextBlock title(FontConfiguration font, Display stringsToDisplay, ISkinParam skinParam) {
if (UseStyle.useBetaStyle()) { throw new UnsupportedOperationException();
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);
} }
public static TextBlock withMargin(TextBlock textBlock, double marginX, double marginY) { public static TextBlock withMargin(TextBlock textBlock, double marginX, double marginY) {
if (marginX == 0 && marginY == 0) { if (marginX == 0 && marginY == 0)
return textBlock; return textBlock;
}
return new TextBlockMarged(textBlock, marginY, marginX, marginY, marginX); return new TextBlockMarged(textBlock, marginY, marginX, marginY, marginX);
} }

View File

@ -35,10 +35,9 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine;
import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UEmpty;
@ -76,12 +75,7 @@ class USymbolDatabase extends USymbol {
final UPath closing = getClosingPath(width); final UPath closing = getClosingPath(width);
ug.apply(new HColorNone().bg()).draw(closing); ug.apply(new HColorNone().bg()).draw(closing);
ug.apply(new UTranslate(width, height)).draw(new UEmpty(10, 10));
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));
}
} }

View File

@ -90,9 +90,8 @@ class USymbolNode extends USymbol {
ug.apply(UTranslate.dy(10)).draw(ULine.hline(width - 10)); ug.apply(UTranslate.dy(10)).draw(ULine.hline(width - 10));
ug.apply(new UTranslate(width - 10, 10)).draw(ULine.vline(height - 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));
}
} }

View File

@ -45,7 +45,6 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamColors; import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
@ -91,9 +90,9 @@ public class Colors {
final String s = st.nextToken(); final String s = st.nextToken();
final int x = s.indexOf(':'); final int x = s.indexOf(':');
if (x == -1) { if (x == -1) {
if (s.contains(".") == false) { if (s.contains(".") == false)
map.put(mainType, set.getColor(themeStyle, s)); map.put(mainType, set.getColor(themeStyle, s));
}
} else { } else {
final String name = s.substring(0, x); final String name = s.substring(0, x);
final String value = s.substring(x + 1); 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(); lineStyle = LinkStyle.DASHED();
} else if (data.contains("line.dotted")) { else if (data.contains("line.dotted"))
lineStyle = LinkStyle.DOTTED(); lineStyle = LinkStyle.DOTTED();
} else if (data.contains("line.bold")) { else if (data.contains("line.bold"))
lineStyle = LinkStyle.BOLD(); lineStyle = LinkStyle.BOLD();
}
} }
public HColor getColor(ColorType key) { public HColor getColor(ColorType key) {
@ -121,29 +120,23 @@ public class Colors {
public HColor getColor(ColorType key1, ColorType key2) { public HColor getColor(ColorType key1, ColorType key2) {
final HColor result = getColor(key1); final HColor result = getColor(key1);
if (result != null) { if (result != null)
return result; return result;
}
return getColor(key2); return getColor(key2);
} }
public UStroke getSpecificLineStroke() { public UStroke getSpecificLineStroke() {
if (lineStyle == null) { if (lineStyle == null)
return null; return null;
}
return lineStyle.getStroke3(); return lineStyle.getStroke3();
} }
// public Colors addSpecificLineStroke(UStroke specificStroke) {
// final Colors result = copy();
// result.specificStroke = specificStroke;
// return result;
// }
public Colors add(ColorType type, HColor color) { public Colors add(ColorType type, HColor color) {
if (color == null) { if (color == null)
return this; return this;
}
final Colors result = copy(); final Colors result = copy();
result.map.put(type, color); result.map.put(type, color);
return result; return result;
@ -152,9 +145,9 @@ public class Colors {
private Colors add(ColorType colorType, Colors other) { private Colors add(ColorType colorType, Colors other) {
final Colors result = copy(); final Colors result = copy();
result.map.putAll(other.map); result.map.putAll(other.map);
if (other.lineStyle != null) { if (other.lineStyle != null)
result.lineStyle = other.lineStyle; result.lineStyle = other.lineStyle;
}
return result; return result;
} }
@ -187,37 +180,20 @@ public class Colors {
throws NoSuchColorException { throws NoSuchColorException {
Objects.requireNonNull(stereotype); Objects.requireNonNull(stereotype);
final ColorType colorType = Objects.requireNonNull(Objects.requireNonNull(param).getColorType()); final ColorType colorType = Objects.requireNonNull(Objects.requireNonNull(param).getColorType());
if (getColor(colorType) != null) { if (getColor(colorType) != null)
return this; return this;
}
final Colors colors = skinParam.getColors(param, stereotype); final Colors colors = skinParam.getColors(param, stereotype);
return add(colorType, colors); 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, public Colors applyStereotypeForNote(Stereotype stereotype, ISkinParam skinParam, FontParam fontParam,
ColorParam... params) throws NoSuchColorException { ColorParam... params) throws NoSuchColorException {
Objects.requireNonNull(stereotype); Objects.requireNonNull(stereotype);
Colors result = this; Colors result = this;
for (ColorParam param : Objects.requireNonNull(params)) { for (ColorParam param : Objects.requireNonNull(params))
result = result.applyStereotype(stereotype, skinParam, param); result = result.applyStereotype(stereotype, skinParam, param);
}
result = result.applyFontParamStereotype(stereotype, skinParam, fontParam);
result.shadowing = skinParam.shadowingForNote(stereotype); result.shadowing = skinParam.shadowingForNote(stereotype);
return result; return result;
} }
@ -227,9 +203,9 @@ public class Colors {
} }
public UStroke muteStroke(UStroke stroke) { public UStroke muteStroke(UStroke stroke) {
if (lineStyle == null) { if (lineStyle == null)
return stroke; return stroke;
}
return lineStyle.muteStroke(stroke); return lineStyle.muteStroke(stroke);
} }

View File

@ -102,7 +102,10 @@ public class CommandCreateMap extends CommandMultilines2<AbstractClassOrObjectDi
for (StringLocated sl : lines) { for (StringLocated sl : lines) {
final String line = sl.getString(); final String line = sl.getString();
assert line.length() > 0; assert line.length() > 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) { if (BodierMap.getLinkedEntry(line) != null) {
final String linkStr = BodierMap.getLinkedEntry(line); final String linkStr = BodierMap.getLinkedEntry(line);
final int x = line.indexOf(linkStr); final int x = line.indexOf(linkStr);
@ -135,11 +138,11 @@ public class CommandCreateMap extends CommandMultilines2<AbstractClassOrObjectDi
return diagram.getOrCreateLeaf(diagram.buildLeafIdent(name), code, LeafType.MAP, null); return diagram.getOrCreateLeaf(diagram.buildLeafIdent(name), code, LeafType.MAP, null);
final IEntity entity = diagram.createLeaf(ident, code, Display.getWithNewlines(display), LeafType.MAP, null); final IEntity entity = diagram.createLeaf(ident, code, Display.getWithNewlines(display), LeafType.MAP, null);
if (stereotype != null) if (stereotype != null)
entity.setStereotype(Stereotype.build(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), entity.setStereotype(Stereotype.build(stereotype, diagram.getSkinParam().getCircledCharacterRadius(),
diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER),
diagram.getSkinParam().getIHtmlColorSet())); diagram.getSkinParam().getIHtmlColorSet()));
final String s = line0.get("COLOR", 0); final String s = line0.get("COLOR", 0);
entity.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null entity.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s)); : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));

View File

@ -35,74 +35,44 @@
*/ */
package net.sourceforge.plantuml.png; package net.sourceforge.plantuml.png;
import java.awt.Font;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.SpriteContainerEmpty; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplaySection; import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class PngTitler { public class PngTitler {
private final HColor textColor;
private final HColor hyperlinkColor;
private final DisplaySection text; private final DisplaySection text;
private final int fontSize;
private final String fontFamily;
private final boolean useUnderlineForHyperlink;
private final Style style; private final Style style;
private final HColorSet set; private final HColorSet set;
private final ISkinSimple spriteContainer; private final ISkinSimple spriteContainer;
public PngTitler(HColor textColor, DisplaySection text, int fontSize, String fontFamily, HColor hyperlinkColor, public PngTitler(DisplaySection text, Style style, HColorSet set, ISkinSimple spriteContainer) {
boolean useUnderlineForHyperlink, Style style, HColorSet set, ISkinSimple spriteContainer) {
this.style = style; this.style = style;
this.set = set; this.set = set;
this.spriteContainer = spriteContainer; this.spriteContainer = spriteContainer;
if (UseStyle.useBetaStyle()) {
textColor = style.value(PName.FontColor).asColor(spriteContainer.getThemeStyle(), set);
fontSize = style.value(PName.FontSize).asInt();
fontFamily = style.value(PName.FontName).asString();
hyperlinkColor = style.value(PName.HyperLinkColor).asColor(spriteContainer.getThemeStyle(), set);
}
this.textColor = textColor;
this.text = text; this.text = text;
this.fontSize = fontSize;
this.fontFamily = fontFamily;
this.hyperlinkColor = hyperlinkColor;
this.useUnderlineForHyperlink = useUnderlineForHyperlink;
} }
public Dimension2D getTextDimension(StringBounder stringBounder) { public Dimension2D getTextDimension(StringBounder stringBounder) {
final TextBlock textBloc = getRibbonBlock(); final TextBlock textBloc = getRibbonBlock();
if (textBloc == null) { if (textBloc == null)
return null; return null;
}
return textBloc.calculateDimension(stringBounder); return textBloc.calculateDimension(stringBounder);
} }
public TextBlock getRibbonBlock() { public TextBlock getRibbonBlock() {
if (UseStyle.useBetaStyle()) { final Display display = text.getDisplay();
final Display display = text.getDisplay(); if (display == null)
if (display == null) { return null;
return null;
} return style.createTextBlockBordered(display, set, spriteContainer);
return style.createTextBlockBordered(display, set, spriteContainer);
}
final UFont normalFont = new UFont(fontFamily, Font.PLAIN, fontSize);
return text.createRibbon(FontConfiguration.create(normalFont, textColor, hyperlinkColor, useUnderlineForHyperlink),
new SpriteContainerEmpty(), null);
} }
} }

View File

@ -63,7 +63,6 @@ public class CommandSkin extends SingleLineCommand2<TitledDiagram> {
@Override @Override
protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) {
try { try {
UseStyle.setBetaStyle(true);
return diagram.loadSkin(arg.get("SKIN", 0)); return diagram.loadSkin(arg.get("SKIN", 0));
} catch (IOException e) { } catch (IOException e) {
return CommandExecutionResult.error("Skin read error"); return CommandExecutionResult.error("Skin read error");

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.sequencediagram.graphic; package net.sourceforge.plantuml.sequencediagram.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
@ -49,6 +48,7 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplaySection; import net.sourceforge.plantuml.cucadiagram.DisplaySection;
@ -157,10 +157,9 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
compTitle = style.createTextBlockBordered(page.getTitle(), diagram.getSkinParam().getIHtmlColorSet(), compTitle = style.createTextBlockBordered(page.getTitle(), diagram.getSkinParam().getIHtmlColorSet(),
diagram.getSkinParam()); diagram.getSkinParam());
} else { } else {
compTitle = TextBlockUtils.withMargin( compTitle = TextBlockUtils.withMargin(TextBlockUtils.title(
TextBlockUtils.title(FontConfiguration.create(drawableSet.getSkinParam(), FontParam.TITLE, null), FontConfiguration.create(drawableSet.getSkinParam(), FontParam.TITLE, null), page.getTitle(),
page.getTitle(), drawableSet.getSkinParam()), drawableSet.getSkinParam()), 7, 7);
7, 7);
} }
final Dimension2D dimTitle = compTitle.calculateDimension(stringBounder); final Dimension2D dimTitle = compTitle.calculateDimension(stringBounder);
area.setTitleArea(dimTitle.getWidth(), dimTitle.getHeight()); area.setTitleArea(dimTitle.getWidth(), dimTitle.getHeight());
@ -244,18 +243,11 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
private PngTitler getPngTitler(final FontParam fontParam, int page) { private PngTitler getPngTitler(final FontParam fontParam, int page) {
final ISkinParam skinParam = diagram.getSkinParam(); 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()); final DisplaySection display = diagram.getFooterOrHeaderTeoz(fontParam).withPage(page + 1, pages.size());
Style style = null; final StyleSignatureBasic def = fontParam.getStyleDefinition(null);
if (UseStyle.useBetaStyle()) { final Style style = def.getMergedStyle(skinParam.getCurrentStyleBuilder());
final StyleSignatureBasic def = fontParam.getStyleDefinition(null);
style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); return new PngTitler(display, style, skinParam.getIHtmlColorSet(), skinParam);
}
return new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor,
skinParam.useUnderlineForHyperlink(), style, skinParam.getIHtmlColorSet(), skinParam);
} }
private boolean isLegendTop() { private boolean isLegendTop() {

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.sequencediagram.teoz; package net.sourceforge.plantuml.sequencediagram.teoz;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -46,6 +45,7 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplaySection; 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.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.MathUtils; import net.sourceforge.plantuml.utils.MathUtils;
public class SequenceDiagramFileMakerTeoz implements FileMaker { public class SequenceDiagramFileMakerTeoz implements FileMaker {
@ -137,9 +136,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
if (this.index != index) { if (this.index != index) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
return diagram.createImageBuilder(fileFormatOption) return diagram.createImageBuilder(fileFormatOption).drawable(new Foo(index)).write(os);
.drawable(new Foo(index))
.write(os);
} }
class Foo implements UDrawable { class Foo implements UDrawable {
@ -234,22 +231,16 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
} }
public TextBlock getFooterOrHeader(final FontParam param) { public TextBlock getFooterOrHeader(final FontParam param) {
if (diagram.getFooterOrHeaderTeoz(param).isNull()) { if (diagram.getFooterOrHeaderTeoz(param).isNull())
return new TeozLayer(null, stringBounder, param); return new TeozLayer(null, stringBounder, param);
}
final DisplaySection display = diagram.getFooterOrHeaderTeoz(param).withPage(index + 1, getNbPages()); 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(); final ISkinParam skinParam = diagram.getSkinParam();
if (UseStyle.useBetaStyle()) {
final StyleSignatureBasic def = param.getStyleDefinition(null); final StyleSignatureBasic def = param.getStyleDefinition(null);
style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = def.getMergedStyle(skinParam.getCurrentStyleBuilder());
}
final PngTitler pngTitler = new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor, final PngTitler pngTitler = new PngTitler(display, style, skinParam.getIHtmlColorSet(), skinParam);
getSkinParam().useUnderlineForHyperlink(), style, skinParam.getIHtmlColorSet(), skinParam);
return new TeozLayer(pngTitler, stringBounder, param); return new TeozLayer(pngTitler, stringBounder, param);
} }

View File

@ -65,15 +65,11 @@ public class CommandStyleMultilinesCSS extends CommandMultilines2<TitledDiagram>
} }
protected CommandExecutionResult executeNow(TitledDiagram diagram, BlocLines lines) { protected CommandExecutionResult executeNow(TitledDiagram diagram, BlocLines lines) {
UseStyle.setBetaStyle(true);
if (UseStyle.useBetaStyle() == false) {
return CommandExecutionResult.ok();
}
try { try {
final StyleBuilder styleBuilder = diagram.getSkinParam().getCurrentStyleBuilder(); 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); diagram.getSkinParam().muteStyle(modifiedStyle);
}
((SkinParam) diagram.getSkinParam()).applyPendingStyleMigration(); ((SkinParam) diagram.getSkinParam()).applyPendingStyleMigration();
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} catch (NoStyleAvailableException e) { } catch (NoStyleAvailableException e) {

View File

@ -209,6 +209,7 @@ public class FromSkinparamToStyle {
addMagic(SName.storage); addMagic(SName.storage);
addMagic(SName.usecase); addMagic(SName.usecase);
addMagic(SName.map); addMagic(SName.map);
addMagic(SName.archimate);
} }
@ -233,7 +234,7 @@ public class FromSkinparamToStyle {
if (key.contains("<<")) { if (key.contains("<<")) {
final StringTokenizer st = new StringTokenizer(key, "<>"); final StringTokenizer st = new StringTokenizer(key, "<>");
this.key = st.nextToken(); this.key = st.nextToken();
this.stereo = st.nextToken(); this.stereo = st.hasMoreTokens() ? st.nextToken() : null;
} else { } else {
this.key = key; this.key = key;
this.stereo = null; this.stereo = null;

View File

@ -50,6 +50,11 @@ public class StyleSignatures implements StyleSignature {
} }
@Override
public String toString() {
return all.toString();
}
@Override @Override
public Style getMergedStyle(StyleBuilder currentStyleBuilder) { public Style getMergedStyle(StyleBuilder currentStyleBuilder) {
if (all.size() == 0) if (all.size() == 0)

View File

@ -36,7 +36,6 @@
*/ */
package net.sourceforge.plantuml.svek.image; package net.sourceforge.plantuml.svek.image;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashSet; import java.util.HashSet;
@ -47,9 +46,8 @@ import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.Guillemet;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url; 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.BodyFactory;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityPortion; import net.sourceforge.plantuml.cucadiagram.EntityPortion;
@ -116,7 +114,6 @@ public class EntityImageDescription extends AbstractEntityImage {
this.fixCircleLabelOverlapping = getSkinParam().fixCircleLabelOverlapping(); this.fixCircleLabelOverlapping = getSkinParam().fixCircleLabelOverlapping();
this.links = links; this.links = links;
final Stereotype stereotype = entity.getStereotype();
USymbol symbol = getUSymbol(entity); USymbol symbol = getUSymbol(entity);
if (symbol == USymbols.FOLDER) if (symbol == USymbols.FOLDER)
this.shapeType = ShapeType.FOLDER; this.shapeType = ShapeType.FOLDER;
@ -134,50 +131,30 @@ public class EntityImageDescription extends AbstractEntityImage {
final Colors colors = entity.getColors(); final Colors colors = entity.getColors();
HColor backcolor = colors.getColor(ColorType.BACK); 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 StyleSignatureBasic tmp = StyleSignatureBasic.of(SName.root, SName.element, styleName,
final HorizontalAlignment defaultAlign; symbol.getSkinParameter().getStyleName());
if (UseStyle.useBetaStyle()) { final Stereotype stereotype = entity.getStereotype();
final StyleSignatureBasic tmp = StyleSignatureBasic.of(SName.root, SName.element, styleName, final Style style = tmp.withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder())
symbol.getSkinParameter().getStyleName()); .eventuallyOverride(colors);
style = tmp.withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder());
style = style.eventuallyOverride(colors); final Style styleStereo = tmp.forStereotypeItself(stereotype)
final Style styleStereo = tmp.forStereotypeItself(stereotype) .getMergedStyle(getSkinParam().getCurrentStyleBuilder());
.getMergedStyle(getSkinParam().getCurrentStyleBuilder()); final HColor forecolor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(),
forecolor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet());
if (backcolor == null)
backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(),
getSkinParam().getIHtmlColorSet()); getSkinParam().getIHtmlColorSet());
if (backcolor == null)
backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(),
getSkinParam().getIHtmlColorSet());
roundCorner = style.value(PName.RoundCorner).asDouble(); final double roundCorner = style.value(PName.RoundCorner).asDouble();
diagonalCorner = style.value(PName.DiagonalCorner).asDouble(); final double diagonalCorner = style.value(PName.DiagonalCorner).asDouble();
deltaShadow = style.value(PName.Shadowing).asDouble(); final double deltaShadow = style.value(PName.Shadowing).asDouble();
stroke = style.getStroke(colors); final UStroke stroke = style.getStroke(colors);
fcTitle = style.getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); final FontConfiguration fcTitle = style.getFontConfiguration(getSkinParam().getThemeStyle(),
fcStereo = styleStereo.getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet());
getSkinParam().getIHtmlColorSet()); final FontConfiguration fcStereo = styleStereo.getFontConfiguration(getSkinParam().getThemeStyle(),
defaultAlign = style.getHorizontalAlignment(); getSkinParam().getIHtmlColorSet());
} else { final HorizontalAlignment defaultAlign = style.getHorizontalAlignment();
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;
}
assert getStereo() == stereotype; assert getStereo() == stereotype;

View File

@ -35,21 +35,17 @@
*/ */
package net.sourceforge.plantuml.svek.image; package net.sourceforge.plantuml.svek.image;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.CornerParam; import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.Guillemet;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineConfigurable; import net.sourceforge.plantuml.LineConfigurable;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url; 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.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityPortion; import net.sourceforge.plantuml.cucadiagram.EntityPortion;
@ -99,12 +95,8 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null); this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null);
final FontConfiguration fcHeader; final FontConfiguration fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(),
if (UseStyle.useBetaStyle()) getSkinParam().getIHtmlColorSet());
fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(),
getSkinParam().getIHtmlColorSet());
else
fcHeader = FontConfiguration.create(getSkinParam(), FontParam.OBJECT, stereotype);
this.name = TextBlockUtils this.name = TextBlockUtils
.withMargin(entity.getDisplay().create(fcHeader, HorizontalAlignment.CENTER, skinParam), 2, 2); .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), FontConfiguration.create(getSkinParam(), FontParam.OBJECT_STEREOTYPE, stereotype),
HorizontalAlignment.CENTER, skinParam); HorizontalAlignment.CENTER, skinParam);
if (UseStyle.useBetaStyle()) { final FontConfiguration fontConfiguration = getStyleHeader()
final FontConfiguration fontConfiguration = getStyleHeader() .getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet());
.getFontConfiguration(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()); this.entries = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, false,
this.entries = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, false, entity.getStereotype(), getStyle(), fontConfiguration);
entity.getStereotype(), getStyle(), fontConfiguration);
} else
this.entries = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, false,
entity.getStereotype(), null, null);
this.url = entity.getUrl99(); this.url = entity.getUrl99();
@ -168,27 +156,23 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(roundCorner); final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(roundCorner);
final HColor borderColor;
final UStroke stroke;
HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK);
HColor headerBackcolor = getEntity().getColors().getColor(ColorType.HEADER);
if (UseStyle.useBetaStyle()) { final Style style = getStyle();
final Style style = getStyle(); final HColor borderColor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(),
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()); getSkinParam().getIHtmlColorSet());
if (backcolor == null)
backcolor = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(), rect.setDeltaShadow(style.value(PName.Shadowing).asDouble());
getSkinParam().getIHtmlColorSet()); final UStroke stroke = style.getStroke();
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();
}
ug = ug.apply(borderColor).apply(backcolor.bg()); 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()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);
ug.apply(stroke).draw(rect); 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())); final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
if (stereo != null) if (stereo != null)
@ -218,17 +208,6 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With
ug.closeGroup(); 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) { private double getMethodOrFieldHeight(final Dimension2D dim) {
final double fieldsHeight = dim.getHeight(); final double fieldsHeight = dim.getHeight();
if (fieldsHeight == 0 && this.getEntity().getLeafType() != LeafType.MAP) if (fieldsHeight == 0 && this.getEntity().getLeafType() != LeafType.MAP)

View File

@ -39,17 +39,13 @@ import java.awt.geom.Rectangle2D;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.CornerParam; import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.Guillemet;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineConfigurable; import net.sourceforge.plantuml.LineConfigurable;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.Stencil; import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
@ -101,12 +97,8 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null); this.roundCorner = skinParam.getRoundCorner(CornerParam.DEFAULT, null);
final FontConfiguration fcHeader; final FontConfiguration fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(),
if (UseStyle.useBetaStyle()) getSkinParam().getIHtmlColorSet());
fcHeader = getStyleHeader().getFontConfiguration(getSkinParam().getThemeStyle(),
getSkinParam().getIHtmlColorSet());
else
fcHeader = FontConfiguration.create(getSkinParam(), FontParam.OBJECT, stereotype);
final TextBlock tmp = getUnderlinedName(entity).create(fcHeader, HorizontalAlignment.CENTER, skinParam); final TextBlock tmp = getUnderlinedName(entity).create(fcHeader, HorizontalAlignment.CENTER, skinParam);
this.name = TextBlockUtils.withMargin(tmp, 2, 2); 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 double heightTotal = dimTotal.getHeight();
final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(roundCorner); final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(roundCorner);
final HColor borderColor;
final UStroke stroke;
HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK);
HColor headerBackcolor = getEntity().getColors().getColor(ColorType.HEADER); HColor headerBackcolor = getEntity().getColors().getColor(ColorType.HEADER);
if (UseStyle.useBetaStyle()) { final Style style = getStyle();
final Style style = getStyle(); final HColor borderColor = style.value(PName.LineColor).asColor(getSkinParam().getThemeStyle(),
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()); getSkinParam().getIHtmlColorSet());
if (headerBackcolor == null) rect.setDeltaShadow(style.value(PName.Shadowing).asDouble());
headerBackcolor = backcolor == null ? getStyleHeader().value(PName.BackGroundColor) final UStroke stroke = style.getStroke();
.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();
}
ug = ug.apply(borderColor).apply(backcolor.bg()); ug = ug.apply(borderColor).apply(backcolor.bg());
@ -213,11 +191,9 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W
ug.startGroup(typeIDent); ug.startGroup(typeIDent);
ug.apply(stroke).draw(rect); ug.apply(stroke).draw(rect);
UGraphic ugHeader = ug;
if (roundCorner == 0 && headerBackcolor != null && backcolor.equals(headerBackcolor) == false) { if (roundCorner == 0 && headerBackcolor != null && backcolor.equals(headerBackcolor) == false) {
final Shadowable rect2 = new URectangle(widthTotal, dimTitle.getHeight()); final Shadowable rect2 = new URectangle(widthTotal, dimTitle.getHeight());
rect2.setDeltaShadow(0); final UGraphic ugHeader = ug.apply(headerBackcolor.bg());
ugHeader = ugHeader.apply(headerBackcolor.bg());
ugHeader.apply(stroke).draw(rect2); ugHeader.apply(stroke).draw(rect2);
} }
@ -242,17 +218,6 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W
return header; 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) { private double getMethodOrFieldHeight(final Dimension2D dim) {
final double fieldsHeight = dim.getHeight(); final double fieldsHeight = dim.getHeight();
if (fieldsHeight == 0) if (fieldsHeight == 0)

View File

@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques * (C) Copyright 2009-2023, Arnaud Roques
* *
* Project Info: http://plantuml.com * Project Info: http://plantuml.com
* *
* If you like this project or if you find it useful, you can support us at: * 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/patreon (only 1$ per month!)
* http://plantuml.com/paypal * http://plantuml.com/paypal
* *
* This file is part of PlantUML. * This file is part of PlantUML.
* *
* PlantUML is free software; you can redistribute it and/or modify it * PlantUML is free software; you can redistribute it and/or modify it
@ -30,7 +30,7 @@
* *
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* *
*/ */
package net.sourceforge.plantuml.tikz; package net.sourceforge.plantuml.tikz;
@ -120,6 +120,19 @@ public class TikzGraphics {
return Objects.requireNonNull(result); 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) { private void appendFillColor(StringBuilder sb, boolean colorBackup) {
if (fillcolor == null) if (fillcolor == null)
return; 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) { public void rectangleRound(double x, double y, double width, double height, double r) {
double[] points = new double[8 * 2]; double[] points = new double[8 * 2];
points[0] = x; points[0] = x;
@ -549,7 +550,7 @@ public class TikzGraphics {
if (color != null) if (color != null)
sb.append("color=" + getColorName(color) + ","); sb.append("color=" + getColorName(color) + ",");
if (fillcolor != null && !HColorUtils.isTransparent(fillcolor)) if (mustApplyFillColor())
sb.append("fill=" + getColorName(fillcolor) + ","); sb.append("fill=" + getColorName(fillcolor) + ",");
sb.append("line width=" + thickness + "pt] " + couple(x, y) + " ellipse (" + format(width) + "pt and " sb.append("line width=" + thickness + "pt] " + couple(x, y) + " ellipse (" + format(width) + "pt and "
@ -563,7 +564,7 @@ public class TikzGraphics {
if (color != null) if (color != null)
sb.append("color=" + getColorName(color) + ","); sb.append("color=" + getColorName(color) + ",");
if (fillcolor != null) if (mustApplyFillColor())
sb.append("fill=" + getColorName(fillcolor) + ","); sb.append("fill=" + getColorName(fillcolor) + ",");
sb.append("line width=" + thickness + "pt] " + couple(x, y) + " arc (" + angleStart + ":" + angleEnd + ":" sb.append("line width=" + thickness + "pt] " + couple(x, y) + " arc (" + angleStart + ":" + angleEnd + ":"

View File

@ -44,7 +44,7 @@ public class Version {
private static final int MAJOR_SEPARATOR = 1000000; private static final int MAJOR_SEPARATOR = 1000000;
public static int version() { public static int version() {
return 1202203; return 1202204;
} }
public static int versionPatched() { public static int versionPatched() {
@ -80,7 +80,7 @@ public class Version {
} }
public static int beta() { public static int beta() {
final int beta = 2; final int beta = 0;
return beta; return beta;
} }
@ -93,7 +93,7 @@ public class Version {
} }
public static long compileTime() { public static long compileTime() {
return 1648570257787L; return 1649510957985L;
} }
public static String compileTimeString() { public static String compileTimeString() {