diff --git a/pom.xml b/pom.xml
index ed0e15aefef..01299bb530b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
net.sourceforge.plantuml
plantuml
- 1.2019.12-SNAPSHOT
+ 1.2019.13-SNAPSHOT
jar
PlantUML
diff --git a/src/gen/lib/label/index__c.java b/src/gen/lib/label/index__c.java
index 40b1fbeb220..7b38b24b720 100644
--- a/src/gen/lib/label/index__c.java
+++ b/src/gen/lib/label/index__c.java
@@ -379,11 +379,12 @@ public static int RTreeInsert2(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_
CombineRect((ST_Rect_t)r, (ST_Rect_t) n.branch[i].rect));
return 0;
} else { /* child was split */
-UNSUPPORTED("7evrfdq7uc1smqislqm9d82l6"); // n->branch[i].rect = NodeCover(n->branch[i].child);
-UNSUPPORTED("echuth2qnq0o4n5gkzgtu5bgs"); // b.child = n2;
-UNSUPPORTED("50z4r9qcomgi4o7vvwq0v0xs"); // b.rect = NodeCover(n2);
-UNSUPPORTED("451qw2ioqybj69k9abzvqw4mk"); // rtp->EntryCount++;
-UNSUPPORTED("9uz11nbvh6yp6yq2axvo7e0fb"); // return AddBranch(rtp, &b, n, new);
+ n.branch[i].setStruct("rect",
+ NodeCover((ST_Node_t___)n.branch[i].child));
+ b.child = n2[0];
+ b.rect.___(NodeCover(n2[0]));
+ rtp.setInt("EntryCount", rtp.EntryCount+1);
+ return AddBranch(rtp, b, n, new_);
}
} else if (n.level == level) { /* at level for insertion. */
/*Add rect, split if necessary */
diff --git a/src/net/sourceforge/plantuml/FileFormatOption.java b/src/net/sourceforge/plantuml/FileFormatOption.java
index 4dd262bed55..dc8ee678a76 100644
--- a/src/net/sourceforge/plantuml/FileFormatOption.java
+++ b/src/net/sourceforge/plantuml/FileFormatOption.java
@@ -57,13 +57,14 @@ public final class FileFormatOption implements Serializable {
private final String hoverColor;
private final TikzFontDistortion tikzFontDistortion;
private final double scale;
+ private final String preserveAspectRatio;
public double getScaleCoef() {
return scale;
}
public FileFormatOption(FileFormat fileFormat) {
- this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0);
+ this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0, "none");
}
public StringBounder getDefaultStringBounder() {
@@ -78,13 +79,17 @@ public final boolean isWithMetadata() {
return withMetadata;
}
+ public final String getPreserveAspectRatio() {
+ return preserveAspectRatio;
+ }
+
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
- this(fileFormat, null, withMetadata, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0);
+ this(fileFormat, null, withMetadata, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0, "none");
}
private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError,
String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion,
- double scale) {
+ double scale, String preserveAspectRatio) {
this.hoverColor = hoverColor;
this.fileFormat = fileFormat;
this.affineTransform = at;
@@ -94,6 +99,7 @@ private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean with
this.debugsvek = debugsvek;
this.tikzFontDistortion = tikzFontDistortion;
this.scale = scale;
+ this.preserveAspectRatio = preserveAspectRatio;
if (tikzFontDistortion == null) {
throw new IllegalArgumentException();
}
@@ -101,27 +107,32 @@ private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean with
public FileFormatOption withUseRedForError() {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
- hoverColor, tikzFontDistortion, scale);
+ hoverColor, tikzFontDistortion, scale, preserveAspectRatio);
}
public FileFormatOption withTikzFontDistortion(TikzFontDistortion tikzFontDistortion) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
- hoverColor, tikzFontDistortion, scale);
+ hoverColor, tikzFontDistortion, scale, preserveAspectRatio);
}
public FileFormatOption withSvgLinkTarget(String svgLinkTarget) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
- debugsvek, hoverColor, tikzFontDistortion, scale);
+ debugsvek, hoverColor, tikzFontDistortion, scale, preserveAspectRatio);
+ }
+
+ public FileFormatOption withPreserveAspectRatio(String preserveAspectRatio) {
+ return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
+ debugsvek, hoverColor, tikzFontDistortion, scale, preserveAspectRatio);
}
public FileFormatOption withHoverColor(String hoverColor) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
- debugsvek, hoverColor, tikzFontDistortion, scale);
+ debugsvek, hoverColor, tikzFontDistortion, scale, preserveAspectRatio);
}
public FileFormatOption withScale(double scale) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
- debugsvek, hoverColor, tikzFontDistortion, scale);
+ debugsvek, hoverColor, tikzFontDistortion, scale, preserveAspectRatio);
}
@Override
diff --git a/src/net/sourceforge/plantuml/ISkinParam.java b/src/net/sourceforge/plantuml/ISkinParam.java
index cd191cae2ae..ef2689ad31e 100644
--- a/src/net/sourceforge/plantuml/ISkinParam.java
+++ b/src/net/sourceforge/plantuml/ISkinParam.java
@@ -141,6 +141,8 @@ public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDir
public String getSvgLinkTarget();
+ public String getPreserveAspectRatio();
+
public int getTabSize();
public int maxAsciiMessageLength();
diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java
index a1469c6ca23..88f1afc3266 100644
--- a/src/net/sourceforge/plantuml/SkinParam.java
+++ b/src/net/sourceforge/plantuml/SkinParam.java
@@ -1046,6 +1046,15 @@ public String getSvgLinkTarget() {
}
return value;
}
+
+ public String getPreserveAspectRatio() {
+ final String value = getValue("preserveaspectratio");
+ if (value == null) {
+ return "none";
+ }
+ return value;
+ }
+
public String getMonospacedFamily() {
final String value = getValue("defaultMonospacedFontName");
diff --git a/src/net/sourceforge/plantuml/SkinParamDelegator.java b/src/net/sourceforge/plantuml/SkinParamDelegator.java
index cf6f1a8c905..40d0cf46122 100644
--- a/src/net/sourceforge/plantuml/SkinParamDelegator.java
+++ b/src/net/sourceforge/plantuml/SkinParamDelegator.java
@@ -234,6 +234,10 @@ public boolean handwritten() {
public String getSvgLinkTarget() {
return skinParam.getSvgLinkTarget();
}
+
+ public String getPreserveAspectRatio() {
+ return skinParam.getPreserveAspectRatio();
+ }
public String getMonospacedFamily() {
return skinParam.getMonospacedFamily();
@@ -355,4 +359,5 @@ public void setDefaultSkin(String newFileName) {
skinParam.setDefaultSkin(newFileName);
}
+
}
diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java
index e0c13490380..2254c09b7ba 100644
--- a/src/net/sourceforge/plantuml/UmlDiagram.java
+++ b/src/net/sourceforge/plantuml/UmlDiagram.java
@@ -186,6 +186,7 @@ final protected ImageData exportDiagramNow(OutputStream os, int index, FileForma
if (fileFormatOption.getSvgLinkTarget() == null || fileFormatOption.getSvgLinkTarget().equals("_top")) {
fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget());
}
+ fileFormatOption = fileFormatOption.withPreserveAspectRatio(getSkinParam().getPreserveAspectRatio());
fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion());
if (hover != null) {
fileFormatOption = fileFormatOption.withHoverColor(StringUtils.getAsHtml(getSkinParam().getColorMapper()
diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
index 704780e7f51..f9c87602d0a 100644
--- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
@@ -61,6 +61,7 @@
import net.sourceforge.plantuml.command.CommandFootboxIgnored;
import net.sourceforge.plantuml.command.CommandNamespace;
import net.sourceforge.plantuml.command.CommandNamespace2;
+import net.sourceforge.plantuml.command.CommandNamespaceEmpty;
import net.sourceforge.plantuml.command.CommandPackage;
import net.sourceforge.plantuml.command.CommandPackageEmpty;
import net.sourceforge.plantuml.command.CommandPage;
@@ -125,6 +126,7 @@ protected List createCommands() {
cmds.add(new CommandNamespace());
cmds.add(new CommandNamespace2());
+ cmds.add(new CommandNamespaceEmpty());
cmds.add(new CommandStereotype());
cmds.add(new CommandLinkClass(UmlDiagramType.CLASS));
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
index b94d766f54a..3ec0dfbd110 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
@@ -76,7 +76,8 @@ public CommandCreateClass() {
}
private static IRegex getRegexConcat() {
- return RegexConcat.build(CommandCreateClass.class.getName(), RegexLeaf.start(), //
+ return RegexConcat.build(CommandCreateClass.class.getName(),
+ RegexLeaf.start(), //
new RegexLeaf("TYPE", //
"(interface|enum|annotation|abstract[%s]+class|abstract|class|entity|circle|diamond)"), //
RegexLeaf.spaceOneOrMore(), //
@@ -95,7 +96,8 @@ private static IRegex getRegexConcat() {
new RegexLeaf("DISPLAY2", DISPLAY_WITH_GENERIC)), //
new RegexLeaf("CODE3", "(" + CODE + ")"), //
new RegexLeaf("CODE4", "[%g]([^%g]+)[%g]")), //
- new RegexOptional(new RegexConcat(RegexLeaf.spaceZeroOrMore(), new RegexLeaf("GENERIC", "\\<(" + GenericRegexProducer.PATTERN + ")\\>"))), //
+ new RegexOptional(new RegexConcat(RegexLeaf.spaceZeroOrMore(), new RegexLeaf("GENERIC", "\\<("
+ + GenericRegexProducer.PATTERN + ")\\>"))), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
RegexLeaf.spaceZeroOrMore(), //
@@ -105,9 +107,14 @@ private static IRegex getRegexConcat() {
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), //
- new RegexOptional(new RegexConcat(new RegexLeaf("##"), new RegexLeaf("LINECOLOR", "(?:\\[(dotted|dashed|bold)\\])?(\\w+)?"))), //
- new RegexOptional(new RegexConcat(RegexLeaf.spaceOneOrMore(), new RegexLeaf("EXTENDS", "(extends)[%s]+(" + CommandCreateClassMultilines.CODES + ")"))), //
- new RegexOptional(new RegexConcat(RegexLeaf.spaceOneOrMore(), new RegexLeaf("IMPLEMENTS", "(implements)[%s]+(" + CommandCreateClassMultilines.CODES + ")"))), //
+ new RegexOptional(new RegexConcat(new RegexLeaf("##"), new RegexLeaf("LINECOLOR",
+ "(?:\\[(dotted|dashed|bold)\\])?(\\w+)?"))), //
+ new RegexOptional(new RegexConcat(RegexLeaf.spaceOneOrMore(), new RegexLeaf("EXTENDS",
+ "(extends)[%s]+(" + CommandCreateClassMultilines.CODES + ")"))), //
+ new RegexOptional(new RegexConcat(RegexLeaf.spaceOneOrMore(), new RegexLeaf("IMPLEMENTS",
+ "(implements)[%s]+(" + CommandCreateClassMultilines.CODES + ")"))), //
+ new RegexOptional(new RegexConcat(RegexLeaf.spaceZeroOrMore(), new RegexLeaf("\\{"), RegexLeaf
+ .spaceZeroOrMore(), new RegexLeaf("\\}"))), //
RegexLeaf.end());
}
diff --git a/src/net/sourceforge/plantuml/command/CommandFooter.java b/src/net/sourceforge/plantuml/command/CommandFooter.java
index 3718a4a54cd..5ab32c201d7 100644
--- a/src/net/sourceforge/plantuml/command/CommandFooter.java
+++ b/src/net/sourceforge/plantuml/command/CommandFooter.java
@@ -48,7 +48,6 @@
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.style.PName;
public class CommandFooter extends SingleLineCommand2 {
diff --git a/src/net/sourceforge/plantuml/command/CommandHeader.java b/src/net/sourceforge/plantuml/command/CommandHeader.java
index 43c1c951e23..b86791772f6 100644
--- a/src/net/sourceforge/plantuml/command/CommandHeader.java
+++ b/src/net/sourceforge/plantuml/command/CommandHeader.java
@@ -48,7 +48,6 @@
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.style.PName;
public class CommandHeader extends SingleLineCommand2 {
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
index 06e0c08639c..71a4c1dcfc8 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
@@ -42,7 +42,6 @@
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.style.PName;
public class CommandMultilinesFooter extends CommandMultilines {
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
index 8a196e9eb74..b87374f2594 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
@@ -42,7 +42,6 @@
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.style.PName;
public class CommandMultilinesHeader extends CommandMultilines {
diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace2.java b/src/net/sourceforge/plantuml/command/CommandNamespace2.java
index 0feb26a535c..3f6356a1d02 100644
--- a/src/net/sourceforge/plantuml/command/CommandNamespace2.java
+++ b/src/net/sourceforge/plantuml/command/CommandNamespace2.java
@@ -43,7 +43,6 @@
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
diff --git a/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java b/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java
new file mode 100644
index 00000000000..b466668ec7f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java
@@ -0,0 +1,109 @@
+/* ========================================================================
+ * 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.command;
+
+import net.sourceforge.plantuml.LineLocation;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.UrlBuilder;
+import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.classdiagram.ClassDiagram;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.Code;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.GroupType;
+import net.sourceforge.plantuml.cucadiagram.IEntity;
+import net.sourceforge.plantuml.cucadiagram.IGroup;
+import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+
+public class CommandNamespaceEmpty extends SingleLineCommand2 {
+
+ public CommandNamespaceEmpty() {
+ super(getRegexConcat());
+ }
+
+ private static IRegex getRegexConcat() {
+ return RegexConcat.build(CommandNamespaceEmpty.class.getName(), RegexLeaf.start(), //
+ new RegexLeaf("namespace"), //
+ RegexLeaf.spaceOneOrMore(), //
+ new RegexLeaf("NAME", "([\\p{L}0-9_][-\\p{L}0-9_.:\\\\]*)"), //
+ RegexLeaf.spaceZeroOrMore(), //
+ new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
+ RegexLeaf.spaceZeroOrMore(), //
+ new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
+ RegexLeaf.spaceZeroOrMore(), //
+ ColorParser.exp1(), //
+ RegexLeaf.spaceZeroOrMore(), //
+ new RegexLeaf("\\{"), //
+ RegexLeaf.spaceZeroOrMore(), //
+ new RegexLeaf("\\}"), //
+ RegexLeaf.end());
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) {
+ final Code code = Code.of(arg.get("NAME", 0));
+ final IGroup currentPackage = diagram.getCurrentGroup();
+ final Display display = Display.getWithNewlines(code);
+ diagram.gotoGroup2(code, display, GroupType.PACKAGE, currentPackage, NamespaceStrategy.MULTIPLE);
+ final IEntity p = diagram.getCurrentGroup();
+ final String stereotype = arg.get("STEREOTYPE", 0);
+ if (stereotype != null) {
+ p.setStereotype(new Stereotype(stereotype));
+ }
+
+ final String urlString = arg.get("URL", 0);
+ if (urlString != null) {
+ final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ final Url url = urlBuilder.getUrl(urlString);
+ p.addUrl(url);
+ }
+
+ final String color = arg.get("COLOR", 0);
+ if (color != null) {
+ p.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+ }
+ diagram.endGroup();
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandPackage.java b/src/net/sourceforge/plantuml/command/CommandPackage.java
index b55eeeeb6e9..1feb11f49c2 100644
--- a/src/net/sourceforge/plantuml/command/CommandPackage.java
+++ b/src/net/sourceforge/plantuml/command/CommandPackage.java
@@ -69,7 +69,7 @@ public CommandPackage() {
private static IRegex getRegexConcat() {
return RegexConcat.build(CommandPackage.class.getName(), RegexLeaf.start(), //
- new RegexLeaf("TYPE", "(package|together)"), //
+ new RegexLeaf("TYPE", "(package)"), //
RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("NAME", "([%g][^%g]+[%g]|[^#%s{}]*)"), //
new RegexOptional( //
diff --git a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
index b3de396e115..b032a8ef4a1 100644
--- a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
@@ -53,7 +53,6 @@
import net.sourceforge.plantuml.error.PSystemError;
import net.sourceforge.plantuml.error.PSystemErrorUtils;
import net.sourceforge.plantuml.sequencediagram.command.CommandSkin;
-import net.sourceforge.plantuml.sprite.CommandListSprite;
import net.sourceforge.plantuml.statediagram.command.CommandHideEmptyDescription;
import net.sourceforge.plantuml.style.CommandStyleImport;
import net.sourceforge.plantuml.style.CommandStyleMultilinesCSS;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
index e8a79de17aa..405fc0eff5a 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
@@ -75,6 +75,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
private final List removed = new ArrayList();
protected final EntityFactory entityFactory = new EntityFactory(hides2, removed);
private IGroup currentGroup = entityFactory.getRootGroup();
+ private List stacks = new ArrayList();
private boolean visibilityModifierPresent;
@@ -196,6 +197,8 @@ protected final String getNamespace(Code fullyCode, String separator) {
final protected void gotoGroupInternalWithNamespace(final Code code, Display display, final Code namespace2,
GroupType type, IGroup parent) {
+
+ this.stacks.add(currentGroup);
if (getNamespaceSeparator() == null) {
gotoGroupInternal(code, display, namespace2, type, parent);
return;
@@ -220,6 +223,18 @@ final protected void gotoGroupInternalWithNamespace(final Code code, Display dis
}
+ public void endGroup() {
+ if (EntityUtils.groupRoot(currentGroup)) {
+ Log.error("No parent group");
+ return;
+ }
+ if (stacks.size() > 0) {
+ currentGroup = stacks.remove(stacks.size() - 1);
+ } else {
+ currentGroup = currentGroup.getParentContainer();
+ }
+ }
+
final protected void gotoGroupInternal(final Code code, Display display, final Code namespace2, GroupType type,
IGroup parent) {
IGroup result = entityFactory.getGroupsget(code);
@@ -277,14 +292,6 @@ public final IGroup getGroup(Code code) {
return p;
}
- public void endGroup() {
- if (EntityUtils.groupRoot(currentGroup)) {
- Log.error("No parent group");
- return;
- }
- currentGroup = currentGroup.getParentContainer();
- }
-
public final boolean isGroup(Code code) {
return leafExist(code) == false && entityFactory.getGroupsget(code) != null;
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Display.java b/src/net/sourceforge/plantuml/cucadiagram/Display.java
index f48c47f1df7..63f9b7968a3 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Display.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Display.java
@@ -54,6 +54,7 @@
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.command.regex.Matcher2;
+import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.CreoleParser;
@@ -74,6 +75,7 @@
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.wbs.WBSDiagram;
public class Display implements Iterable {
@@ -270,6 +272,26 @@ public Display withPage(int page, int lastpage) {
return new Display(result, this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
}
+ public Display removeEndingStereotype() {
+ final Matcher2 m = patternStereotype.matcher(displayData.get(displayData.size() - 1));
+ if (m.matches()) {
+ final List result = new ArrayList(this.displayData);
+ result.set(result.size() - 1, m.group(1));
+ return new Display(result, this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
+ }
+ return this;
+ }
+
+ public final static Pattern2 patternStereotype = MyPattern.cmpile("^(.*?)(?:\\<\\<\\s*(.*)\\s*\\>\\>)\\s*$");
+
+ public String getEndingStereotype() {
+ final Matcher2 m = patternStereotype.matcher(displayData.get(displayData.size() - 1));
+ if (m.matches()) {
+ return m.group(2);
+ }
+ return null;
+ }
+
public Display underlined() {
final List result = new ArrayList();
for (CharSequence line : displayData) {
diff --git a/src/net/sourceforge/plantuml/donors/PSystemDonors.java b/src/net/sourceforge/plantuml/donors/PSystemDonors.java
index 6a85fff67fb..99fedab088a 100644
--- a/src/net/sourceforge/plantuml/donors/PSystemDonors.java
+++ b/src/net/sourceforge/plantuml/donors/PSystemDonors.java
@@ -71,23 +71,23 @@ public class PSystemDonors extends AbstractPSystem {
private static final int COLS = 6;
private static final int FREE_LINES = 6;
- public static final String DONORS = "6uq902mFw6aNBnoRoJQNUtErFonYo206_-9C-IFeunriW0n1BL5IhOvS7xq622gWQ-ZeCRVlzBZVI7yH"
- + "NUdUDys8jcnDSPvH50k27c-JQuPjxkqnSsBnGt1dZe133yW3iacsZHfPkfVj92sddof3IY7pywS6s9OA"
- + "ihYRQXukK7S6TknnUzX_ePwbHp_sKxhZEw0nZHBhiAEQb5SFVAsgP8B2sM_7DwrYLapW42cEjd043jcO"
- + "YNnrMiUu85NxZte3BJPcM2foJoYssYMf-UVP-hQ1xXCOJ2AmYG4RC7Eew32UO2vGRyGGM4MYYUpiZCQ6"
- + "QsvveeC95zInXd-KHKsFLEOSZau4Dg-40Ww_XXE0hIYlmcVxDWCAHNgBkYN9EZMUX9N6XoKfhXyqt006"
- + "R2ne7QY2a3T19_nfCVjJatjT3GLUzEpClTaPo4Ms0y3nPaRVPDsPAF_t3yuqiMsfbaXrBlrvhlTn3iZT"
- + "Kgj6_37QM6LBtDQJ5nLQUN81_4FGIxsZOdxETMCX6UAvT7iYpdFgojSe0cR5OMJXJx4bDUxIBazZVLcU"
- + "eIp1Z_RhL2EPq89N8bu6_QfMA0zqlb2oBArSFlHeMBqCV4t8JBmjkcV7NCh_lrAymupI5RJVnPogQo1A"
- + "dh5pLUjigWXC8texv2QGAr3jhbknU_-G_vmFIBqbaO78RCvnlrIig3LT334RrdIwn0nWyfHe9mAxaqGY"
- + "faReNR2oZ4mhnQw7g-VqYJ5nxVJ2uxwfCOWFTBBo9EpfHR1cXY79chaDxGUSWt06NvnNN_VXFLO1hBjv"
- + "Zxr9pHzd85tfXP4aRKQKszRzgR1c1QLdKPPyM96_U_4p5mzT2bvdikW8Cwysno5ZeNZPf9N-PFJ3aY5l"
- + "dygo_aeLUGFkbug5G9XdV0nuF3XPKCKb15RJMGuJ6u1mweDNx3SlSJEekgNav18snAp3LkU1IkU7UGT6"
- + "bN7WcOCTtRt4pz0IHSx7vxso-cbbhIfsBA1uLWYMKaVPQweeqkTKCcICGSzXQ-3jDmjT42xrsXkc1Gfl"
- + "W-Y-V0EjKyYq4kC7JPybqeLyHRxaiJ02_iwltsGlEDP1nhyPtOV7cUUA8AKgEi0vSRRKQbjQ1-ij-lpv"
- + "ifoy1t_-xpLjvrI8vtoM0Bg0WlQlfS2SQDRLF7liJwEF3kmsiW9Y7PpqbLUcNWWm40oQPQcNrcb6uSuO"
- + "Ncwg1dt6yQ52No4L9uZZ3SikbYcA6bFEykLanQYys9VU22SvU5x_55M6KbnbkPeOeLNi_2ZEqtWVjHjk"
- + "TUa24j0T5mJAVlExtIntZJvVW7qO7b3avoDvwB25QK4Lfx4yDJ15OtrlnjjJPwP-4m00";
+ public static final String DONORS = "6wO902mFU3XMJYceJdotTlPGzS6YgH3yYpFbZw2FTx01CWIrH4crEd9zz1eWg82keQF7tBxJutuZ_KLq"
+ + "fNlVD2FQiZN5UKPHB0Xwl4sk6RQvjmV2d2KlWZjJWfuF5n0bqTtfBCiTANQVa85C9s9S14-RrrZgP2tv"
+ + "1mcd-zyr5RAlgiAGBgiwVxf2SL807Z2x_5ETowPoBbUrwKqeGAVkNC5DLOUvTgAlJWmIOEBrR-TRrMHM"
+ + "JF0GASwsS0HEepD3CnUjCx8Xi_OVzGzeip73Kf5RGd7KBedEFo-TsJRGVOu44nAxADWmvb3AOLgWUyYD"
+ + "cCGcWeRwB4PZipLRdkXXS4CB-_AFHbBZaShCuMYJsDq31KxVnW58hzJK96RxDmFAH4QB6KjITM7SX3ld"
+ + "OJ4LwGSDDuB2pe9Ma1g2l0bTyEan-rEJMrqD1Lxo3CczsIxKATi6jCsClirrIAByxpRDjF4UKowHwcpz"
+ + "UQxtSGx8tL8hp_XZj3784TpxoOiALfvQ03y2lLGBbUJdf-mR2oaGzzRjYJmwLwxSHn4Ocp9CBFOgjbYB"
+ + "_5YNjx4LMLOO2_helYuq8GCjTELoD_HjMfaqTBvGafPMBXzwT5gz369DnaplFFqP7NCv_xzIlCDCYXle"
+ + "IedPfci4HUGSMaqN6nE1QQ77Gsu2iWBbxheLk_SF-NK-8FEMPGGYjpcZVL_nGjrr4M8wrdGrnGnW_fJI"
+ + "5ed3WWW5xOBUHfL-fAqKknwkdkaJO-w-w9F7NJDZ40SwHMCHldeHtDqme-hDaGtjUymXU8Wlowkl-_0T"
+ + "gm3MuTuR_aZDds0Wd-c54P568nhRrlsfSBU24bdK9HShybt5prmyT2TudScYGyoysXo7B0oL1qbQwfyC"
+ + "FomPVFjCDkolIf4tu7bfc8PmP7mCBXzDUjJa4edDT9PZPYS0bofUiTzymdMXwfQQaoriYCd3Lnz29lWn"
+ + "le2bCXMU1jQwUr6SGOmIvyIyLrOjAsjLyR60YbaXw4iBfMggADBdD3BYh47FGUjW-yt25kYbNdl3c51u"
+ + "6wAx6XkmJH7JLKp_Q0AUY2gA9NefayG0lkR3hzL3Onry_6Pq7n47oEwI4485QewUE2tDjsDO1-ij-l_p"
+ + "PJbv3_xytslQmQaLztnM0NI2aF_hA1W7JLtjCmflNJwSE1om0gasJcBbfQMdGG91v9QTFdMTPgHtOaIv"
+ + "BLdqZkD3PRvI8Gv8OyFoYtwAeiQKaxwSh3YL3_lE6-4aXyZhdwBAcXHNfP6Q6C4cTdOKvsdiLhlXheih"
+ + "yA0UN12e-_NZqyqiTuqrNq1g61uqvESZSkZGmxMWfgQ5iIom8iRwtYVzKAR7RyQcW5qbW3dJ0000";
/*
* Special thanks to our sponsors and donors:
diff --git a/src/net/sourceforge/plantuml/graphic/SkinParameter.java b/src/net/sourceforge/plantuml/graphic/SkinParameter.java
index 713dd4c6bbf..c4b54835ee5 100644
--- a/src/net/sourceforge/plantuml/graphic/SkinParameter.java
+++ b/src/net/sourceforge/plantuml/graphic/SkinParameter.java
@@ -116,7 +116,7 @@ public class SkinParameter {
public static final SkinParameter CONTROL = new SkinParameter("CONTROL", ColorParam.controlBackground,
ColorParam.controlBorder, FontParam.CONTROL, FontParam.CONTROL_STEREOTYPE);
- public static final SkinParameter ENTITY_DOMAIN = new SkinParameter("ENTITY_DOMAIN", ColorParam.entityBackground,
+ public static final SkinParameter ENTITY = new SkinParameter("ENTITY", ColorParam.entityBackground,
ColorParam.entityBorder, FontParam.ENTITY, FontParam.ENTITY_STEREOTYPE);
public static final SkinParameter INTERFACE = new SkinParameter("INTERFACE", ColorParam.interfaceBackground,
diff --git a/src/net/sourceforge/plantuml/graphic/USymbol.java b/src/net/sourceforge/plantuml/graphic/USymbol.java
index a822908301b..5b169512e4b 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbol.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbol.java
@@ -73,7 +73,7 @@ public abstract class USymbol {
public final static USymbol COMPONENT1 = record("COMPONENT1", SkinParameter.COMPONENT1, new USymbolComponent1());
public final static USymbol COMPONENT2 = record("COMPONENT2", SkinParameter.COMPONENT2, new USymbolComponent2());
public final static USymbol BOUNDARY = record("BOUNDARY", SkinParameter.BOUNDARY, new USymbolBoundary());
- public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", SkinParameter.ENTITY_DOMAIN,
+ public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", SkinParameter.ENTITY,
new USymbolEntityDomain(2));
public final static USymbol CONTROL = record("CONTROL", SkinParameter.CONTROL, new USymbolControl(2));
public final static USymbol INTERFACE = record("INTERFACE", SkinParameter.INTERFACE, new USymbolInterface());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java
index ed4845373bf..d7b6ddb8959 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java
@@ -48,7 +48,7 @@ public USymbolEntityDomain(double thickness) {
@Override
public SkinParameter getSkinParameter() {
- return SkinParameter.ENTITY_DOMAIN;
+ return SkinParameter.ENTITY;
}
diff --git a/src/net/sourceforge/plantuml/mindmap/FingerImpl.java b/src/net/sourceforge/plantuml/mindmap/FingerImpl.java
index a077552ec33..29017f01c77 100644
--- a/src/net/sourceforge/plantuml/mindmap/FingerImpl.java
+++ b/src/net/sourceforge/plantuml/mindmap/FingerImpl.java
@@ -45,7 +45,7 @@
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParam;
-import net.sourceforge.plantuml.SkinParamBackcolored;
+import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBox;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -55,6 +55,7 @@
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
@@ -85,19 +86,23 @@ public class FingerImpl implements Finger, UDrawable {
private Tetris tetris = null;
private StyleSignature getDefaultStyleDefinitionNode() {
+ final String depth = SName.depth(level);
if (level == 0) {
- return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.rootNode).add(
- stereotype);
+ return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.rootNode)
+ .add(stereotype).add(depth);
}
if (nail.size() == 0) {
- return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.leafNode).add(
- stereotype);
+ return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.leafNode)
+ .add(stereotype).add(depth);
}
- return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node).add(stereotype);
+ return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node).add(stereotype)
+ .add(depth);
}
public StyleSignature getDefaultStyleDefinitionArrow() {
- return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.arrow).add(stereotype);
+ final String depth = SName.depth(level);
+ return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.arrow).add(stereotype)
+ .add(depth);
}
public static FingerImpl build(Idea idea, ISkinParam skinParam, Direction direction) {
@@ -237,7 +242,8 @@ private TextBlock getPhalanx() {
font = skinParam.getFont(null, false, FontParam.ACTIVITY);
}
if (shape == IdeaShape.BOX) {
- final ISkinParam foo = new SkinParamBackcolored(Colors.empty().mute(skinParam), backColor);
+ // final ISkinParam foo = new SkinParamBackcolored(Colors.empty().mute(skinParam), backColor);
+ final ISkinParam foo = new SkinParamColors(skinParam, Colors.empty().add(ColorType.BACK, backColor));
final FtileBox box = FtileBox.createMindMap(styleBuilder, foo, label, getDefaultStyleDefinitionNode());
return TextBlockUtils.withMargin(box, 0, 0, margin(), margin());
}
diff --git a/src/net/sourceforge/plantuml/mindmap/Idea.java b/src/net/sourceforge/plantuml/mindmap/Idea.java
index 509ecea9385..f8cf6c636c3 100644
--- a/src/net/sourceforge/plantuml/mindmap/Idea.java
+++ b/src/net/sourceforge/plantuml/mindmap/Idea.java
@@ -46,10 +46,6 @@
class Idea {
- // public StyleDefinition getDefaultStyleDefinition() {
- // return StyleDefinition.of(SName.root, SName.element, SName.mindmapDiagram, SName.node);
- // }
-
private final Display label;
private final int level;
private final Idea parent;
@@ -59,8 +55,8 @@ class Idea {
private final StyleBuilder styleBuilder;
private final String stereotype;
- public Idea(StyleBuilder styleBuilder, Display label, IdeaShape shape, String stereotype) {
- this(styleBuilder, null, 0, null, label, shape, stereotype);
+ public Idea(StyleBuilder styleBuilder, HtmlColor backColor, Display label, IdeaShape shape, String stereotype) {
+ this(styleBuilder, backColor, 0, null, label, shape, stereotype);
}
public Idea createIdea(StyleBuilder styleBuilder, HtmlColor backColor, int newLevel, Display newDisplay,
@@ -70,14 +66,6 @@ public Idea createIdea(StyleBuilder styleBuilder, HtmlColor backColor, int newLe
return result;
}
- // public Style getStyle(StyleBuilder styleBuilder) {
- // Style result = getDefaultStyleDefinition().getMergedStyle(styleBuilder);
- // if (backColor != null) {
- // result = result.eventuallyOverride(PName.BackGroundColor, backColor);
- // }
- // return result;
- // }
-
private Idea(StyleBuilder styleBuilder, HtmlColor backColor, int level, Idea parent, Display label,
IdeaShape shape, String stereotype) {
this.backColor = backColor;
diff --git a/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java b/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java
index ed6df88040f..5c12e5456c7 100644
--- a/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java
+++ b/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java
@@ -181,19 +181,17 @@ public CommandExecutionResult addIdea(HtmlColor backColor, int level, Display la
public CommandExecutionResult addIdea(HtmlColor backColor, int level, Display label, IdeaShape shape,
Direction direction) {
- final Matcher2 m = WBSDiagram.patternStereotype.matcher(label.get(0));
- String stereotype = null;
- if (m.matches()) {
- label = Display.getWithNewlines(m.group(1));
- stereotype = m.group(2);
+ String stereotype = label.getEndingStereotype();
+ if (stereotype != null) {
+ label = label.removeEndingStereotype();
}
if (level == 0) {
if (this.right.root != null) {
return CommandExecutionResult
.error("I don't know how to draw multi-root diagram. You should suggest an image so that the PlantUML team implements it :-)");
}
- right.initRoot(getSkinParam().getCurrentStyleBuilder(), label, shape, stereotype);
- left.initRoot(getSkinParam().getCurrentStyleBuilder(), label, shape, stereotype);
+ right.initRoot(getSkinParam().getCurrentStyleBuilder(), backColor, label, shape, stereotype);
+ left.initRoot(getSkinParam().getCurrentStyleBuilder(), backColor, label, shape, stereotype);
return CommandExecutionResult.ok();
}
if (direction == Direction.LEFT) {
@@ -207,8 +205,8 @@ static class Branch {
private Idea last;
private Finger finger;
- private void initRoot(StyleBuilder styleBuilder, Display label, IdeaShape shape, String stereotype) {
- root = new Idea(styleBuilder, label, shape, stereotype);
+ private void initRoot(StyleBuilder styleBuilder, HtmlColor backColor, Display label, IdeaShape shape, String stereotype) {
+ root = new Idea(styleBuilder, backColor, label, shape, stereotype);
last = root;
}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementDayOfWeek.java b/src/net/sourceforge/plantuml/project3/ComplementDayOfWeek.java
new file mode 100644
index 00000000000..ce2a9757703
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/ComplementDayOfWeek.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * 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.project3;
+
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class ComplementDayOfWeek implements ComplementPattern {
+
+ public IRegex toRegex(String suffix) {
+ return new RegexConcat( //
+ new RegexLeaf("COMPLEMENT" + suffix, "(" + DayOfWeek.getRegexString() + ")")); //
+ }
+
+ public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) {
+ final String s = arg.get("COMPLEMENT" + suffix, 0);
+ return Failable. ok(DayOfWeek.fromString(s));
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java b/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java
index cb8c44c46a7..91a1cd021fc 100644
--- a/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java
+++ b/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java
@@ -45,19 +45,14 @@ public class ComplementSeveralDays implements ComplementPattern {
public IRegex toRegex(String suffix) {
return new RegexConcat( //
new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+(days?|weeks?)")); //
- // new RegexLeaf("LOAD" + suffix, "([%s]+at[%s]+(\\d+)%)?"));
}
public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String number = arg.get("COMPLEMENT" + suffix, 0);
final boolean inWeeks = arg.get("COMPLEMENT" + suffix, 1).startsWith("w");
final int factor = inWeeks ? system.daysInWeek() : 1;
- // final String load = arg.get("LOAD" + suffix, 1);
final int days = Integer.parseInt(number) * factor;
- // if (load == null) {
return Failable. ok(LoadInDays.inDay(days));
- // }
- // return Failable. ok(LoadInDays.inDayWithLoad(days, Integer.parseInt(load)));
}
}
diff --git a/src/net/sourceforge/plantuml/project3/DayOfWeek.java b/src/net/sourceforge/plantuml/project3/DayOfWeek.java
index 6f8a09c8c07..54af9a75b14 100644
--- a/src/net/sourceforge/plantuml/project3/DayOfWeek.java
+++ b/src/net/sourceforge/plantuml/project3/DayOfWeek.java
@@ -37,7 +37,7 @@
import net.sourceforge.plantuml.StringUtils;
-public enum DayOfWeek implements Subject {
+public enum DayOfWeek implements Subject, Complement {
MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;
diff --git a/src/net/sourceforge/plantuml/project3/GanttDiagram.java b/src/net/sourceforge/plantuml/project3/GanttDiagram.java
index b298e305cc7..b22f34344f7 100644
--- a/src/net/sourceforge/plantuml/project3/GanttDiagram.java
+++ b/src/net/sourceforge/plantuml/project3/GanttDiagram.java
@@ -586,7 +586,7 @@ public void affectResource(Task result, String description) {
public Resource getResource(String resourceName) {
Resource resource = resources.get(resourceName);
if (resource == null) {
- resource = new Resource(resourceName, getDefaultPlan());
+ resource = new Resource(resourceName, getDefaultPlan(), getCalendarSimple());
}
resources.put(resourceName, resource);
return resource;
diff --git a/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java b/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java
index e5d9a84461d..06ae4948fd8 100644
--- a/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/project3/GanttDiagramFactory.java
@@ -38,7 +38,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.command.Command;
diff --git a/src/net/sourceforge/plantuml/project3/LoadInDays.java b/src/net/sourceforge/plantuml/project3/LoadInDays.java
index 2695cf1c104..7ef804869a1 100644
--- a/src/net/sourceforge/plantuml/project3/LoadInDays.java
+++ b/src/net/sourceforge/plantuml/project3/LoadInDays.java
@@ -49,11 +49,6 @@ public static LoadInDays inDay(int days) {
return new LoadInDays(days, 100);
}
-// public static Complement inDayWithLoad(int days, int loadPerDay) {
-// final int tmp = (int) Math.ceil(days * 100.0 / loadPerDay);
-// return new LoadInDays(tmp, loadPerDay);
-// }
-
public int getFullLoad() {
return days * loadPerDay;
}
diff --git a/src/net/sourceforge/plantuml/project3/Resource.java b/src/net/sourceforge/plantuml/project3/Resource.java
index ea95a93aa69..668c89d505a 100644
--- a/src/net/sourceforge/plantuml/project3/Resource.java
+++ b/src/net/sourceforge/plantuml/project3/Resource.java
@@ -35,19 +35,25 @@
*/
package net.sourceforge.plantuml.project3;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
-public class Resource implements Subject /* , LoadPlanable */{
+public class Resource implements Subject {
private final String name;
private ResourceDraw draw;
- // private final LoadPlanable loadPlanable;
- private Set closed = new TreeSet();
+ private final Set closed = new TreeSet();
+ private final Set forcedOn = new TreeSet();
+ private final GCalendar calendar;
- public Resource(String name, LoadPlanable loadPlanable) {
+ private final Collection closedDayOfWeek = EnumSet.noneOf(DayOfWeek.class);
+
+ public Resource(String name, LoadPlanable loadPlanable, GCalendar calendar) {
this.name = name;
- // this.loadPlanable = loadPlanable;
+ this.calendar = calendar;
}
@Override
@@ -79,17 +85,27 @@ public void setTaskDraw(ResourceDraw draw) {
}
public boolean isClosedAt(Instant instant) {
- return this.closed.contains(instant);
+ if (this.forcedOn.contains(instant)) {
+ return false;
+ }
+ if (closedDayOfWeek.size() > 0 && calendar != null) {
+ final DayAsDate d = calendar.toDayAsDate((InstantDay) instant);
+ if (closedDayOfWeek.contains(d.getDayOfWeek())) {
+ return true;
+ }
+ }
+ return this.closed.contains(instant);
}
-// public int getLoadAt(Instant instant) {
-// if (this.closed.contains(instant)) {
-// return 0;
-// }
-// return loadPlanable.getLoadAt(instant);
-// }
-
public void addCloseDay(Instant instant) {
this.closed.add(instant);
}
+
+ public void addForceOnDay(Instant instant) {
+ this.forcedOn.add(instant);
+ }
+
+ public void addCloseDay(DayOfWeek dayOfWeek) {
+ closedDayOfWeek.add(dayOfWeek);
+ }
}
diff --git a/src/net/sourceforge/plantuml/project3/SubjectResource.java b/src/net/sourceforge/plantuml/project3/SubjectResource.java
index e19601dbe5d..510d074b359 100644
--- a/src/net/sourceforge/plantuml/project3/SubjectResource.java
+++ b/src/net/sourceforge/plantuml/project3/SubjectResource.java
@@ -46,7 +46,7 @@
public class SubjectResource implements SubjectPattern {
public Collection getVerbs() {
- return Arrays. asList(new VerbIsOff());
+ return Arrays. asList(new VerbIsOff(), new VerbIsOn());
}
public IRegex toRegex() {
diff --git a/src/net/sourceforge/plantuml/project3/VerbIsOff.java b/src/net/sourceforge/plantuml/project3/VerbIsOff.java
index b2b398ee60e..7ce044d75d5 100644
--- a/src/net/sourceforge/plantuml/project3/VerbIsOff.java
+++ b/src/net/sourceforge/plantuml/project3/VerbIsOff.java
@@ -42,12 +42,14 @@
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
public class VerbIsOff implements VerbPattern {
public Collection getComplements() {
- return Arrays. asList(new ComplementDate(), new ComplementDates());
+ return Arrays
+ . asList(new ComplementDate(), new ComplementDates(), new ComplementDayOfWeek());
}
public IRegex toRegex() {
@@ -55,14 +57,21 @@ public IRegex toRegex() {
RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("off"), //
RegexLeaf.spaceOneOrMore(), //
- new RegexLeaf("on"));
+ new RegexOr(//
+ new RegexLeaf("on"),//
+ new RegexLeaf("for"),//
+ new RegexLeaf("the"),//
+ new RegexLeaf("at") //
+ ));
}
public Verb getVerb(final GanttDiagram project, RegexResult arg) {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Resource resource = (Resource) subject;
- if (complement instanceof DaysAsDates) {
+ if (complement instanceof DayOfWeek) {
+ resource.addCloseDay(((DayOfWeek) complement));
+ } else if (complement instanceof DaysAsDates) {
for (DayAsDate when : (DaysAsDates) complement) {
resource.addCloseDay(project.convert(when));
}
@@ -75,5 +84,4 @@ public CommandExecutionResult execute(Subject subject, Complement complement) {
};
}
-
}
diff --git a/src/net/sourceforge/plantuml/project3/VerbIsOn.java b/src/net/sourceforge/plantuml/project3/VerbIsOn.java
new file mode 100644
index 00000000000..11e46883099
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project3/VerbIsOn.java
@@ -0,0 +1,85 @@
+/* ========================================================================
+ * 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.project3;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexOr;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+
+public class VerbIsOn implements VerbPattern {
+
+ public Collection getComplements() {
+ return Arrays. asList(new ComplementDate(), new ComplementDates());
+ }
+
+ public IRegex toRegex() {
+ return new RegexConcat(new RegexLeaf("is"), //
+ RegexLeaf.spaceOneOrMore(), //
+ new RegexLeaf("on"), //
+ RegexLeaf.spaceOneOrMore(), //
+ new RegexOr(//
+ new RegexLeaf("on"),//
+ new RegexLeaf("for"),//
+ new RegexLeaf("the"),//
+ new RegexLeaf("at") //
+ ) //
+ );
+ }
+
+ public Verb getVerb(final GanttDiagram project, RegexResult arg) {
+ return new Verb() {
+ public CommandExecutionResult execute(Subject subject, Complement complement) {
+ final Resource resource = (Resource) subject;
+ if (complement instanceof DaysAsDates) {
+ for (DayAsDate when : (DaysAsDates) complement) {
+ resource.addForceOnDay(project.convert(when));
+ }
+ } else {
+ final DayAsDate when = (DayAsDate) complement;
+ resource.addForceOnDay(project.convert(when));
+ }
+ return CommandExecutionResult.ok();
+ }
+
+ };
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project3/VerbProjectStarts.java b/src/net/sourceforge/plantuml/project3/VerbProjectStarts.java
index 5646c1d738c..74350ec2087 100644
--- a/src/net/sourceforge/plantuml/project3/VerbProjectStarts.java
+++ b/src/net/sourceforge/plantuml/project3/VerbProjectStarts.java
@@ -40,8 +40,12 @@
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexOptional;
+import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
public class VerbProjectStarts implements VerbPattern {
@@ -49,10 +53,23 @@ public Collection getComplements() {
return Arrays. asList(new ComplementDate());
}
- public IRegex toRegex() {
+ public IRegex toRegexOld() {
return new RegexLeaf("starts[%s]*(the[%s]*|on[%s]*)*");
}
+ public IRegex toRegex() {
+ return new RegexConcat(new RegexLeaf("start"), //
+ new RegexOptional(new RegexLeaf("s")), //
+ RegexLeaf.spaceZeroOrMore(), //
+ new RegexOptional(new RegexOr(//
+ new RegexLeaf("on"),//
+ new RegexLeaf("for"),//
+ new RegexLeaf("the"),//
+ new RegexLeaf("at") //
+ )) //
+ );
+ }
+
public Verb getVerb(final GanttDiagram project, RegexResult arg) {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java
index c56eb9bca3c..334b6ce0e3c 100644
--- a/src/net/sourceforge/plantuml/skin/rose/Rose.java
+++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java
@@ -370,6 +370,16 @@ private double deltaShadow(ISkinParam param, ColorParam color) {
skinParameter = SkinParameter.PARTICIPANT;
} else if (color == ColorParam.actorBorder) {
skinParameter = SkinParameter.ACTOR;
+ } else if (color == ColorParam.boundaryBorder) {
+ skinParameter = SkinParameter.BOUNDARY;
+ } else if (color == ColorParam.controlBorder) {
+ skinParameter = SkinParameter.CONTROL;
+ } else if (color == ColorParam.entityBorder) {
+ skinParameter = SkinParameter.ENTITY;
+ } else if (color == ColorParam.collectionsBorder) {
+ skinParameter = SkinParameter.COLLECTIONS;
+ } else if (color == ColorParam.databaseBorder) {
+ skinParameter = SkinParameter.DATABASE;
}
final boolean result = skinParameter == null ? param.shadowing(null) : param.shadowing2(null, skinParameter);
return result ? 4.0 : 0;
@@ -403,9 +413,10 @@ private SymbolContext getSymbolContext(ISkinParam skin, ColorParam color) {
.withDeltaShadow(deltaShadow(skin, color));
}
if (color == ColorParam.entityBorder) {
+ final double tmp = deltaShadow(skin, color);
return new SymbolContext(getHtmlColor(skin, ColorParam.entityBackground), getHtmlColor(skin,
ColorParam.entityBorder)).withStroke(getStroke(skin, LineParam.sequenceActorBorder, 2))
- .withDeltaShadow(deltaShadow(skin, color));
+ .withDeltaShadow(tmp);
}
if (color == ColorParam.databaseBorder) {
return new SymbolContext(getHtmlColor(skin, ColorParam.databaseBackground), getHtmlColor(skin,
diff --git a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java
index e9a8c167bb4..2057c135c15 100644
--- a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java
+++ b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java
@@ -88,7 +88,7 @@ public ImageData writeImageEps(OutputStream os) throws IOException {
public ImageData writeImageSvg(OutputStream os) throws IOException {
final UGraphicSvg ug = new UGraphicSvg(true, new Dimension2DDouble(0, 0), new ColorMapperIdentity(),
- (String) null, false, 1.0, null, null, 0);
+ (String) null, false, 1.0, null, null, 0, "none");
drawInternal(ug);
ug.createXml(os, null);
return ImageDataSimple.ok();
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java
index 838d07d689f..0b49f397704 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCrowfoot.java
@@ -50,7 +50,8 @@ public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2, Side side)
@Override
public UDrawable createUDrawable(Point2D p0, double angle, Side side) {
- throw new UnsupportedOperationException(getClass().toString());
+ angle -= Math.PI / 2;
+ return new ExtremityCrowfoot(p0, angle, side);
}
}
\ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/svg/SvgGraphics.java b/src/net/sourceforge/plantuml/svg/SvgGraphics.java
index f75e291b372..7b4c221b907 100644
--- a/src/net/sourceforge/plantuml/svg/SvgGraphics.java
+++ b/src/net/sourceforge/plantuml/svg/SvgGraphics.java
@@ -109,6 +109,8 @@ public class SvgGraphics {
private int maxX = 10;
private int maxY = 10;
+ private final String preserveAspectRatio;
+
private final double scale;
private final String filterUid;
private final String shadowId;
@@ -124,17 +126,19 @@ final protected void ensureVisible(double x, double y) {
}
}
- public SvgGraphics(boolean svgDimensionStyle, Dimension2D minDim, double scale, String hover, long seed) {
- this(svgDimensionStyle, minDim, null, scale, hover, seed);
+ public SvgGraphics(boolean svgDimensionStyle, Dimension2D minDim, double scale, String hover, long seed,
+ String preserveAspectRatio) {
+ this(svgDimensionStyle, minDim, null, scale, hover, seed, preserveAspectRatio);
}
public SvgGraphics(boolean svgDimensionStyle, Dimension2D minDim, String backcolor, double scale, String hover,
- long seed) {
+ long seed, String preserveAspectRatio) {
try {
this.svgDimensionStyle = svgDimensionStyle;
this.scale = scale;
this.document = getDocument();
this.backcolor = backcolor;
+ this.preserveAspectRatio = preserveAspectRatio;
ensureVisible(minDim.getWidth(), minDim.getHeight());
this.root = getRootNode();
@@ -594,7 +598,7 @@ private void createXmlInternal(OutputStream os) throws TransformerException {
}
root.setAttribute("viewBox", "0 0 " + maxXscaled + " " + maxYscaled);
root.setAttribute("zoomAndPan", "magnify");
- root.setAttribute("preserveAspectRatio", "none");
+ root.setAttribute("preserveAspectRatio", preserveAspectRatio);
root.setAttribute("contentScriptType", "application/ecmascript");
root.setAttribute("contentStyleType", "text/css");
diff --git a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
index 5d2c0f4f9c6..00e6785ace1 100644
--- a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
+++ b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
@@ -82,6 +82,7 @@ public LanguageDescriptor() {
type.add("queue");
type.add("archimate");
type.add("diamond");
+ type.add("detach");
keyword.add("@startuml");
keyword.add("@enduml");
diff --git a/src/net/sourceforge/plantuml/tim/TContext.java b/src/net/sourceforge/plantuml/tim/TContext.java
index 7724674f6e8..2a3ddfd40a9 100644
--- a/src/net/sourceforge/plantuml/tim/TContext.java
+++ b/src/net/sourceforge/plantuml/tim/TContext.java
@@ -75,6 +75,7 @@
import net.sourceforge.plantuml.tim.stdlib.Filename;
import net.sourceforge.plantuml.tim.stdlib.FunctionExists;
import net.sourceforge.plantuml.tim.stdlib.GetVariableValue;
+import net.sourceforge.plantuml.tim.stdlib.GetVersion;
import net.sourceforge.plantuml.tim.stdlib.Getenv;
import net.sourceforge.plantuml.tim.stdlib.IntVal;
import net.sourceforge.plantuml.tim.stdlib.InvokeVoidFunction;
@@ -125,6 +126,7 @@ private void addStandardFunctions(Defines defines) {
addFunction(new SetVariableValue());
addFunction(new GetVariableValue());
addFunction(new IntVal());
+ addFunction(new GetVersion());
// !exit
// !log
// %min
diff --git a/src/net/sourceforge/plantuml/tim/stdlib/GetVersion.java b/src/net/sourceforge/plantuml/tim/stdlib/GetVersion.java
new file mode 100644
index 00000000000..1e48a2c5657
--- /dev/null
+++ b/src/net/sourceforge/plantuml/tim/stdlib/GetVersion.java
@@ -0,0 +1,59 @@
+/* ========================================================================
+ * 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.tim.stdlib;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.tim.EaterException;
+import net.sourceforge.plantuml.tim.TContext;
+import net.sourceforge.plantuml.tim.TFunctionSignature;
+import net.sourceforge.plantuml.tim.TMemory;
+import net.sourceforge.plantuml.tim.expression.TValue;
+import net.sourceforge.plantuml.version.Version;
+
+public class GetVersion extends SimpleReturnFunction {
+
+ public TFunctionSignature getSignature() {
+ return new TFunctionSignature("%version", 1);
+ }
+
+ public boolean canCover(int nbArg) {
+ return nbArg == 0;
+ }
+
+ public TValue executeReturn(TContext context, TMemory memory, List args) throws EaterException {
+ return TValue.fromString(Version.versionString());
+ }
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
index caa03b91d4a..3767e57c753 100644
--- a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
+++ b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
@@ -157,7 +157,7 @@ public void printChar(final PrintWriter pw, char c) throws IOException, Transfor
}
private String getSvgImage(char c) throws IOException, TransformerException {
- final SvgGraphics svg = new SvgGraphics(true, new Dimension2DDouble(0, 0), 1.0, null, 42);
+ final SvgGraphics svg = new SvgGraphics(true, new Dimension2DDouble(0, 0), 1.0, null, 42, "none");
svg.setStrokeColor("black");
svg.svgImage(getBufferedImage(c), 0, 0);
final ByteArrayOutputStream os = new ByteArrayOutputStream();
diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
index f9eba490a82..5fabb1ea7f3 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
@@ -393,7 +393,7 @@ private UGraphic2 createUGraphic(FileFormatOption fileFormatOption, long seed, f
return createUGraphicPNG(colorMapper, dpiFactor, dim, mybackcolor, animationArg, dx, dy);
case SVG:
return createUGraphicSVG(colorMapper, dpiFactor, dim, mybackcolor, fileFormatOption.getSvgLinkTarget(),
- fileFormatOption.getHoverColor(), seed);
+ fileFormatOption.getHoverColor(), seed, fileFormatOption.getPreserveAspectRatio());
case EPS:
return new UGraphicEps(colorMapper, EpsStrategy.getDefault2());
case EPS_TEXT:
@@ -417,7 +417,7 @@ private UGraphic2 createUGraphic(FileFormatOption fileFormatOption, long seed, f
}
private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale, Dimension2D dim, HtmlColor mybackcolor,
- String svgLinkTarget, String hover, long seed) {
+ String svgLinkTarget, String hover, long seed, String preserveAspectRatio) {
Color backColor = Color.WHITE;
if (mybackcolor instanceof HtmlColorSimple) {
backColor = colorMapper.getMappedColor(mybackcolor);
@@ -425,12 +425,12 @@ private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale, Dimen
final UGraphicSvg ug;
if (mybackcolor instanceof HtmlColorGradient) {
ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, (HtmlColorGradient) mybackcolor, false, scale,
- svgLinkTarget, hover, seed);
+ svgLinkTarget, hover, seed, preserveAspectRatio);
} else if (backColor == null || backColor.equals(Color.WHITE)) {
- ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, false, scale, svgLinkTarget, hover, seed);
+ ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, false, scale, svgLinkTarget, hover, seed, preserveAspectRatio);
} else {
ug = new UGraphicSvg(svgDimensionStyle, dim, colorMapper, StringUtils.getAsHtml(backColor), false, scale,
- svgLinkTarget, hover, seed);
+ svgLinkTarget, hover, seed, preserveAspectRatio);
}
return ug;
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
index ef66b0262ce..8cbf193e9c9 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
@@ -65,7 +65,7 @@ public static void writeImage(OutputStream os, String metadata, FileFormatOption
final Dimension2D size = computeSize(colorMapper, background, image);
final UGraphicSvg svg = new UGraphicSvg(true, size, colorMapper, StringUtils.getAsHtml(colorMapper
.getMappedColor(background)), false, 1.0, fileFormatOption.getSvgLinkTarget(),
- fileFormatOption.getHoverColor(), seed);
+ fileFormatOption.getHoverColor(), seed, fileFormatOption.getPreserveAspectRatio());
image.drawU(svg);
svg.createXml(os, fileFormatOption.isWithMetadata() ? metadata : null);
} else if (fileFormat == FileFormat.EPS) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
index 44cea4efe2b..97aebdc93f1 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
@@ -88,20 +88,21 @@ private UGraphicSvg(UGraphicSvg other) {
}
public UGraphicSvg(boolean svgDimensionStyle, Dimension2D minDim, ColorMapper colorMapper, String backcolor,
- boolean textAsPath, double scale, String linkTarget, String hover, long seed) {
- this(minDim, colorMapper, new SvgGraphics(svgDimensionStyle, minDim, backcolor, scale, hover, seed),
- textAsPath, linkTarget);
+ boolean textAsPath, double scale, String linkTarget, String hover, long seed, String preserveAspectRatio) {
+ this(minDim, colorMapper, new SvgGraphics(svgDimensionStyle, minDim, backcolor, scale, hover, seed,
+ preserveAspectRatio), textAsPath, linkTarget);
}
public UGraphicSvg(boolean svgDimensionStyle, Dimension2D minDim, ColorMapper colorMapper, boolean textAsPath,
- double scale, String linkTarget, String hover, long seed) {
- this(minDim, colorMapper, new SvgGraphics(svgDimensionStyle, minDim, scale, hover, seed), textAsPath,
- linkTarget);
+ double scale, String linkTarget, String hover, long seed, String preserveAspectRatio) {
+ this(minDim, colorMapper, new SvgGraphics(svgDimensionStyle, minDim, scale, hover, seed, preserveAspectRatio),
+ textAsPath, linkTarget);
}
public UGraphicSvg(boolean svgDimensionStyle, Dimension2D minDim, ColorMapper mapper, HtmlColorGradient gr,
- boolean textAsPath, double scale, String linkTarget, String hover, long seed) {
- this(minDim, mapper, new SvgGraphics(svgDimensionStyle, minDim, scale, hover, seed), textAsPath, linkTarget);
+ boolean textAsPath, double scale, String linkTarget, String hover, long seed, String preserveAspectRatio) {
+ this(minDim, mapper, new SvgGraphics(svgDimensionStyle, minDim, scale, hover, seed, preserveAspectRatio),
+ textAsPath, linkTarget);
final SvgGraphics svg = getGraphicObject();
svg.paintBackcolorGradient(mapper, gr);
diff --git a/src/net/sourceforge/plantuml/utils/CharHidder.java b/src/net/sourceforge/plantuml/utils/CharHidder.java
index 5ce1a31a06e..beb4ba2f68c 100644
--- a/src/net/sourceforge/plantuml/utils/CharHidder.java
+++ b/src/net/sourceforge/plantuml/utils/CharHidder.java
@@ -46,7 +46,10 @@ public static String hide(String s) {
final StringBuilder result = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
final char c = s.charAt(i);
- if (c == '~' && i + 1 < s.length()) {
+ if (c == '\\' && i + 1 < s.length() && s.charAt(i + 1) == '~') {
+ result.append(hideChar('~'));
+ i++;
+ } else if (c == '~' && i + 1 < s.length()) {
i++;
final char c2 = s.charAt(i);
if (isToBeHidden(c2)) {
diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java
index 947113ca7a4..cdfee3042a7 100644
--- a/src/net/sourceforge/plantuml/version/Version.java
+++ b/src/net/sourceforge/plantuml/version/Version.java
@@ -43,7 +43,7 @@ public class Version {
private static final int MAJOR_SEPARATOR = 1000000;
public static int version() {
- return 1201911;
+ return 1201912;
}
public static int versionPatched() {
@@ -93,7 +93,7 @@ public static String turningId() {
}
public static long compileTime() {
- return 1569146535007L;
+ return 1572776694309L;
}
public static String compileTimeString() {
diff --git a/stdlib/home.repx b/stdlib/home.repx
index 9496900f7fa..b0956634594 100644
--- a/stdlib/home.repx
+++ b/stdlib/home.repx
@@ -8,3 +8,4 @@ material
office
c4
osa
+kubernetes
diff --git a/stdlib/kubernetes-abx.repx b/stdlib/kubernetes-abx.repx
new file mode 100644
index 00000000000..5563efebb96
Binary files /dev/null and b/stdlib/kubernetes-abx.repx differ
diff --git a/stdlib/kubernetes-dex.repx b/stdlib/kubernetes-dex.repx
new file mode 100644
index 00000000000..22b008ffa9c
Binary files /dev/null and b/stdlib/kubernetes-dex.repx differ
diff --git a/stdlib/osa-abx.repx b/stdlib/osa-abx.repx
index 95516ae1867..14cbddfdebd 100644
Binary files a/stdlib/osa-abx.repx and b/stdlib/osa-abx.repx differ
diff --git a/stdlib/osa-dex.repx b/stdlib/osa-dex.repx
index e0870ae6eb3..d471bdd3d86 100644
Binary files a/stdlib/osa-dex.repx and b/stdlib/osa-dex.repx differ