1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-21 12:35:10 +00:00

version 1.2019.12

This commit is contained in:
Arnaud Roques 2019-11-03 18:40:03 +01:00
parent 82b570d0f0
commit 36c461dabe
55 changed files with 557 additions and 142 deletions

View File

@ -35,7 +35,7 @@
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2019.12-SNAPSHOT</version>
<version>1.2019.13-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>

View File

@ -379,11 +379,12 @@ UNSUPPORTED("1um729vqiy3529kbsrzyl9u3y"); // rtp->InTouchCount++;
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 */

View File

@ -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 class FileFormatOption implements Serializable {
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 @@ public final class FileFormatOption implements Serializable {
this.debugsvek = debugsvek;
this.tikzFontDistortion = tikzFontDistortion;
this.scale = scale;
this.preserveAspectRatio = preserveAspectRatio;
if (tikzFontDistortion == null) {
throw new IllegalArgumentException();
}
@ -101,27 +107,32 @@ public final class FileFormatOption implements Serializable {
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

View File

@ -141,6 +141,8 @@ public interface ISkinParam extends ISkinSimple {
public String getSvgLinkTarget();
public String getPreserveAspectRatio();
public int getTabSize();
public int maxAsciiMessageLength();

View File

@ -1046,6 +1046,15 @@ public class SkinParam implements ISkinParam {
}
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");

View File

@ -234,6 +234,10 @@ public class SkinParamDelegator implements ISkinParam {
public String getSvgLinkTarget() {
return skinParam.getSvgLinkTarget();
}
public String getPreserveAspectRatio() {
return skinParam.getPreserveAspectRatio();
}
public String getMonospacedFamily() {
return skinParam.getMonospacedFamily();
@ -355,4 +359,5 @@ public class SkinParamDelegator implements ISkinParam {
skinParam.setDefaultSkin(newFileName);
}
}

View File

@ -186,6 +186,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
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()

View File

@ -61,6 +61,7 @@ import net.sourceforge.plantuml.command.CommandEndPackage;
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 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandNamespace());
cmds.add(new CommandNamespace2());
cmds.add(new CommandNamespaceEmpty());
cmds.add(new CommandStereotype());
cmds.add(new CommandLinkClass(UmlDiagramType.CLASS));

View File

@ -76,7 +76,8 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
}
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 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
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 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
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());
}

View File

@ -48,7 +48,6 @@ import net.sourceforge.plantuml.command.regex.RegexOr;
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<TitledDiagram> {

View File

@ -48,7 +48,6 @@ import net.sourceforge.plantuml.command.regex.RegexOr;
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<TitledDiagram> {

View File

@ -42,7 +42,6 @@ import net.sourceforge.plantuml.UmlDiagram;
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<TitledDiagram> {

View File

@ -42,7 +42,6 @@ import net.sourceforge.plantuml.UmlDiagram;
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<TitledDiagram> {

View File

@ -43,7 +43,6 @@ 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.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;

View File

@ -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<ClassDiagram> {
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();
}
}

View File

@ -69,7 +69,7 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
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( //

View File

@ -53,7 +53,6 @@ import net.sourceforge.plantuml.core.UmlSource;
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;

View File

@ -75,6 +75,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
private final List<HideOrShow2> removed = new ArrayList<HideOrShow2>();
protected final EntityFactory entityFactory = new EntityFactory(hides2, removed);
private IGroup currentGroup = entityFactory.getRootGroup();
private List<IGroup> stacks = new ArrayList<IGroup>();
private boolean visibilityModifierPresent;
@ -196,6 +197,8 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
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 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
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 abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
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;
}

View File

@ -54,6 +54,7 @@ import net.sourceforge.plantuml.StringUtils;
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.skin.VisibilityModifier;
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<CharSequence> {
@ -270,6 +272,26 @@ public class Display implements Iterable<CharSequence> {
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<CharSequence> result = new ArrayList<CharSequence>(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<CharSequence> result = new ArrayList<CharSequence>();
for (CharSequence line : displayData) {

View File

@ -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:

View File

@ -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,

View File

@ -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());

View File

@ -48,7 +48,7 @@ class USymbolEntityDomain extends USymbolSimpleAbstract {
@Override
public SkinParameter getSkinParameter() {
return SkinParameter.ENTITY_DOMAIN;
return SkinParameter.ENTITY;
}

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.Direction;
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.StringBounder;
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 @@ public class FingerImpl implements Finger, UDrawable {
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());
}

View File

@ -46,10 +46,6 @@ import net.sourceforge.plantuml.style.StyleBuilder;
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 @@ class Idea {
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;

View File

@ -181,19 +181,17 @@ public class MindMapDiagram extends UmlDiagram {
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 @@ public class MindMapDiagram extends UmlDiagram {
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;
}

View File

@ -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<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String s = arg.get("COMPLEMENT" + suffix, 0);
return Failable.<Complement> ok(DayOfWeek.fromString(s));
}
}

View File

@ -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<Complement> 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.<Complement> ok(LoadInDays.inDay(days));
// }
// return Failable.<Complement> ok(LoadInDays.inDayWithLoad(days, Integer.parseInt(load)));
}
}

View File

@ -37,7 +37,7 @@ package net.sourceforge.plantuml.project3;
import net.sourceforge.plantuml.StringUtils;
public enum DayOfWeek implements Subject {
public enum DayOfWeek implements Subject, Complement {
MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;

View File

@ -586,7 +586,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
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;

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.project3;
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;

View File

@ -49,11 +49,6 @@ public class LoadInDays implements Load {
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;
}

View File

@ -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<Instant> closed = new TreeSet<Instant>();
private final Set<Instant> closed = new TreeSet<Instant>();
private final Set<Instant> forcedOn = new TreeSet<Instant>();
private final GCalendar calendar;
public Resource(String name, LoadPlanable loadPlanable) {
private final Collection<DayOfWeek> 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 class Resource implements Subject /* , LoadPlanable */{
}
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);
}
}

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
public class SubjectResource implements SubjectPattern {
public Collection<VerbPattern> getVerbs() {
return Arrays.<VerbPattern> asList(new VerbIsOff());
return Arrays.<VerbPattern> asList(new VerbIsOff(), new VerbIsOn());
}
public IRegex toRegex() {

View File

@ -42,12 +42,14 @@ 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 VerbIsOff implements VerbPattern {
public Collection<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> asList(new ComplementDate(), new ComplementDates());
return Arrays
.<ComplementPattern> asList(new ComplementDate(), new ComplementDates(), new ComplementDayOfWeek());
}
public IRegex toRegex() {
@ -55,14 +57,21 @@ public class VerbIsOff implements VerbPattern {
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 class VerbIsOff implements VerbPattern {
};
}
}

View File

@ -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<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> 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();
}
};
}
}

View File

@ -40,8 +40,12 @@ 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.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 class VerbProjectStarts implements VerbPattern {
return Arrays.<ComplementPattern> 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) {

View File

@ -370,6 +370,16 @@ public class Rose {
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 @@ public class Rose {
.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,

View File

@ -88,7 +88,7 @@ public class GraphicsSudoku {
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();

View File

@ -50,7 +50,8 @@ public class ExtremityFactoryCrowfoot extends AbstractExtremityFactory implement
@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);
}
}

View File

@ -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 @@ public class SvgGraphics {
}
}
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 @@ public class SvgGraphics {
}
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");

View File

@ -82,6 +82,7 @@ public class LanguageDescriptor {
type.add("queue");
type.add("archimate");
type.add("diamond");
type.add("detach");
keyword.add("@startuml");
keyword.add("@enduml");

View File

@ -75,6 +75,7 @@ import net.sourceforge.plantuml.tim.stdlib.FileExists;
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 @@ public class TContext {
addFunction(new SetVariableValue());
addFunction(new GetVariableValue());
addFunction(new IntVal());
addFunction(new GetVersion());
// !exit
// !log
// %min

View File

@ -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<TValue> args) throws EaterException {
return TValue.fromString(Version.versionString());
}
}

View File

@ -157,7 +157,7 @@ public class FontChecker {
}
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();

View File

@ -393,7 +393,7 @@ public class ImageBuilder {
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 @@ public class ImageBuilder {
}
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 @@ public class ImageBuilder {
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;

View File

@ -65,7 +65,7 @@ public abstract class UGraphicUtils {
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) {

View File

@ -88,20 +88,21 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
}
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);

View File

@ -46,7 +46,10 @@ public class CharHidder {
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)) {

View File

@ -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 class Version {
}
public static long compileTime() {
return 1569146535007L;
return 1572776694309L;
}
public static String compileTimeString() {

View File

@ -8,3 +8,4 @@ material
office
c4
osa
kubernetes

BIN
stdlib/kubernetes-abx.repx Normal file

Binary file not shown.

BIN
stdlib/kubernetes-dex.repx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.