1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-26 06:46:45 +00:00

Improve theme support

This commit is contained in:
Arnaud Roques 2021-05-06 23:23:05 +02:00
parent 1048a07d7d
commit c216d071b5
239 changed files with 1437 additions and 837 deletions

View File

@ -21,6 +21,7 @@ package jcckit.util;
import java.awt.Color; import java.awt.Color;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException; import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
@ -305,7 +306,7 @@ static private HColorSet colors = HColorSet.instance();
private Color decodeInternal(String value) { private Color decodeInternal(String value) {
if (value!=null) { if (value!=null) {
try { try {
return new ColorMapperIdentity().toColor(colors.getColor(value, null)); return new ColorMapperIdentity().toColor(colors.getColor(ThemeStyle.LIGHT, value, null));
} catch (NoSuchColorException e) { } catch (NoSuchColorException e) {
return Color.WHITE; return Color.WHITE;
} }

View File

@ -48,12 +48,15 @@ import java.util.List;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils; import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
import net.sourceforge.plantuml.ugraphic.UAntiAliasing; import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d; import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
public class EmptyImageBuilder { public class EmptyImageBuilder {
private final BufferedImage im; private final BufferedImage im;
private final Graphics2D g2d; private final Graphics2D g2d;
private final Color background;
public EmptyImageBuilder(String watermark, double width, double height, Color background) { public EmptyImageBuilder(String watermark, double width, double height, Color background) {
this(watermark, (int) width, (int) height, background); this(watermark, (int) width, (int) height, background);
@ -68,6 +71,7 @@ public class EmptyImageBuilder {
Log.info("Height too large " + height + ". You should set PLANTUML_LIMIT_SIZE"); Log.info("Height too large " + height + ". You should set PLANTUML_LIMIT_SIZE");
height = GraphvizUtils.getenvImageLimit(); height = GraphvizUtils.getenvImageLimit();
} }
this.background = background;
Log.info("Creating image " + width + "x" + height); Log.info("Creating image " + width + "x" + height);
im = new BufferedImage(width, height, getType(background)); im = new BufferedImage(width, height, getType(background));
g2d = im.createGraphics(); g2d = im.createGraphics();
@ -161,7 +165,8 @@ public class EmptyImageBuilder {
} }
public UGraphicG2d getUGraphicG2d() { public UGraphicG2d getUGraphicG2d() {
final UGraphicG2d result = new UGraphicG2d(new ColorMapperIdentity(), g2d, 1.0); final HColor back = new HColorSimple(background, false);
final UGraphicG2d result = new UGraphicG2d(back, new ColorMapperIdentity(), g2d, 1.0);
result.setBufferedImage(im); result.setBufferedImage(im);
return result; return result;
} }

View File

@ -194,5 +194,6 @@ public interface ISkinParam extends ISkinSimple {
public LengthAdjust getlengthAdjust(); public LengthAdjust getlengthAdjust();
public void assumeTransparent(ThemeStyle style);
} }

View File

@ -333,8 +333,8 @@ public class SkinParam implements ISkinParam {
checkStereotype(stereotype); checkStereotype(stereotype);
for (String s : stereotype.getMultipleLabels()) { for (String s : stereotype.getMultipleLabels()) {
final String value2 = getValue(param.name() + "color" + "<<" + s + ">>"); final String value2 = getValue(param.name() + "color" + "<<" + s + ">>");
if (value2 != null && getIHtmlColorSet().getColorOrWhite(value2) != null) { if (value2 != null && getIHtmlColorSet().getColorOrWhite(themeStyle, value2) != null) {
return getIHtmlColorSet().getColorOrWhite(value2); return getIHtmlColorSet().getColorOrWhite(themeStyle, value2);
} }
} }
} }
@ -347,12 +347,12 @@ public class SkinParam implements ISkinParam {
return HColorUtils.transparent(); return HColorUtils.transparent();
} }
if (param == ColorParam.background) { if (param == ColorParam.background) {
return getIHtmlColorSet().getColorOrWhite(value); return getIHtmlColorSet().getColorOrWhite(themeStyle, value);
} }
assert param != ColorParam.background; assert param != ColorParam.background;
// final boolean acceptTransparent = param == ColorParam.background // final boolean acceptTransparent = param == ColorParam.background
// || param == ColorParam.sequenceGroupBodyBackground || param == ColorParam.sequenceBoxBackground; // || param == ColorParam.sequenceGroupBodyBackground || param == ColorParam.sequenceBoxBackground;
return getIHtmlColorSet().getColorOrWhite(value, getBackgroundColor(false)); return getIHtmlColorSet().getColorOrWhite(themeStyle, value, getBackgroundColor(false));
} }
public char getCircledCharacter(Stereotype stereotype) { public char getCircledCharacter(Stereotype stereotype) {
@ -371,14 +371,14 @@ public class SkinParam implements ISkinParam {
checkStereotype(stereotype); checkStereotype(stereotype);
final String value2 = getValue(param.name() + "color" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR)); final String value2 = getValue(param.name() + "color" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null) { if (value2 != null) {
return new Colors(value2, getIHtmlColorSet(), param.getColorType()); return new Colors(themeStyle, value2, getIHtmlColorSet(), param.getColorType());
} }
} }
final String value = getValue(getParamName(param, false)); final String value = getValue(getParamName(param, false));
if (value == null) { if (value == null) {
return Colors.empty(); return Colors.empty();
} }
return new Colors(value, getIHtmlColorSet(), param.getColorType()); return new Colors(themeStyle, value, getIHtmlColorSet(), param.getColorType());
} }
private String getParamName(ColorParam param, boolean clickable) { private String getParamName(ColorParam param, boolean clickable) {
@ -459,7 +459,7 @@ public class SkinParam implements ISkinParam {
if (value == null) { if (value == null) {
return null; return null;
} }
return getIHtmlColorSet().getColorOrWhite(value); return getIHtmlColorSet().getColorOrWhite(themeStyle, value);
} }
private String getFirstValueNonNullWithSuffix(String suffix, FontParam... param) { private String getFirstValueNonNullWithSuffix(String suffix, FontParam... param) {
@ -1066,8 +1066,8 @@ public class SkinParam implements ISkinParam {
public SplitParam getSplitParam() { public SplitParam getSplitParam() {
final String border = getValue("pageBorderColor"); final String border = getValue("pageBorderColor");
final String external = getValue("pageExternalColor"); final String external = getValue("pageExternalColor");
final HColor borderColor = border == null ? null : getIHtmlColorSet().getColorOrWhite(border); final HColor borderColor = border == null ? null : getIHtmlColorSet().getColorOrWhite(themeStyle, border);
final HColor externalColor = external == null ? null : getIHtmlColorSet().getColorOrWhite(external); final HColor externalColor = external == null ? null : getIHtmlColorSet().getColorOrWhite(themeStyle, external);
int margin = getAsInt("pageMargin", 0); int margin = getAsInt("pageMargin", 0);
return new SplitParam(borderColor, externalColor, margin); return new SplitParam(borderColor, externalColor, margin);
} }
@ -1092,7 +1092,7 @@ public class SkinParam implements ISkinParam {
if (value == null) { if (value == null) {
return null; return null;
} }
return getIHtmlColorSet().getColorOrWhite(value, null); return getIHtmlColorSet().getColorOrWhite(themeStyle, value, null);
} }
public double getPadding() { public double getPadding() {
@ -1162,8 +1162,9 @@ public class SkinParam implements ISkinParam {
if (padding == 0 && margin == 0 && borderColor == null && backgroundColor == null) { if (padding == 0 && margin == 0 && borderColor == null && backgroundColor == null) {
return Padder.NONE; return Padder.NONE;
} }
final HColor border = borderColor == null ? null : getIHtmlColorSet().getColorOrWhite(borderColor); final HColor border = borderColor == null ? null : getIHtmlColorSet().getColorOrWhite(themeStyle, borderColor);
final HColor background = backgroundColor == null ? null : getIHtmlColorSet().getColorOrWhite(backgroundColor); final HColor background = backgroundColor == null ? null
: getIHtmlColorSet().getColorOrWhite(themeStyle, backgroundColor);
final double roundCorner = getRoundCorner(CornerParam.DEFAULT, null); final double roundCorner = getRoundCorner(CornerParam.DEFAULT, null);
return Padder.NONE.withMargin(margin).withPadding(padding).withBackgroundColor(background) return Padder.NONE.withMargin(margin).withPadding(padding).withBackgroundColor(background)
.withBorderColor(border).withRoundCorner(roundCorner); .withBorderColor(border).withRoundCorner(roundCorner);
@ -1206,4 +1207,14 @@ public class SkinParam implements ISkinParam {
return LengthAdjust.defaultValue(); return LengthAdjust.defaultValue();
} }
private ThemeStyle themeStyle = ThemeStyle.LIGHT;
public void assumeTransparent(ThemeStyle style) {
this.themeStyle = style;
}
public ThemeStyle getThemeStyle() {
return themeStyle;
}
} }

View File

@ -378,4 +378,12 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.getlengthAdjust(); return skinParam.getlengthAdjust();
} }
public void assumeTransparent(ThemeStyle style) {
skinParam.assumeTransparent(style);
}
public ThemeStyle getThemeStyle() {
return skinParam.getThemeStyle();
}
} }

View File

@ -43,4 +43,6 @@ public interface SpriteContainer extends SvgCharSizeHack {
public Guillemet guillemet(); public Guillemet guillemet();
public ThemeStyle getThemeStyle();
} }

View File

@ -102,4 +102,8 @@ public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
return s; return s;
} }
public ThemeStyle getThemeStyle() {
return ThemeStyle.LIGHT;
}
} }

View File

@ -0,0 +1,42 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml;
public enum ThemeStyle {
DARK, LIGHT
}

View File

@ -50,8 +50,14 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder; import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public abstract class TitledDiagram extends AbstractPSystem implements Diagram, Annotated { public abstract class TitledDiagram extends AbstractPSystem implements Diagram, Annotated {
@ -248,4 +254,21 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
public ImageBuilder createImageBuilder(FileFormatOption fileFormatOption) throws IOException { public ImageBuilder createImageBuilder(FileFormatOption fileFormatOption) throws IOException {
return super.createImageBuilder(fileFormatOption).styled(this); return super.createImageBuilder(fileFormatOption).styled(this);
} }
public HColor calculateBackColor() {
if (UseStyle.useBetaStyle()) {
final Style style = StyleSignature.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName())
.getMergedStyle(this.getSkinParam().getCurrentStyleBuilder());
HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(),
this.getSkinParam().getIHtmlColorSet());
if (backgroundColor == null) {
backgroundColor = HColorUtils.transparent();
}
return backgroundColor;
}
return this.getSkinParam().getBackgroundColor(false);
}
} }

View File

@ -133,7 +133,7 @@ public class CommandIf extends SingleLineCommand2<ActivityDiagram> {
} }
} }
link.applyStyle(arg.getLazzy("ARROW_STYLE", 0)); link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -122,7 +122,8 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final IEntity entity1 = getEntity(diagram, arg, true); final IEntity entity1 = getEntity(diagram, arg, true);
if (entity1 == null) { if (entity1 == null) {
return CommandExecutionResult.error("No such activity"); return CommandExecutionResult.error("No such activity");
@ -133,7 +134,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
if (arg.get("BACKCOLOR", 0) != null) { if (arg.get("BACKCOLOR", 0) != null) {
String s = arg.get("BACKCOLOR", 0); String s = arg.get("BACKCOLOR", 0);
entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, entity1.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(s)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
} }
final IEntity entity2 = getEntity(diagram, arg, false); final IEntity entity2 = getEntity(diagram, arg, false);
@ -143,7 +144,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
if (arg.get("BACKCOLOR2", 0) != null) { if (arg.get("BACKCOLOR2", 0) != null) {
String s = arg.get("BACKCOLOR2", 0); String s = arg.get("BACKCOLOR2", 0);
entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, entity2.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(s)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
} }
if (arg.get("STEREOTYPE2", 0) != null) { if (arg.get("STEREOTYPE2", 0) != null) {
entity2.setStereotype(new Stereotype(arg.get("STEREOTYPE2", 0))); entity2.setStereotype(new Stereotype(arg.get("STEREOTYPE2", 0)));
@ -181,7 +182,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
link.setUrl(urlLink); link.setUrl(urlLink);
} }
link.applyStyle(arg.getLazzy("ARROW_STYLE", 0)); link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -115,7 +115,8 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
} }
@Override @Override
protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines)
throws NoSuchColorException {
lines = lines.trim(); lines = lines.trim();
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
@ -129,8 +130,8 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
} }
final String stringColor = line0.get("BACKCOLOR", 0); final String stringColor = line0.get("BACKCOLOR", 0);
if (stringColor != null) { if (stringColor != null) {
entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
diagram.getSkinParam().getIHtmlColorSet().getColor(stringColor)); .getColor(diagram.getSkinParam().getThemeStyle(), stringColor));
} }
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
@ -200,7 +201,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
if (lineLast.get(4) != null) { if (lineLast.get(4) != null) {
String s = lineLast.get(4); String s = lineLast.get(4);
entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, entity2.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(s)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
} }
final String arrowBody1 = CommandLinkClass.notNull(line0.get("ARROW_BODY1", 0)); final String arrowBody1 = CommandLinkClass.notNull(line0.get("ARROW_BODY1", 0));
@ -230,7 +231,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
link.setUrl(urlLink); link.setUrl(urlLink);
} }
link.applyStyle(line0.getLazzy("ARROW_STYLE", 0)); link.applyStyle(diagram.getSkinParam().getThemeStyle(), line0.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -85,7 +85,8 @@ public class CommandPartition extends SingleLineCommand2<ActivityDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0)); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0));
final Ident ident = diagram.buildLeafIdent(idShort); final Ident ident = diagram.buildLeafIdent(idShort);
final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort); final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort);
@ -94,7 +95,8 @@ public class CommandPartition extends SingleLineCommand2<ActivityDiagram> {
NamespaceStrategy.SINGLE); NamespaceStrategy.SINGLE);
final IEntity p = diagram.getCurrentGroup(); final IEntity p = diagram.getCurrentGroup();
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
if (colors.isEmpty() == false) { if (colors.isEmpty() == false) {
p.setColors(colors); p.setColors(colors);
} }

View File

@ -96,7 +96,8 @@ public class Branch {
if (UseStyle.useBetaStyle()) { 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(styleBuilder.getSkinParam().getIHtmlColorSet()) ? style.value(PName.BackGroundColor).asColor(styleBuilder.getSkinParam().getThemeStyle(),
styleBuilder.getSkinParam().getIHtmlColorSet())
: color; : color;
} else { } else {
this.color = color; this.color = color;

View File

@ -113,7 +113,8 @@ public class CommandActivity3 extends SingleLineCommand2<ActivityDiagram3> {
url = urlBuilder.getUrl(arg.get("URL", 0)); url = urlBuilder.getUrl(arg.get("URL", 0));
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String stereo = arg.get("STEREO", 0); final String stereo = arg.get("STEREO", 0);
Stereotype stereotype = null; Stereotype stereotype = null;
if (stereo != null) { if (stereo != null) {

View File

@ -77,8 +77,11 @@ public class CommandActivityLong3 extends CommandMultilines2<ActivityDiagram3> {
protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) throws NoSuchColorException {
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
// final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)); diagram.getSkinParam().getIHtmlColorSet());
// final HtmlColor color =
// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR",
// 0));
final BoxStyle style = BoxStyle.fromChar(lines.getLastChar()); final BoxStyle style = BoxStyle.fromChar(lines.getLastChar());
lines = lines.removeStartingAndEnding(line0.get("DATA", 0), 1); lines = lines.removeStartingAndEnding(line0.get("DATA", 0), 1);
diagram.addActivity(lines.toDisplay(), style, null, colors, null); diagram.addActivity(lines.toDisplay(), style, null, colors, null);

View File

@ -62,9 +62,11 @@ public class CommandCircleSpot3 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
String s = arg.get("COLOR", 0); String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
diagram.addSpot(arg.get("SPOT", 0), color); diagram.addSpot(arg.get("SPOT", 0), color);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -96,9 +96,11 @@ public class CommandElseIf2 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: 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) {

View File

@ -79,9 +79,11 @@ public class CommandIf2 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: 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) {

View File

@ -76,9 +76,11 @@ public class CommandIf4 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: 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) {

View File

@ -63,9 +63,11 @@ public class CommandLink3 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
if (color != null) { if (color != null) {
diagram.setColorNextArrow(Rainbow.fromColor(color, null)); diagram.setColorNextArrow(Rainbow.fromColor(color, null));
} }

View File

@ -76,8 +76,10 @@ public class CommandNote3 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); throws NoSuchColorException {
final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final Display note = Display.getWithNewlines(arg.get("NOTE", 0)); final Display note = Display.getWithNewlines(arg.get("NOTE", 0));
final NotePosition position = NotePosition.defaultLeft(arg.get("POSITION", 0)); final NotePosition position = NotePosition.defaultLeft(arg.get("POSITION", 0));
final NoteType type = NoteType.defaultType(arg.get("TYPE", 0)); final NoteType type = NoteType.defaultType(arg.get("TYPE", 0));

View File

@ -68,15 +68,18 @@ public class CommandNoteLong3 extends CommandMultilines2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines)
// final List<? extends CharSequence> in = StringUtils.removeEmptyColumns2(lines.subList(1, lines.size() - 1)); throws NoSuchColorException {
// final List<? extends CharSequence> in =
// StringUtils.removeEmptyColumns2(lines.subList(1, lines.size() - 1));
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
final NotePosition position = NotePosition.defaultLeft(line0.get("POSITION", 0)); final NotePosition position = NotePosition.defaultLeft(line0.get("POSITION", 0));
final NoteType type = NoteType.defaultType(line0.get("TYPE", 0)); final NoteType type = NoteType.defaultType(line0.get("TYPE", 0));
final Display note = lines.toDisplay(); final Display note = lines.toDisplay();
final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
diagram.getSkinParam().getIHtmlColorSet());
return diagram.addNote(note, position, type, colors); return diagram.addNote(note, position, type, colors);
} }

View File

@ -73,7 +73,7 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexOptional(// new RegexOptional(//
new RegexConcat( // new RegexConcat( //
color("BACK1").getRegex(),// color("BACK1").getRegex(), //
RegexLeaf.spaceOneOrMore())), // RegexLeaf.spaceOneOrMore())), //
new RegexLeaf("NAME", "([%g][^%g]+[%g]|\\S+)"), // new RegexLeaf("NAME", "([%g][^%g]+[%g]|\\S+)"), //
new RegexOptional(// new RegexOptional(//
@ -119,19 +119,20 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String partitionTitle = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0)); final String partitionTitle = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0));
final String b1 = arg.get("BACK1", 0); final String b1 = arg.get("BACK1", 0);
final Colors colors = color(b1 == null ? "BACK2" : "BACK1").getColor(arg, final Colors colors = color(b1 == null ? "BACK2" : "BACK1").getColor(diagram.getSkinParam().getThemeStyle(),
diagram.getSkinParam().getIHtmlColorSet()); arg, diagram.getSkinParam().getIHtmlColorSet());
final USymbol symbol = getUSymbol(arg.get("TYPE", 0)); final USymbol symbol = getUSymbol(arg.get("TYPE", 0));
final String stereo = arg.get("STEREO", 0); final String stereo = arg.get("STEREO", 0);
final Stereotype stereotype = stereo == null ? null : new Stereotype(stereo); final Stereotype stereotype = stereo == null ? null : new Stereotype(stereo);
final HColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol), final HColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol), stereotype,
stereotype, false); false);
HColor backColor; HColor backColor;
if (backColorInSkinparam == null) { if (backColorInSkinparam == null) {
backColor = colors.getColor(ColorType.BACK); backColor = colors.getColor(ColorType.BACK);
@ -148,12 +149,13 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
double roundCorner = symbol.getSkinParameter().getRoundCorner(diagram.getSkinParam(), stereotype); double roundCorner = symbol.getSkinParameter().getRoundCorner(diagram.getSkinParam(), stereotype);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style stylePartition = getDefaultStyleDefinitionPartition().getMergedStyle( final Style stylePartition = getDefaultStyleDefinitionPartition()
diagram.getSkinParam().getCurrentStyleBuilder()); .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder());
borderColor = stylePartition.value(PName.LineColor).asColor(diagram.getSkinParam().getIHtmlColorSet()); borderColor = stylePartition.value(PName.LineColor).asColor(diagram.getSkinParam().getThemeStyle(),
diagram.getSkinParam().getIHtmlColorSet());
backColor = colors.getColor(ColorType.BACK); backColor = colors.getColor(ColorType.BACK);
if (backColor == null) { if (backColor == null) {
backColor = stylePartition.value(PName.BackGroundColor).asColor( backColor = stylePartition.value(PName.BackGroundColor).asColor(diagram.getSkinParam().getThemeStyle(),
diagram.getSkinParam().getIHtmlColorSet()); diagram.getSkinParam().getIHtmlColorSet());
} }
titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet()); titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet());

View File

@ -77,9 +77,11 @@ public class CommandRepeat3 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
final BoxStyle boxStyle; final BoxStyle boxStyle;
final String styleString = arg.get("STYLE", 0); final String styleString = arg.get("STYLE", 0);
@ -88,7 +90,8 @@ public class CommandRepeat3 extends SingleLineCommand2<ActivityDiagram3> {
} else { } else {
boxStyle = BoxStyle.fromChar(styleString.charAt(0)); boxStyle = BoxStyle.fromChar(styleString.charAt(0));
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String stereo = arg.get("STEREO", 0); final String stereo = arg.get("STEREO", 0);
if (stereo != null) { if (stereo != null) {
final Stereotype stereotype = new Stereotype(stereo); final Stereotype stereotype = new Stereotype(stereo);

View File

@ -65,9 +65,11 @@ public class CommandSwimlane extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
final String name = arg.get("SWIMLANE", 0); final String name = arg.get("SWIMLANE", 0);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
return diagram.swimlane(name, color, label); return diagram.swimlane(name, color, label);

View File

@ -73,9 +73,11 @@ public class CommandSwimlane2 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
final String name = arg.get("SWIMLANE", 0); final String name = arg.get("SWIMLANE", 0);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
return diagram.swimlane(name, color, label); return diagram.swimlane(name, color, label);

View File

@ -67,9 +67,11 @@ public class CommandSwitch extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: 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) {

View File

@ -73,9 +73,11 @@ public class CommandWhile3 extends SingleLineCommand2<ActivityDiagram3> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor color = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
diagram.doWhile(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("YES", 0)), color); diagram.doWhile(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("YES", 0)), color);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -88,7 +88,7 @@ public class FtileFactoryDelegator implements FtileFactory {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow() final Style style = getDefaultStyleDefinitionArrow()
.getMergedStyle(skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
return Rainbow.build(style, skinParam().getIHtmlColorSet()); return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
color = Rainbow.build(skinParam()); color = Rainbow.build(skinParam());
} }
@ -99,7 +99,7 @@ public class FtileFactoryDelegator implements FtileFactory {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow() final Style style = getDefaultStyleDefinitionArrow()
.getMergedStyle(skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
return Rainbow.build(style, skinParam().getIHtmlColorSet()); return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
color = Rainbow.build(skinParam()); color = Rainbow.build(skinParam());
} }
@ -115,7 +115,7 @@ public class FtileFactoryDelegator implements FtileFactory {
final FontConfiguration fontConfiguration; final FontConfiguration fontConfiguration;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getIHtmlColorSet()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);
} }

View File

@ -100,7 +100,7 @@ public class LaneDivider extends AbstractTextBlock {
} }
UStroke thickness = Rose.getStroke(skinParam, LineParam.swimlaneBorder, 2); UStroke thickness = Rose.getStroke(skinParam, LineParam.swimlaneBorder, 2);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
color = getStyle().value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); color = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
thickness = getStyle().getStroke(); 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

@ -229,7 +229,8 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT;
FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.SWIMLANE_TITLE, null); FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.SWIMLANE_TITLE, null);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
fontConfiguration = getStyle().getFontConfiguration(skinParam.getIHtmlColorSet()); fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
} }
LineBreakStrategy wrap = getWrap(); LineBreakStrategy wrap = getWrap();
if (wrap.isAuto()) { if (wrap.isAuto()) {
@ -303,7 +304,8 @@ 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); HColor color = skinParam.getHtmlColor(ColorParam.swimlaneTitleBackground, null, false);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
color = getStyle().value(PName.BackGroundColor).asColor(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());

View File

@ -137,7 +137,7 @@ public abstract class AbstractParallelFtilesBuilder {
final FontConfiguration fontConfiguration; final FontConfiguration fontConfiguration;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getIHtmlColorSet()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);
} }

View File

@ -82,20 +82,22 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
: FontParam.ARROW; : FontParam.ARROW;
final FontConfiguration fcArrow; final FontConfiguration fcArrow;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle( final Style styleArrow = getDefaultStyleDefinitionArrow()
skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style styleDiamond = getDefaultStyleDefinitionDiamond().getMergedStyle( final Style styleDiamond = getDefaultStyleDefinitionDiamond()
skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getIHtmlColorSet()); borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
backColor = branch0.getColor() == null ? styleDiamond.value(PName.BackGroundColor).asColor( skinParam().getIHtmlColorSet());
skinParam().getIHtmlColorSet()) : branch0.getColor(); backColor = branch0.getColor() == null ? styleDiamond.value(PName.BackGroundColor)
arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet()); .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor();
fcTest = styleDiamond.getFontConfiguration(skinParam().getIHtmlColorSet()); arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
fcArrow = styleArrow.getFontConfiguration(skinParam().getIHtmlColorSet()); fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
fcArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(), backColor = branch0.getColor() == null
ColorParam.activityDiamondBackground) : branch0.getColor(); ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: branch0.getColor();
arrowColor = Rainbow.build(skinParam()); arrowColor = Rainbow.build(skinParam());
fcTest = new FontConfiguration(skinParam(), testParam, null) fcTest = new FontConfiguration(skinParam(), testParam, null)
.changeColor(fontColor(FontParam.ACTIVITY_DIAMOND)); .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));

View File

@ -90,11 +90,13 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
.getMergedStyle(skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style styleDiamond = getDefaultStyleDefinitionDiamond() final Style styleDiamond = getDefaultStyleDefinitionDiamond()
.getMergedStyle(skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getIHtmlColorSet()); borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
diamondColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getIHtmlColorSet()); skinParam().getIHtmlColorSet());
arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet()); diamondColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(),
fcDiamond = styleDiamond.getFontConfiguration(skinParam().getIHtmlColorSet()); skinParam().getIHtmlColorSet());
fcArrow = styleArrow.getFontConfiguration(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 { } else {
borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
// diamondColor = color == null ? getRose().getHtmlColor(skinParam(), // diamondColor = color == null ? getRose().getHtmlColor(skinParam(),

View File

@ -87,11 +87,13 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
.getMergedStyle(skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
final Style styleDiamond = getDefaultStyleDefinitionDiamond() final Style styleDiamond = getDefaultStyleDefinitionDiamond()
.getMergedStyle(skinParam().getCurrentStyleBuilder()); .getMergedStyle(skinParam().getCurrentStyleBuilder());
borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getIHtmlColorSet()); borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam().getThemeStyle(),
backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getIHtmlColorSet()); skinParam().getIHtmlColorSet());
arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet()); backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(),
fontArrow = styleArrow.getFontConfiguration(skinParam().getIHtmlColorSet()); skinParam().getIHtmlColorSet());
fcTest = styleDiamond.getFontConfiguration(skinParam().getIHtmlColorSet()); arrowColor = Rainbow.build(styleArrow, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
fontArrow = styleArrow.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
fcTest = styleDiamond.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)

View File

@ -104,7 +104,7 @@ public class FtileGroup extends AbstractFtile {
final Style style; final Style style;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder()); style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder());
fc = style.getFontConfiguration(getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
this.shadowing = style.value(PName.Shadowing).asDouble(); this.shadowing = style.value(PName.Shadowing).asDouble();
} else { } else {
style = null; style = null;

View File

@ -113,8 +113,9 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(getIHtmlColorSet()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
borderColor = style.value(PName.LineColor).asColor(getIHtmlColorSet()); getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
} else { } else {
@ -129,8 +130,8 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
final Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)
.createSheet(note); .createSheet(note);
final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, wrapWidth, skinParam.getPadding()), this,
this, new UStroke(1)); new UStroke(1));
opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, false); opale = new Opale(shadowing, borderColor, noteBackgroundColor, text, false);
} }

View File

@ -148,9 +148,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors()); .eventuallyOverride(note.getColors());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(getIHtmlColorSet()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
borderColor = style.value(PName.LineColor).asColor(getIHtmlColorSet()); getIHtmlColorSet());
fc = style.getFontConfiguration(getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
} else { } else {

View File

@ -119,9 +119,10 @@ public class FtileWithNotes extends AbstractFtile {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors()); .eventuallyOverride(note.getColors());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(getIHtmlColorSet()); noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
borderColor = style.value(PName.LineColor).asColor(getIHtmlColorSet()); getIHtmlColorSet());
fc = style.getFontConfiguration(getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble(); shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
} else { } else {

View File

@ -138,7 +138,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
} }
@ -203,7 +203,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
} }
@ -248,8 +248,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0); final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY()); final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY());
Snake snake = Snake.create(arrowColor, Arrows.asToDown()) Snake snake = Snake.create(arrowColor, Arrows.asToDown()).ignoreForCompression();
.ignoreForCompression();
if (Display.isNull(label) == false) { if (Display.isNull(label) == false) {
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
} }
@ -305,8 +304,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final Point2D p1 = new Point2D.Double(geo.getLeft(), barHeight + geo.getOutY()); final Point2D p1 = new Point2D.Double(geo.getLeft(), barHeight + geo.getOutY());
final Point2D p2 = new Point2D.Double(geo.getLeft(), justBeforeBar2); final Point2D p2 = new Point2D.Double(geo.getLeft(), justBeforeBar2);
Snake snake = Snake.create(arrowColor, Arrows.asToDown()) Snake snake = Snake.create(arrowColor, Arrows.asToDown()).ignoreForCompression();
.ignoreForCompression();
if (Display.isNull(label) == false) { if (Display.isNull(label) == false) {
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment()); snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
} }

View File

@ -82,7 +82,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
} }
@ -114,7 +114,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final Rainbow def; final Rainbow def;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
def = Rainbow.build(style, skinParam().getIHtmlColorSet()); def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
def = Rainbow.build(skinParam()); def = Rainbow.build(skinParam());
} }
@ -126,7 +126,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
return FtileUtils.addConnection(result, conns); return FtileUtils.addConnection(result, conns);
} }
class ConnectionHorizontalThenVertical extends AbstractConnection /* implements ConnectionTranslatable */{ class ConnectionHorizontalThenVertical extends AbstractConnection /* implements ConnectionTranslatable */ {
private final Rainbow arrowColor; private final Rainbow arrowColor;
private final UTranslate diamondTranslate; private final UTranslate diamondTranslate;
@ -170,8 +170,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
} }
private Point2D getP2(final StringBounder stringBounder) { private Point2D getP2(final StringBounder stringBounder) {
final Point2D result = diamondTranslate.getTranslated(getFtile2().calculateDimension(stringBounder) final Point2D result = diamondTranslate
.getPointOut()); .getTranslated(getFtile2().calculateDimension(stringBounder).getPointOut());
final Dimension2D dim = getFtile2().calculateDimension(stringBounder); final Dimension2D dim = getFtile2().calculateDimension(stringBounder);
UTranslate arrival = new UTranslate(); UTranslate arrival = new UTranslate();
if (counter == 0) { if (counter == 0) {

View File

@ -81,7 +81,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final Rainbow thinColor; final Rainbow thinColor;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet()); thinColor = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
} else { } else {
thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam())); thinColor = result.getInLinkRendering().getRainbow(Rainbow.build(skinParam()));
} }
@ -100,7 +100,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final Rainbow rainbow; final Rainbow rainbow;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
rainbow = inLinkRendering.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet())); rainbow = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { } else {
rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
} }
@ -128,7 +129,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final LinkRendering inLinkRendering = tmp.getInLinkRendering(); final LinkRendering inLinkRendering = tmp.getInLinkRendering();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
rainbow = inLinkRendering.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet())); rainbow = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { } else {
rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam())); rainbow = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
} }
@ -161,7 +163,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final LinkRendering inLinkRendering = result.getInLinkRendering(); final LinkRendering inLinkRendering = result.getInLinkRendering();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
thinColor = inLinkRendering.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet())); thinColor = inLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { } else {
thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam())); thinColor = inLinkRendering.getRainbow(Rainbow.build(skinParam()));
} }
@ -186,7 +189,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final LinkRendering outLinkRendering = tmp.getOutLinkRendering(); final LinkRendering outLinkRendering = tmp.getOutLinkRendering();
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder()); Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
rainbow = outLinkRendering.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet())); rainbow = outLinkRendering
.getRainbow(Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle()));
} else { } else {
rainbow = outLinkRendering.getRainbow(Rainbow.build(skinParam())); rainbow = outLinkRendering.getRainbow(Rainbow.build(skinParam()));
} }

View File

@ -74,7 +74,6 @@ import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class VCompactFactory implements FtileFactory { public class VCompactFactory implements FtileFactory {
@ -104,7 +103,7 @@ public class VCompactFactory implements FtileFactory {
Style style = null; Style style = null;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder()); style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
color = style.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else { } else {
color = rose.getHtmlColor(skinParam, ColorParam.activityStart); color = rose.getHtmlColor(skinParam, ColorParam.activityStart);
} }
@ -117,8 +116,9 @@ public class VCompactFactory implements FtileFactory {
final HColor backgroundColor; final HColor backgroundColor;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder()); style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
borderColor = style.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
// backgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet()); // backgroundColor =
// style.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet());
backgroundColor = skinParam.getBackgroundColor(false); backgroundColor = skinParam.getBackgroundColor(false);
} else { } else {
borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd); borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
@ -140,8 +140,9 @@ public class VCompactFactory implements FtileFactory {
final HColor backgroundColor; final HColor backgroundColor;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder()); style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
borderColor = style.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
// backgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet()); // backgroundColor =
// style.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet());
backgroundColor = skinParam.getBackgroundColor(false); backgroundColor = skinParam.getBackgroundColor(false);
} else { } else {
borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd); borderColor = rose.getHtmlColor(skinParam, ColorParam.activityEnd);

View File

@ -110,12 +110,15 @@ public class ConditionalBuilder {
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
final Style styleDiamond = getDefaultStyleDefinitionDiamond() final Style styleDiamond = getDefaultStyleDefinitionDiamond()
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
this.borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); this.borderColor = styleDiamond.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
this.backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
this.arrowColor = Rainbow.fromColor(styleArrow.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()), this.backColor = styleDiamond.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
this.arrowColor = Rainbow.fromColor(
styleArrow.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()),
null); null);
this.fontTest = styleDiamond.getFontConfiguration(skinParam.getIHtmlColorSet()); this.fontTest = styleDiamond.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
this.fontArrow = styleArrow.getFontConfiguration(skinParam.getIHtmlColorSet()); this.fontArrow = styleArrow.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else { } else {
this.borderColor = borderColor; this.borderColor = borderColor;
this.backColor = backColor; this.backColor = backColor;

View File

@ -187,15 +187,16 @@ public class FtileBox extends AbstractFtile {
final FontConfiguration fc; final FontConfiguration fc;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering(Rainbow.build(styleArrow, getIHtmlColorSet())); this.inRendering = new LinkRendering(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null; Colors specBack = null;
if (skinParam instanceof SkinParamColors) { if (skinParam instanceof SkinParamColors) {
specBack = ((SkinParamColors) skinParam).getColors(); specBack = ((SkinParamColors) skinParam).getColors();
} }
style = style.eventuallyOverride(specBack); style = style.eventuallyOverride(specBack);
this.borderColor = style.value(PName.LineColor).asColor(getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = style.value(PName.BackGroundColor).asColor(getIHtmlColorSet()); this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
fc = style.getFontConfiguration(getIHtmlColorSet()); fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
horizontalAlignment = style.getHorizontalAlignment(); horizontalAlignment = style.getHorizontalAlignment();
this.padding1 = style.getPadding().getLeft(); this.padding1 = style.getPadding().getLeft();
this.padding2 = style.getPadding().getRight(); this.padding2 = style.getPadding().getRight();

View File

@ -83,8 +83,8 @@ public class FtileDiamondInside extends AbstractFtile implements Styleable {
public FtileDiamondInside(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane, public FtileDiamondInside(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label) { TextBlock label) {
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0), this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0)); TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
} }
public FtileDiamondInside withNorth(TextBlock north) { public FtileDiamondInside withNorth(TextBlock north) {
@ -112,8 +112,8 @@ public class FtileDiamondInside extends AbstractFtile implements Styleable {
super(skinParam); super(skinParam);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder());
this.borderColor = style.value(PName.LineColor).asColor(getIHtmlColorSet()); this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.backColor = style.value(PName.BackGroundColor).asColor(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 { } else {
this.backColor = backColor; this.backColor = backColor;
@ -185,7 +185,8 @@ public class FtileDiamondInside extends AbstractFtile implements Styleable {
final Dimension2D dimEast = east.calculateDimension(stringBounder); final Dimension2D dimEast = east.calculateDimension(stringBounder);
final double northHeight = north.calculateDimension(stringBounder).getHeight(); final double northHeight = north.calculateDimension(stringBounder).getHeight();
return dimDiamonAlone.incHeight(northHeight); return dimDiamonAlone.incHeight(northHeight);
// return dimDiamonAlone.incHeight(northHeight).addMarginX(dimWest.getWidth(), dimEast.getWidth()); // return dimDiamonAlone.incHeight(northHeight).addMarginX(dimWest.getWidth(),
// dimEast.getWidth());
} }
public double getEastLabelWidth(StringBounder stringBounder) { public double getEastLabelWidth(StringBounder stringBounder) {

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.braille; package net.sourceforge.plantuml.braille;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
@ -54,14 +55,14 @@ public class BrailleDrawer implements UDrawable {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(HColorSet.instance().getColorOrWhite("#F0F0F0")); ug = ug.apply(HColorSet.instance().getColorOrWhite(ThemeStyle.LIGHT, "#F0F0F0"));
for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) { for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) {
ug.apply(UTranslate.dx(x * step + spotSize + 1)).draw( ug.apply(UTranslate.dx(x * step + spotSize + 1))
ULine.vline((grid.getMaxY() - grid.getMinY()) * step)); .draw(ULine.vline((grid.getMaxY() - grid.getMinY()) * step));
} }
for (int y = grid.getMinY(); y <= grid.getMaxY(); y++) { for (int y = grid.getMinY(); y <= grid.getMaxY(); y++) {
ug.apply(UTranslate.dy(y * step + spotSize + 1)).draw( ug.apply(UTranslate.dy(y * step + spotSize + 1))
ULine.hline((grid.getMaxX() - grid.getMinX()) * step)); .draw(ULine.hline((grid.getMaxX() - grid.getMinX()) * step));
} }
ug = ug.apply(HColorUtils.BLACK).apply(HColorUtils.BLACK.bg()); ug = ug.apply(HColorUtils.BLACK).apply(HColorUtils.BLACK.bg());
for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) { for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) {

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.UText;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import static net.sourceforge.plantuml.ugraphic.ImageBuilder.plainPngBuilder; import static net.sourceforge.plantuml.ugraphic.ImageBuilder.plainPngBuilder;
@ -67,8 +68,8 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
return new UGraphicBraille(this); return new UGraphicBraille(this);
} }
public UGraphicBraille(ColorMapper colorMapper) { public UGraphicBraille(HColor defaultBackground, ColorMapper colorMapper) {
this(colorMapper, new BrailleGrid(QUANTA)); this(defaultBackground, colorMapper, new BrailleGrid(QUANTA));
} }
private UGraphicBraille(UGraphicBraille other) { private UGraphicBraille(UGraphicBraille other) {
@ -97,8 +98,8 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
// svg.paintBackcolorGradient(mapper, gr); // svg.paintBackcolorGradient(mapper, gr);
// } // }
private UGraphicBraille(ColorMapper colorMapper, BrailleGrid grid) { private UGraphicBraille(HColor defaultBackground, ColorMapper colorMapper, BrailleGrid grid) {
super(colorMapper, grid); super(defaultBackground, colorMapper, grid);
this.grid = grid; this.grid = grid;
register(); register();
} }

View File

@ -124,7 +124,8 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final LeafType type = LeafType.getLeafType(StringUtils.goUpperCase(arg.get("TYPE", 0))); final LeafType type = LeafType.getLeafType(StringUtils.goUpperCase(arg.get("TYPE", 0)));
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0), final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0),
"\"([:"); "\"([:");
@ -172,10 +173,12 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
} }
entity.setCodeLine(location); entity.setCodeLine(location);
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String s = arg.get("LINECOLOR", 1); final String s = arg.get("LINECOLOR", 1);
final HColor lineColor = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor lineColor = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
if (lineColor != null) { if (lineColor != null) {
colors = colors.add(ColorType.LINE, lineColor); colors = colors.add(ColorType.LINE, lineColor);
} }

View File

@ -276,10 +276,12 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
result.addUrl(url); result.addUrl(url);
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String s = arg.get("LINECOLOR", 1); final String s = arg.get("LINECOLOR", 1);
final HColor lineColor = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor lineColor = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
if (lineColor != null) { if (lineColor != null) {
colors = colors.add(ColorType.LINE, lineColor); colors = colors.add(ColorType.LINE, lineColor);
} }

View File

@ -152,7 +152,8 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
} }
@Override @Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
if (mode == Mode.NORMAL_KEYWORD && diagram.isAllowMixing() == false) { if (mode == Mode.NORMAL_KEYWORD && diagram.isAllowMixing() == false) {
return CommandExecutionResult.error("Use 'allowmixing' if you want to mix classes and other UML elements."); return CommandExecutionResult.error("Use 'allowmixing' if you want to mix classes and other UML elements.");
} }
@ -224,8 +225,8 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
} }
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
entity.setSpecificColorTOBEREMOVED(ColorType.BACK, entity.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null
s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s)); : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -227,8 +227,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
link = link.getInv(); link = link.getInv();
} }
link.setLinkArrow(labels.getLinkArrow()); link.setLinkArrow(labels.getLinkArrow());
link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet())); link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
link.applyStyle(arg.getLazzy("ARROW_STYLE", 0)); diagram.getSkinParam().getIHtmlColorSet()));
link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0));
link.setCodeLine(location); link.setCodeLine(location);
addLink(diagram, link, arg.get("HEADER", 0)); addLink(diagram, link, arg.get("HEADER", 0));
@ -332,7 +333,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
} }
} }
private CommandExecutionResult executePackageLink(AbstractClassOrObjectDiagram diagram, RegexResult arg) throws NoSuchColorException { private CommandExecutionResult executePackageLink(AbstractClassOrObjectDiagram diagram, RegexResult arg)
throws NoSuchColorException {
final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""); final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""); final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
final IEntity cl1 = diagram.V1972() ? diagram.getGroupVerySmart(diagram.buildLeafIdent(ent1String)) final IEntity cl1 = diagram.V1972() ? diagram.getGroupVerySmart(diagram.buildLeafIdent(ent1String))
@ -354,11 +356,12 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String secondLabel = arg.get("SECOND_LABEL", 0); final String secondLabel = arg.get("SECOND_LABEL", 0);
final Link link = new Link(cl1, cl2, linkType, labelLink, queue, firstLabel, secondLabel, final Link link = new Link(cl1, cl2, linkType, labelLink, queue, firstLabel, secondLabel,
diagram.getLabeldistance(), diagram.getLabelangle(), diagram.getSkinParam().getCurrentStyleBuilder()); diagram.getLabeldistance(), diagram.getLabelangle(), diagram.getSkinParam().getCurrentStyleBuilder());
link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet())); link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet()));
diagram.resetPragmaLabel(); diagram.resetPragmaLabel();
link.applyStyle(arg.getLazzy("ARROW_STYLE", 0)); link.applyStyle(diagram.getSkinParam().getThemeStyle(), arg.getLazzy("ARROW_STYLE", 0));
addLink(diagram, link, arg.get("HEADER", 0)); addLink(diagram, link, arg.get("HEADER", 0));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -33,37 +33,36 @@
* *
* *
*/ */
package net.sourceforge.plantuml.project.command; package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.TitledDiagram;
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;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.project.GanttDiagram;
public class CommandLabelOnFirstColumn extends SingleLineCommand2<GanttDiagram> { public class CommandAssumeTransparent extends SingleLineCommand2<TitledDiagram> {
public CommandLabelOnFirstColumn() { public CommandAssumeTransparent() {
super(getRegexConcat()); super(getRegexConcat());
} }
static IRegex getRegexConcat() { static IRegex getRegexConcat() {
return RegexConcat.build(CommandLabelOnFirstColumn.class.getName(), RegexLeaf.start(), // return RegexConcat.build(CommandAssumeTransparent.class.getName(), RegexLeaf.start(), //
new RegexLeaf("labels?"), // new RegexLeaf("!assume"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("on"), // new RegexLeaf("transparent"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("first"), // new RegexLeaf("TYPE", "(dark|light)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.end()); //
new RegexLeaf("column"), RegexLeaf.end()); //
} }
@Override @Override
protected CommandExecutionResult executeArg(GanttDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(TitledDiagram system, LineLocation location, RegexResult arg) {
diagram.labelOnFirstColumn(); final String type = arg.get("TYPE", 0).toUpperCase();
system.getSkinParam().assumeTransparent(ThemeStyle.valueOf(type));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -78,7 +78,8 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort = arg.get("NAME", 0); final String idShort = arg.get("NAME", 0);
final Code code; final Code code;
final IGroup currentPackage; final IGroup currentPackage;
@ -110,7 +111,7 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
final String color = arg.get("COLOR", 0); final String color = arg.get("COLOR", 0);
if (color != null) { if (color != null) {
p.setSpecificColorTOBEREMOVED(ColorType.BACK, p.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(color)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), color));
} }
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -86,7 +86,8 @@ public class CommandNamespace2 extends SingleLineCommand2<ClassDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort = arg.get("NAME", 0); final String idShort = arg.get("NAME", 0);
final Ident ident = diagram.buildLeafIdent(idShort); final Ident ident = diagram.buildLeafIdent(idShort);
final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort); final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort);
@ -110,7 +111,7 @@ public class CommandNamespace2 extends SingleLineCommand2<ClassDiagram> {
final String color = arg.get("COLOR", 0); final String color = arg.get("COLOR", 0);
if (color != null) { if (color != null) {
p.setSpecificColorTOBEREMOVED(ColorType.BACK, p.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(color)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), color));
} }
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -81,7 +81,8 @@ public class CommandNamespaceEmpty extends SingleLineCommand2<ClassDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort = arg.get("NAME", 0); final String idShort = arg.get("NAME", 0);
final Ident idNewLong = diagram.buildLeafIdent(idShort); final Ident idNewLong = diagram.buildLeafIdent(idShort);
final Code code = diagram.V1972() ? idNewLong : diagram.buildCode(idShort); final Code code = diagram.V1972() ? idNewLong : diagram.buildCode(idShort);
@ -104,7 +105,7 @@ public class CommandNamespaceEmpty extends SingleLineCommand2<ClassDiagram> {
final String color = arg.get("COLOR", 0); final String color = arg.get("COLOR", 0);
if (color != null) { if (color != null) {
p.setSpecificColorTOBEREMOVED(ColorType.BACK, p.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(color)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), color));
} }
diagram.endGroup(); diagram.endGroup();
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -102,7 +102,8 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort; final String idShort;
/* final */String display; /* final */String display;
final String name = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0)); final String name = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0));
@ -154,7 +155,8 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
p.addUrl(url); p.addUrl(url);
} }
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
p.setColors(colors); p.setColors(colors);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -82,7 +82,8 @@ public class CommandPackageEmpty extends SingleLineCommand2<AbstractEntityDiagra
} }
@Override @Override
protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String idShort; final String idShort;
final String display; final String display;
if (arg.get("CODE", 0) == null) { if (arg.get("CODE", 0) == null) {
@ -106,7 +107,7 @@ public class CommandPackageEmpty extends SingleLineCommand2<AbstractEntityDiagra
final String color = arg.get("COLOR", 0); final String color = arg.get("COLOR", 0);
if (color != null) { if (color != null) {
p.setSpecificColorTOBEREMOVED(ColorType.BACK, p.setSpecificColorTOBEREMOVED(ColorType.BACK,
diagram.getSkinParam().getIHtmlColorSet().getColor(color)); diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), color));
} }
diagram.endGroup(); diagram.endGroup();
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -225,6 +225,7 @@ public abstract class PSystemCommandFactory extends PSystemAbstractFactory {
final protected void addCommonCommands2(List<Command> cmds) { final protected void addCommonCommands2(List<Command> cmds) {
cmds.add(new CommandNope()); cmds.add(new CommandNope());
cmds.add(new CommandPragma()); cmds.add(new CommandPragma());
cmds.add(new CommandAssumeTransparent());
cmds.add(new CommandSkinParam()); cmds.add(new CommandSkinParam());
cmds.add(new CommandSkinParamMultilines()); cmds.add(new CommandSkinParamMultilines());

View File

@ -116,7 +116,8 @@ public final class CommandFactoryNote implements SingleMultiFactoryCommand<Abstr
return "(?i)^[%s]*end[%s]?note$"; return "(?i)^[%s]*end[%s]?note$";
} }
protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines)
throws NoSuchColorException {
// StringUtils.trim(lines, false); // StringUtils.trim(lines, false);
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
@ -126,7 +127,8 @@ public final class CommandFactoryNote implements SingleMultiFactoryCommand<Abstr
}; };
} }
private CommandExecutionResult executeInternal(AbstractEntityDiagram diagram, RegexResult arg, BlocLines display) throws NoSuchColorException { private CommandExecutionResult executeInternal(AbstractEntityDiagram diagram, RegexResult arg, BlocLines display)
throws NoSuchColorException {
final String idShort = arg.get("CODE", 0); final String idShort = arg.get("CODE", 0);
final Ident ident = diagram.buildLeafIdent(idShort); final Ident ident = diagram.buildLeafIdent(idShort);
final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort); final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort);
@ -137,8 +139,8 @@ public final class CommandFactoryNote implements SingleMultiFactoryCommand<Abstr
final IEntity entity = diagram.createLeaf(ident, code, display.toDisplay(), LeafType.NOTE, null); final IEntity entity = diagram.createLeaf(ident, code, display.toDisplay(), LeafType.NOTE, null);
assert entity != null; assert entity != null;
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
entity.setSpecificColorTOBEREMOVED(ColorType.BACK, entity.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null
s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s)); : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
CommandCreateClassMultilines.addTags(entity, arg.get("TAGS", 0)); CommandCreateClassMultilines.addTags(entity, arg.get("TAGS", 0));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -99,7 +99,8 @@ public final class CommandFactoryNoteActivity implements SingleMultiFactoryComma
return "(?i)^[%s]*end[%s]?note$"; return "(?i)^[%s]*end[%s]?note$";
} }
public final CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) throws NoSuchColorException { public final CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines)
throws NoSuchColorException {
// StringUtils.trim(lines, true); // StringUtils.trim(lines, true);
final RegexResult arg = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult arg = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
@ -146,11 +147,12 @@ public final class CommandFactoryNoteActivity implements SingleMultiFactoryComma
}; };
} }
private CommandExecutionResult executeInternal(ActivityDiagram diagram, RegexResult arg, IEntity note) throws NoSuchColorException { private CommandExecutionResult executeInternal(ActivityDiagram diagram, RegexResult arg, IEntity note)
throws NoSuchColorException {
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
note.setSpecificColorTOBEREMOVED(ColorType.BACK, note.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null
s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s)); : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
IEntity activity = diagram.getLastEntityConsulted(); IEntity activity = diagram.getLastEntityConsulted();
if (activity == null) { if (activity == null) {

View File

@ -185,7 +185,8 @@ public final class CommandFactoryNoteOnEntity implements SingleMultiFactoryComma
return "(?i)^[%s]*(end[%s]?note)$"; return "(?i)^[%s]*(end[%s]?note)$";
} }
protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines)
throws NoSuchColorException {
// StringUtils.trim(lines, false); // StringUtils.trim(lines, false);
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
@ -236,7 +237,8 @@ public final class CommandFactoryNoteOnEntity implements SingleMultiFactoryComma
else else
note = diagram.createLeaf(idNewLong, diagram.buildCode(tmp), strings.toDisplay(), LeafType.NOTE, null); note = diagram.createLeaf(idNewLong, diagram.buildCode(tmp), strings.toDisplay(), LeafType.NOTE, null);
Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
diagram.getSkinParam().getIHtmlColorSet());
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {

View File

@ -102,7 +102,8 @@ public final class CommandFactoryNoteOnLink implements SingleMultiFactoryCommand
return "(?i)^end[%s]?note$"; return "(?i)^end[%s]?note$";
} }
protected CommandExecutionResult executeNow(final CucaDiagram system, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final CucaDiagram system, BlocLines lines)
throws NoSuchColorException {
final String line0 = lines.getFirst().getTrimmed().getString(); final String line0 = lines.getFirst().getTrimmed().getString();
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
@ -120,14 +121,16 @@ public final class CommandFactoryNoteOnLink implements SingleMultiFactoryCommand
return new SingleLineCommand2<CucaDiagram>(getRegexConcatSingleLine()) { return new SingleLineCommand2<CucaDiagram>(getRegexConcatSingleLine()) {
@Override @Override
protected CommandExecutionResult executeArg(final CucaDiagram system, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(final CucaDiagram system, LineLocation location,
RegexResult arg) throws NoSuchColorException {
final BlocLines note = BlocLines.getWithNewlines(arg.get("NOTE", 0)); final BlocLines note = BlocLines.getWithNewlines(arg.get("NOTE", 0));
return executeInternal(system, note, arg); return executeInternal(system, note, arg);
} }
}; };
} }
private CommandExecutionResult executeInternal(CucaDiagram diagram, BlocLines note, final RegexResult arg) throws NoSuchColorException { private CommandExecutionResult executeInternal(CucaDiagram diagram, BlocLines note, final RegexResult arg)
throws NoSuchColorException {
final Link link = diagram.getLastLink(); final Link link = diagram.getLastLink();
if (link == null) { if (link == null) {
return CommandExecutionResult.error("No link defined"); return CommandExecutionResult.error("No link defined");
@ -141,7 +144,8 @@ public final class CommandFactoryNoteOnLink implements SingleMultiFactoryCommand
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT); final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
url = urlBuilder.getUrl(arg.get("URL", 0)); url = urlBuilder.getUrl(arg.get("URL", 0));
} }
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
link.addNote(note.toDisplay(), position, colors); link.addNote(note.toDisplay(), position, colors);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -78,7 +78,7 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
color().getRegex(), // color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end() // new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end() //
); );
} }
private IRegex getRegexConcatSingleLine() { private IRegex getRegexConcatSingleLine() {
@ -127,7 +127,8 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
return "(?i)^end[%s]?(note|hnote|rnote)$"; return "(?i)^end[%s]?(note|hnote|rnote)$";
} }
protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines)
throws NoSuchColorException {
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
@ -137,7 +138,8 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
}; };
} }
private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines) throws NoSuchColorException { private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines)
throws NoSuchColorException {
// final Participant p1 = diagram.getOrCreateParticipant(StringUtils // final Participant p1 = diagram.getOrCreateParticipant(StringUtils
// .eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P1", 0))); // .eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P1", 0)));
// final Participant p2 = diagram.getOrCreateParticipant(StringUtils // final Participant p2 = diagram.getOrCreateParticipant(StringUtils
@ -151,8 +153,10 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
if (lines.size() > 0) { if (lines.size() > 0) {
final boolean tryMerge = line0.get("VMERGE", 0) != null; final boolean tryMerge = line0.get("VMERGE", 0) != null;
final Display display = diagram.manageVariable(lines.toDisplay()); final Display display = diagram.manageVariable(lines.toDisplay());
final Note note = new Note((Participant) null, (Participant) null, display, diagram.getSkinParam().getCurrentStyleBuilder()); final Note note = new Note((Participant) null, (Participant) null, display,
Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); diagram.getSkinParam().getCurrentStyleBuilder());
Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
diagram.getSkinParam().getIHtmlColorSet());
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = new Stereotype(stereotypeString); final Stereotype stereotype = new Stereotype(stereotypeString);
@ -162,7 +166,8 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
} }
note.setColors(colors); note.setColors(colors);
// note.setSpecificColorTOBEREMOVED(ColorType.BACK, // note.setSpecificColorTOBEREMOVED(ColorType.BACK,
// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0))); // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR",
// 0)));
note.setNoteStyle(NoteStyle.getNoteStyle(line0.get("STYLE", 0))); note.setNoteStyle(NoteStyle.getNoteStyle(line0.get("STYLE", 0)));
if (line0.get("URL", 0) != null) { if (line0.get("URL", 0) != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT); final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);

View File

@ -120,7 +120,8 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
return "(?i)^end[%s]?(note|hnote|rnote)$"; return "(?i)^end[%s]?(note|hnote|rnote)$";
} }
protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines)
throws NoSuchColorException {
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
@ -141,9 +142,10 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
}; };
} }
private CommandExecutionResult executeInternal(SequenceDiagram diagram, RegexResult arg, BlocLines strings) throws NoSuchColorException { private CommandExecutionResult executeInternal(SequenceDiagram diagram, RegexResult arg, BlocLines strings)
final Participant p = diagram.getOrCreateParticipant(StringUtils throws NoSuchColorException {
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("PARTICIPANT", 0))); final Participant p = diagram.getOrCreateParticipant(
StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("PARTICIPANT", 0)));
final NotePosition position = NotePosition.valueOf(StringUtils.goUpperCase(arg.get("POSITION", 0))); final NotePosition position = NotePosition.valueOf(StringUtils.goUpperCase(arg.get("POSITION", 0)));
@ -152,7 +154,8 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
final boolean parallel = arg.get("PARALLEL", 0) != null; final boolean parallel = arg.get("PARALLEL", 0) != null;
final Display display = diagram.manageVariable(strings.toDisplay()); final Display display = diagram.manageVariable(strings.toDisplay());
final Note note = new Note(p, position, display, diagram.getSkinParam().getCurrentStyleBuilder()); final Note note = new Note(p, position, display, diagram.getSkinParam().getCurrentStyleBuilder());
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String stereotypeString = arg.get("STEREO", 0); final String stereotypeString = arg.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = new Stereotype(stereotypeString); final Stereotype stereotype = new Stereotype(stereotypeString);

View File

@ -123,7 +123,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
return "(?i)^[%s]*end[%s]?note$"; return "(?i)^[%s]*end[%s]?note$";
} }
protected CommandExecutionResult executeNow(final SequenceDiagram diagram, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final SequenceDiagram diagram, BlocLines lines)
throws NoSuchColorException {
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
@ -133,7 +134,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
}; };
} }
private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines) throws NoSuchColorException { private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines)
throws NoSuchColorException {
final EventWithDeactivate m = diagram.getLastEventWithDeactivate(); final EventWithDeactivate m = diagram.getLastEventWithDeactivate();
if (m instanceof AbstractMessage || m instanceof GroupingLeaf) { if (m instanceof AbstractMessage || m instanceof GroupingLeaf) {
final NotePosition position = NotePosition.valueOf(StringUtils.goUpperCase(line0.get("POSITION", 0))); final NotePosition position = NotePosition.valueOf(StringUtils.goUpperCase(line0.get("POSITION", 0)));
@ -146,8 +148,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0)); final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0));
final Display display = diagram.manageVariable(lines.toDisplay()); final Display display = diagram.manageVariable(lines.toDisplay());
final String backcolor0 = line0.get("COLOR", 0); final String backcolor0 = line0.get("COLOR", 0);
Colors colors = Colors.empty().add(ColorType.BACK, Colors colors = Colors.empty().add(ColorType.BACK, backcolor0 == null ? null
backcolor0 == null ? null : HColorSet.instance().getColor(backcolor0)); : HColorSet.instance().getColor(diagram.getSkinParam().getThemeStyle(), backcolor0));
final Note note = new Note(display, position, style, diagram.getSkinParam().getCurrentStyleBuilder()); final Note note = new Note(display, position, style, diagram.getSkinParam().getCurrentStyleBuilder());
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {

View File

@ -86,7 +86,7 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
color().getRegex(), // color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end() // new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end() //
); );
} }
private IRegex getRegexConcatSingleLine() { private IRegex getRegexConcatSingleLine() {
@ -142,7 +142,8 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
return "(?i)^end[%s]?(note|hnote|rnote)$"; return "(?i)^end[%s]?(note|hnote|rnote)$";
} }
protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines)
throws NoSuchColorException {
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
lines = lines.subExtract(1, 1); lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
@ -152,18 +153,20 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
}; };
} }
private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines) throws NoSuchColorException { private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines)
final Participant p1 = diagram.getOrCreateParticipant(StringUtils throws NoSuchColorException {
.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P1", 0))); final Participant p1 = diagram
final Participant p2 = diagram.getOrCreateParticipant(StringUtils .getOrCreateParticipant(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P1", 0)));
.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P2", 0))); final Participant p2 = diagram
.getOrCreateParticipant(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P2", 0)));
if (lines.size() > 0) { if (lines.size() > 0) {
final boolean tryMerge = line0.get("VMERGE", 0) != null; final boolean tryMerge = line0.get("VMERGE", 0) != null;
final boolean parallel = line0.get("PARALLEL", 0) != null; final boolean parallel = line0.get("PARALLEL", 0) != null;
final Display display = diagram.manageVariable(lines.toDisplay()); final Display display = diagram.manageVariable(lines.toDisplay());
final Note note = new Note(p1, p2, display, diagram.getSkinParam().getCurrentStyleBuilder()); final Note note = new Note(p1, p2, display, diagram.getSkinParam().getCurrentStyleBuilder());
Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
diagram.getSkinParam().getIHtmlColorSet());
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = new Stereotype(stereotypeString); final Stereotype stereotype = new Stereotype(stereotypeString);
@ -173,7 +176,8 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
} }
note.setColors(colors); note.setColors(colors);
// note.setSpecificColorTOBEREMOVED(ColorType.BACK, // note.setSpecificColorTOBEREMOVED(ColorType.BACK,
// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0))); // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR",
// 0)));
note.setNoteStyle(NoteStyle.getNoteStyle(line0.get("STYLE", 0))); note.setNoteStyle(NoteStyle.getNoteStyle(line0.get("STYLE", 0)));
if (line0.get("URL", 0) != null) { if (line0.get("URL", 0) != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT); final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.creole.command; package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -48,20 +49,21 @@ import net.sourceforge.plantuml.ugraphic.color.NoSuchColorRuntimeException;
public class CommandCreoleColorAndSizeChange implements Command { public class CommandCreoleColorAndSizeChange implements Command {
private final Pattern2 pattern; private final Pattern2 pattern;
private final ThemeStyle themeStyle;
public static final String fontPattern = "\\<font(?:[%s]+size[%s]*=[%s]*[%g]?(\\d+)[%g]?|[%s]+color[%s]*=[%s]*[%g]?(#[0-9a-fA-F]{6}|\\w+)[%g]?)+[%s]*\\>"; public static final String fontPattern = "\\<font(?:[%s]+size[%s]*=[%s]*[%g]?(\\d+)[%g]?|[%s]+color[%s]*=[%s]*[%g]?(#[0-9a-fA-F]{6}|\\w+)[%g]?)+[%s]*\\>";
public static Command create() { public static Command create(ThemeStyle themeStyle) {
return new CommandCreoleColorAndSizeChange("^(?i)(" + fontPattern + "(.*?)\\</font\\>)"); return new CommandCreoleColorAndSizeChange(themeStyle, "^(?i)(" + fontPattern + "(.*?)\\</font\\>)");
} }
public static Command createEol() { public static Command createEol(ThemeStyle themeStyle) {
return new CommandCreoleColorAndSizeChange("^(?i)(" + fontPattern + "(.*))$"); return new CommandCreoleColorAndSizeChange(themeStyle, "^(?i)(" + fontPattern + "(.*))$");
} }
private CommandCreoleColorAndSizeChange(String p) { private CommandCreoleColorAndSizeChange(ThemeStyle themeStyle, String p) {
this.pattern = MyPattern.cmpile(p); this.pattern = MyPattern.cmpile(p);
this.themeStyle = themeStyle;
} }
public int matchingSize(String line) { public int matchingSize(String line) {
@ -89,7 +91,7 @@ public class CommandCreoleColorAndSizeChange implements Command {
try { try {
if (m.group(3) != null) { if (m.group(3) != null) {
final String s = m.group(3); final String s = m.group(3);
final HColor color = HColorSet.instance().getColor(s); final HColor color = HColorSet.instance().getColor(themeStyle, s);
fc2 = fc2.changeColor(color); fc2 = fc2.changeColor(color);
} }

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.creole.command; package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -49,17 +50,19 @@ import net.sourceforge.plantuml.ugraphic.color.NoSuchColorRuntimeException;
public class CommandCreoleColorChange implements Command { public class CommandCreoleColorChange implements Command {
private final Pattern2 pattern; private final Pattern2 pattern;
private final ThemeStyle themeStyle;
public static Command create() { public static Command create(ThemeStyle themeStyle) {
return new CommandCreoleColorChange("^(?i)(" + Splitter.fontColorPattern2 + "(.*?)\\</color\\>)"); return new CommandCreoleColorChange(themeStyle, "^(?i)(" + Splitter.fontColorPattern2 + "(.*?)\\</color\\>)");
} }
public static Command createEol() { public static Command createEol(ThemeStyle themeStyle) {
return new CommandCreoleColorChange("^(?i)(" + Splitter.fontColorPattern2 + "(.*)$)"); return new CommandCreoleColorChange(themeStyle, "^(?i)(" + Splitter.fontColorPattern2 + "(.*)$)");
} }
private CommandCreoleColorChange(String p) { private CommandCreoleColorChange(ThemeStyle themeStyle, String p) {
this.pattern = MyPattern.cmpile(p); this.pattern = MyPattern.cmpile(p);
this.themeStyle = themeStyle;
} }
@ -79,7 +82,7 @@ public class CommandCreoleColorChange implements Command {
final FontConfiguration fc1 = stripe.getActualFontConfiguration(); final FontConfiguration fc1 = stripe.getActualFontConfiguration();
final String s = m.group(2); final String s = m.group(2);
try { try {
final HColor color = HColorSet.instance().getColor(s); final HColor color = HColorSet.instance().getColor(themeStyle, s);
final FontConfiguration fc2 = fc1.changeColor(color); final FontConfiguration fc2 = fc1.changeColor(color);
stripe.setActualFontConfiguration(fc2); stripe.setActualFontConfiguration(fc2);
stripe.analyzeAndAdd(m.group(3)); stripe.analyzeAndAdd(m.group(3));

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.creole.command; package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -48,14 +49,16 @@ public class CommandCreoleOpenIcon implements Command {
private final Pattern2 pattern; private final Pattern2 pattern;
private final HColorSet colorSet; private final HColorSet colorSet;
private final ThemeStyle themeStyle;
private CommandCreoleOpenIcon(HColorSet colorSet, String p) { private CommandCreoleOpenIcon(ThemeStyle themeStyle, HColorSet colorSet, String p) {
this.pattern = MyPattern.cmpile(p); this.pattern = MyPattern.cmpile(p);
this.colorSet = colorSet; this.colorSet = colorSet;
this.themeStyle = themeStyle;
} }
public static Command create(HColorSet colorSet) { public static Command create(ThemeStyle themeStyle, HColorSet colorSet) {
return new CommandCreoleOpenIcon(colorSet, "^(?i)(" + Splitter.openiconPattern + ")"); return new CommandCreoleOpenIcon(themeStyle, colorSet, "^(?i)(" + Splitter.openiconPattern + ")");
} }
public int matchingSize(String line) { public int matchingSize(String line) {
@ -76,7 +79,7 @@ public class CommandCreoleOpenIcon implements Command {
final String colorName = Parser.getColor(m.group(3)); final String colorName = Parser.getColor(m.group(3));
HColor color = null; HColor color = null;
if (colorName != null) { if (colorName != null) {
color = colorSet.getColorOrWhite(colorName); color = colorSet.getColorOrWhite(themeStyle, colorName);
} }
stripe.addOpenIcon(src, scale, color); stripe.addOpenIcon(src, scale, color);
return line.substring(m.group(1).length()); return line.substring(m.group(1).length());

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.creole.command; package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -48,14 +49,16 @@ public class CommandCreoleSprite implements Command {
private final Pattern2 pattern; private final Pattern2 pattern;
private final HColorSet colorSet; private final HColorSet colorSet;
private final ThemeStyle themeStyle;
private CommandCreoleSprite(HColorSet colorSet, String p) { private CommandCreoleSprite(ThemeStyle themeStyle, HColorSet colorSet, String p) {
this.pattern = MyPattern.cmpile(p); this.pattern = MyPattern.cmpile(p);
this.colorSet = colorSet; this.colorSet = colorSet;
this.themeStyle = themeStyle;
} }
public static Command create(HColorSet colorSet) { public static Command create(ThemeStyle themeStyle, HColorSet colorSet) {
return new CommandCreoleSprite(colorSet, "^(?i)(" + Splitter.spritePattern2 + ")"); return new CommandCreoleSprite(themeStyle, colorSet, "^(?i)(" + Splitter.spritePattern2 + ")");
} }
public int matchingSize(String line) { public int matchingSize(String line) {
@ -76,7 +79,7 @@ public class CommandCreoleSprite implements Command {
final String colorName = Parser.getColor(m.group(3)); final String colorName = Parser.getColor(m.group(3));
HColor color = null; HColor color = null;
if (colorName != null) { if (colorName != null) {
color = colorSet.getColorOrWhite(colorName); color = colorSet.getColorOrWhite(themeStyle, colorName);
} }
stripe.addSprite(src, scale, color); stripe.addSprite(src, scale, color);
return line.substring(m.group(1).length()); return line.substring(m.group(1).length());

View File

@ -150,7 +150,10 @@ public final class AtomText extends AbstractAtom implements Atom {
useFontConfiguration = fontConfiguration.changeColor(textColor); useFontConfiguration = fontConfiguration.changeColor(textColor);
} }
if (textColor instanceof HColorAutomatic) { if (textColor instanceof HColorAutomatic) {
final HColor backcolor = ug.getParam().getBackcolor(); HColor backcolor = ug.getParam().getBackcolor();
if (backcolor == null) {
backcolor = ug.getDefaultBackground();
}
textColor = ((HColorAutomatic) textColor).getAppropriateColor(backcolor); textColor = ((HColorAutomatic) textColor).getAppropriateColor(backcolor);
useFontConfiguration = fontConfiguration.changeColor(textColor); useFontConfiguration = fontConfiguration.changeColor(textColor);
} }

View File

@ -153,18 +153,18 @@ public class StripeSimple implements Stripe {
this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.BACKCOLOR)); this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.BACKCOLOR));
this.commands.add(CommandCreoleSizeChange.create()); this.commands.add(CommandCreoleSizeChange.create());
this.commands.add(CommandCreoleSizeChange.createEol()); this.commands.add(CommandCreoleSizeChange.createEol());
this.commands.add(CommandCreoleColorChange.create()); this.commands.add(CommandCreoleColorChange.create(skinParam.getThemeStyle()));
this.commands.add(CommandCreoleColorChange.createEol()); this.commands.add(CommandCreoleColorChange.createEol(skinParam.getThemeStyle()));
this.commands.add(CommandCreoleColorAndSizeChange.create()); this.commands.add(CommandCreoleColorAndSizeChange.create(skinParam.getThemeStyle()));
this.commands.add(CommandCreoleColorAndSizeChange.createEol()); this.commands.add(CommandCreoleColorAndSizeChange.createEol(skinParam.getThemeStyle()));
this.commands.add(CommandCreoleExposantChange.create(FontPosition.EXPOSANT)); this.commands.add(CommandCreoleExposantChange.create(FontPosition.EXPOSANT));
this.commands.add(CommandCreoleExposantChange.create(FontPosition.INDICE)); this.commands.add(CommandCreoleExposantChange.create(FontPosition.INDICE));
this.commands.add(CommandCreoleImg.create()); this.commands.add(CommandCreoleImg.create());
this.commands.add(CommandCreoleQrcode.create()); this.commands.add(CommandCreoleQrcode.create());
this.commands.add(CommandCreoleOpenIcon.create(skinParam.getIHtmlColorSet())); this.commands.add(CommandCreoleOpenIcon.create(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()));
this.commands.add(CommandCreoleMath.create()); this.commands.add(CommandCreoleMath.create());
this.commands.add(CommandCreoleLatex.create()); this.commands.add(CommandCreoleLatex.create());
this.commands.add(CommandCreoleSprite.create(skinParam.getIHtmlColorSet())); this.commands.add(CommandCreoleSprite.create(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()));
this.commands.add(CommandCreoleSpace.create()); this.commands.add(CommandCreoleSpace.create());
this.commands.add(CommandCreoleFontFamilyChange.create()); this.commands.add(CommandCreoleFontFamilyChange.create());
this.commands.add(CommandCreoleFontFamilyChange.createEol()); this.commands.add(CommandCreoleFontFamilyChange.createEol());

View File

@ -107,7 +107,7 @@ public class StripeTable implements Stripe {
final String[] color = line.substring(idx1, idx2).split(","); final String[] color = line.substring(idx1, idx2).split(",");
if (idx < color.length) { if (idx < color.length) {
final String s = color[idx]; final String s = color[idx];
return s == null ? null : skinParam.getIHtmlColorSet().getColorOrWhite(s); return s == null ? null : skinParam.getIHtmlColorSet().getColorOrWhite(skinParam.getThemeStyle(), s);
} }
} }
return null; return null;

View File

@ -92,7 +92,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam,
Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
super(align, style == null ? new FontConfiguration(skinParam, fontParam, stereotype) super(align, style == null ? new FontConfiguration(skinParam, fontParam, stereotype)
: style.getFontConfiguration(skinParam.getIHtmlColorSet())); : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()));
this.style = style; this.style = style;
this.entity = entity; this.entity = entity;

View File

@ -154,7 +154,7 @@ public class Stereotype implements CharSequence {
local = null; local = null;
} }
final String colName = mCircleSprite.get("COLOR", 0); final String colName = mCircleSprite.get("COLOR", 0);
final HColor col = colName == null ? null : htmlColorSet.getColor(colName); final HColor col = colName == null ? null : htmlColorSet.getColorLEGACY(colName);
this.htmlColor = col == null ? HColorUtils.BLACK : col; this.htmlColor = col == null ? HColorUtils.BLACK : col;
this.spriteName = mCircleSprite.get("NAME", 0); this.spriteName = mCircleSprite.get("NAME", 0);
this.character = '\0'; this.character = '\0';
@ -166,7 +166,7 @@ public class Stereotype implements CharSequence {
local = null; local = null;
} }
final String colName = mCircleChar.get("COLOR", 0); final String colName = mCircleChar.get("COLOR", 0);
this.htmlColor = colName == null ? null : htmlColorSet.getColor(colName); this.htmlColor = colName == null ? null : htmlColorSet.getColorLEGACY(colName);
this.character = mCircleChar.get("CHAR", 0).charAt(0); this.character = mCircleChar.get("CHAR", 0).charAt(0);
this.spriteName = null; this.spriteName = null;
} }

View File

@ -40,6 +40,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.graphic.color.ColorType; 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.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -113,7 +114,7 @@ public abstract class WithLinkType {
return single; return single;
} }
public void applyStyle(String arrowStyle) { public void applyStyle(ThemeStyle themeStyle, String arrowStyle) {
if (arrowStyle == null) { if (arrowStyle == null) {
return; return;
} }
@ -121,12 +122,12 @@ public abstract class WithLinkType {
int i = 0; int i = 0;
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
final String s = st.nextToken(); final String s = st.nextToken();
applyOneStyle(s, i); applyOneStyle(themeStyle, s, i);
i++; i++;
} }
} }
private void applyOneStyle(String arrowStyle, int i) { private void applyOneStyle(ThemeStyle themeStyle, String arrowStyle, int i) {
final StringTokenizer st = new StringTokenizer(arrowStyle, ","); final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
final String s = st.nextToken(); final String s = st.nextToken();
@ -147,7 +148,7 @@ public abstract class WithLinkType {
} else if (s.startsWith("thickness=")) { } else if (s.startsWith("thickness=")) {
this.goThickness(Double.parseDouble(s.substring("thickness=".length()))); this.goThickness(Double.parseDouble(s.substring("thickness=".length())));
} else { } else {
final HColor tmp = HColorSet.instance().getColorOrWhite(s); final HColor tmp = HColorSet.instance().getColorOrWhite(themeStyle, s);
setSpecificColor(tmp, i); setSpecificColor(tmp, i);
} }
} }

View File

@ -84,7 +84,8 @@ public class CommandCreateDomain extends SingleLineCommand2<DescriptionDiagram>
} }
@Override @Override
protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
String type = arg.get("TYPE", 0); String type = arg.get("TYPE", 0);
String display = arg.getLazzy("DISPLAY", 0); String display = arg.getLazzy("DISPLAY", 0);
String codeString = arg.getLazzy("CODE", 0); String codeString = arg.getLazzy("CODE", 0);
@ -130,8 +131,8 @@ public class CommandCreateDomain extends SingleLineCommand2<DescriptionDiagram>
entity.addUrl(url); entity.addUrl(url);
} }
final String s = arg.get("COLOR", 0); final String s = arg.get("COLOR", 0);
entity.setSpecificColorTOBEREMOVED(ColorType.BACK, entity.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null
s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s)); : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s));
if (type.equalsIgnoreCase("domain")) { if (type.equalsIgnoreCase("domain")) {
if (stereotype != null && stereotype.equalsIgnoreCase("<<Machine>>")) { if (stereotype != null && stereotype.equalsIgnoreCase("<<Machine>>")) {
type = "machine"; type = "machine";

View File

@ -120,7 +120,8 @@ public class CommandArchimate extends SingleLineCommand2<DescriptionDiagram> {
} }
@Override @Override
protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String codeRaw = arg.getLazzy("CODE", 0); final String codeRaw = arg.getLazzy("CODE", 0);
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw);
@ -141,12 +142,14 @@ public class CommandArchimate extends SingleLineCommand2<DescriptionDiagram> {
entity.setDisplay(Display.getWithNewlines(display)); entity.setDisplay(Display.getWithNewlines(display));
entity.setUSymbol(USymbol.ARCHIMATE); entity.setUSymbol(USymbol.ARCHIMATE);
if (icon != null) { if (icon != null) {
entity.setStereotype(new Stereotype("<<$archimate/" + icon + ">>", diagram.getSkinParam() entity.setStereotype(
.getCircledCharacterRadius(), diagram.getSkinParam().getFont(null, false, new Stereotype("<<$archimate/" + icon + ">>", diagram.getSkinParam().getCircledCharacterRadius(),
FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet())); diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER),
diagram.getSkinParam().getIHtmlColorSet()));
} }
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
entity.setColors(colors); entity.setColors(colors);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -99,7 +99,8 @@ public class CommandArchimateMultilines extends CommandMultilines2<AbstractEntit
} }
@Override @Override
protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines)
throws NoSuchColorException {
lines = lines.trim(); lines = lines.trim();
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
final String codeRaw = line0.getLazzy("CODE", 0); final String codeRaw = line0.getLazzy("CODE", 0);
@ -117,12 +118,14 @@ public class CommandArchimateMultilines extends CommandMultilines2<AbstractEntit
entity.setDisplay(display); entity.setDisplay(display);
entity.setUSymbol(USymbol.RECTANGLE); entity.setUSymbol(USymbol.RECTANGLE);
if (icon != null) { if (icon != null) {
entity.setStereotype(new Stereotype("<<$archimate/" + icon + ">>", diagram.getSkinParam() entity.setStereotype(
.getCircledCharacterRadius(), diagram.getSkinParam().getFont(null, false, new Stereotype("<<$archimate/" + icon + ">>", diagram.getSkinParam().getCircledCharacterRadius(),
FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet())); diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER),
diagram.getSkinParam().getIHtmlColorSet()));
} }
final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
diagram.getSkinParam().getIHtmlColorSet());
entity.setColors(colors); entity.setColors(colors);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -155,7 +155,8 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
} }
@Override @Override
protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
String codeRaw = arg.getLazzy("CODE", 0); String codeRaw = arg.getLazzy("CODE", 0);
String displayRaw = arg.getLazzy("DISPLAY", 0); String displayRaw = arg.getLazzy("DISPLAY", 0);
final char codeChar = getCharEncoding(codeRaw); final char codeChar = getCharEncoding(codeRaw);
@ -261,10 +262,12 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
entity.addUrl(url); entity.addUrl(url);
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String s = arg.get("LINECOLOR", 1); final String s = arg.get("LINECOLOR", 1);
final HColor lineColor = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor lineColor = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
if (lineColor != null) { if (lineColor != null) {
colors = colors.add(ColorType.LINE, lineColor); colors = colors.add(ColorType.LINE, lineColor);
} }

View File

@ -124,7 +124,8 @@ public class CommandCreateElementMultilines extends CommandMultilines2<AbstractE
} }
@Override @Override
protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) throws NoSuchColorException { protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines)
throws NoSuchColorException {
lines = lines.trimSmart(1); lines = lines.trimSmart(1);
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
final String symbol = StringUtils.goUpperCase(line0.get("TYPE", 0)); final String symbol = StringUtils.goUpperCase(line0.get("TYPE", 0));
@ -185,7 +186,8 @@ public class CommandCreateElementMultilines extends CommandMultilines2<AbstractE
// final HColor backColor = // final HColor backColor =
// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR",
// 0)); // 0));
final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0,
diagram.getSkinParam().getIHtmlColorSet());
result.setColors(colors); result.setColors(colors);
// result.setSpecificColorTOBEREMOVED(ColorType.BACK, backColor); // result.setSpecificColorTOBEREMOVED(ColorType.BACK, backColor);

View File

@ -148,7 +148,8 @@ public class CommandCreateElementParenthesis extends SingleLineCommand2<ClassDia
} }
@Override @Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
String codeRaw = arg.getLazzy("CODE", 0); String codeRaw = arg.getLazzy("CODE", 0);
final String displayRaw = arg.getLazzy("DISPLAY", 0); final String displayRaw = arg.getLazzy("DISPLAY", 0);
final String symbol = "interface"; final String symbol = "interface";
@ -192,10 +193,12 @@ public class CommandCreateElementParenthesis extends SingleLineCommand2<ClassDia
entity.addUrl(url); entity.addUrl(url);
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
final String s = arg.get("LINECOLOR", 1); final String s = arg.get("LINECOLOR", 1);
final HColor lineColor = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final HColor lineColor = s == null ? null
: diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s);
if (lineColor != null) { if (lineColor != null) {
colors = colors.add(ColorType.LINE, lineColor); colors = colors.add(ColorType.LINE, lineColor);
} }

View File

@ -269,8 +269,9 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) { if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv(); link = link.getInv();
} }
link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet())); link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
link.applyStyle(arg.getLazzy("ARROW_STYLE", 0)); diagram.getSkinParam().getIHtmlColorSet()));
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 = new Stereotype(arg.get("STEREOTYPE", 0)); final Stereotype stereotype = new Stereotype(arg.get("STEREOTYPE", 0));
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {

View File

@ -134,7 +134,8 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
} }
@Override @Override
protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg) throws NoSuchColorException { protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final String codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0)); final String codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("CODE", 0));
final String displayRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("DISPLAY", 0)); final String displayRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.getLazzy("DISPLAY", 0));
final String display; final String display;
@ -174,7 +175,8 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
p.addUrl(url); p.addUrl(url);
} }
CommandCreateClassMultilines.addTags(p, arg.get("TAGS", 0)); CommandCreateClassMultilines.addTags(p, arg.get("TAGS", 0));
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet());
p.setColors(colors); p.setColors(colors);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -72,7 +72,7 @@ public class GraphicsPath {
final BufferedImage im = builder.getBufferedImage(); final BufferedImage im = builder.getBufferedImage();
final Graphics2D g2d = builder.getGraphics2D(); final Graphics2D g2d = builder.getGraphics2D();
final UGraphicG2d ug = new UGraphicG2d(colorMapper, g2d, 1.0); final UGraphicG2d ug = new UGraphicG2d(HColorUtils.WHITE, colorMapper, g2d, 1.0);
ug.setBufferedImage(im); ug.setBufferedImage(im);
final UMotif motif = new UMotif(path); final UMotif motif = new UMotif(path);
motif.drawHorizontal(ug.apply((UChange) HColorUtils.BLACK), 20, 20, 1); motif.drawHorizontal(ug.apply((UChange) HColorUtils.BLACK), 20, 20, 1);

View File

@ -84,7 +84,7 @@ public class SmetanaForGit {
public SmetanaForGit(UGraphic ug, ISkinParam skinParam) { public SmetanaForGit(UGraphic ug, ISkinParam skinParam) {
this.stringBounder = ug.getStringBounder(); this.stringBounder = ug.getStringBounder();
this.skinParam = skinParam; this.skinParam = skinParam;
this.ug = getStyle().applyStrokeAndLineColor(ug, skinParam.getIHtmlColorSet()); this.ug = getStyle().applyStrokeAndLineColor(ug, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
} }
private Style getStyle() { private Style getStyle() {

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -50,11 +51,11 @@ class ColorAndSizeChange implements FontChange {
private final HColor color; private final HColor color;
private final Integer size; private final Integer size;
ColorAndSizeChange(String s) { ColorAndSizeChange(ThemeStyle themeStyle, String s) {
final Matcher2 matcherColor = colorPattern.matcher(s); final Matcher2 matcherColor = colorPattern.matcher(s);
if (matcherColor.find()) { if (matcherColor.find()) {
final String s1 = matcherColor.group(1); final String s1 = matcherColor.group(1);
color = HColorSet.instance().getColorOrWhite(s1); color = HColorSet.instance().getColorOrWhite(themeStyle, s1);
} else { } else {
color = null; color = null;
} }

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -47,13 +48,13 @@ class ColorChange implements FontChange {
private final HColor color; private final HColor color;
ColorChange(String s) { ColorChange(ThemeStyle themeStyle, String s) {
final Matcher2 matcherColor = colorPattern.matcher(s); final Matcher2 matcherColor = colorPattern.matcher(s);
if (matcherColor.find() == false) { if (matcherColor.find() == false) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
final String s1 = matcherColor.group(1); final String s1 = matcherColor.group(1);
this.color = HColorSet.instance().getColorOrWhite(s1); this.color = HColorSet.instance().getColorOrWhite(themeStyle, s1);
} }
HColor getColor() { HColor getColor() {

View File

@ -91,7 +91,8 @@ public class FontConfiguration {
public FontConfiguration(ISkinParam skinParam, Style style) { public FontConfiguration(ISkinParam skinParam, Style style) {
// User getStyle().getFontConfiguration(skinParam.getIHtmlColorSet()) instead ? // User getStyle().getFontConfiguration(skinParam.getIHtmlColorSet()) instead ?
this(style.getUFont(), style.value(PName.FontColor).asColor(skinParam.getIHtmlColorSet()), this(style.getUFont(),
style.value(PName.FontColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()),
skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
} }

View File

@ -91,7 +91,7 @@ public class HtmlColorAndStyle {
HColor arrowHeadColor = null; HColor arrowHeadColor = null;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
arrowColor = style.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); arrowColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else { } else {
arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowColor; arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowColor;
arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowHeadColor; arrowColor = Rainbow.build(skinParam).getColors().get(0).arrowHeadColor;
@ -104,7 +104,7 @@ public class HtmlColorAndStyle {
style = tmpStyle; style = tmpStyle;
continue; continue;
} }
final HColor tmpColor = s == null ? null : set.getColor(s); final HColor tmpColor = s == null ? null : set.getColor(skinParam.getThemeStyle(), s);
if (tmpColor != null) { if (tmpColor != null) {
arrowColor = tmpColor; arrowColor = tmpColor;
} }

View File

@ -38,6 +38,7 @@ package net.sourceforge.plantuml.graphic;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder; import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl; import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
@ -68,7 +69,7 @@ class HtmlCommandFactory {
private Pattern2 htmlTag = MyPattern.cmpile(Splitter.htmlTag, Pattern.CASE_INSENSITIVE); private Pattern2 htmlTag = MyPattern.cmpile(Splitter.htmlTag, Pattern.CASE_INSENSITIVE);
HtmlCommand getHtmlCommand(String s) { HtmlCommand getHtmlCommand(ThemeStyle themeStyle, String s) {
if (htmlTag.matcher(s).matches() == false) { if (htmlTag.matcher(s).matches() == false) {
return new Text(s); return new Text(s);
} }
@ -88,11 +89,11 @@ class HtmlCommandFactory {
} }
if (MyPattern.mtches(s, Splitter.fontPattern)) { if (MyPattern.mtches(s, Splitter.fontPattern)) {
return new ColorAndSizeChange(s); return new ColorAndSizeChange(themeStyle, s);
} }
if (MyPattern.mtches(s, Splitter.fontColorPattern2)) { if (MyPattern.mtches(s, Splitter.fontColorPattern2)) {
return new ColorChange(s); return new ColorChange(themeStyle, s);
} }
if (MyPattern.mtches(s, Splitter.fontSizePattern2)) { if (MyPattern.mtches(s, Splitter.fontSizePattern2)) {

View File

@ -41,6 +41,7 @@ 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.ThemeStyle;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
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;
@ -85,8 +86,8 @@ public class Rainbow {
return fromColor(arrow, arrowHead); return fromColor(arrow, arrowHead);
} }
public static Rainbow build(Style style, HColorSet set) { public static Rainbow build(Style style, HColorSet set, ThemeStyle themeStyle) {
final HColor color = style.value(PName.LineColor).asColor(set); final HColor color = style.value(PName.LineColor).asColor(themeStyle, set);
return fromColor(color, null); return fromColor(color, null);
} }
@ -106,7 +107,8 @@ public class Rainbow {
return result; return result;
} }
public static Rainbow build(ISkinParam skinParam, String colorString, int colorArrowSeparationSpace) throws NoSuchColorException { public static Rainbow build(ISkinParam skinParam, String colorString, int colorArrowSeparationSpace)
throws NoSuchColorException {
if (colorString == null) { if (colorString == null) {
return Rainbow.none(); return Rainbow.none();
} }

View File

@ -76,7 +76,7 @@ class SingleLine extends AbstractTextBlock implements Line {
this.horizontalAlignment = horizontalAlignment; this.horizontalAlignment = horizontalAlignment;
final Splitter lineSplitter = new Splitter(text); final Splitter lineSplitter = new Splitter(text);
for (HtmlCommand cmd : lineSplitter.getHtmlCommands(false)) { for (HtmlCommand cmd : lineSplitter.getHtmlCommands(spriteContainer.getThemeStyle(), false)) {
if (cmd instanceof Text) { if (cmd instanceof Text) {
final String s = ((Text) cmd).getText(); final String s = ((Text) cmd).getText();
blocs.add(new TileText(s, fontConfiguration, null)); blocs.add(new TileText(s, fontConfiguration, null));
@ -111,13 +111,16 @@ class SingleLine extends AbstractTextBlock implements Line {
// private double maxDeltaY(Graphics2D g2d) { // private double maxDeltaY(Graphics2D g2d) {
// double result = 0; // double result = 0;
// final Dimension2D dim = calculateDimension(StringBounderUtils.asStringBounder(g2d)); // final Dimension2D dim =
// calculateDimension(StringBounderUtils.asStringBounder(g2d));
// for (TextBlock b : blocs) { // for (TextBlock b : blocs) {
// if (b instanceof TileText == false) { // if (b instanceof TileText == false) {
// continue; // continue;
// } // }
// final Dimension2D dimBloc = b.calculateDimension(StringBounderUtils.asStringBounder(g2d)); // final Dimension2D dimBloc =
// final double deltaY = dim.getHeight() - dimBloc.getHeight() + ((TileText) b).getFontSize2D(); // b.calculateDimension(StringBounderUtils.asStringBounder(g2d));
// final double deltaY = dim.getHeight() - dimBloc.getHeight() + ((TileText)
// b).getFontSize2D();
// result = Math.max(result, deltaY); // result = Math.max(result, deltaY);
// } // }
// return result; // return result;

View File

@ -43,6 +43,7 @@ import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -145,11 +146,11 @@ public class Splitter {
return s.replaceAll(htmlTag, ""); return s.replaceAll(htmlTag, "");
} }
public List<HtmlCommand> getHtmlCommands(boolean newLineAlone) { public List<HtmlCommand> getHtmlCommands(ThemeStyle themeStyle, boolean newLineAlone) {
final HtmlCommandFactory factory = new HtmlCommandFactory(); final HtmlCommandFactory factory = new HtmlCommandFactory();
final List<HtmlCommand> result = new ArrayList<HtmlCommand>(); final List<HtmlCommand> result = new ArrayList<HtmlCommand>();
for (String s : getSplittedInternal()) { for (String s : getSplittedInternal()) {
final HtmlCommand cmd = factory.getHtmlCommand(s); final HtmlCommand cmd = factory.getHtmlCommand(themeStyle, s);
if (newLineAlone && cmd instanceof Text) { if (newLineAlone && cmd instanceof Text) {
result.addAll(splitText((Text) cmd)); result.addAll(splitText((Text) cmd));
} else { } else {

View File

@ -41,6 +41,7 @@ import net.sourceforge.plantuml.ugraphic.UGroupType;
import net.sourceforge.plantuml.ugraphic.UParam; import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public abstract class UGraphicDelegator implements UGraphic { public abstract class UGraphicDelegator implements UGraphic {
@ -99,4 +100,9 @@ public abstract class UGraphicDelegator implements UGraphic {
ug.flushUg(); ug.flushUg();
} }
@Override
public HColor getDefaultBackground() {
return ug.getDefaultBackground();
}
} }

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.graphic.color; package net.sourceforge.plantuml.graphic.color;
import net.sourceforge.plantuml.ThemeStyle;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.HColorSet;
@ -57,7 +58,7 @@ public class ColorParser {
this.mainType = mainType; this.mainType = mainType;
} }
public Colors getColor(RegexResult arg, HColorSet set) throws NoSuchColorException { public Colors getColor(ThemeStyle themeStyle, RegexResult arg, HColorSet set) throws NoSuchColorException {
if (mainType == null) { if (mainType == null) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
@ -65,8 +66,7 @@ public class ColorParser {
if (data == null) { if (data == null) {
return Colors.empty(); return Colors.empty();
} }
return new Colors(data, set, mainType); return new Colors(themeStyle, data, set, mainType);
// return result.getColor(type);
} }
// New Parsers // New Parsers

View File

@ -44,6 +44,7 @@ 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.ThemeStyle;
import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
@ -82,7 +83,7 @@ public class Colors {
private Colors() { private Colors() {
} }
public Colors(String data, HColorSet set, ColorType mainType) throws NoSuchColorException { public Colors(ThemeStyle themeStyle, String data, HColorSet set, ColorType mainType) throws NoSuchColorException {
data = StringUtils.goLowerCase(data); data = StringUtils.goLowerCase(data);
for (final StringTokenizer st = new StringTokenizer(data, "#;"); st.hasMoreTokens();) { for (final StringTokenizer st = new StringTokenizer(data, "#;"); st.hasMoreTokens();) {
@ -90,7 +91,7 @@ public class Colors {
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(s)); map.put(mainType, set.getColor(themeStyle, s));
} }
} else { } else {
final String name = s.substring(0, x); final String name = s.substring(0, x);
@ -99,7 +100,7 @@ public class Colors {
this.shadowing = value.equalsIgnoreCase("true"); this.shadowing = value.equalsIgnoreCase("true");
} else { } else {
final ColorType key = ColorType.getType(name); final ColorType key = ColorType.getType(name);
final HColor color = set.getColor(value); final HColor color = set.getColor(themeStyle, value);
map.put(key, color); map.put(key, color);
} }
} }
@ -187,7 +188,8 @@ public class Colors {
return ug.apply(colors.lineStyle.getStroke3()); return ug.apply(colors.lineStyle.getStroke3());
} }
public Colors applyStereotype(Stereotype stereotype, ISkinParam skinParam, ColorParam param) throws NoSuchColorException { public Colors applyStereotype(Stereotype stereotype, ISkinParam skinParam, ColorParam param)
throws NoSuchColorException {
if (stereotype == null) { if (stereotype == null) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }

View File

@ -110,7 +110,7 @@ public class SmetanaForJson {
} }
private UGraphic getUgFor(SName name) { private UGraphic getUgFor(SName name) {
return getStyle(name).applyStrokeAndLineColor(ug, skinParam.getIHtmlColorSet()); return getStyle(name).applyStrokeAndLineColor(ug, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
} }
private SName getDiagramType() { private SName getDiagramType() {
@ -173,7 +173,8 @@ public class SmetanaForJson {
for (InternalNode node : nodes) { for (InternalNode node : nodes) {
node.block.drawU(getUgFor(SName.node).apply(getPosition(node.node))); node.block.drawU(getUgFor(SName.node).apply(getPosition(node.node)));
} }
final HColor color = getStyle(SName.arrow).value(PName.LineColor).asColor(skinParam.getIHtmlColorSet()); final HColor color = getStyle(SName.arrow).value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
for (ST_Agedge_s edge : edges) { for (ST_Agedge_s edge : edges) {
final JsonCurve curve = getCurve(edge, 13); final JsonCurve curve = getCurve(edge, 13);

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