mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 10:59:01 +00:00
Version 6121
This commit is contained in:
parent
27af4f85f3
commit
2ce0511e80
2
pom.xml
2
pom.xml
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<groupId>net.sourceforge.plantuml</groupId>
|
<groupId>net.sourceforge.plantuml</groupId>
|
||||||
<artifactId>plantuml</artifactId>
|
<artifactId>plantuml</artifactId>
|
||||||
<version>6085-SNAPSHOT</version>
|
<version>6121-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>PlantUML</name>
|
<name>PlantUML</name>
|
||||||
|
@ -33,8 +33,14 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml;
|
package net.sourceforge.plantuml;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
@ -92,6 +98,18 @@ public class FileUtils {
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public void copyToFile(File src, File dest) throws IOException {
|
||||||
|
if (dest.isDirectory()) {
|
||||||
|
dest = new File(dest, src.getName());
|
||||||
|
}
|
||||||
|
final InputStream fis = new BufferedInputStream(new FileInputStream(src));
|
||||||
|
final OutputStream fos = new BufferedOutputStream(new FileOutputStream(dest));
|
||||||
|
int lu;
|
||||||
|
while ((lu = fis.read()) != -1) {
|
||||||
|
fos.write(lu);
|
||||||
|
}
|
||||||
|
fos.close();
|
||||||
|
fis.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5977 $
|
* Revision $Revision: 6096 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml;
|
package net.sourceforge.plantuml;
|
||||||
@ -67,6 +67,7 @@ public class OptionFlags {
|
|||||||
private String dotExecutable = null;
|
private String dotExecutable = null;
|
||||||
private boolean gui = false;
|
private boolean gui = false;
|
||||||
private boolean quiet = false;
|
private boolean quiet = false;
|
||||||
|
private boolean checkDotError = false;
|
||||||
|
|
||||||
private OptionFlags() {
|
private OptionFlags() {
|
||||||
reset();
|
reset();
|
||||||
@ -164,4 +165,12 @@ public class OptionFlags {
|
|||||||
this.quiet = quiet;
|
this.quiet = quiet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean isCheckDotError() {
|
||||||
|
return checkDotError;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setCheckDotError(boolean checkDotError) {
|
||||||
|
this.checkDotError = checkDotError;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6060 $
|
* Revision $Revision: 6110 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml;
|
package net.sourceforge.plantuml;
|
||||||
@ -329,7 +329,8 @@ public class StringUtils {
|
|||||||
|
|
||||||
public static String uncommentSource(String source) {
|
public static String uncommentSource(String source) {
|
||||||
final StringReader sr = new StringReader(source);
|
final StringReader sr = new StringReader(source);
|
||||||
final UncommentReadLine un = new UncommentReadLine(new ReadLineReader(sr));
|
final UncommentReadLine un = new UncommentReadLine(new ReadLineReader(
|
||||||
|
sr));
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
String s = null;
|
String s = null;
|
||||||
try {
|
try {
|
||||||
@ -346,4 +347,18 @@ public class StringUtils {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isDiagramCacheable(String uml) {
|
||||||
|
uml = uml.toLowerCase();
|
||||||
|
if (uml.startsWith("@startuml\nversion\n")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (uml.startsWith("@startuml\ntestdot\n")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (uml.startsWith("@startuml\nsudoku\n")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5811 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml;
|
package net.sourceforge.plantuml;
|
||||||
@ -40,6 +40,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignement;
|
|||||||
public abstract class UmlDiagram extends AbstractPSystem implements PSystem {
|
public abstract class UmlDiagram extends AbstractPSystem implements PSystem {
|
||||||
|
|
||||||
private boolean rotation;
|
private boolean rotation;
|
||||||
|
private boolean hideUnlinkedData;
|
||||||
|
|
||||||
private int minwidth = Integer.MAX_VALUE;
|
private int minwidth = Integer.MAX_VALUE;
|
||||||
|
|
||||||
@ -142,4 +143,12 @@ public abstract class UmlDiagram extends AbstractPSystem implements PSystem {
|
|||||||
return getSkinParam().getDpi();
|
return getSkinParam().getDpi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean isHideUnlinkedData() {
|
||||||
|
return hideUnlinkedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setHideUnlinkedData(boolean hideUnlinkedData) {
|
||||||
|
this.hideUnlinkedData = hideUnlinkedData;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,12 @@ public class CommandIf extends SingleLineCommand2<ActivityDiagram> {
|
|||||||
static RegexConcat getRegexConcat() {
|
static RegexConcat getRegexConcat() {
|
||||||
return new RegexConcat(new RegexLeaf("^"),
|
return new RegexConcat(new RegexLeaf("^"),
|
||||||
new RegexOr("FIRST", true,
|
new RegexOr("FIRST", true,
|
||||||
new RegexLeaf("STAR", "(\\(\\*\\))"),
|
new RegexLeaf("STAR", "(\\(\\*(top)?\\))"),
|
||||||
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"),
|
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"),
|
||||||
new RegexLeaf("BAR", "(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"),
|
new RegexLeaf("BAR", "(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"),
|
||||||
new RegexLeaf("QUOTED", "\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")),
|
new RegexLeaf("QUOTED", "\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexLeaf("ARROW", "([=-]+(?:left|right|up|down|le?|ri?|up?|do?)?[=-]*\\>)?"),
|
new RegexLeaf("ARROW", "([=-]+(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.]))?[=-]*\\>)?"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"),
|
new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
|
@ -58,20 +58,33 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RegexConcat getRegexConcat() {
|
static RegexConcat getRegexConcat() {
|
||||||
return new RegexConcat(new RegexLeaf("^"), new RegexOr("FIRST", true, new RegexLeaf("STAR", "(\\(\\*\\))"),
|
return new RegexConcat(
|
||||||
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"), new RegexLeaf("BAR",
|
new RegexLeaf("^"), //
|
||||||
"(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"), new RegexLeaf("QUOTED",
|
new RegexOr("FIRST", true, //
|
||||||
"\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")), new RegexLeaf("\\s*"), new RegexLeaf(
|
new RegexLeaf("STAR", "(\\(\\*(top)?\\))"), //
|
||||||
"STEREOTYPE", "(\\<\\<.*\\>\\>)?"), new RegexLeaf("\\s*"), new RegexLeaf("BACKCOLOR", "(#\\w+)?"),
|
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"), //
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("BAR", "(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"), //
|
||||||
new RegexLeaf("ARROW", "([=-]+(?:left|right|up|down|le?|ri?|up?|do?)?[=-]*\\>)"),
|
new RegexLeaf("QUOTED", "\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")), //
|
||||||
new RegexLeaf("\\s*"), new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"), new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"), //
|
||||||
new RegexOr("FIRST2", new RegexLeaf("STAR2", "(\\(\\*\\))"), new RegexLeaf("OPENBRACKET2", "(\\{)"),
|
new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
|
||||||
new RegexLeaf("CODE2", "([\\p{L}0-9_.]+)"), new RegexLeaf("BAR2",
|
new RegexLeaf("\\s*"), //
|
||||||
"(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"), new RegexLeaf("QUOTED2",
|
new RegexLeaf("BACKCOLOR", "(#\\w+)?"), //
|
||||||
"\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")), new RegexLeaf("\\s*"), new RegexLeaf(
|
new RegexLeaf("\\s*"), //
|
||||||
"STEREOTYPE2", "(\\<\\<.*\\>\\>)?"), new RegexLeaf("\\s*"), new RegexLeaf("BACKCOLOR2",
|
new RegexLeaf("ARROW", "([=-]+(?:left|right|up|down|le?|ri?|up?|do?)?[=-]*\\>)"), //
|
||||||
"(#\\w+)?"), new RegexLeaf("$"));
|
new RegexLeaf("\\s*"), //
|
||||||
|
new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"), //
|
||||||
|
new RegexLeaf("\\s*"), //
|
||||||
|
new RegexOr("FIRST2", //
|
||||||
|
new RegexLeaf("STAR2", "(\\(\\*(top)?\\))"), //
|
||||||
|
new RegexLeaf("OPENBRACKET2", "(\\{)"), //
|
||||||
|
new RegexLeaf("CODE2", "([\\p{L}0-9_.]+)"), //
|
||||||
|
new RegexLeaf("BAR2", "(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"), //
|
||||||
|
new RegexLeaf("QUOTED2", "\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")),
|
||||||
|
new RegexLeaf("\\s*"), //
|
||||||
|
new RegexLeaf("STEREOTYPE2", "(\\<\\<.*\\>\\>)?"), //
|
||||||
|
new RegexLeaf("\\s*"), //
|
||||||
|
new RegexLeaf("BACKCOLOR2", "(#\\w+)?"), //
|
||||||
|
new RegexLeaf("$"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -124,6 +137,9 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
|
|||||||
}
|
}
|
||||||
if (arg.get("STAR" + suf).get(0) != null) {
|
if (arg.get("STAR" + suf).get(0) != null) {
|
||||||
if (start) {
|
if (start) {
|
||||||
|
if (arg.get("STAR" + suf).get(1) != null) {
|
||||||
|
system.getStart().setTop(true);
|
||||||
|
}
|
||||||
return system.getStart();
|
return system.getStart();
|
||||||
}
|
}
|
||||||
return system.getEnd();
|
return system.getEnd();
|
||||||
|
@ -65,7 +65,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
|
|||||||
static RegexConcat getRegexConcat() {
|
static RegexConcat getRegexConcat() {
|
||||||
return new RegexConcat(new RegexLeaf("^"),
|
return new RegexConcat(new RegexLeaf("^"),
|
||||||
new RegexOr("FIRST", true,
|
new RegexOr("FIRST", true,
|
||||||
new RegexLeaf("STAR", "(\\(\\*\\))"),
|
new RegexLeaf("STAR", "(\\(\\*(top)?\\))"),
|
||||||
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"),
|
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"),
|
||||||
new RegexLeaf("BAR", "(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"),
|
new RegexLeaf("BAR", "(?:==+)\\s*([\\p{L}0-9_.]+)\\s*(?:==+)"),
|
||||||
new RegexLeaf("QUOTED", "\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")),
|
new RegexLeaf("QUOTED", "\"([^\"]+)\"(?:\\s+as\\s+([\\p{L}0-9_.]+))?")),
|
||||||
@ -74,7 +74,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
|
|||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexLeaf("BACKCOLOR", "(#\\w+)?"),
|
new RegexLeaf("BACKCOLOR", "(#\\w+)?"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexLeaf("ARROW", "([=-]+(?:left|right|up|down|le?|ri?|up?|do?)?[=-]*\\>)"),
|
new RegexLeaf("ARROW", "([=-]+(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=]))?[=-]*\\>)"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"),
|
new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5350 $
|
* Revision $Revision: 6095 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.classdiagram;
|
package net.sourceforge.plantuml.classdiagram;
|
||||||
@ -43,7 +43,7 @@ public abstract class AbstractEntityDiagram extends CucaDiagram {
|
|||||||
|
|
||||||
abstract public IEntity getOrCreateClass(String code);
|
abstract public IEntity getOrCreateClass(String code);
|
||||||
|
|
||||||
final protected List<String> getDotStrings() {
|
protected List<String> getDotStrings() {
|
||||||
// return Arrays.asList("nodesep=.5;", "ranksep=0.8;", "edge [fontsize=11,labelfontsize=11];",
|
// return Arrays.asList("nodesep=.5;", "ranksep=0.8;", "edge [fontsize=11,labelfontsize=11];",
|
||||||
// "node [fontsize=11,height=.35,width=.55];");
|
// "node [fontsize=11,height=.35,width=.55];");
|
||||||
return Arrays.asList("nodesep=.35;", "ranksep=0.8;", "edge [fontsize=11,labelfontsize=11];",
|
return Arrays.asList("nodesep=.35;", "ranksep=0.8;", "edge [fontsize=11,labelfontsize=11];",
|
||||||
|
@ -73,13 +73,13 @@ final public class CommandLinkClass2 extends SingleLineCommand2<AbstractClassOrO
|
|||||||
new RegexLeaf("FIRST_LABEL", "(?:\"([^\"]+)\")?"),
|
new RegexLeaf("FIRST_LABEL", "(?:\"([^\"]+)\")?"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexOr(new RegexLeaf("LEFT_TO_RIGHT",
|
new RegexOr(new RegexLeaf("LEFT_TO_RIGHT",
|
||||||
"(([-=.]+)(left|right|up|down|le?|ri?|up?|do?)?([-=.]*)(o +|[\\]>*+]|\\|[>\\]])?)"),
|
"(([-=.]+)(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.]))?([-=.]*)(o +|[\\]>*+]|\\|[>\\]])?)"),
|
||||||
new RegexLeaf("RIGHT_TO_LEFT",
|
new RegexLeaf("RIGHT_TO_LEFT",
|
||||||
"(( +o|[\\[<*+]|[<\\[]\\|)?([-=.]*)(left|right|up|down|le?|ri?|up?|do?)?([-=.]+))"),
|
"(( +o|[\\[<*+]|[<\\[]\\|)?([-=.]*)(left|right|up|down|le?|ri?|up?|do?)?([-=.]+))"),
|
||||||
new RegexLeaf("NAV_AGREG_OR_COMPO_INV",
|
new RegexLeaf("NAV_AGREG_OR_COMPO_INV",
|
||||||
"(\\<([-=.]*)(left|right|up|down|le?|ri?|up?|do?[-=.]+)?([-=.]+)(o +|\\*))"),
|
"(\\<([-=.]*)(left|right|up|down|le?|ri?|up?|do?[-=.]+)?([-=.]+)(o +|\\*))"),
|
||||||
new RegexLeaf("NAV_AGREG_OR_COMPO",
|
new RegexLeaf("NAV_AGREG_OR_COMPO",
|
||||||
"(( +o|\\*)([-=.]+)(left|right|up|down|le?|ri?|up?|do?)?([-=.]*)\\>)")),
|
"(( +o|\\*)([-=.]+)(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.]))?([-=.]*)\\>)")),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexLeaf("SECOND_LABEL", "(?:\"([^\"]+)\")?"),
|
new RegexLeaf("SECOND_LABEL", "(?:\"([^\"]+)\")?"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6002 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.command;
|
package net.sourceforge.plantuml.command;
|
||||||
@ -99,6 +99,8 @@ public abstract class AbstractUmlSystemCommandFactory implements PSystemCommandF
|
|||||||
addCommand(new CommandScale(system));
|
addCommand(new CommandScale(system));
|
||||||
addCommand(new CommandScaleWidthAndHeight(system));
|
addCommand(new CommandScaleWidthAndHeight(system));
|
||||||
addCommand(new CommandScaleWidthOrHeight(system));
|
addCommand(new CommandScaleWidthOrHeight(system));
|
||||||
|
addCommand(new CommandHideUnlinked(system));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void addCommand(Command cmd) {
|
protected final void addCommand(Command cmd) {
|
||||||
|
@ -58,13 +58,20 @@ public class CommandLinkComponent2 extends SingleLineCommand2<ComponentDiagram>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static RegexConcat getRegex() {
|
static RegexConcat getRegex() {
|
||||||
return new RegexConcat(new RegexLeaf("^"), getRegexGroup("G1"), new RegexLeaf("\\s*"), new RegexOr(
|
return new RegexConcat(new RegexLeaf("^"), //
|
||||||
new RegexLeaf("AR_TO_RIGHT",
|
getRegexGroup("G1"),//
|
||||||
"(([-=.]+)(left|right|up|down|le?|ri?|up?|do?)?([-=.]*?\\.*)([\\]>]|\\|[>\\]])?)"),
|
new RegexLeaf("\\s*"),//
|
||||||
new RegexLeaf("AR_TO_LEFT",
|
new RegexOr(
|
||||||
"(([\\[<]|[<\\[]\\|)?([-=.]*)(left|right|up|down|le?|ri?|up?|do?)?([-=.]+))")),
|
//
|
||||||
new RegexLeaf("\\s*"), getRegexGroup("G2"), new RegexLeaf("\\s*"), new RegexLeaf("END",
|
new RegexLeaf("AR_TO_RIGHT",
|
||||||
"(?::\\s*([^\"]+))?$"));
|
"(([-=.]+)(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.]))?([-=.]*)([\\]>]|\\|[>\\]])?)"),
|
||||||
|
// "(([-=.]+)(left|right|up|down|le?|ri?|up?|do?)?([-=.]*?\\.*)([\\]>]|\\|[>\\]])?)"),
|
||||||
|
new RegexLeaf("AR_TO_LEFT",
|
||||||
|
"(([\\[<]|[<\\[]\\|)?([-=.]*)(left|right|up|down|le?|ri?|up?|do?)?([-=.]+))")),
|
||||||
|
new RegexLeaf("\\s*"),//
|
||||||
|
getRegexGroup("G2"),//
|
||||||
|
new RegexLeaf("\\s*"),//
|
||||||
|
new RegexLeaf("END", "(?::\\s*([^\"]+))?$"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RegexLeaf getRegexGroup(String name) {
|
private static RegexLeaf getRegexGroup(String name) {
|
||||||
@ -87,7 +94,6 @@ public class CommandLinkComponent2 extends SingleLineCommand2<ComponentDiagram>
|
|||||||
final IEntity cl1 = getSystem().getOrCreateClass(g1);
|
final IEntity cl1 = getSystem().getOrCreateClass(g1);
|
||||||
final IEntity cl2 = getSystem().getOrCreateClass(g2);
|
final IEntity cl2 = getSystem().getOrCreateClass(g2);
|
||||||
|
|
||||||
|
|
||||||
if (arg.get("G1").get(1) != null) {
|
if (arg.get("G1").get(1) != null) {
|
||||||
cl1.setStereotype(new Stereotype(arg.get("G1").get(1)));
|
cl1.setStereotype(new Stereotype(arg.get("G1").get(1)));
|
||||||
}
|
}
|
||||||
@ -116,7 +122,6 @@ public class CommandLinkComponent2 extends SingleLineCommand2<ComponentDiagram>
|
|||||||
link = link.getInv();
|
link = link.getInv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getSystem().addLink(link);
|
getSystem().addLink(link);
|
||||||
return CommandExecutionResult.ok();
|
return CommandExecutionResult.ok();
|
||||||
}
|
}
|
||||||
@ -131,8 +136,6 @@ public class CommandLinkComponent2 extends SingleLineCommand2<ComponentDiagram>
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private CommandExecutionResult executePackageLink(Map<String, RegexPartialMatch> arg) {
|
private CommandExecutionResult executePackageLink(Map<String, RegexPartialMatch> arg) {
|
||||||
final String g1 = arg.get("G1").get(0);
|
final String g1 = arg.get("G1").get(0);
|
||||||
final String g2 = arg.get("G2").get(0);
|
final String g2 = arg.get("G2").get(0);
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5694 $
|
* Revision $Revision: 6121 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.cucadiagram;
|
package net.sourceforge.plantuml.cucadiagram;
|
||||||
@ -61,9 +61,18 @@ public class Entity implements IEntity {
|
|||||||
private DrawFile imageFile;
|
private DrawFile imageFile;
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
private boolean top;
|
||||||
|
|
||||||
|
public final boolean isTop() {
|
||||||
|
return top;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setTop(boolean top) {
|
||||||
|
this.top = top;
|
||||||
|
}
|
||||||
|
|
||||||
public Entity(String code, String display, EntityType type, Group entityPackage) {
|
public Entity(String code, String display, EntityType type, Group entityPackage) {
|
||||||
this("cl" + UniqueSequence.getValue(), code, display, type, entityPackage);
|
this("cl" + UniqueSequence.getValue(), code, display, type, entityPackage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Entity(String uid, String code, String display, EntityType type, Group entityPackage) {
|
public Entity(String uid, String code, String display, EntityType type, Group entityPackage) {
|
||||||
|
@ -118,6 +118,14 @@ public abstract class EntityUtils {
|
|||||||
return ent.getImageFile(searched);
|
return ent.getImageFile(searched);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isTop() {
|
||||||
|
return ent.isTop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTop(boolean top) {
|
||||||
|
ent.setTop(top);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,4 +64,9 @@ public interface IEntity extends Imaged, SpecificBackcolorable {
|
|||||||
|
|
||||||
public DrawFile getImageFile(File searched) throws IOException;
|
public DrawFile getImageFile(File searched) throws IOException;
|
||||||
|
|
||||||
|
public boolean isTop();
|
||||||
|
|
||||||
|
public void setTop(boolean top);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6005 $
|
* Revision $Revision: 6104 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.cucadiagram.dot;
|
package net.sourceforge.plantuml.cucadiagram.dot;
|
||||||
@ -90,10 +90,11 @@ abstract class AbstractGraphviz implements Graphviz {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String cmd = getCommandLine();
|
final String cmd = getCommandLine();
|
||||||
|
ProcessRunner p = null;
|
||||||
try {
|
try {
|
||||||
Log.info("Starting Graphviz process " + cmd);
|
Log.info("Starting Graphviz process " + cmd);
|
||||||
Log.info("DotString size: " + dotString.length());
|
Log.info("DotString size: " + dotString.length());
|
||||||
final ProcessRunner p = new ProcessRunner(cmd);
|
p = new ProcessRunner(cmd);
|
||||||
p.run(dotString.getBytes(), os);
|
p.run(dotString.getBytes(), os);
|
||||||
Log.info("Ending process ok");
|
Log.info("Ending process ok");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
@ -105,8 +106,20 @@ abstract class AbstractGraphviz implements Graphviz {
|
|||||||
Log.error("");
|
Log.error("");
|
||||||
} finally {
|
} finally {
|
||||||
Log.info("Ending Graphviz process");
|
Log.info("Ending Graphviz process");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (OptionFlags.getInstance().isCheckDotError() && p != null && p.getError().length() > 0) {
|
||||||
|
Log.error("GraphViz error stream : " + p.getError());
|
||||||
|
if (OptionFlags.getInstance().isCheckDotError()) {
|
||||||
|
throw new IllegalStateException("Dot error " + p.getError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (OptionFlags.getInstance().isCheckDotError() && p != null && p.getOut().length() > 0) {
|
||||||
|
Log.error("GraphViz out stream : " + p.getOut());
|
||||||
|
if (OptionFlags.getInstance().isCheckDotError()) {
|
||||||
|
throw new IllegalStateException("Dot out " + p.getOut());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean illegalDotExe() {
|
private boolean illegalDotExe() {
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6035 $
|
* Revision $Revision: 6121 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.cucadiagram.dot;
|
package net.sourceforge.plantuml.cucadiagram.dot;
|
||||||
@ -99,6 +99,8 @@ final public class DotMaker implements GraphvizMaker {
|
|||||||
|
|
||||||
private final Set<String> hasAlreadyOneIncommingArrowLenghtOne;
|
private final Set<String> hasAlreadyOneIncommingArrowLenghtOne;
|
||||||
|
|
||||||
|
final private Set<String> rankMin = new HashSet<String>();
|
||||||
|
|
||||||
public static void goJunit() {
|
public static void goJunit() {
|
||||||
isJunit = true;
|
isJunit = true;
|
||||||
}
|
}
|
||||||
@ -123,6 +125,7 @@ final public class DotMaker implements GraphvizMaker {
|
|||||||
printGroups(sb, null);
|
printGroups(sb, null);
|
||||||
printEntities(sb, getUnpackagedEntities());
|
printEntities(sb, getUnpackagedEntities());
|
||||||
printLinks(sb, data.getLinks());
|
printLinks(sb, data.getLinks());
|
||||||
|
printRanking(sb);
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
|
|
||||||
// System.err.println(sb);
|
// System.err.println(sb);
|
||||||
@ -132,6 +135,20 @@ final public class DotMaker implements GraphvizMaker {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void printRanking(StringBuilder sb) {
|
||||||
|
if (rankMin.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sb.append("{ rank = min;");
|
||||||
|
for (String id : rankMin) {
|
||||||
|
sb.append(id);
|
||||||
|
sb.append(";");
|
||||||
|
}
|
||||||
|
sb.append("}");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initPrintWriter(StringBuilder sb) {
|
private void initPrintWriter(StringBuilder sb) {
|
||||||
|
|
||||||
Log.info("Entities = " + data.getEntities().size());
|
Log.info("Entities = " + data.getEntities().size());
|
||||||
@ -891,6 +908,11 @@ final public class DotMaker implements GraphvizMaker {
|
|||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException(type.toString() + " " + data.getUmlDiagramType());
|
throw new IllegalStateException(type.toString() + " " + data.getUmlDiagramType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entity.isTop()) {
|
||||||
|
rankMin.add(entity.getUid());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ColorParam getEndColorParam() {
|
private ColorParam getEndColorParam() {
|
||||||
|
@ -80,9 +80,10 @@ public class DrawFile {
|
|||||||
|
|
||||||
private DrawFile(File fPng, String svg, File fEps) {
|
private DrawFile(File fPng, String svg, File fEps) {
|
||||||
this(new Unlazy<File>(fPng), new Unlazy<String>(svg), new Unlazy<File>(fEps));
|
this(new Unlazy<File>(fPng), new Unlazy<String>(svg), new Unlazy<File>(fEps));
|
||||||
if (svg.contains("\\")) {
|
// if (svg.contains("\\")) {
|
||||||
throw new IllegalArgumentException();
|
// System.err.println("svg="+svg);
|
||||||
}
|
// throw new IllegalArgumentException();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getPngOrEps(boolean isEps) throws IOException {
|
public File getPngOrEps(boolean isEps) throws IOException {
|
||||||
|
@ -28,11 +28,12 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5650 $
|
* Revision $Revision: 6107 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.cucadiagram.dot;
|
package net.sourceforge.plantuml.cucadiagram.dot;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -53,7 +54,11 @@ public class ProcessRunner {
|
|||||||
static private int cpt = 0;
|
static private int cpt = 0;
|
||||||
|
|
||||||
public void run(byte in[], OutputStream redirection) throws IOException, InterruptedException {
|
public void run(byte in[], OutputStream redirection) throws IOException, InterruptedException {
|
||||||
final Process process = Runtime.getRuntime().exec(cmd);
|
run(in, redirection, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(byte in[], OutputStream redirection, File dir) throws IOException, InterruptedException {
|
||||||
|
final Process process = Runtime.getRuntime().exec(cmd, null, dir);
|
||||||
final ThreadStream errorStream = new ThreadStream(process.getErrorStream(), null);
|
final ThreadStream errorStream = new ThreadStream(process.getErrorStream(), null);
|
||||||
final ThreadStream outStream = new ThreadStream(process.getInputStream(), redirection);
|
final ThreadStream outStream = new ThreadStream(process.getInputStream(), redirection);
|
||||||
errorStream.start();
|
errorStream.start();
|
||||||
@ -68,7 +73,7 @@ public class ProcessRunner {
|
|||||||
outStream.join(10000L);
|
outStream.join(10000L);
|
||||||
this.out = outStream.sb.toString();
|
this.out = outStream.sb.toString();
|
||||||
this.error = errorStream.sb.toString();
|
this.error = errorStream.sb.toString();
|
||||||
Log.info("RUN nb = "+(++cpt));
|
Log.info("RUN nb = " + (++cpt));
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ThreadStream extends Thread {
|
static class ThreadStream extends Thread {
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5200 $
|
* Revision $Revision: 6107 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.preproc;
|
package net.sourceforge.plantuml.preproc;
|
||||||
@ -39,9 +39,9 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
class IfManager implements ReadLine {
|
class IfManager implements ReadLine {
|
||||||
|
|
||||||
protected static final Pattern ifdefPattern = Pattern.compile("^!if(n)?def\\s+([A-Za-z_][A-Za-z_0-9]*)$");
|
protected static final Pattern ifdefPattern = Pattern.compile("^\\s*!if(n)?def\\s+([A-Za-z_][A-Za-z_0-9]*)$");
|
||||||
protected static final Pattern elsePattern = Pattern.compile("^!else$");
|
protected static final Pattern elsePattern = Pattern.compile("^\\s*!else$");
|
||||||
protected static final Pattern endifPattern = Pattern.compile("^!endif$");
|
protected static final Pattern endifPattern = Pattern.compile("^\\s*!endif$");
|
||||||
|
|
||||||
private final Defines defines;
|
private final Defines defines;
|
||||||
private final ReadLine source;
|
private final ReadLine source;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6070 $
|
* Revision $Revision: 6107 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.preproc;
|
package net.sourceforge.plantuml.preproc;
|
||||||
@ -41,8 +41,8 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public class Preprocessor implements ReadLine {
|
public class Preprocessor implements ReadLine {
|
||||||
|
|
||||||
private static final Pattern definePattern = Pattern.compile("^!define\\s+([A-Za-z_][A-Za-z_0-9]*)(?:\\s+(.*))?$");
|
private static final Pattern definePattern = Pattern.compile("^\\s*!define\\s+([A-Za-z_][A-Za-z_0-9]*)(?:\\s+(.*))?$");
|
||||||
private static final Pattern undefPattern = Pattern.compile("^!undef\\s+([A-Za-z_][A-Za-z_0-9]*)$");
|
private static final Pattern undefPattern = Pattern.compile("^\\s*!undef\\s+([A-Za-z_][A-Za-z_0-9]*)$");
|
||||||
|
|
||||||
private final Defines defines;
|
private final Defines defines;
|
||||||
private final PreprocessorInclude rawSource;
|
private final PreprocessorInclude rawSource;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6070 $
|
* Revision $Revision: 6107 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.preproc;
|
package net.sourceforge.plantuml.preproc;
|
||||||
@ -45,7 +45,7 @@ import net.sourceforge.plantuml.FileSystem;
|
|||||||
|
|
||||||
class PreprocessorInclude implements ReadLine {
|
class PreprocessorInclude implements ReadLine {
|
||||||
|
|
||||||
private static final Pattern includePattern = Pattern.compile("^!include\\s+\"?([^\"]+)\"?$");
|
private static final Pattern includePattern = Pattern.compile("^\\s*!include\\s+\"?([^\"]+)\"?$");
|
||||||
|
|
||||||
private final ReadLine reader2;
|
private final ReadLine reader2;
|
||||||
private int numLine = 0;
|
private int numLine = 0;
|
||||||
|
@ -47,4 +47,8 @@ public class Delay implements Event {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -47,4 +47,9 @@ public class Divider implements Event {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,13 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 3835 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
|
|
||||||
public interface Event {
|
public interface Event {
|
||||||
|
|
||||||
|
boolean dealWith(Participant someone);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 4321 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -74,4 +74,9 @@ public class GroupingLeaf extends Grouping {
|
|||||||
}
|
}
|
||||||
return backColorGeneral;
|
return backColorGeneral;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,4 +73,9 @@ public class GroupingStart extends Grouping {
|
|||||||
return backColorGeneral;
|
return backColorGeneral;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 4243 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -59,5 +59,8 @@ public class LifeEvent implements Event {
|
|||||||
return backcolor;
|
return backcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return this.p == someone;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5923 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -57,4 +57,8 @@ public class Message extends AbstractMessage {
|
|||||||
return p2;
|
return p2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return someone == p1 || someone == p2;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,4 +57,8 @@ public class MessageExo extends AbstractMessage {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return participant == someone;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 3835 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -47,4 +47,9 @@ public class Newpage implements Event {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 4237 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -87,4 +87,7 @@ public class Note implements Event, SpecificBackcolorable {
|
|||||||
this.specificBackcolor = HtmlColor.getColorIfValid(s);
|
this.specificBackcolor = HtmlColor.getColorIfValid(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean dealWith(Participant someone) {
|
||||||
|
return p == someone || p2 == someone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 4836 $
|
* Revision $Revision: 6099 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -70,6 +70,11 @@ public class Participant implements SpecificBackcolorable {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getCode();
|
||||||
|
}
|
||||||
|
|
||||||
public List<CharSequence> getDisplay() {
|
public List<CharSequence> getDisplay() {
|
||||||
return Collections.unmodifiableList(display);
|
return Collections.unmodifiableList(display);
|
||||||
}
|
}
|
||||||
|
@ -40,28 +40,13 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
public class ParticipantEnglober {
|
public class ParticipantEnglober {
|
||||||
|
|
||||||
final private List<String> title;
|
final private List<String> title;
|
||||||
final private Participant first;
|
|
||||||
final private Participant last;
|
|
||||||
final private HtmlColor boxColor;
|
final private HtmlColor boxColor;
|
||||||
|
|
||||||
public ParticipantEnglober(Participant first, Participant last, List<String> title, HtmlColor boxColor) {
|
public ParticipantEnglober(List<String> title, HtmlColor boxColor) {
|
||||||
if (first == null || last == null) {
|
|
||||||
throw new IllegalArgumentException();
|
|
||||||
}
|
|
||||||
this.first = first;
|
|
||||||
this.last = last;
|
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.boxColor = boxColor;
|
this.boxColor = boxColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Participant getFirst() {
|
|
||||||
return first;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final Participant getLast() {
|
|
||||||
return last;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final List<String> getTitle() {
|
public final List<String> getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
@ -70,4 +55,5 @@ public class ParticipantEnglober {
|
|||||||
return boxColor;
|
return boxColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ import java.text.DecimalFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -63,7 +63,7 @@ public class SequenceDiagram extends UmlDiagram {
|
|||||||
|
|
||||||
private final List<Event> events = new ArrayList<Event>();
|
private final List<Event> events = new ArrayList<Event>();
|
||||||
|
|
||||||
private final List<ParticipantEnglober> participantEnglobers = new ArrayList<ParticipantEnglober>();
|
private final Map<Participant, ParticipantEnglober> participantEnglobers2 = new HashMap<Participant, ParticipantEnglober>();
|
||||||
|
|
||||||
private Skin skin = new ProtectedSkin(new Rose());
|
private Skin skin = new ProtectedSkin(new Rose());
|
||||||
|
|
||||||
@ -77,6 +77,7 @@ public class SequenceDiagram extends UmlDiagram {
|
|||||||
if (result == null) {
|
if (result == null) {
|
||||||
result = new Participant(ParticipantType.PARTICIPANT, code, display);
|
result = new Participant(ParticipantType.PARTICIPANT, code, display);
|
||||||
participants.put(code, result);
|
participants.put(code, result);
|
||||||
|
participantEnglobers2.put(result, participantEnglober);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -96,6 +97,7 @@ public class SequenceDiagram extends UmlDiagram {
|
|||||||
}
|
}
|
||||||
final Participant result = new Participant(type, code, display);
|
final Participant result = new Participant(type, code, display);
|
||||||
participants.put(code, result);
|
participants.put(code, result);
|
||||||
|
participantEnglobers2.put(result, participantEnglober);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,65 +268,98 @@ public class SequenceDiagram extends UmlDiagram {
|
|||||||
return UmlDiagramType.SEQUENCE;
|
return UmlDiagramType.SEQUENCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Participant boxStart;
|
// private Participant boxStart;
|
||||||
private List<String> boxStartComment;
|
// private List<String> boxStartComment;
|
||||||
private HtmlColor boxColor;
|
// private HtmlColor boxColor;
|
||||||
private boolean boxPending = false;
|
// private boolean boxPending = false;
|
||||||
|
|
||||||
|
private ParticipantEnglober participantEnglober;
|
||||||
|
|
||||||
public void boxStart(List<String> comment, HtmlColor color) {
|
public void boxStart(List<String> comment, HtmlColor color) {
|
||||||
if (boxPending) {
|
if (participantEnglober != null) {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
this.boxStart = getLastParticipant();
|
this.participantEnglober = new ParticipantEnglober(comment, color);
|
||||||
this.boxStartComment = comment;
|
|
||||||
this.boxColor = color;
|
|
||||||
this.boxPending = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endBox() {
|
public void endBox() {
|
||||||
if (boxPending == false) {
|
if (participantEnglober == null) {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
final Participant last = getLastParticipant();
|
this.participantEnglober = null;
|
||||||
this.participantEnglobers.add(new ParticipantEnglober(next(boxStart), last, boxStartComment, boxColor));
|
|
||||||
this.boxStart = null;
|
|
||||||
this.boxStartComment = null;
|
|
||||||
this.boxColor = null;
|
|
||||||
this.boxPending = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBoxPending() {
|
public boolean isBoxPending() {
|
||||||
return boxPending;
|
return participantEnglober != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Participant next(Participant p) {
|
// private Participant next(Participant p) {
|
||||||
if (p == null) {
|
// if (p == null) {
|
||||||
return participants.values().iterator().next();
|
// return participants.values().iterator().next();
|
||||||
}
|
// }
|
||||||
for (final Iterator<Participant> it = participants.values().iterator(); it.hasNext();) {
|
// for (final Iterator<Participant> it = participants.values().iterator(); it.hasNext();) {
|
||||||
final Participant current = it.next();
|
// final Participant current = it.next();
|
||||||
if (current == p && it.hasNext()) {
|
// if (current == p && it.hasNext()) {
|
||||||
return it.next();
|
// return it.next();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
throw new IllegalArgumentException("p=" + p.getCode());
|
// throw new IllegalArgumentException("p=" + p.getCode());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private Participant getLastParticipant() {
|
// private Participant getLastParticipant() {
|
||||||
Participant result = null;
|
// Participant result = null;
|
||||||
for (Participant p : participants.values()) {
|
// for (Participant p : participants.values()) {
|
||||||
result = p;
|
// result = p;
|
||||||
}
|
// }
|
||||||
return result;
|
// return result;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public final List<ParticipantEnglober> getParticipantEnglobers() {
|
// public final List<ParticipantEnglober> getParticipantEnglobers() {
|
||||||
return Collections.unmodifiableList(participantEnglobers);
|
// return Collections.unmodifiableList(participantEnglobers);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getNbImages() {
|
public int getNbImages() {
|
||||||
return getSequenceDiagramPngMaker(new FileFormatOption(FileFormat.PNG)).getNbPages();
|
return getSequenceDiagramPngMaker(new FileFormatOption(FileFormat.PNG)).getNbPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeHiddenParticipants() {
|
||||||
|
for (Participant p : new ArrayList<Participant>(participants.values())) {
|
||||||
|
if (isAlone(p)) {
|
||||||
|
remove(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void remove(Participant p) {
|
||||||
|
final boolean ok = participants.values().remove(p);
|
||||||
|
if (ok==false) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
participantEnglobers2.remove(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAlone(Participant p) {
|
||||||
|
for (Event ev : events) {
|
||||||
|
if (ev.dealWith(p)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void putParticipantInLast(String code) {
|
||||||
|
final Participant p = participants.get(code);
|
||||||
|
if (p == null) {
|
||||||
|
throw new IllegalArgumentException(code);
|
||||||
|
}
|
||||||
|
participants.remove(code);
|
||||||
|
participants.put(code, p);
|
||||||
|
participantEnglobers2.put(p, participantEnglober);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ParticipantEnglober getEnglober(Participant p) {
|
||||||
|
return participantEnglobers2.get(p);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5933 $
|
* Revision $Revision: 6097 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -107,4 +107,13 @@ public class SequenceDiagramFactory extends AbstractUmlSystemCommandFactory {
|
|||||||
return system;
|
return system;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkFinalError() {
|
||||||
|
if (system.isHideUnlinkedData()) {
|
||||||
|
system.removeHiddenParticipants();
|
||||||
|
}
|
||||||
|
return super.checkFinalError();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5728 $
|
* Revision $Revision: 6109 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram.command;
|
package net.sourceforge.plantuml.sequencediagram.command;
|
||||||
@ -55,7 +55,8 @@ public class CommandParticipant extends SingleLineCommand<SequenceDiagram> {
|
|||||||
protected CommandExecutionResult executeArg(List<String> arg) {
|
protected CommandExecutionResult executeArg(List<String> arg) {
|
||||||
final String code = arg.get(2);
|
final String code = arg.get(2);
|
||||||
if (getSystem().participants().containsKey(code)) {
|
if (getSystem().participants().containsKey(code)) {
|
||||||
return CommandExecutionResult.error("Duplicate participant : "+code);
|
getSystem().putParticipantInLast(code);
|
||||||
|
return CommandExecutionResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> strings = null;
|
List<String> strings = null;
|
||||||
|
@ -55,7 +55,8 @@ public class CommandParticipant2 extends SingleLineCommand<SequenceDiagram> {
|
|||||||
protected CommandExecutionResult executeArg(List<String> arg) {
|
protected CommandExecutionResult executeArg(List<String> arg) {
|
||||||
final String code = arg.get(1);
|
final String code = arg.get(1);
|
||||||
if (getSystem().participants().containsKey(code)) {
|
if (getSystem().participants().containsKey(code)) {
|
||||||
return CommandExecutionResult.error("Duplicate participant : " + code);
|
getSystem().putParticipantInLast(code);
|
||||||
|
return CommandExecutionResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<String> strings = StringUtils.getWithNewlines(arg.get(2));
|
final List<String> strings = StringUtils.getWithNewlines(arg.get(2));
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5829 $
|
* Revision $Revision: 6113 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||||
@ -51,6 +51,7 @@ import net.sourceforge.plantuml.sequencediagram.Event;
|
|||||||
import net.sourceforge.plantuml.sequencediagram.Newpage;
|
import net.sourceforge.plantuml.sequencediagram.Newpage;
|
||||||
import net.sourceforge.plantuml.sequencediagram.Participant;
|
import net.sourceforge.plantuml.sequencediagram.Participant;
|
||||||
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
|
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
|
||||||
|
import net.sourceforge.plantuml.sequencediagram.ParticipantEngloberContexted;
|
||||||
import net.sourceforge.plantuml.skin.Component;
|
import net.sourceforge.plantuml.skin.Component;
|
||||||
import net.sourceforge.plantuml.skin.ComponentType;
|
import net.sourceforge.plantuml.skin.ComponentType;
|
||||||
import net.sourceforge.plantuml.skin.Context2D;
|
import net.sourceforge.plantuml.skin.Context2D;
|
||||||
@ -63,7 +64,8 @@ class DrawableSet {
|
|||||||
|
|
||||||
private final Map<Participant, LivingParticipantBox> participants = new LinkedHashMap<Participant, LivingParticipantBox>();
|
private final Map<Participant, LivingParticipantBox> participants = new LinkedHashMap<Participant, LivingParticipantBox>();
|
||||||
private final Map<Event, GraphicalElement> events = new HashMap<Event, GraphicalElement>();
|
private final Map<Event, GraphicalElement> events = new HashMap<Event, GraphicalElement>();
|
||||||
private final List<ParticipantEnglober> participantEnglobers = new ArrayList<ParticipantEnglober>();
|
private final Map<Participant, ParticipantEnglober> participantEnglobers2 = new LinkedHashMap<Participant, ParticipantEnglober>();
|
||||||
|
|
||||||
private final List<Event> eventsList = new ArrayList<Event>();
|
private final List<Event> eventsList = new ArrayList<Event>();
|
||||||
private final Skin skin;
|
private final Skin skin;
|
||||||
private final ISkinParam skinParam;
|
private final ISkinParam skinParam;
|
||||||
@ -129,19 +131,41 @@ class DrawableSet {
|
|||||||
public double getHeadAndEngloberHeight(Participant p, StringBounder stringBounder) {
|
public double getHeadAndEngloberHeight(Participant p, StringBounder stringBounder) {
|
||||||
final LivingParticipantBox box = participants.get(p);
|
final LivingParticipantBox box = participants.get(p);
|
||||||
final double height = box.getParticipantBox().getHeadHeight(stringBounder);
|
final double height = box.getParticipantBox().getHeadHeight(stringBounder);
|
||||||
final ParticipantEnglober englober = getParticipantEnglober(p);
|
final ParticipantEngloberContexted englober = getParticipantEnglober(p);
|
||||||
if (englober == null) {
|
if (englober == null) {
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
final Component comp = skin.createComponent(ComponentType.ENGLOBER, skinParam, englober.getTitle());
|
final Component comp = skin.createComponent(ComponentType.ENGLOBER, skinParam, englober
|
||||||
|
.getParticipantEnglober().getTitle());
|
||||||
final double heightEnglober = comp.getPreferredHeight(stringBounder);
|
final double heightEnglober = comp.getPreferredHeight(stringBounder);
|
||||||
return height + heightEnglober;
|
return height + heightEnglober;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ParticipantEngloberContexted> getExistingParticipantEnglober2() {
|
||||||
|
final List<ParticipantEngloberContexted> result = new ArrayList<ParticipantEngloberContexted>();
|
||||||
|
ParticipantEngloberContexted pending = null;
|
||||||
|
for (Map.Entry<Participant, ParticipantEnglober> ent : participantEnglobers2.entrySet()) {
|
||||||
|
final ParticipantEnglober englober = ent.getValue();
|
||||||
|
if (englober == null) {
|
||||||
|
pending = null;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
assert englober != null;
|
||||||
|
if (pending != null && englober == pending.getParticipantEnglober()) {
|
||||||
|
pending.add(ent.getKey());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pending = new ParticipantEngloberContexted(englober, ent.getKey());
|
||||||
|
result.add(pending);
|
||||||
|
}
|
||||||
|
return Collections.unmodifiableList(result);
|
||||||
|
}
|
||||||
|
|
||||||
public double getOffsetForEnglobers(StringBounder stringBounder) {
|
public double getOffsetForEnglobers(StringBounder stringBounder) {
|
||||||
double result = 0;
|
double result = 0;
|
||||||
for (ParticipantEnglober englober : participantEnglobers) {
|
for (ParticipantEngloberContexted englober : getExistingParticipantEnglober2()) {
|
||||||
final Component comp = skin.createComponent(ComponentType.ENGLOBER, skinParam, englober.getTitle());
|
final Component comp = skin.createComponent(ComponentType.ENGLOBER, skinParam, englober
|
||||||
|
.getParticipantEnglober().getTitle());
|
||||||
final double height = comp.getPreferredHeight(stringBounder);
|
final double height = comp.getPreferredHeight(stringBounder);
|
||||||
if (height > result) {
|
if (height > result) {
|
||||||
result = height;
|
result = height;
|
||||||
@ -154,7 +178,7 @@ class DrawableSet {
|
|||||||
static private final int MARGIN_FOR_ENGLOBERS1 = 2;
|
static private final int MARGIN_FOR_ENGLOBERS1 = 2;
|
||||||
|
|
||||||
public double getTailHeight(StringBounder stringBounder, boolean showTail) {
|
public double getTailHeight(StringBounder stringBounder, boolean showTail) {
|
||||||
final double marginForEnglobers = this.participantEnglobers.size() > 0 ? MARGIN_FOR_ENGLOBERS : 0;
|
final double marginForEnglobers = getExistingParticipantEnglober2().size() > 0 ? MARGIN_FOR_ENGLOBERS : 0;
|
||||||
|
|
||||||
if (showTail == false) {
|
if (showTail == false) {
|
||||||
return 1 + marginForEnglobers;
|
return 1 + marginForEnglobers;
|
||||||
@ -167,7 +191,15 @@ class DrawableSet {
|
|||||||
return r + marginForEnglobers;
|
return r + marginForEnglobers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addParticipant(Participant p, LivingParticipantBox box) {
|
public void addParticipant(Participant p, ParticipantEnglober participantEnglober) {
|
||||||
|
participants.put(p, null);
|
||||||
|
participantEnglobers2.put(p, participantEnglober);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLivingParticipantBox(Participant p, LivingParticipantBox box) {
|
||||||
|
if (participants.containsKey(p) == false) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
participants.put(p, box);
|
participants.put(p, box);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,16 +315,17 @@ class DrawableSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawEnglobers(UGraphic ug, double height, Context2D context) {
|
private void drawEnglobers(UGraphic ug, double height, Context2D context) {
|
||||||
for (ParticipantEnglober englober : participantEnglobers) {
|
for (ParticipantEngloberContexted englober : getExistingParticipantEnglober2()) {
|
||||||
double x1 = getX1(englober);
|
double x1 = getX1(englober);
|
||||||
final double x2 = getX2(ug.getStringBounder(), englober);
|
final double x2 = getX2(ug.getStringBounder(), englober);
|
||||||
|
|
||||||
final Component comp = getEngloberComponent(englober);
|
final Component comp = getEngloberComponent(englober.getParticipantEnglober());
|
||||||
|
|
||||||
final double width = x2 - x1;
|
final double width = x2 - x1;
|
||||||
final double preferedWidth = getEngloberPreferedWidth(ug.getStringBounder(), englober);
|
final double preferedWidth = getEngloberPreferedWidth(ug.getStringBounder(),
|
||||||
|
englober.getParticipantEnglober());
|
||||||
if (preferedWidth > width) {
|
if (preferedWidth > width) {
|
||||||
if (englober.getFirst() == englober.getLast()) {
|
if (englober.getFirst2() == englober.getLast2()) {
|
||||||
x1 -= (preferedWidth - width) / 2;
|
x1 -= (preferedWidth - width) / 2;
|
||||||
}
|
}
|
||||||
final Dimension2DDouble dim = new Dimension2DDouble(preferedWidth, height);
|
final Dimension2DDouble dim = new Dimension2DDouble(preferedWidth, height);
|
||||||
@ -313,19 +346,19 @@ class DrawableSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Component getEngloberComponent(ParticipantEnglober englober) {
|
private Component getEngloberComponent(ParticipantEnglober englober) {
|
||||||
final ISkinParam s = englober.getBoxColor() == null ? skinParam : new SkinParamBackcolored(skinParam, englober
|
final ISkinParam s = englober.getBoxColor() == null ? skinParam : new SkinParamBackcolored(skinParam,
|
||||||
.getBoxColor());
|
englober.getBoxColor());
|
||||||
return skin.createComponent(ComponentType.ENGLOBER, s, englober.getTitle());
|
return skin.createComponent(ComponentType.ENGLOBER, s, englober.getTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getX1(ParticipantEnglober englober) {
|
private double getX1(ParticipantEngloberContexted englober) {
|
||||||
final Participant first = englober.getFirst();
|
final Participant first = englober.getFirst2();
|
||||||
final ParticipantBox firstBox = participants.get(first).getParticipantBox();
|
final ParticipantBox firstBox = participants.get(first).getParticipantBox();
|
||||||
return firstBox.getStartingX() + 1;
|
return firstBox.getStartingX() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getX2(StringBounder stringBounder, ParticipantEnglober englober) {
|
private double getX2(StringBounder stringBounder, ParticipantEngloberContexted englober) {
|
||||||
final Participant last = englober.getLast();
|
final Participant last = englober.getLast2();
|
||||||
final ParticipantBox lastBox = participants.get(last).getParticipantBox();
|
final ParticipantBox lastBox = participants.get(last).getParticipantBox();
|
||||||
return lastBox.getMaxX(stringBounder) - 1;
|
return lastBox.getMaxX(stringBounder) - 1;
|
||||||
}
|
}
|
||||||
@ -337,32 +370,32 @@ class DrawableSet {
|
|||||||
line.drawU(ug, getSkin(), skinParam);
|
line.drawU(ug, getSkin(), skinParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addParticipantEnglober(ParticipantEnglober englober) {
|
// public void addParticipantEnglober(ParticipantEnglober englober) {
|
||||||
participantEnglobers.add(englober);
|
// participantEnglobers.add(englober);
|
||||||
}
|
// }
|
||||||
|
|
||||||
private boolean contains(ParticipantEnglober englober, Participant toTest) {
|
// private boolean contains(ParticipantEngloberContexted englober, Participant toTest) {
|
||||||
if (toTest == englober.getFirst() || toTest == englober.getLast()) {
|
// if (toTest == englober.getFirst2() || toTest == englober.getLast2()) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
boolean inside = false;
|
// boolean inside = false;
|
||||||
for (Participant p : participants.keySet()) {
|
// for (Participant p : participants.keySet()) {
|
||||||
if (p == englober.getFirst()) {
|
// if (p == englober.getFirst2()) {
|
||||||
inside = true;
|
// inside = true;
|
||||||
}
|
// }
|
||||||
if (p == toTest) {
|
// if (p == toTest) {
|
||||||
return inside;
|
// return inside;
|
||||||
}
|
// }
|
||||||
if (p == englober.getLast()) {
|
// if (p == englober.getLast2()) {
|
||||||
inside = false;
|
// inside = false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
throw new IllegalArgumentException();
|
// throw new IllegalArgumentException();
|
||||||
}
|
// }
|
||||||
|
|
||||||
private ParticipantEnglober getParticipantEnglober(Participant p) {
|
private ParticipantEngloberContexted getParticipantEnglober(Participant p) {
|
||||||
for (ParticipantEnglober pe : participantEnglobers) {
|
for (ParticipantEngloberContexted pe : getExistingParticipantEnglober2()) {
|
||||||
if (contains(pe, p)) {
|
if (pe.contains(p)) {
|
||||||
return pe;
|
return pe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -373,8 +406,8 @@ class DrawableSet {
|
|||||||
this.topStartingY = topStartingY;
|
this.topStartingY = topStartingY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final List<ParticipantEnglober> getParticipantEnglobers() {
|
// public final List<ParticipantEnglober> getParticipantEnglobers() {
|
||||||
return Collections.unmodifiableList(participantEnglobers);
|
// return Collections.unmodifiableList(participantEnglobers);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6046 $
|
* Revision $Revision: 6113 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||||
@ -57,6 +57,7 @@ import net.sourceforge.plantuml.sequencediagram.Newpage;
|
|||||||
import net.sourceforge.plantuml.sequencediagram.Note;
|
import net.sourceforge.plantuml.sequencediagram.Note;
|
||||||
import net.sourceforge.plantuml.sequencediagram.Participant;
|
import net.sourceforge.plantuml.sequencediagram.Participant;
|
||||||
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
|
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
|
||||||
|
import net.sourceforge.plantuml.sequencediagram.ParticipantEngloberContexted;
|
||||||
import net.sourceforge.plantuml.sequencediagram.ParticipantType;
|
import net.sourceforge.plantuml.sequencediagram.ParticipantType;
|
||||||
import net.sourceforge.plantuml.skin.Component;
|
import net.sourceforge.plantuml.skin.Component;
|
||||||
import net.sourceforge.plantuml.skin.ComponentType;
|
import net.sourceforge.plantuml.skin.ComponentType;
|
||||||
@ -164,10 +165,11 @@ class DrawableSetInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void takeParticipantEngloberTitleWidth(StringBounder stringBounder) {
|
private void takeParticipantEngloberTitleWidth(StringBounder stringBounder) {
|
||||||
for (ParticipantEnglober pe : drawableSet.getParticipantEnglobers()) {
|
for (ParticipantEngloberContexted pe : drawableSet.getExistingParticipantEnglober2()) {
|
||||||
final double preferredWidth = drawableSet.getEngloberPreferedWidth(stringBounder, pe);
|
final double preferredWidth = drawableSet.getEngloberPreferedWidth(stringBounder,
|
||||||
final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst()).getParticipantBox();
|
pe.getParticipantEnglober());
|
||||||
final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast()).getParticipantBox();
|
final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst2()).getParticipantBox();
|
||||||
|
final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast2()).getParticipantBox();
|
||||||
if (first == last) {
|
if (first == last) {
|
||||||
final Constraint constraint1 = constraintSet.getConstraintBefore(first);
|
final Constraint constraint1 = constraintSet.getConstraintBefore(first);
|
||||||
final Constraint constraint2 = constraintSet.getConstraintAfter(last);
|
final Constraint constraint2 = constraintSet.getConstraintAfter(last);
|
||||||
@ -420,21 +422,21 @@ class DrawableSetInitializer {
|
|||||||
drawableSet.getSkinParam(), null);
|
drawableSet.getSkinParam(), null);
|
||||||
|
|
||||||
final LifeLine lifeLine = new LifeLine(box, comp.getPreferredWidth(stringBounder));
|
final LifeLine lifeLine = new LifeLine(box, comp.getPreferredWidth(stringBounder));
|
||||||
drawableSet.addParticipant(p, new LivingParticipantBox(box, lifeLine));
|
drawableSet.setLivingParticipantBox(p, new LivingParticipantBox(box, lifeLine));
|
||||||
|
|
||||||
this.freeX = box.getMaxX(stringBounder);
|
this.freeX = box.getMaxX(stringBounder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addParticipant(Participant p) {
|
public void addParticipant(Participant p, ParticipantEnglober participantEnglober) {
|
||||||
drawableSet.addParticipant(p, null);
|
drawableSet.addParticipant(p, participantEnglober);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEvent(Event event) {
|
public void addEvent(Event event) {
|
||||||
drawableSet.addEvent(event, null);
|
drawableSet.addEvent(event, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addParticipantEnglober(ParticipantEnglober englober) {
|
// public void addParticipantEnglober(ParticipantEnglober englober) {
|
||||||
drawableSet.addParticipantEnglober(englober);
|
// drawableSet.addParticipantEnglober(englober);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 5872 $
|
* Revision $Revision: 6113 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||||
@ -103,11 +103,11 @@ public class SequenceDiagramFileMaker implements FileMaker {
|
|||||||
sequenceDiagram.isShowFootbox(), sequenceDiagram.getAutonewpage());
|
sequenceDiagram.isShowFootbox(), sequenceDiagram.getAutonewpage());
|
||||||
|
|
||||||
for (Participant p : sequenceDiagram.participants().values()) {
|
for (Participant p : sequenceDiagram.participants().values()) {
|
||||||
initializer.addParticipant(p);
|
initializer.addParticipant(p, sequenceDiagram.getEnglober(p));
|
||||||
}
|
|
||||||
for (ParticipantEnglober englober : sequenceDiagram.getParticipantEnglobers()) {
|
|
||||||
initializer.addParticipantEnglober(englober);
|
|
||||||
}
|
}
|
||||||
|
// for (ParticipantEnglober englober : sequenceDiagram.getParticipantEnglobers()) {
|
||||||
|
// initializer.addParticipantEnglober(englober);
|
||||||
|
// }
|
||||||
|
|
||||||
for (Event ev : sequenceDiagram.events()) {
|
for (Event ev : sequenceDiagram.events()) {
|
||||||
initializer.addEvent(ev);
|
initializer.addEvent(ev);
|
||||||
|
@ -73,7 +73,7 @@ public class SequenceDiagramTxtMaker implements FileMaker {
|
|||||||
sequenceDiagram.isShowFootbox(), sequenceDiagram.getAutonewpage());
|
sequenceDiagram.isShowFootbox(), sequenceDiagram.getAutonewpage());
|
||||||
|
|
||||||
for (Participant p : sequenceDiagram.participants().values()) {
|
for (Participant p : sequenceDiagram.participants().values()) {
|
||||||
initializer.addParticipant(p);
|
initializer.addParticipant(p, null);
|
||||||
}
|
}
|
||||||
for (Event ev : sequenceDiagram.events()) {
|
for (Event ev : sequenceDiagram.events()) {
|
||||||
initializer.addEvent(ev);
|
initializer.addEvent(ev);
|
||||||
|
@ -89,7 +89,12 @@ abstract class Step1Abstract {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert n.getType() == LifeEventType.ACTIVATE;
|
assert n.getType() == LifeEventType.ACTIVATE;
|
||||||
line.addSegmentVariation(LifeSegmentVariation.LARGER, pos, n.getSpecificBackColor());
|
|
||||||
|
int delta = 0;
|
||||||
|
if (message.isCreate()) {
|
||||||
|
delta += 10;
|
||||||
|
}
|
||||||
|
line.addSegmentVariation(LifeSegmentVariation.LARGER, pos + delta, n.getSpecificBackColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void afterMessage(StringBounder stringBounder, LifeEvent n, final double pos) {
|
protected final void afterMessage(StringBounder stringBounder, LifeEvent n, final double pos) {
|
||||||
@ -150,7 +155,8 @@ abstract class Step1Abstract {
|
|||||||
freeY += v;
|
freeY += v;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final NoteBox createNoteBox(StringBounder stringBounder, Arrow arrow, Component noteComp, NotePosition notePosition) {
|
protected final NoteBox createNoteBox(StringBounder stringBounder, Arrow arrow, Component noteComp,
|
||||||
|
NotePosition notePosition) {
|
||||||
final LivingParticipantBox p = arrow.getParticipantAt(stringBounder, notePosition);
|
final LivingParticipantBox p = arrow.getParticipantAt(stringBounder, notePosition);
|
||||||
final NoteBox noteBox = new NoteBox(arrow.getStartingY(), noteComp, p, null, notePosition);
|
final NoteBox noteBox = new NoteBox(arrow.getStartingY(), noteComp, p, null, notePosition);
|
||||||
|
|
||||||
|
@ -28,11 +28,14 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6085 $
|
* Revision $Revision: 6095 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.statediagram;
|
package net.sourceforge.plantuml.statediagram;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.UmlDiagramType;
|
import net.sourceforge.plantuml.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.UniqueSequence;
|
import net.sourceforge.plantuml.UniqueSequence;
|
||||||
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
|
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
|
||||||
@ -103,4 +106,13 @@ public class StateDiagram extends AbstractEntityDiagram {
|
|||||||
return UmlDiagramType.STATE;
|
return UmlDiagramType.STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// final protected List<String> getDotStrings() {
|
||||||
|
// return Arrays.asList("nodesep=1.95;", "ranksep=1.8;", "edge [fontsize=11,labelfontsize=11];",
|
||||||
|
// "node [fontsize=11,height=.35,width=.55];");
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ public class CommandLinkUsecase2 extends SingleLineCommand2<UsecaseDiagram> {
|
|||||||
getGroup("ENT1"),
|
getGroup("ENT1"),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
new RegexOr(
|
new RegexOr(
|
||||||
new RegexLeaf("LEFT_TO_RIGHT", "(([-=.]+)(left|right|up|down|le?|ri?|up?|do?)?([-=.]*)([\\]>]|\\|[>\\]])?)"),
|
new RegexLeaf("LEFT_TO_RIGHT", "(([-=.]+)(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.]))?([-=.]*)([\\]>]|\\|[>\\]])?)"),
|
||||||
new RegexLeaf("RIGHT_TO_LEFT", "(([\\[<]|[<\\[]\\|)?([-=.]*)(left|right|up|down|le?|ri?|up?|do?)?([-=.]+))")),
|
new RegexLeaf("RIGHT_TO_LEFT", "(([\\[<]|[<\\[]\\|)?([-=.]*)(left|right|up|down|le?|ri?|up?|do?)?([-=.]+))")),
|
||||||
new RegexLeaf("\\s*"),
|
new RegexLeaf("\\s*"),
|
||||||
getGroup("ENT2"),
|
getGroup("ENT2"),
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 6086 $
|
* Revision $Revision: 6122 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.version;
|
package net.sourceforge.plantuml.version;
|
||||||
@ -36,11 +36,11 @@ package net.sourceforge.plantuml.version;
|
|||||||
public class Version {
|
public class Version {
|
||||||
|
|
||||||
public static int version() {
|
public static int version() {
|
||||||
return 6085;
|
return 6121;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long compileTime() {
|
public static long compileTime() {
|
||||||
return 1296252260468L;
|
return 1297683757562L;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user