1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00

version 1.2019.4

This commit is contained in:
Arnaud Roques 2019-03-29 23:14:07 +01:00
parent 120fb859b2
commit 857ec10b8b
456 changed files with 8061 additions and 1606 deletions

View File

@ -69,7 +69,7 @@
<jar jarfile="plantuml.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
<attribute name="Class-Path" value="avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar commons-logging-1.0.4.jar fop.jar xml-apis-ext-1.3.04.jar xmlgraphics-commons-1.4.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
<attribute name="Class-Path" value="avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar commons-logging-1.0.4.jar fop.jar xml-apis-ext-1.3.04.jar xmlgraphics-commons-1.4.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar ditaa0_9.jar" />
</manifest>
</jar>
<delete dir="build" />

View File

@ -30,13 +30,12 @@
Script Author: Julien Eluard
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2019.2-SNAPSHOT</version>
<version>1.2019.5-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>

View File

@ -48,18 +48,21 @@ import net.sourceforge.plantuml.code.TranscoderUtil;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.preproc2.PreprocessorMode;
import net.sourceforge.plantuml.preproc2.PreprocessorModeSet;
import net.sourceforge.plantuml.tim.TimLoader;
import net.sourceforge.plantuml.utils.StartUtils;
import net.sourceforge.plantuml.version.Version;
public class BlockUml {
private final List<CharSequence2> data;
private final List<StringLocated> data;
private Diagram system;
private final Defines localDefines;
private final ISkinSimple skinParam;
BlockUml(String... strings) {
this(convert(strings), Defines.createEmpty(), null);
this(convert(strings), Defines.createEmpty(), null, null);
}
public String getEncodedUrl() throws IOException {
@ -71,43 +74,47 @@ public class BlockUml {
public String getFlashData() {
final StringBuilder sb = new StringBuilder();
for (CharSequence2 line : data) {
sb.append(line);
for (StringLocated line : data) {
sb.append(line.getString());
sb.append('\r');
sb.append(BackSlash.CHAR_NEWLINE);
}
return sb.toString();
}
public static List<CharSequence2> convert(String... strings) {
public static List<StringLocated> convert(String... strings) {
return convert(Arrays.asList(strings));
}
public static List<CharSequence2> convert(List<String> strings) {
final List<CharSequence2> result = new ArrayList<CharSequence2>();
public static List<StringLocated> convert(List<String> strings) {
final List<StringLocated> result = new ArrayList<StringLocated>();
LineLocationImpl location = new LineLocationImpl("block", null);
for (String s : strings) {
location = location.oneLineRead();
result.add(new CharSequence2Impl(s, location));
result.add(new StringLocated(s, location));
}
return result;
}
public BlockUml(List<CharSequence2> strings, Defines defines, ISkinSimple skinParam) {
public BlockUml(List<StringLocated> strings, Defines defines, ISkinSimple skinParam, PreprocessorModeSet mode) {
this.localDefines = defines;
this.skinParam = skinParam;
final CharSequence2 s0 = strings.get(0).trin();
final String s0 = strings.get(0).getStringTrimmed();
if (StartUtils.startsWithSymbolAnd("start", s0) == false) {
throw new IllegalArgumentException();
}
this.data = new ArrayList<CharSequence2>(strings);
if (mode != null && mode.getPreprocessorMode() == PreprocessorMode.V2_NEW_TIM) {
this.data = new TimLoader(mode.getImportedFiles()).load(strings);
} else {
this.data = new ArrayList<StringLocated>(strings);
}
}
public String getFileOrDirname() {
if (OptionFlags.getInstance().isWord()) {
return null;
}
final Matcher2 m = StartUtils.patternFilename.matcher(StringUtils.trin(data.get(0).toString()));
final Matcher2 m = StartUtils.patternFilename.matcher(StringUtils.trin(data.get(0).getString()));
final boolean ok = m.find();
if (ok == false) {
return null;
@ -137,7 +144,7 @@ public class BlockUml {
return system;
}
public final List<CharSequence2> getData() {
public final List<StringLocated> getData() {
return data;
}
@ -145,8 +152,8 @@ public class BlockUml {
try {
final AsciiEncoder coder = new AsciiEncoder();
final MessageDigest msgDigest = MessageDigest.getInstance("MD5");
for (CharSequence s : data) {
msgDigest.update(s.toString().getBytes("UTF-8"));
for (StringLocated s : data) {
msgDigest.update(s.getString().getBytes("UTF-8"));
}
final byte[] digest = msgDigest.digest();
return coder.encode(digest);
@ -166,14 +173,18 @@ public class BlockUml {
public boolean isStartDef(String name) {
final String signature = "@startdef(id=" + name + ")";
return data.get(0).toString().equalsIgnoreCase(signature);
return data.get(0).getString().equalsIgnoreCase(signature);
}
public List<? extends CharSequence> getDefinition(boolean withHeader) {
if (withHeader) {
return Collections.unmodifiableList(data);
public List<String> getDefinition(boolean withHeader) {
final List<String> data2 = new ArrayList<String>();
for (StringLocated s : data) {
data2.add(s.getString());
}
return Collections.unmodifiableList(data.subList(1, data.size() - 1));
if (withHeader) {
return Collections.unmodifiableList(data2);
}
return Collections.unmodifiableList(data2.subList(1, data2.size() - 1));
}
public Defines getLocalDefines() {

View File

@ -45,30 +45,35 @@ import java.util.List;
import java.util.Set;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.preproc.DefinesGet;
import net.sourceforge.plantuml.preproc.FileWithSuffix;
import net.sourceforge.plantuml.preproc.ImportedFiles;
import net.sourceforge.plantuml.preproc.PreprocessorChangeModeReader;
import net.sourceforge.plantuml.preproc.ReadLineNumbered;
import net.sourceforge.plantuml.preproc.ReadLineReader;
import net.sourceforge.plantuml.preproc.UncommentReadLine;
import net.sourceforge.plantuml.preproc2.Preprocessor2;
import net.sourceforge.plantuml.preproc2.Preprocessor;
import net.sourceforge.plantuml.preproc2.PreprocessorMode;
import net.sourceforge.plantuml.utils.StartUtils;
public final class BlockUmlBuilder implements DefinitionsContainer {
private PreprocessorMode mode = PreprocessorMode.V1_LEGACY;
private final List<BlockUml> blocks = new ArrayList<BlockUml>();
private Set<FileWithSuffix> usedFiles = new HashSet<FileWithSuffix>();
private final UncommentReadLine reader2;
private final Defines defines;
private final ImportedFiles importedFiles;
public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader reader, File newCurrentDir,
String desc) throws IOException {
ReadLineNumbered includer = null;
this.defines = defines;
try {
reader2 = new UncommentReadLine(ReadLineReader.create(reader, desc));
includer = new Preprocessor2(config, reader2, charset, defines, this,
ImportedFiles.createImportedFiles(new AParentFolderRegular(newCurrentDir)));
this.reader2 = new UncommentReadLine(new PreprocessorChangeModeReader(ReadLineReader.create(reader, desc),
this));
this.importedFiles = ImportedFiles.createImportedFiles(new AParentFolderRegular(newCurrentDir));
includer = new Preprocessor(config, reader2, charset, defines, this, importedFiles);
init(includer);
} finally {
if (includer != null) {
@ -83,41 +88,41 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
}
private void init(ReadLineNumbered includer) throws IOException {
CharSequence2 s = null;
List<CharSequence2> current2 = null;
StringLocated s = null;
List<StringLocated> current2 = null;
boolean paused = false;
while ((s = includer.readLine()) != null) {
if (StartUtils.isArobaseStartDiagram(s)) {
current2 = new ArrayList<CharSequence2>();
if (StartUtils.isArobaseStartDiagram(s.getString())) {
current2 = new ArrayList<StringLocated>();
paused = false;
}
if (StartUtils.isArobasePauseDiagram(s)) {
if (StartUtils.isArobasePauseDiagram(s.getString())) {
paused = true;
reader2.setPaused(true);
}
if (StartUtils.isExit(s)) {
if (StartUtils.isExit(s.getString())) {
paused = true;
reader2.setPaused(true);
}
if (current2 != null && paused == false) {
current2.add(s);
} else if (paused) {
final CharSequence2 append = StartUtils.getPossibleAppend(s);
final StringLocated append = StartUtils.getPossibleAppend(s);
if (append != null) {
current2.add(append);
}
}
if (StartUtils.isArobaseUnpauseDiagram(s)) {
if (StartUtils.isArobaseUnpauseDiagram(s.getString())) {
paused = false;
reader2.setPaused(false);
}
if (StartUtils.isArobaseEndDiagram(s) && current2 != null) {
if (StartUtils.isArobaseEndDiagram(s.getString()) && current2 != null) {
if (paused) {
current2.add(s);
}
blocks.add(new BlockUml(current2, defines.cloneMe(), null));
blocks.add(new BlockUml(current2, defines.cloneMe(), null, this));
current2 = null;
reader2.setPaused(false);
}
@ -132,7 +137,7 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
return Collections.unmodifiableSet(usedFiles);
}
public List<? extends CharSequence> getDefinition(String name) {
public List<String> getDefinition(String name) {
for (BlockUml block : blocks) {
if (block.isStartDef(name)) {
this.defines.importFrom(block.getLocalDefines());
@ -142,4 +147,16 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
return Collections.emptyList();
}
public PreprocessorMode getPreprocessorMode() {
return mode;
}
public void setPreprocessorMode(PreprocessorMode mode) {
this.mode = mode;
}
public final ImportedFiles getImportedFiles() {
return importedFiles;
}
}

View File

@ -37,8 +37,10 @@ package net.sourceforge.plantuml;
import java.util.List;
public interface DefinitionsContainer {
import net.sourceforge.plantuml.preproc2.PreprocessorModeSet;
public List<? extends CharSequence> getDefinition(String name);
public interface DefinitionsContainer extends PreprocessorModeSet {
public List<String> getDefinition(String name);
}

View File

@ -40,6 +40,7 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import javax.imageio.ImageIO;
@ -84,6 +85,10 @@ public class EmbeddedDiagram implements CharSequence {
private BufferedImage image;
private final ISkinSimple skinParam;
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
throw new UnsupportedOperationException(getClass().toString());
}
private Draw(ISkinSimple skinParam) {
this.skinParam = skinParam;
}
@ -155,7 +160,7 @@ public class EmbeddedDiagram implements CharSequence {
}
private Diagram getSystem() throws IOException, InterruptedException {
final BlockUml blockUml = new BlockUml(system.as2(), Defines.createEmpty(), skinParam);
final BlockUml blockUml = new BlockUml(system.as2(), Defines.createEmpty(), skinParam, null);
return blockUml.getDiagram();
}

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
* @author Arnaud Roques
*
*/
public class FileFormatOption implements Serializable {
public final class FileFormatOption implements Serializable {
private final FileFormat fileFormat;
private final AffineTransform affineTransform;
@ -56,9 +56,14 @@ public class FileFormatOption implements Serializable {
private final String svgLinkTarget;
private final String hoverColor;
private final TikzFontDistortion tikzFontDistortion;
private final double scale;
public double getScaleCoef() {
return scale;
}
public FileFormatOption(FileFormat fileFormat) {
this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault());
this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0);
}
public StringBounder getDefaultStringBounder() {
@ -74,11 +79,12 @@ public class FileFormatOption implements Serializable {
}
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
this(fileFormat, null, false, false, "_top", false, null, TikzFontDistortion.getDefault());
this(fileFormat, null, false, false, "_top", false, null, TikzFontDistortion.getDefault(), 1.0);
}
private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError,
String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion) {
String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion,
double scale) {
this.hoverColor = hoverColor;
this.fileFormat = fileFormat;
this.affineTransform = at;
@ -87,6 +93,7 @@ public class FileFormatOption implements Serializable {
this.svgLinkTarget = svgLinkTarget;
this.debugsvek = debugsvek;
this.tikzFontDistortion = tikzFontDistortion;
this.scale = scale;
if (tikzFontDistortion == null) {
throw new IllegalArgumentException();
}
@ -94,22 +101,27 @@ public class FileFormatOption implements Serializable {
public FileFormatOption withUseRedForError() {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion);
hoverColor, tikzFontDistortion, scale);
}
public FileFormatOption withTikzFontDistortion(TikzFontDistortion tikzFontDistortion) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion);
hoverColor, tikzFontDistortion, scale);
}
public FileFormatOption withSvgLinkTarget(String svgLinkTarget) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
debugsvek, hoverColor, tikzFontDistortion);
debugsvek, hoverColor, tikzFontDistortion, scale);
}
public FileFormatOption withHoverColor(String hoverColor) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
debugsvek, hoverColor, tikzFontDistortion);
debugsvek, hoverColor, tikzFontDistortion, scale);
}
public FileFormatOption withScale(double scale) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
debugsvek, hoverColor, tikzFontDistortion, scale);
}
@Override

View File

@ -152,7 +152,9 @@ public class FileUtils {
// return ImageIO.read(f);
// }
public static BufferedImage ImageIO_read(File f) {
// http://forum.plantuml.net/9048/img-tag-for-sequence-diagram-participants-does-always-render
public synchronized static BufferedImage ImageIO_read(File f) {
// https://www.experts-exchange.com/questions/26171948/Why-are-ImageIO-read-images-losing-their-transparency.html
// https://stackoverflow.com/questions/18743790/can-java-load-images-with-transparency
@ -163,7 +165,7 @@ public class FileUtils {
}
}
public static BufferedImage ImageIO_read(URL url) {
public synchronized static BufferedImage ImageIO_read(URL url) {
try {
return readImage(new ImageIcon(url));
} catch (Exception e) {
@ -171,7 +173,7 @@ public class FileUtils {
}
}
private static BufferedImage readImage(final ImageIcon imageIcon) {
private synchronized static BufferedImage readImage(final ImageIcon imageIcon) {
final Image tmpImage = imageIcon.getImage();
final BufferedImage image = new BufferedImage(imageIcon.getIconWidth(), imageIcon.getIconHeight(),
BufferedImage.TYPE_INT_ARGB);

View File

@ -90,6 +90,7 @@ public enum FontParam {
SEQUENCE_GROUP(11, Font.BOLD), //
SEQUENCE_GROUP_HEADER(13, Font.BOLD), //
PARTICIPANT(14, Font.PLAIN), //
PARTICIPANT_STEREOTYPE(14, Font.ITALIC), //
SEQUENCE_TITLE(14, Font.BOLD), //
STATE(14, Font.PLAIN), //
STATE_ATTRIBUTE(12, Font.PLAIN), //

View File

@ -0,0 +1,100 @@
/* ========================================================================
* 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;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
public class Guillemet {
public static final Guillemet NONE = new Guillemet("", "");
public static final Guillemet DOUBLE_COMPARATOR = new Guillemet("<<", ">>");
public static final Guillemet GUILLEMET = new Guillemet("\u00AB", "\u00BB");
private final String start;
private final String end;
public Guillemet fromDescription(String value) {
if (value != null) {
if ("false".equalsIgnoreCase(value)) {
return Guillemet.DOUBLE_COMPARATOR;
}
if ("<< >>".equalsIgnoreCase(value)) {
return Guillemet.DOUBLE_COMPARATOR;
}
if ("none".equalsIgnoreCase(value)) {
return Guillemet.NONE;
}
if (value.contains(" ")) {
final StringTokenizer st = new StringTokenizer(value, " ");
return new Guillemet(st.nextToken(), st.nextToken());
}
}
return Guillemet.GUILLEMET;
}
private Guillemet(String start, String end) {
this.start = start;
this.end = end;
}
public String manageGuillemet(String st) {
if (this == DOUBLE_COMPARATOR) {
return st;
}
return st.replaceAll("\\<\\<\\s?((?:\\<&\\w+\\>|[^<>])+?)\\s?\\>\\>", Matcher.quoteReplacement(start) + "$1"
+ Matcher.quoteReplacement(end));
}
public String manageGuillemetStrict(String st) {
if (this == DOUBLE_COMPARATOR) {
return st;
}
if (st.startsWith("<< ")) {
st = start + st.substring(3);
} else if (st.startsWith("<<")) {
st = start + st.substring(2);
}
if (st.endsWith(" >>")) {
st = st.substring(0, st.length() - 3) + end;
} else if (st.endsWith(">>")) {
st = st.substring(0, st.length() - 2) + end;
}
return st;
}
}

View File

@ -125,7 +125,7 @@ public interface ISkinParam extends ISkinSimple {
public int groupInheritance();
public boolean useGuillemet();
public Guillemet guillemet();
public boolean handwritten();

View File

@ -64,8 +64,8 @@ public class LineLocationImpl implements LineLocation {
}
public static LineLocation fromLine(CharSequence cs) {
if (cs instanceof CharSequence2) {
return ((CharSequence2) cs).getLocation();
if (cs instanceof StringLocated) {
return ((StringLocated) cs).getLocation();
}
return null;
}

View File

@ -50,7 +50,6 @@ import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.creole.PSystemCreoleFactory;
import net.sourceforge.plantuml.cute.PSystemCuteFactory;
import net.sourceforge.plantuml.dedication.PSystemDedicationFactory;
import net.sourceforge.plantuml.definition.PSystemDefinitionFactory;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagramFactory;
@ -62,16 +61,12 @@ import net.sourceforge.plantuml.eggs.PSystemAppleTwoFactory;
import net.sourceforge.plantuml.eggs.PSystemCharlieFactory;
import net.sourceforge.plantuml.eggs.PSystemColorsFactory;
import net.sourceforge.plantuml.eggs.PSystemEggFactory;
import net.sourceforge.plantuml.eggs.PSystemLostFactory;
import net.sourceforge.plantuml.eggs.PSystemPathFactory;
import net.sourceforge.plantuml.eggs.PSystemRIPFactory;
import net.sourceforge.plantuml.eggs.PSystemWelcomeFactory;
import net.sourceforge.plantuml.flowdiagram.FlowDiagramFactory;
import net.sourceforge.plantuml.font.PSystemListFontsFactory;
import net.sourceforge.plantuml.help.HelpFactory;
import net.sourceforge.plantuml.jcckit.PSystemJcckitFactory;
import net.sourceforge.plantuml.jungle.PSystemTreeFactory;
import net.sourceforge.plantuml.logo.PSystemLogoFactory;
import net.sourceforge.plantuml.math.PSystemLatexFactory;
import net.sourceforge.plantuml.math.PSystemMathFactory;
import net.sourceforge.plantuml.mindmap.MindMapDiagramFactory;
@ -79,7 +74,6 @@ import net.sourceforge.plantuml.nwdiag.NwDiagramFactory;
import net.sourceforge.plantuml.openiconic.PSystemListOpenIconicFactory;
import net.sourceforge.plantuml.openiconic.PSystemOpenIconicFactory;
import net.sourceforge.plantuml.oregon.PSystemOregonFactory;
import net.sourceforge.plantuml.postit.PostIdDiagramFactory;
import net.sourceforge.plantuml.project3.GanttDiagramFactory;
import net.sourceforge.plantuml.salt.PSystemSaltFactory;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagramFactory;
@ -91,22 +85,23 @@ import net.sourceforge.plantuml.ugraphic.sprite.PSystemListInternalSpritesFactor
import net.sourceforge.plantuml.version.License;
import net.sourceforge.plantuml.version.PSystemLicenseFactory;
import net.sourceforge.plantuml.version.PSystemVersionFactory;
import net.sourceforge.plantuml.wbs.WBSDiagramFactory;
public class PSystemBuilder {
public static final long startTime = System.currentTimeMillis();
final public Diagram createPSystem(ISkinSimple skinParam, final List<CharSequence2> strings2) {
final public Diagram createPSystem(ISkinSimple skinParam, final List<StringLocated> strings2) {
final long now = System.currentTimeMillis();
Diagram result = null;
try {
final DiagramType type = DiagramType.getTypeFromArobaseStart(strings2.get(0).toString2());
final DiagramType type = DiagramType.getTypeFromArobaseStart(strings2.get(0).getString());
final UmlSource umlSource = new UmlSource(strings2, type == DiagramType.UML);
// int cpt = 0;
for (CharSequence2 s : strings2) {
for (StringLocated s : strings2) {
if (s.getPreprocessorError() != null) {
Log.error("Preprocessor Error: " + s.getPreprocessorError());
final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, s.getPreprocessorError(), /* cpt */
@ -153,10 +148,8 @@ public class PSystemBuilder {
factories.add(new StateDiagramFactory());
factories.add(new ActivityDiagramFactory3());
factories.add(new CompositeDiagramFactory());
// factories.add(new ObjectDiagramFactory());
factories.add(new BpmDiagramFactory(DiagramType.BPM));
factories.add(new PostIdDiagramFactory());
// factories.add(new PrintSkinFactory());
// factories.add(new PostIdDiagramFactory());
factories.add(new PSystemLicenseFactory());
factories.add(new PSystemVersionFactory());
factories.add(new PSystemDonorsFactory());
@ -171,12 +164,13 @@ public class PSystemBuilder {
factories.add(new PSystemDotFactory(DiagramType.UML));
factories.add(new NwDiagramFactory());
factories.add(new MindMapDiagramFactory());
factories.add(new WBSDiagramFactory());
factories.add(new PSystemDitaaFactory(DiagramType.DITAA));
factories.add(new PSystemDitaaFactory(DiagramType.UML));
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
factories.add(new PSystemDitaaFactory(DiagramType.DITAA));
factories.add(new PSystemDitaaFactory(DiagramType.UML));
factories.add(new PSystemJcckitFactory(DiagramType.JCCKIT));
factories.add(new PSystemJcckitFactory(DiagramType.UML));
factories.add(new PSystemLogoFactory());
// factories.add(new PSystemLogoFactory());
factories.add(new PSystemSudokuFactory());
}
factories.add(new PSystemDefinitionFactory());
@ -187,8 +181,8 @@ public class PSystemBuilder {
factories.add(new PSystemEggFactory());
factories.add(new PSystemAppleTwoFactory());
factories.add(new PSystemRIPFactory());
factories.add(new PSystemLostFactory());
factories.add(new PSystemPathFactory());
// factories.add(new PSystemLostFactory());
// factories.add(new PSystemPathFactory());
factories.add(new PSystemOregonFactory());
factories.add(new PSystemCharlieFactory());
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
@ -197,8 +191,8 @@ public class PSystemBuilder {
factories.add(new GanttDiagramFactory(DiagramType.GANTT));
factories.add(new GanttDiagramFactory(DiagramType.UML));
factories.add(new FlowDiagramFactory());
factories.add(new PSystemTreeFactory(DiagramType.JUNGLE));
factories.add(new PSystemCuteFactory(DiagramType.CUTE));
// factories.add(new PSystemTreeFactory(DiagramType.JUNGLE));
// factories.add(new PSystemCuteFactory(DiagramType.CUTE));
factories.add(new PSystemDedicationFactory());
factories.add(new TimingDiagramFactory());
factories.add(new HelpFactory());

View File

@ -419,11 +419,13 @@ public class PSystemError extends AbstractPSystem {
private List<String> getPartialCode() {
List<String> result = new ArrayList<String>();
for (Iterator<CharSequence2> it = getSource().iterator2(); it.hasNext();) {
final CharSequence2 s = it.next();
result.add(s.toString());
if (s.getLocation().getDescription().equals(higherErrorPosition.getDescription())
&& s.getLocation().compareTo(higherErrorPosition) >= 0) {
for (Iterator<StringLocated> it = getSource().iterator2(); it.hasNext();) {
final StringLocated s = it.next();
final String tmp = s.getString();
result.add(tmp);
final LineLocation location = s.getLocation();
if (location.getDescription().equals(higherErrorPosition.getDescription())
&& location.compareTo(higherErrorPosition) >= 0) {
break;
}
}
@ -458,11 +460,7 @@ public class PSystemError extends AbstractPSystem {
final String last = htmlStrings.get(idx);
htmlStrings.set(idx, "<w:" + getRed(useRed) + ">" + last + "</w>");
}
// final String errorLine = getSource().getLine(higherErrorPosition);
// final String err = StringUtils.hideComparatorCharacters(errorLine);
// if (StringUtils.isNotEmpty(err)) {
// htmlStrings.add("<w:" + getRed(useRed) + ">" + err + "</w>");
// }
final Collection<String> textErrors = new LinkedHashSet<String>();
for (ErrorUml er : printedErrors) {
textErrors.add(er.getError());

View File

@ -247,8 +247,8 @@ public class PSystemUtils {
if (fileFormat.getFileFormat() == FileFormat.PNG) {
result = new PngSplitter(suggestedFile, system.getHorizontalPages(), system.getVerticalPages(),
system.getMetadata(), system.getDpi(fileFormat), fileFormat.isWithMetadata(), system.getSkinParam()
.getSplitParam()).getFiles();
system.getMetadata(), (int) (system.getScaleCoef(fileFormat) * 96), fileFormat.isWithMetadata(),
system.getSkinParam().getSplitParam()).getFiles();
}
final List<FileImageData> result2 = new ArrayList<FileImageData>();
for (File f : result) {

View File

@ -220,7 +220,7 @@ public class SkinParam implements ISkinParam {
if (stereotype == null) {
throw new IllegalArgumentException();
}
final String value2 = getValue("spotchar" + stereotype.getLabel(false));
final String value2 = getValue("spotchar" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null && value2.length() > 0) {
return value2.charAt(0);
}
@ -230,7 +230,7 @@ public class SkinParam implements ISkinParam {
public Colors getColors(ColorParam param, Stereotype stereotype) {
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue(param.name() + "color" + stereotype.getLabel(false));
final String value2 = getValue(param.name() + "color" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null && getIHtmlColorSet().getColorIfValid(value2) != null) {
return new Colors(value2, getIHtmlColorSet(), param.getColorType());
}
@ -261,7 +261,8 @@ public class SkinParam implements ISkinParam {
private int getFontSize(Stereotype stereotype, FontParam... param) {
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getFirstValueNonNullWithSuffix("fontsize" + stereotype.getLabel(false), param);
final String value2 = getFirstValueNonNullWithSuffix(
"fontsize" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR), param);
if (value2 != null && value2.matches("\\d+")) {
return Integer.parseInt(value2);
}
@ -279,7 +280,8 @@ public class SkinParam implements ISkinParam {
private String getFontFamily(Stereotype stereotype, FontParam... param) {
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getFirstValueNonNullWithSuffix("fontname" + stereotype.getLabel(false), param);
final String value2 = getFirstValueNonNullWithSuffix(
"fontname" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR), param);
if (value2 != null) {
return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value2);
}
@ -302,7 +304,8 @@ public class SkinParam implements ISkinParam {
String value = null;
if (stereotype != null) {
checkStereotype(stereotype);
value = getFirstValueNonNullWithSuffix("fontcolor" + stereotype.getLabel(false), param);
value = getFirstValueNonNullWithSuffix("fontcolor" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR),
param);
}
if (value == null || getIHtmlColorSet().getColorIfValid(value) == null) {
value = getFirstValueNonNullWithSuffix("fontcolor", param);
@ -330,7 +333,8 @@ public class SkinParam implements ISkinParam {
String value = null;
if (stereotype != null) {
checkStereotype(stereotype);
value = getFirstValueNonNullWithSuffix("fontstyle" + stereotype.getLabel(false), param);
value = getFirstValueNonNullWithSuffix("fontstyle" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR),
param);
}
if (value == null) {
value = getFirstValueNonNullWithSuffix("fontstyle", param);
@ -579,7 +583,7 @@ public class SkinParam implements ISkinParam {
public boolean shadowing(Stereotype stereotype) {
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue("shadowing" + stereotype.getLabel(false));
final String value2 = getValue("shadowing" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null) {
return value2.equalsIgnoreCase("true");
}
@ -600,7 +604,7 @@ public class SkinParam implements ISkinParam {
public boolean shadowingForNote(Stereotype stereotype) {
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue("note" + "shadowing" + stereotype.getLabel(false));
final String value2 = getValue("note" + "shadowing" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null) {
return value2.equalsIgnoreCase("true");
}
@ -619,7 +623,7 @@ public class SkinParam implements ISkinParam {
final String name = skinParameter.getUpperCaseName();
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue(name + "shadowing" + stereotype.getLabel(false));
final String value2 = getValue(name + "shadowing" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null) {
return value2.equalsIgnoreCase("true");
}
@ -743,7 +747,7 @@ public class SkinParam implements ISkinParam {
private Double getCornerInternal(String key, CornerParam param, Stereotype stereotype) {
if (stereotype != null) {
key += stereotype.getLabel(false);
key += stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR);
}
final String value = getValue(key);
if (value != null && value.matches("\\d+")) {
@ -757,12 +761,14 @@ public class SkinParam implements ISkinParam {
if (stereotype != null) {
checkStereotype(stereotype);
final String styleValue = getValue(param.name() + "style" + stereotype.getLabel(false));
final String styleValue = getValue(param.name() + "style"
+ stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (styleValue != null) {
style = LinkStyle.fromString2(styleValue);
}
final String value2 = getValue(param.name() + "thickness" + stereotype.getLabel(false));
final String value2 = getValue(param.name() + "thickness"
+ stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null && value2.matches("[\\d.]+")) {
if (style == null) {
style = LinkStyle.NORMAL();
@ -856,7 +862,7 @@ public class SkinParam implements ISkinParam {
String value = getValue("activityshape");
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue("activityshape" + stereotype.getLabel(false));
final String value2 = getValue("activityshape" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null) {
value = value2;
}
@ -896,12 +902,9 @@ public class SkinParam implements ISkinParam {
return result;
}
public boolean useGuillemet() {
public Guillemet guillemet() {
final String value = getValue("guillemet");
if ("false".equalsIgnoreCase(value)) {
return false;
}
return true;
return Guillemet.GUILLEMET.fromDescription(value);
}
public boolean handwritten() {

View File

@ -214,8 +214,8 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.groupInheritance();
}
public boolean useGuillemet() {
return skinParam.useGuillemet();
public Guillemet guillemet() {
return skinParam.guillemet();
}
public boolean handwritten() {

View File

@ -41,6 +41,6 @@ public interface SpriteContainer {
public Sprite getSprite(String name);
public boolean useGuillemet();
public Guillemet guillemet();
}

View File

@ -59,8 +59,8 @@ public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
return 0;
}
public boolean useGuillemet() {
return false;
public Guillemet guillemet() {
return Guillemet.DOUBLE_COMPARATOR;
}
public String getMonospacedFamily() {

View File

@ -35,17 +35,22 @@
*/
package net.sourceforge.plantuml;
public class CharSequence2Impl implements CharSequence2 {
public class StringLocated {
private final CharSequence s;
private final String s;
private final LineLocation location;
private String preprocessorError;
private final String preprocessorError;
public CharSequence2Impl(CharSequence s, LineLocation location) {
public StringLocated(String s, LineLocation location) {
this(s, location, null);
}
public CharSequence2Impl(CharSequence s, LineLocation location, String preprocessorError) {
@Override
public String toString() {
return super.toString() + " " + s;
}
public StringLocated(String s, LineLocation location, String preprocessorError) {
if (s == null) {
throw new IllegalArgumentException();
}
@ -54,84 +59,59 @@ public class CharSequence2Impl implements CharSequence2 {
this.preprocessorError = preprocessorError;
}
// public static CharSequence2 errorPreprocessor(CharSequence s, String preprocessorError) {
// return new CharSequence2Impl("FOO4242", null, preprocessorError);
// }
public CharSequence2 withErrorPreprocessor(String preprocessorError) {
return new CharSequence2Impl(s, location, preprocessorError);
public StringLocated withErrorPreprocessor(String preprocessorError) {
return new StringLocated(s, location, preprocessorError);
}
public int length() {
return s.length();
public StringLocated sub(int start, int end) {
return new StringLocated(this.getString().substring(start, end), this.getLocation(),
this.getPreprocessorError());
}
public char charAt(int index) {
return s.charAt(index);
public String getStringTrimmed() {
return StringUtils.trin(this.getString());
}
public CharSequence2 subSequence(int start, int end) {
return new CharSequence2Impl(s.subSequence(start, end), location, preprocessorError);
}
public CharSequence toCharSequence() {
return s;
}
@Override
public String toString() {
return s.toString();
}
public String toString2() {
return s.toString();
}
public LineLocation getLocation() {
return location;
}
public CharSequence2 trin() {
return new CharSequence2Impl(StringUtils.trin(s.toString()), location, preprocessorError);
}
public boolean startsWith(String start) {
return s.toString().startsWith(start);
}
public String getPreprocessorError() {
return preprocessorError;
}
public CharSequence2 removeInnerComment() {
public StringLocated removeInnerComment() {
final String string = s.toString();
final String trim = string.replace('\t', ' ').trim();
if (trim.startsWith("/'")) {
final int idx = string.indexOf("'/");
if (idx != -1) {
return new CharSequence2Impl(removeSpecialInnerComment(s.subSequence(idx + 2, s.length())), location,
return new StringLocated(removeSpecialInnerComment(s.substring(idx + 2, s.length())), location,
preprocessorError);
}
}
if (trim.endsWith("'/")) {
final int idx = string.lastIndexOf("/'");
if (idx != -1) {
return new CharSequence2Impl(removeSpecialInnerComment(s.subSequence(0, idx)), location,
preprocessorError);
return new StringLocated(removeSpecialInnerComment(s.substring(0, idx)), location, preprocessorError);
}
}
if (trim.contains("/'''") && trim.contains("'''/")) {
return new CharSequence2Impl(removeSpecialInnerComment(s), location, preprocessorError);
return new StringLocated(removeSpecialInnerComment(s), location, preprocessorError);
}
return this;
}
private CharSequence removeSpecialInnerComment(CharSequence cs) {
final String s = cs.toString();
private String removeSpecialInnerComment(String s) {
if (s.contains("/'''") && s.contains("'''/")) {
return s.replaceAll("/'''[-\\w]*'''/", "");
}
return cs;
return s;
}
public String getString() {
return s;
}
public LineLocation getLocation() {
return location;
}
public String getPreprocessorError() {
return preprocessorError;
}
}

View File

@ -412,20 +412,6 @@ public class StringUtils {
return s.endsWith("\\") && s.endsWith("\\\\") == false;
}
public static String manageGuillemetStrict(String st) {
if (st.startsWith("<< ")) {
st = "\u00AB" + st.substring(3);
} else if (st.startsWith("<<")) {
st = "\u00AB" + st.substring(2);
}
if (st.endsWith(" >>")) {
st = st.substring(0, st.length() - 3) + "\u00BB";
} else if (st.endsWith(">>")) {
st = st.substring(0, st.length() - 2) + "\u00BB";
}
return st;
}
public static String rot(String s) {
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
@ -442,10 +428,6 @@ public class StringUtils {
return sb.toString();
}
public static String manageGuillemet(String st) {
return st.replaceAll("\\<\\<\\s?((?:\\<&\\w+\\>|[^<>])+?)\\s?\\>\\>", "\u00AB$1\u00BB");
}
public static String manageUnicodeNotationUplus(String s) {
final Pattern pattern = Pattern.compile("\\<U\\+([0-9a-fA-F]{4,5})\\>");
final Matcher matcher = pattern.matcher(s);
@ -478,12 +460,15 @@ public class StringUtils {
}
public static String trinNoTrace(CharSequence s) {
// if (s instanceof CharSequence2) {
// return ((CharSequence2) s).getString().trim();
// }
return s.toString().trim();
}
public static String trin(CharSequence arg) {
public static String trin(String arg) {
if (arg.length() == 0) {
return arg.toString();
return arg;
}
int i = 0;
while (i < arg.length() && isSpaceOrTabOrNull(arg.charAt(i))) {
@ -494,9 +479,9 @@ public class StringUtils {
j--;
}
if (i == 0 && j == arg.length() - 1) {
return arg.toString();
return arg;
}
return arg.subSequence(i, j + 1).toString();
return arg.substring(i, j + 1);
}
private static boolean isSpaceOrTabOrNull(char c) {

View File

@ -207,16 +207,16 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
return animation;
}
public final double getDpiFactor(FileFormatOption fileFormatOption) {
public final double getScaleCoef(FileFormatOption fileFormatOption) {
if (getSkinParam().getDpi() == 96) {
return 1.0;
return fileFormatOption.getScaleCoef();
}
return getSkinParam().getDpi() / 96.0;
return getSkinParam().getDpi() * fileFormatOption.getScaleCoef() / 96.0;
}
public final int getDpi(FileFormatOption fileFormatOption) {
return getSkinParam().getDpi();
}
// public final int getDpi(FileFormatOption fileFormatOption) {
// return getSkinParam().getDpi();
// }
public final boolean isHideUnlinkedData() {
return hideUnlinkedData;
@ -473,7 +473,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
if (f.exists() == false || f.canRead() == false) {
return CommandExecutionResult.error("Cannot load skin from " + filename);
}
final BlocLines lines = BlocLines.load(f);
final BlocLines lines = BlocLines.load(f, new LineLocationImpl(f.getName(), null));
final CommandSkinParam cmd1 = new CommandSkinParam();
final CommandSkinParamMultilines cmd2 = new CommandSkinParamMultilines();
for (int i = 0; i < lines.size(); i++) {

View File

@ -36,5 +36,5 @@
package net.sourceforge.plantuml;
public enum UmlDiagramType {
SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM, NWDIAG, MINDMAP, HELP
SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM, NWDIAG, MINDMAP, WBS, HELP
}

View File

@ -52,7 +52,6 @@ import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import ext.plantuml.com.ctreber.acearth.ACearth;
import ext.plantuml.com.ctreber.acearth.ConfigurationACearth;
import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;

View File

@ -44,7 +44,6 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;
public class PSystemXearthFactory extends PSystemBasicFactory<PSystemXearth> {

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -78,7 +79,7 @@ public class CommandIf extends SingleLineCommand2<ActivityDiagram> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram system, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram system, LineLocation location, RegexResult arg) {
final IEntity entity1 = CommandLinkActivity.getEntity(system, arg, true);
if (entity1 == null) {
return CommandExecutionResult.error("No if possible at this point");

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
@ -111,7 +112,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) {
final IEntity entity1 = getEntity(diagram, arg, true);
if (entity1 == null) {
return CommandExecutionResult.error("No such activity");

View File

@ -39,6 +39,7 @@ import java.util.List;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
@ -110,7 +111,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) {
lines = lines.trim(false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getStringTrimmed());
final IEntity entity1 = CommandLinkActivity.getEntity(diagram, line0, true);
if (entity1 == null) {
@ -129,14 +130,14 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
final String desc0 = line0.get("DESC", 0);
Url urlActivity = null;
if (StringUtils.isNotEmpty(desc0)) {
urlActivity = extractUrl(diagram, desc0);
urlActivity = extractUrlString(diagram, desc0);
if (urlActivity == null) {
sb.append(desc0);
sb.append(BackSlash.BS_BS_N);
}
}
int i = 0;
for (CharSequence cs : lines.subExtract(1, 1)) {
for (StringLocated cs : lines.subExtract(1, 1)) {
i++;
if (i == 1 && urlActivity == null) {
urlActivity = extractUrl(diagram, cs);
@ -144,14 +145,14 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
continue;
}
}
sb.append(cs);
sb.append(cs.getString());
if (i < lines.size() - 2) {
sb.append(BackSlash.BS_BS_N);
}
}
final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()), lines.getLast499()
.toString());
.getString());
if (StringUtils.isNotEmpty(lineLast.get(0))) {
if (sb.length() > 0 && sb.toString().endsWith(BackSlash.BS_BS_N) == false) {
sb.append(BackSlash.BS_BS_N);
@ -223,9 +224,13 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
return CommandExecutionResult.ok();
}
public Url extractUrl(final ActivityDiagram diagram, CharSequence string) {
public Url extractUrl(final ActivityDiagram diagram, StringLocated string) {
return extractUrlString(diagram, string.getString());
}
public Url extractUrlString(final ActivityDiagram diagram, String string) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
return urlBuilder.getUrl(string.toString());
return urlBuilder.getUrl(string);
}
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -77,7 +78,7 @@ public class CommandPartition extends SingleLineCommand2<ActivityDiagram> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) {
final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0)));
final IGroup currentPackage = diagram.getCurrentGroup();
diagram.gotoGroup2(code, Display.getWithNewlines(code), GroupType.PACKAGE, currentPackage,

View File

@ -171,7 +171,11 @@ public class ActivityDiagram3 extends UmlDiagram {
if (last instanceof InstructionWhile == false) {
return false;
}
((InstructionWhile) last).setSpecial(special);
final InstructionWhile instructionWhile = (InstructionWhile) last;
if (instructionWhile.containsBreak()) {
return false;
}
instructionWhile.setSpecial(special);
return true;
}
@ -220,7 +224,7 @@ public class ActivityDiagram3 extends UmlDiagram {
final double dpiFactor;
final Scale scale = getScale();
if (scale == null) {
dpiFactor = getDpiFactor(fileFormatOption);
dpiFactor = getScaleCoef(fileFormatOption);
} else {
dpiFactor = scale.getScale(dim.getWidth(), dim.getHeight());
}

View File

@ -60,6 +60,10 @@ public class Branch {
private Ftile ftile;
public boolean containsBreak() {
return list.containsBreak();
}
public Branch(Swimlane swimlane, Display labelPositive, Display labelTest, HtmlColor color, Display inlabel) {
if (labelPositive == null) {
throw new IllegalArgumentException();
@ -162,4 +166,5 @@ public class Branch {
return special;
}
}

View File

@ -55,5 +55,7 @@ public interface Instruction extends Swimable {
public LinkRendering getInLinkRendering();
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote);
public boolean containsBreak();
}

View File

@ -68,4 +68,8 @@ public class InstructionBreak extends MonoSwimable implements Instruction {
return inlinkRendering;
}
public boolean containsBreak() {
return true;
}
}

View File

@ -69,4 +69,8 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
return inlinkRendering;
}
public boolean containsBreak() {
return false;
}
}

View File

@ -59,6 +59,15 @@ public class InstructionFork extends WithNote implements Instruction {
private String label;
boolean finished = false;
public boolean containsBreak() {
for (InstructionList fork : forks) {
if (fork.containsBreak()) {
return true;
}
}
return false;
}
public InstructionFork(Instruction parent, LinkRendering inlinkRendering, ISkinParam skinParam) {
this.parent = parent;
this.inlinkRendering = inlinkRendering;

View File

@ -65,4 +65,8 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
return LinkRendering.none();
}
public boolean containsBreak() {
return false;
}
}

View File

@ -63,6 +63,10 @@ public class InstructionGroup implements Instruction, InstructionCollection {
private final double roundCorner;
private PositionedNote note = null;
public boolean containsBreak() {
return list.containsBreak();
}
public InstructionGroup(Instruction parent, Display test, HtmlColor backColor, HtmlColor titleColor,
Swimlane swimlane, HtmlColor borderColor, LinkRendering linkRendering, USymbol type, double roundCorner) {
this.list = new InstructionList(swimlane);

View File

@ -69,6 +69,18 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
private final Swimlane swimlane;
public boolean containsBreak() {
for (Branch branch : thens) {
if (branch.containsBreak()) {
return true;
}
}
if (elseBranch != null) {
return elseBranch.containsBreak();
}
return false;
}
public InstructionIf(Swimlane swimlane, Instruction parent, Display labelTest, Display whenThen,
LinkRendering inlinkRendering, HtmlColor color, ISkinParam skinParam) {
this.parent = parent;

View File

@ -65,4 +65,8 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
return LinkRendering.none();
}
public boolean containsBreak() {
return false;
}
}

View File

@ -57,6 +57,15 @@ public class InstructionList extends WithNote implements Instruction, Instructio
private final List<Instruction> all = new ArrayList<Instruction>();
private final Swimlane defaultSwimlane;
public boolean containsBreak() {
for (Instruction ins : all) {
if (ins.containsBreak()) {
return true;
}
}
return false;
}
public InstructionList() {
this(null);
}

View File

@ -90,4 +90,8 @@ public class InstructionPartition implements Instruction {
throw new UnsupportedOperationException();
}
public boolean containsBreak() {
return list.containsBreak();
}
}

View File

@ -65,6 +65,11 @@ public class InstructionRepeat implements Instruction {
private boolean testCalled = false;
private LinkRendering endRepeatLinkRendering = LinkRendering.none();
private LinkRendering backRepeatLinkRendering = LinkRendering.none();
public boolean containsBreak() {
return repeatList.containsBreak();
}
public InstructionRepeat(Swimlane swimlane, Instruction parent, LinkRendering nextLinkRenderer, HtmlColor color,
Display startLabel) {

View File

@ -52,6 +52,11 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
private final LinkRendering inlinkRendering;
private final BoxStyle style;
private final Url url;
public boolean containsBreak() {
return false;
}
public InstructionSimple(Display label, LinkRendering inlinkRendering, Swimlane swimlane, BoxStyle style, Url url,
Colors colors) {

View File

@ -61,6 +61,16 @@ public class InstructionSplit implements Instruction {
throw new IllegalArgumentException();
}
}
public boolean containsBreak() {
for (InstructionList split : splits) {
if (split.containsBreak()) {
return true;
}
}
return false;
}
private InstructionList getLast() {
return splits.get(splits.size() - 1);

View File

@ -46,6 +46,10 @@ public class InstructionSpot extends MonoSwimable implements Instruction {
private final LinkRendering inlinkRendering;
private final String spot;
public boolean containsBreak() {
return false;
}
public InstructionSpot(String spot, LinkRendering inlinkRendering, Swimlane swimlane) {
super(swimlane);
this.spot = spot;

View File

@ -50,6 +50,11 @@ public class InstructionStart extends MonoSwimable implements Instruction {
throw new IllegalArgumentException();
}
}
public boolean containsBreak() {
return false;
}
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.start(getSwimlaneIn());

View File

@ -50,6 +50,11 @@ public class InstructionStop extends MonoSwimable implements Instruction {
throw new IllegalArgumentException();
}
}
public boolean containsBreak() {
return false;
}
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.stop(getSwimlaneIn());

View File

@ -166,4 +166,8 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
this.specialOut = special;
}
public boolean containsBreak() {
return repeatList.containsBreak();
}
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
@ -74,7 +75,7 @@ public class CommandActivity3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final Url url;
if (arg.get("URL", 0) == null) {

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -59,7 +60,7 @@ public class CommandActivityLegacy1 extends SingleLineCommand2<ActivityDiagram3>
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.addActivity(Display.getWithNewlines(arg.get("LABEL", 0)), BoxStyle.PLAIN, null, Colors.empty());
return CommandExecutionResult.ok();
}

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.command.BlocLines;
@ -74,7 +73,7 @@ public class CommandActivityLong3 extends CommandMultilines2<ActivityDiagram3> {
protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
lines = lines.removeEmptyColumns();
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getStringTrimmed());
final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
// final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
final BoxStyle style = BoxStyle.fromChar(lines.getLastChar());

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -65,7 +66,7 @@ public class CommandArrow3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final String colorString = arg.get("COLOR", 0);
if (colorString != null) {

View File

@ -37,7 +37,6 @@ package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -73,7 +72,7 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
lines = lines.removeEmptyColumns();
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getStringTrimmed());
// final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
// diagram.setColorNextArrow(HtmlColorAndStyle.fromColor(color));
final String colorString = line0.get("COLOR", 0);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -59,7 +60,7 @@ public class CommandBackward3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
return diagram.backwardWhile(label);
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandBreak extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.breakInstruction();
return CommandExecutionResult.ok();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandCircleSpot3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.addSpot(arg.get("SPOT", 0));
return CommandExecutionResult.ok();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -58,7 +59,7 @@ public class CommandElse3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
// if (getSystem().getLastEntityConsulted() == null) {
// return CommandExecutionResult.error("No if for this endif");
// }

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -66,7 +67,7 @@ public class CommandElseIf2 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -58,7 +59,7 @@ public class CommandElseLegacy1 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
// if (getSystem().getLastEntityConsulted() == null) {
// return CommandExecutionResult.error("No if for this endif");
// }

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandEnd3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.end();
return CommandExecutionResult.ok();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandEndif3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
// if (getSystem().getLastEntityConsulted() == null) {
// return CommandExecutionResult.error("No if for this endif");
// }

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandFork3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.fork();
return CommandExecutionResult.ok();

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandForkAgain3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
return diagram.forkAgain();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -59,7 +60,7 @@ public class CommandForkEnd3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final String style = arg.get("STYLE", 0);
final ForkStyle forkStyle = style.contains("merge") ? ForkStyle.MERGE : ForkStyle.FORK;
final String label = arg.get("LABEL", 0);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -58,7 +59,7 @@ public class CommandGoto extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final String name = arg.get("NAME", 0);
return diagram.addGoto(name);
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -59,7 +60,7 @@ public class CommandGroup3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null, null, USymbol.FRAME, 0);
return CommandExecutionResult.ok();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -55,7 +56,7 @@ public class CommandGroupEnd3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
return diagram.endGroup();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -63,7 +64,7 @@ public class CommandIf2 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -64,7 +65,7 @@ public class CommandIf4 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -60,7 +61,7 @@ public class CommandIfLegacy1 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.startIf(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("WHEN", 0)), null);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandKill3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
return diagram.kill();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -58,7 +59,7 @@ public class CommandLabel extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final String name = arg.get("NAME", 0);
return diagram.addLabel(name);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -59,7 +60,7 @@ public class CommandLink3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
if (color != null) {
diagram.setColorNextArrow(HtmlColorAndStyle.fromColor(color));

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -57,7 +58,7 @@ public class CommandNolink extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
// diagram.setColorNextArrow(color);
diagram.setLabelNextArrow(Display.getWithNewlines("NOLINK"));
return CommandExecutionResult.ok();

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -71,7 +72,7 @@ public class CommandNote3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final Display note = Display.getWithNewlines(arg.get("NOTE", 0));
final NotePosition position = NotePosition.defaultLeft(arg.get("POSITION", 0));

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -68,7 +67,7 @@ public class CommandNoteLong3 extends CommandMultilines2<ActivityDiagram3> {
protected CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines) {
// final List<? extends CharSequence> in = StringUtils.removeEmptyColumns2(lines.subList(1, lines.size() - 1));
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getStringTrimmed());
lines = lines.subExtract(1, 1);
lines = lines.removeEmptyColumns();
final NotePosition position = NotePosition.defaultLeft(line0.get("POSITION", 0));

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -110,7 +111,7 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final String partitionTitle = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0));
final String b1 = arg.get("BACK1", 0);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -61,7 +62,7 @@ public class CommandRepeat3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -87,7 +88,7 @@ public class CommandRepeatWhile3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final Display test = Display.getWithNewlines(arg.getLazzy("TEST", 0));
final Display yes = Display.getWithNewlines(arg.getLazzy("WHEN", 0));
final Display out = Display.getWithNewlines(arg.getLazzy("OUT", 0));

View File

@ -38,6 +38,7 @@ package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.BlocLines;
@ -76,8 +77,8 @@ public class CommandRepeatWhile3Multilines extends CommandMultilines3<ActivityDi
@Override
protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
lines = lines.trim(false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final RegexResult lineLast = getPatternEnd2().matcher(lines.getLast499().toString());
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499().getString()));
final RegexResult lineLast = getPatternEnd2().matcher(lines.getLast499().getString());
// System.err.println("line0=" + line0);
// System.err.println("linesLast=" + lineLast);
@ -87,8 +88,8 @@ public class CommandRepeatWhile3Multilines extends CommandMultilines3<ActivityDi
final String test = line0.get("TEST1", 0);
Display testDisplay = Display.getWithNewlines(test);
for (CharSequence s : lines.subExtract(1, 1)) {
testDisplay = testDisplay.add(s);
for (StringLocated s : lines.subExtract(1, 1)) {
testDisplay = testDisplay.add(s.getString());
}
final String trailTest = lineLast.get("TEST1", 0);
if (StringUtils.isEmpty(trailTest) == false) {

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandSplit3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.split();
return CommandExecutionResult.ok();

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandSplitAgain3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
return diagram.splitAgain();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandSplitEnd3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
return diagram.endSplit();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandStart3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
// if (getSystem().getLastEntityConsulted() == null) {
// return CommandExecutionResult.error("No if for this endif");
// }

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -56,7 +57,7 @@ public class CommandStop3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
diagram.stop();
return CommandExecutionResult.ok();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -62,7 +63,7 @@ public class CommandSwimlane extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
final String name = arg.get("SWIMLANE", 0);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -62,7 +63,7 @@ public class CommandSwimlane2 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
final String name = arg.get("SWIMLANE", 0);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -65,7 +66,7 @@ public class CommandWhile3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
diagram.doWhile(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("YES", 0)), color);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -57,7 +58,7 @@ public class CommandWhileEnd3 extends SingleLineCommand2<ActivityDiagram3> {
}
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
return diagram.endwhile(Display.getWithNewlines(arg.get("OUT", 0)));
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.util.Collection;
import java.util.Set;
import net.sourceforge.plantuml.graphic.StringBounder;
@ -48,6 +49,11 @@ public class FtileKilled extends AbstractFtile {
super(tileToKill.skinParam());
this.tile = tileToKill;
}
@Override
public Collection<Ftile> getMyChildren() {
return tile.getMyChildren();
}
public Set<Swimlane> getSwimlanes() {
return tile.getSwimlanes();

View File

@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.activitydiagram3.Instruction;
@ -57,8 +56,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicIntercep
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.VCompactFactory;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.awt.geom.Dimension2D;
import java.util.List;
import net.sourceforge.plantuml.ColorParam;
@ -97,27 +96,29 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
final Genealogy genealogy = new Genealogy(result);
final FtileBreak ftileBreak = (FtileBreak) weldingPoints.get(0);
for (WeldingPoint w : weldingPoints) {
final FtileBreak ftileBreak = (FtileBreak) w;
result = FtileUtils.addConnection(result, new Connection() {
public void drawU(UGraphic ug) {
final UTranslate tr1 = genealogy.getTranslate(ftileBreak, ug.getStringBounder());
result = FtileUtils.addConnection(result, new Connection() {
public void drawU(UGraphic ug) {
final UTranslate tr1 = genealogy.getTranslate(ftileBreak, ug.getStringBounder());
final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows
.asToLeft());
snake.addPoint(tr1.getDx(), tr1.getDy());
snake.addPoint(Diamond.diamondHalfSize, tr1.getDy());
ug.draw(snake);
}
final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows.asToLeft());
snake.addPoint(tr1.getDx(), tr1.getDy());
snake.addPoint(Diamond.diamondHalfSize, tr1.getDy());
ug.draw(snake);
}
public Ftile getFtile1() {
return ftileBreak;
}
public Ftile getFtile1() {
return ftileBreak;
}
public Ftile getFtile2() {
return null;
}
public Ftile getFtile2() {
return null;
}
});
});
}
}
return result;

View File

@ -162,7 +162,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
final TextBlock tb1 = branch.getLabelPositive().create(fcArrow, HorizontalAlignment.LEFT,
ftileFactory.skinParam());
final TextBlock tbTest = branch.getLabelTest().create(fcTest,
ftileFactory.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT), ftileFactory.skinParam());
ftileFactory.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT),
ftileFactory.skinParam());
final HtmlColor diamondColor = branch.getColor() == null ? backColor : branch.getColor();
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.skinParam(), diamondColor, borderColor,
@ -189,12 +190,18 @@ class FtileIfLongHorizontal extends AbstractFtile {
final FtileIfLongHorizontal result = new FtileIfLongHorizontal(diamonds, inlabelSizes, tiles, tile2, arrowColor);
final List<Connection> conns = new ArrayList<Connection>();
int nbOut = 0;
for (int i = 0; i < thens.size(); i++) {
final Ftile ftile = tiles.get(i);
final Ftile diam = diamonds.get(i);
final Rainbow rainbowIn = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
final Branch branch = thens.get(i);
if (branch.getFtile().calculateDimension(ftileFactory.getStringBounder()).hasPointOut()) {
nbOut++;
}
final Rainbow rainbowOut = branch.getInlinkRenderingColorAndStyle();
TextBlock out2 = null;
if (branch.getSpecial() != null) {
@ -218,10 +225,12 @@ class FtileIfLongHorizontal extends AbstractFtile {
}
conns.add(result.new ConnectionLastElseIn(FtileIfWithLinks.getInColor(branch2, arrowColor)));
conns.add(result.new ConnectionLastElseOut(arrowColor, out2));
final Rainbow horizontalOutColor = afterEndwhile.getRainbow(arrowColor);
conns.add(result.new ConnectionHline(horizontalOutColor));
// conns.add(result.new ConnectionHline(HtmlColorUtils.BLUE));
conns.add(result.new ConnectionLastElseOut(arrowColor, out2, nbOut));
final boolean horizontalOut = nbOut > 0;
if (horizontalOut) {
final Rainbow horizontalOutColor = afterEndwhile.getRainbow(arrowColor);
conns.add(result.new ConnectionHline(horizontalOutColor));
}
return FtileUtils.addConnection(result, conns);
}
@ -329,11 +338,13 @@ class FtileIfLongHorizontal extends AbstractFtile {
private final Rainbow arrowColor;
private final TextBlock out2;
private final int nbOut;
public ConnectionLastElseOut(Rainbow arrowColor, TextBlock out2) {
public ConnectionLastElseOut(Rainbow arrowColor, TextBlock out2, int nbOut) {
super(tile2, null);
this.arrowColor = arrowColor;
this.out2 = out2;
this.nbOut = nbOut;
}
public void drawU(UGraphic ug) {
@ -344,13 +355,17 @@ class FtileIfLongHorizontal extends AbstractFtile {
return;
}
final Point2D p1 = tr1.getTranslated(dim.getPointOut());
final double totalHeight = calculateDimensionInternal(stringBounder).getHeight();
final FtileGeometry full = calculateDimensionInternal(stringBounder);
final double totalHeight = full.getHeight();
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
final Snake snake = new Snake(arrowHorizontalAlignment(), arrowColor, Arrows.asToDown());
snake.setLabel(out2);
snake.addPoint(p1);
snake.addPoint(p2);
if (nbOut == 0) {
snake.addPoint(new Point2D.Double(full.getLeft(), totalHeight));
}
ug.draw(snake);
}

View File

@ -44,7 +44,6 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;

View File

@ -45,6 +45,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorMiddle;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@ -54,7 +56,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class FtileCircleStop extends AbstractFtile {
private static final int SIZE = 20;
private static final int SIZE = 22;
private final HtmlColor backColor;
private final Swimlane swimlane;
@ -86,26 +88,19 @@ public class FtileCircleStop extends AbstractFtile {
}
public void drawU(UGraphic ug) {
double xTheoricalPosition = 0;
double yTheoricalPosition = 0;
xTheoricalPosition = Math.round(xTheoricalPosition);
yTheoricalPosition = Math.round(yTheoricalPosition);
final UEllipse circle = new UEllipse(SIZE, SIZE);
if (skinParam().shadowing(null)) {
circle.setDeltaShadow(3);
}
ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(null))
.apply(new UTranslate(xTheoricalPosition, yTheoricalPosition)).draw(circle);
ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(HtmlColorUtils.WHITE)).draw(circle);
final double delta = 4;
final double delta = 5;
final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2);
if (skinParam().shadowing(null)) {
circleSmall.setDeltaShadow(3);
}
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor))
.apply(new UTranslate(xTheoricalPosition + delta + .5, yTheoricalPosition + delta + .5))
.draw(circleSmall);
// if (skinParam().shadowing(null)) {
// circleSmall.setDeltaShadow(3);
// }
ug.apply(new UChangeColor(new HtmlColorMiddle(backColor, HtmlColorUtils.WHITE)))
.apply(new UChangeBackColor(backColor)).apply(new UTranslate(delta, delta)).draw(circleSmall);
}
@Override

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.bpm;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -56,7 +57,7 @@ public class CommandDockedEvent extends SingleLineCommand2<BpmDiagram> {
}
@Override
protected CommandExecutionResult executeArg(BpmDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(BpmDiagram diagram, LineLocation location, RegexResult arg) {
final String label = arg.get("LABEL", 0);
final BpmElement element = new BpmElement(null, BpmElementType.DOCKED_EVENT, label);

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.bpm;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -54,7 +55,7 @@ public class CommandElseBranch extends SingleLineCommand2<BpmDiagram> {
}
@Override
protected CommandExecutionResult executeArg(BpmDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(BpmDiagram diagram, LineLocation location, RegexResult arg) {
return diagram.elseBranch();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.bpm;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -54,7 +55,7 @@ public class CommandEndBranch extends SingleLineCommand2<BpmDiagram> {
}
@Override
protected CommandExecutionResult executeArg(BpmDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(BpmDiagram diagram, LineLocation location, RegexResult arg) {
return diagram.endBranch();
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.bpm;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -56,7 +57,7 @@ public class CommandGoto extends SingleLineCommand2<BpmDiagram> {
}
@Override
protected CommandExecutionResult executeArg(BpmDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(BpmDiagram diagram, LineLocation location, RegexResult arg) {
final BpmEvent event = new BpmEventGoto(arg.get("ID", 0));
return diagram.addEvent(event);
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.bpm;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -56,7 +57,7 @@ public class CommandMerge extends SingleLineCommand2<BpmDiagram> {
}
@Override
protected CommandExecutionResult executeArg(BpmDiagram diagram, RegexResult arg) {
protected CommandExecutionResult executeArg(BpmDiagram diagram, LineLocation location, RegexResult arg) {
final BpmEvent event = new BpmEventAdd(new BpmElement(arg.get("ID", 0), BpmElementType.MERGE, null));
return diagram.addEvent(event);
}

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