mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-25 06:17:33 +00:00
version 8054
This commit is contained in:
parent
ae4cf31832
commit
69c25ec749
2
pom.xml
2
pom.xml
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<groupId>net.sourceforge.plantuml</groupId>
|
<groupId>net.sourceforge.plantuml</groupId>
|
||||||
<artifactId>plantuml</artifactId>
|
<artifactId>plantuml</artifactId>
|
||||||
<version>8054-SNAPSHOT</version>
|
<version>8055-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>PlantUML</name>
|
<name>PlantUML</name>
|
||||||
|
@ -36,10 +36,10 @@ import net.sourceforge.plantuml.graphic.color.ColorType;
|
|||||||
|
|
||||||
|
|
||||||
public enum ColorParam {
|
public enum ColorParam {
|
||||||
background(HtmlColorUtils.WHITE, ColorType.BACK),
|
background(HtmlColorUtils.WHITE, true, ColorType.BACK),
|
||||||
hyperlink(HtmlColorUtils.BLUE),
|
hyperlink(HtmlColorUtils.BLUE),
|
||||||
|
|
||||||
activityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
activityBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
activityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
activityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
activityStart(HtmlColorUtils.BLACK),
|
activityStart(HtmlColorUtils.BLACK),
|
||||||
activityEnd(HtmlColorUtils.BLACK),
|
activityEnd(HtmlColorUtils.BLACK),
|
||||||
@ -48,15 +48,15 @@ public enum ColorParam {
|
|||||||
swimlaneBorder(HtmlColorUtils.BLACK),
|
swimlaneBorder(HtmlColorUtils.BLACK),
|
||||||
|
|
||||||
usecaseBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
usecaseBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
usecaseBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
usecaseBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
usecaseArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
usecaseArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
||||||
|
|
||||||
objectBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
objectBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
objectBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
objectBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
objectArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
objectArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
||||||
|
|
||||||
classHeaderBackground(null, ColorType.BACK),
|
classHeaderBackground(null, true, ColorType.BACK),
|
||||||
classBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
classBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
classBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
classBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
stereotypeCBackground(HtmlColorUtils.COL_ADD1B2),
|
stereotypeCBackground(HtmlColorUtils.COL_ADD1B2),
|
||||||
stereotypeNBackground(HtmlColorUtils.COL_E3664A),
|
stereotypeNBackground(HtmlColorUtils.COL_E3664A),
|
||||||
@ -65,19 +65,19 @@ public enum ColorParam {
|
|||||||
stereotypeEBackground(HtmlColorUtils.COL_EB937F),
|
stereotypeEBackground(HtmlColorUtils.COL_EB937F),
|
||||||
classArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
classArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
||||||
|
|
||||||
packageBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
packageBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
packageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
packageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
|
|
||||||
partitionBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
partitionBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
partitionBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
partitionBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
|
|
||||||
componentBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
componentBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
componentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
componentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
interfaceBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
interfaceBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
interfaceBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
interfaceBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
componentArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
componentArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
||||||
|
|
||||||
stateBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
stateBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
stateBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
stateBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
stateArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
stateArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
|
||||||
stateStart(HtmlColorUtils.BLACK),
|
stateStart(HtmlColorUtils.BLACK),
|
||||||
@ -113,35 +113,35 @@ public enum ColorParam {
|
|||||||
sequenceBoxBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
sequenceBoxBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
|
sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
|
||||||
|
|
||||||
artifactBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
artifactBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
artifactBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
artifactBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
cloudBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
cloudBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
cloudBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
cloudBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
queueBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
queueBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
queueBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
queueBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
databaseBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
databaseBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
databaseBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
databaseBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
folderBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
folderBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
folderBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
folderBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
fileBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
fileBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
fileBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
fileBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
frameBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
frameBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
frameBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
frameBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
nodeBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
nodeBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
nodeBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
nodeBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
rectangleBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
rectangleBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
rectangleBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
rectangleBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
agentBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
agentBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
agentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
agentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
storageBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
storageBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
boundaryBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
boundaryBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
collectionsBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
collectionsBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
collectionsBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
collectionsBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
controlBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
controlBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
entityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
entityBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
|
||||||
entityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
entityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
|
|
||||||
|
|
||||||
@ -152,8 +152,9 @@ public enum ColorParam {
|
|||||||
iconProtected(HtmlColorUtils.COL_B38D22),
|
iconProtected(HtmlColorUtils.COL_B38D22),
|
||||||
iconProtectedBackground(HtmlColorUtils.COL_FFFF44),
|
iconProtectedBackground(HtmlColorUtils.COL_FFFF44),
|
||||||
iconPublic(HtmlColorUtils.COL_038048),
|
iconPublic(HtmlColorUtils.COL_038048),
|
||||||
iconPublicBackground(HtmlColorUtils.COL_84BE84);
|
iconPublicBackground(HtmlColorUtils.COL_84BE84),
|
||||||
|
iconIEMandatory(HtmlColorUtils.BLACK);
|
||||||
|
|
||||||
private final boolean isBackground;
|
private final boolean isBackground;
|
||||||
private final HtmlColor defaultValue;
|
private final HtmlColor defaultValue;
|
||||||
private final ColorType colorType;
|
private final ColorType colorType;
|
||||||
@ -178,6 +179,10 @@ public enum ColorParam {
|
|||||||
this.isBackground = isBackground;
|
this.isBackground = isBackground;
|
||||||
this.defaultValue = defaultValue;
|
this.defaultValue = defaultValue;
|
||||||
this.colorType = colorType;
|
this.colorType = colorType;
|
||||||
|
if (colorType == ColorType.BACK && isBackground == false) {
|
||||||
|
System.err.println(this);
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isBackground() {
|
protected boolean isBackground() {
|
||||||
|
@ -60,7 +60,7 @@ public class OptionFlags {
|
|||||||
static public final boolean FORCE_TEOZ = false;
|
static public final boolean FORCE_TEOZ = false;
|
||||||
static public final boolean USE_INTERFACE_EYE1 = false;
|
static public final boolean USE_INTERFACE_EYE1 = false;
|
||||||
static public final boolean USE_INTERFACE_EYE2 = false;
|
static public final boolean USE_INTERFACE_EYE2 = false;
|
||||||
static public final boolean SWI2 = false;
|
// static public final boolean SWI2 = false;
|
||||||
// static public final boolean USE_COMPOUND = false;
|
// static public final boolean USE_COMPOUND = false;
|
||||||
static public final boolean OMEGA_CROSSING = false;
|
static public final boolean OMEGA_CROSSING = false;
|
||||||
|
|
||||||
|
@ -54,6 +54,11 @@ public class SkinParamBackcolored extends SkinParamDelegator {
|
|||||||
this(skinParam, backColorElement, backColorGeneral, false);
|
this(skinParam, backColorElement, backColorGeneral, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return super.toString() + " " + backColorElement + " " + backColorGeneral;
|
||||||
|
}
|
||||||
|
|
||||||
public SkinParamBackcolored(ISkinParam skinParam, HtmlColor backColorElement, HtmlColor backColorGeneral,
|
public SkinParamBackcolored(ISkinParam skinParam, HtmlColor backColorElement, HtmlColor backColorGeneral,
|
||||||
boolean forceClickage) {
|
boolean forceClickage) {
|
||||||
super(skinParam);
|
super(skinParam);
|
||||||
|
@ -218,9 +218,10 @@ public class ActivityDiagram3 extends UmlDiagram {
|
|||||||
return CommandExecutionResult.error("Cannot find fork");
|
return CommandExecutionResult.error("Cannot find fork");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommandExecutionResult endFork() {
|
public CommandExecutionResult endFork(ForkStyle forkStyle, String label) {
|
||||||
if (current() instanceof InstructionFork) {
|
if (current() instanceof InstructionFork) {
|
||||||
final InstructionFork currentFork = (InstructionFork) current();
|
final InstructionFork currentFork = (InstructionFork) current();
|
||||||
|
currentFork.setStyle(forkStyle, label);
|
||||||
currentFork.manageOutRendering(nextLinkRenderer(), true);
|
currentFork.manageOutRendering(nextLinkRenderer(), true);
|
||||||
setNextLinkRendererInternal(LinkRendering.none());
|
setNextLinkRendererInternal(LinkRendering.none());
|
||||||
setCurrent(currentFork.getParent());
|
setCurrent(currentFork.getParent());
|
||||||
|
35
src/net/sourceforge/plantuml/activitydiagram3/ForkStyle.java
Normal file
35
src/net/sourceforge/plantuml/activitydiagram3/ForkStyle.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.activitydiagram3;
|
||||||
|
|
||||||
|
public enum ForkStyle {
|
||||||
|
FORK, SPLIT, MERGE
|
||||||
|
}
|
@ -50,6 +50,8 @@ public class InstructionFork extends WithNote implements Instruction {
|
|||||||
private final Instruction parent;
|
private final Instruction parent;
|
||||||
private final LinkRendering inlinkRendering;
|
private final LinkRendering inlinkRendering;
|
||||||
private final ISkinParam skinParam;
|
private final ISkinParam skinParam;
|
||||||
|
private ForkStyle style = ForkStyle.FORK;
|
||||||
|
private String label;
|
||||||
boolean finished = false;
|
boolean finished = false;
|
||||||
|
|
||||||
public InstructionFork(Instruction parent, LinkRendering inlinkRendering, ISkinParam skinParam) {
|
public InstructionFork(Instruction parent, LinkRendering inlinkRendering, ISkinParam skinParam) {
|
||||||
@ -75,7 +77,7 @@ public class InstructionFork extends WithNote implements Instruction {
|
|||||||
for (InstructionList list : forks) {
|
for (InstructionList list : forks) {
|
||||||
all.add(list.createFtile(factory));
|
all.add(list.createFtile(factory));
|
||||||
}
|
}
|
||||||
Ftile result = factory.createFork(getSwimlaneIn(), all);
|
Ftile result = factory.createParallel(getSwimlaneIn(), all, style, label);
|
||||||
if (getPositionedNotes().size() > 0) {
|
if (getPositionedNotes().size() > 0) {
|
||||||
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false);
|
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false);
|
||||||
}
|
}
|
||||||
@ -120,7 +122,7 @@ public class InstructionFork extends WithNote implements Instruction {
|
|||||||
|
|
||||||
public Swimlane getSwimlaneOut() {
|
public Swimlane getSwimlaneOut() {
|
||||||
return forks.get(0).getSwimlaneOut();
|
return forks.get(0).getSwimlaneOut();
|
||||||
//return getLastList().getSwimlaneOut();
|
// return getLastList().getSwimlaneOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manageOutRendering(LinkRendering nextLinkRenderer, boolean endFork) {
|
public void manageOutRendering(LinkRendering nextLinkRenderer, boolean endFork) {
|
||||||
@ -133,4 +135,9 @@ public class InstructionFork extends WithNote implements Instruction {
|
|||||||
getLastList().setOutRendering(nextLinkRenderer);
|
getLastList().setOutRendering(nextLinkRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setStyle(ForkStyle style, String label) {
|
||||||
|
this.style = style;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class InstructionSplit implements Instruction {
|
|||||||
for (InstructionList list : splits) {
|
for (InstructionList list : splits) {
|
||||||
all.add(list.createFtile(factory));
|
all.add(list.createFtile(factory));
|
||||||
}
|
}
|
||||||
return factory.createSplit(all);
|
return factory.createParallel(getSwimlaneIn(), all, ForkStyle.SPLIT, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Instruction getParent() {
|
public Instruction getParent() {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
package net.sourceforge.plantuml.activitydiagram3.command;
|
package net.sourceforge.plantuml.activitydiagram3.command;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
|
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
|
||||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||||
import net.sourceforge.plantuml.command.SingleLineCommand2;
|
import net.sourceforge.plantuml.command.SingleLineCommand2;
|
||||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||||
@ -46,13 +47,18 @@ public class CommandForkEnd3 extends SingleLineCommand2<ActivityDiagram3> {
|
|||||||
static RegexConcat getRegexConcat() {
|
static RegexConcat getRegexConcat() {
|
||||||
return new RegexConcat(//
|
return new RegexConcat(//
|
||||||
new RegexLeaf("^"), //
|
new RegexLeaf("^"), //
|
||||||
new RegexLeaf("(end[%s]?fork|fork[%s]?end)"), //
|
new RegexLeaf("STYLE", "(end[%s]?fork|fork[%s]?end|end[%s]?merge)"), //
|
||||||
|
new RegexLeaf("\\s*"), //
|
||||||
|
new RegexLeaf("LABEL", "(\\{.+\\})?"), //
|
||||||
new RegexLeaf(";?$"));
|
new RegexLeaf(";?$"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
|
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
|
||||||
return diagram.endFork();
|
final String style = arg.get("STYLE", 0);
|
||||||
|
final ForkStyle forkStyle = style.contains("merge") ? ForkStyle.MERGE : ForkStyle.FORK;
|
||||||
|
final String label = arg.get("LABEL", 0);
|
||||||
|
return diagram.endFork(forkStyle, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ import java.util.List;
|
|||||||
import net.sourceforge.plantuml.ISkinParam;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.Url;
|
import net.sourceforge.plantuml.Url;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
||||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||||
@ -76,9 +77,7 @@ public interface FtileFactory {
|
|||||||
public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
|
public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
|
||||||
LinkRendering topInlinkRendering);
|
LinkRendering topInlinkRendering);
|
||||||
|
|
||||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all);
|
public Ftile createParallel(Swimlane swimlane, List<Ftile> all, ForkStyle style, String label);
|
||||||
|
|
||||||
public Ftile createSplit(List<Ftile> all);
|
|
||||||
|
|
||||||
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
|
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
|
||||||
HtmlColor borderColor);
|
HtmlColor borderColor);
|
||||||
|
@ -37,6 +37,7 @@ import net.sourceforge.plantuml.FontParam;
|
|||||||
import net.sourceforge.plantuml.ISkinParam;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.Url;
|
import net.sourceforge.plantuml.Url;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
||||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||||
@ -72,6 +73,7 @@ public class FtileFactoryDelegator implements FtileFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected final TextBlock getTextBlock(Display display) {
|
protected final TextBlock getTextBlock(Display display) {
|
||||||
|
// DUP3945
|
||||||
if (Display.isNull(display)) {
|
if (Display.isNull(display)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -148,12 +150,8 @@ public class FtileFactoryDelegator implements FtileFactory {
|
|||||||
return factory.createIf(swimlane, thens, elseBranch, afterEndwhile, topInlinkRendering);
|
return factory.createIf(swimlane, thens, elseBranch, afterEndwhile, topInlinkRendering);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
public Ftile createParallel(Swimlane swimlane, List<Ftile> all, ForkStyle style, String label) {
|
||||||
return factory.createFork(swimlane, all);
|
return factory.createParallel(swimlane, all, style, label);
|
||||||
}
|
|
||||||
|
|
||||||
public Ftile createSplit(List<Ftile> all) {
|
|
||||||
return factory.createSplit(all);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
|
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
|
||||||
|
@ -38,7 +38,6 @@ import net.sourceforge.plantuml.ColorParam;
|
|||||||
import net.sourceforge.plantuml.FontParam;
|
import net.sourceforge.plantuml.FontParam;
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.LineParam;
|
import net.sourceforge.plantuml.LineParam;
|
||||||
import net.sourceforge.plantuml.OptionFlags;
|
|
||||||
import net.sourceforge.plantuml.Pragma;
|
import net.sourceforge.plantuml.Pragma;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.Instruction;
|
import net.sourceforge.plantuml.activitydiagram3.Instruction;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.InstructionList;
|
import net.sourceforge.plantuml.activitydiagram3.InstructionList;
|
||||||
@ -46,9 +45,8 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
|||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAddNote;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAddNote;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAddUrl;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAddUrl;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAssembly;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorAssembly;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateFork;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateParallel;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateGroup;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateGroup;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorCreateSplit;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorIf;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorIf;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorRepeat;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorRepeat;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorWhile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDelegatorWhile;
|
||||||
@ -59,7 +57,6 @@ import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
|||||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||||
@ -67,10 +64,8 @@ import net.sourceforge.plantuml.graphic.UGraphicDelegator;
|
|||||||
import net.sourceforge.plantuml.graphic.color.ColorType;
|
import net.sourceforge.plantuml.graphic.color.ColorType;
|
||||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||||
import net.sourceforge.plantuml.svek.UGraphicForSnake;
|
import net.sourceforge.plantuml.svek.UGraphicForSnake;
|
||||||
import net.sourceforge.plantuml.ugraphic.CompressionTransform;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.LimitFinder;
|
import net.sourceforge.plantuml.ugraphic.LimitFinder;
|
||||||
import net.sourceforge.plantuml.ugraphic.MinMax;
|
import net.sourceforge.plantuml.ugraphic.MinMax;
|
||||||
import net.sourceforge.plantuml.ugraphic.SlotFinderX;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.SlotSet;
|
import net.sourceforge.plantuml.ugraphic.SlotSet;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChange;
|
import net.sourceforge.plantuml.ugraphic.UChange;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||||
@ -112,8 +107,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
|||||||
factory = new FtileFactoryDelegatorIf(factory, pragma);
|
factory = new FtileFactoryDelegatorIf(factory, pragma);
|
||||||
factory = new FtileFactoryDelegatorWhile(factory);
|
factory = new FtileFactoryDelegatorWhile(factory);
|
||||||
factory = new FtileFactoryDelegatorRepeat(factory);
|
factory = new FtileFactoryDelegatorRepeat(factory);
|
||||||
factory = new FtileFactoryDelegatorCreateFork(factory);
|
factory = new FtileFactoryDelegatorCreateParallel(factory);
|
||||||
factory = new FtileFactoryDelegatorCreateSplit(factory);
|
|
||||||
factory = new FtileFactoryDelegatorAddNote(factory);
|
factory = new FtileFactoryDelegatorAddNote(factory);
|
||||||
factory = new FtileFactoryDelegatorCreateGroup(factory);
|
factory = new FtileFactoryDelegatorCreateGroup(factory);
|
||||||
return factory;
|
return factory;
|
||||||
@ -188,43 +182,43 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OptionFlags.SWI2) {
|
// if (OptionFlags.SWI2) {
|
||||||
|
//
|
||||||
final SlotFinderX slotFinder = new SlotFinderX(ug.getStringBounder());
|
// final SlotFinderX slotFinder = new SlotFinderX(ug.getStringBounder());
|
||||||
drawWhenSwimlanes(slotFinder, full);
|
// drawWhenSwimlanes(slotFinder, full);
|
||||||
final SlotSet slotX = slotFinder.getXSlotSet().reverse();
|
// final SlotSet slotX = slotFinder.getXSlotSet().reverse();
|
||||||
//
|
// //
|
||||||
// // final SlotSet ysSlotSet = slotFinder.getYSlotSet().reverse().smaller(5.0);
|
// // // final SlotSet ysSlotSet = slotFinder.getYSlotSet().reverse().smaller(5.0);
|
||||||
//
|
// //
|
||||||
System.err.println("slotX=" + slotX);
|
// System.err.println("slotX=" + slotX);
|
||||||
|
//
|
||||||
printDebug(ug, slotX, HtmlColorUtils.GRAY, full);
|
// printDebug(ug, slotX, HtmlColorUtils.GRAY, full);
|
||||||
|
//
|
||||||
double x2 = 0;
|
// double x2 = 0;
|
||||||
double y2 = 0;
|
// double y2 = 0;
|
||||||
final double stepy = 40;
|
// final double stepy = 40;
|
||||||
int i = 0;
|
// int i = 0;
|
||||||
final SlotSet deconnectedSwimlanes = new SlotSet();
|
// final SlotSet deconnectedSwimlanes = new SlotSet();
|
||||||
for (Swimlane swimlane : swimlanes) {
|
// for (Swimlane swimlane : swimlanes) {
|
||||||
final UGraphic ug2 = ug.apply(new UChangeColor(HtmlColorUtils.GREEN)).apply(
|
// final UGraphic ug2 = ug.apply(new UChangeColor(HtmlColorUtils.GREEN)).apply(
|
||||||
new UChangeBackColor(HtmlColorUtils.GREEN));
|
// new UChangeBackColor(HtmlColorUtils.GREEN));
|
||||||
final double totalWidth = swimlane.getTotalWidth();
|
// final double totalWidth = swimlane.getTotalWidth();
|
||||||
final SlotSet slot2 = slotX.filter(x2 + separationMargin, x2 + totalWidth - separationMargin);
|
// final SlotSet slot2 = slotX.filter(x2 + separationMargin, x2 + totalWidth - separationMargin);
|
||||||
deconnectedSwimlanes.addAll(slot2);
|
// deconnectedSwimlanes.addAll(slot2);
|
||||||
// ug2.apply(new UTranslate(x2, y2)).draw(new URectangle(totalWidth, stepy));
|
// // ug2.apply(new UTranslate(x2, y2)).draw(new URectangle(totalWidth, stepy));
|
||||||
x2 += totalWidth;
|
// x2 += totalWidth;
|
||||||
y2 += stepy;
|
// y2 += stepy;
|
||||||
i++;
|
// i++;
|
||||||
}
|
// }
|
||||||
// printDebug(ug, deconnectedSwimlanes, HtmlColorUtils.GRAY, full);
|
// // printDebug(ug, deconnectedSwimlanes, HtmlColorUtils.GRAY, full);
|
||||||
|
//
|
||||||
//
|
// //
|
||||||
final CompressionTransform compressionTransform = new CompressionTransform(deconnectedSwimlanes);
|
// final CompressionTransform compressionTransform = new CompressionTransform(deconnectedSwimlanes);
|
||||||
// ug = new UGraphicCompress2(ug, compressionTransform);
|
// // ug = new UGraphicCompress2(ug, compressionTransform);
|
||||||
drawWhenSwimlanes(ug, full);
|
// drawWhenSwimlanes(ug, full);
|
||||||
} else {
|
// } else {
|
||||||
drawWhenSwimlanes(ug, full);
|
drawWhenSwimlanes(ug, full);
|
||||||
}
|
// }
|
||||||
// getCollisionDetector(ug, titleHeightTranslate).drawDebug(ug);
|
// getCollisionDetector(ug, titleHeightTranslate).drawDebug(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,13 +246,13 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
|||||||
+ titleHeightTranslate.getDy()));
|
+ titleHeightTranslate.getDy()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OptionFlags.SWI2 == false) {
|
// if (OptionFlags.SWI2 == false) {
|
||||||
final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(),
|
final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
|
||||||
HorizontalAlignment.LEFT, skinParam);
|
skinParam);
|
||||||
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
|
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
|
||||||
final double posTitle = x2 + (swimlane.getTotalWidth() - titleWidth) / 2;
|
final double posTitle = x2 + (swimlane.getTotalWidth() - titleWidth) / 2;
|
||||||
swTitle.drawU(ug.apply(new UTranslate(posTitle, 0)));
|
swTitle.drawU(ug.apply(new UTranslate(posTitle, 0)));
|
||||||
}
|
// }
|
||||||
|
|
||||||
drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
|
drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
|
||||||
|
|
||||||
|
@ -0,0 +1,81 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.activitydiagram3.ftile.vcompact;
|
||||||
|
|
||||||
|
import java.awt.geom.Dimension2D;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixed;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
|
|
||||||
|
public class FtileFactoryDelegatorCreateParallel extends FtileFactoryDelegator {
|
||||||
|
|
||||||
|
private final double spaceArroundBlackBar = 20;
|
||||||
|
private final double xMargin = 14;
|
||||||
|
|
||||||
|
public FtileFactoryDelegatorCreateParallel(FtileFactory factory) {
|
||||||
|
super(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ftile createParallel(Swimlane swimlane, List<Ftile> all, ForkStyle style, String label) {
|
||||||
|
|
||||||
|
final Dimension2D dimSuper = super.createParallel(swimlane, all, style, label).calculateDimension(
|
||||||
|
getStringBounder());
|
||||||
|
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||||
|
|
||||||
|
final List<Ftile> list = new ArrayList<Ftile>();
|
||||||
|
for (Ftile tmp : all) {
|
||||||
|
list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
|
||||||
|
}
|
||||||
|
final Ftile inner = super.createParallel(swimlane, list, style, label);
|
||||||
|
|
||||||
|
ParallelFtilesBuilder builder;
|
||||||
|
|
||||||
|
if (style == ForkStyle.SPLIT) {
|
||||||
|
builder = new ParallelBuilderSplit(skinParam(), getStringBounder(), list, inner, swimlane);
|
||||||
|
} else if (style == ForkStyle.MERGE) {
|
||||||
|
builder = new ParallelBuilderMerge(skinParam(), getStringBounder(), list, inner, swimlane);
|
||||||
|
} else if (style == ForkStyle.FORK) {
|
||||||
|
builder = new ParallelBuilderFork(skinParam(), getStringBounder(), list, inner, swimlane, label);
|
||||||
|
} else {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -34,7 +34,6 @@ import java.awt.geom.Dimension2D;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ColorParam;
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
import net.sourceforge.plantuml.Direction;
|
|
||||||
import net.sourceforge.plantuml.FontParam;
|
import net.sourceforge.plantuml.FontParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||||
|
@ -36,70 +36,75 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ColorParam;
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixed;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
|
||||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
public class ParallelBuilderFork extends ParallelFtilesBuilder {
|
||||||
|
|
||||||
private final double spaceArroundBlackBar = 20;
|
private final String label;
|
||||||
private final double barHeight = 6;
|
|
||||||
private final double xMargin = 14;
|
|
||||||
|
|
||||||
private final Rose rose = new Rose();
|
public ParallelBuilderFork(ISkinParam skinParam, StringBounder stringBounder,
|
||||||
|
final List<Ftile> list, Ftile inner, Swimlane swimlane, String label) {
|
||||||
public FtileFactoryDelegatorCreateFork(FtileFactory factory) {
|
super(skinParam, stringBounder, list, inner, swimlane);
|
||||||
super(factory);
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
protected Ftile doStep1() {
|
||||||
final HtmlColor colorBar = rose.getHtmlColor(skinParam(), ColorParam.activityBar);
|
Ftile result = getMiddle();
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
|
||||||
|
|
||||||
final Dimension2D dimSuper = super.createFork(swimlane, all).calculateDimension(getStringBounder());
|
|
||||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
|
||||||
|
|
||||||
final List<Ftile> list = new ArrayList<Ftile>();
|
|
||||||
for (Ftile tmp : all) {
|
|
||||||
list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ftile inner = super.createFork(swimlane, list);
|
|
||||||
|
|
||||||
final List<Connection> conns = new ArrayList<Connection>();
|
final List<Connection> conns = new ArrayList<Connection>();
|
||||||
|
final Ftile black = new FtileBlackBlock(skinParam(), getRose()
|
||||||
final Ftile black = new FtileBlackBlock(skinParam(), colorBar, list.get(0).getSwimlaneIn());
|
.getHtmlColor(skinParam(), ColorParam.activityBar), getList().get(0).getSwimlaneIn());
|
||||||
double x = 0;
|
double x = 0;
|
||||||
for (Ftile tmp : list) {
|
for (Ftile tmp : getList()) {
|
||||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
conns.add(new ConnectionIn(black, tmp, x, tmp.getInLinkRendering().getRainbow(arrowColor)));
|
conns.add(new ConnectionIn(black, tmp, x, tmp.getInLinkRendering().getRainbow(
|
||||||
conns.add(new ConnectionOut(tmp, black, x, tmp.getOutLinkRendering().getRainbow(arrowColor), height1));
|
HtmlColorAndStyle.build(skinParam()))));
|
||||||
x += dim.getWidth();
|
x += dim.getWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
inner = FtileUtils.addConnection(inner, conns);
|
result = FtileUtils.addConnection(result, conns);
|
||||||
((FtileBlackBlock) black).setDimenstion(inner.calculateDimension(getStringBounder()).getWidth(), barHeight);
|
((FtileBlackBlock) black).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), barHeight);
|
||||||
final Ftile tmp1 = new FtileAssemblySimple(black, inner);
|
|
||||||
return new FtileAssemblySimple(tmp1, black);
|
return new FtileAssemblySimple(black, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Ftile doStep2(Ftile result) {
|
||||||
|
final Ftile out = new FtileBlackBlock(skinParam(), getRose().getHtmlColor(skinParam(), ColorParam.activityBar),
|
||||||
|
getList().get(0).getSwimlaneIn());
|
||||||
|
((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), barHeight);
|
||||||
|
if (label != null) {
|
||||||
|
((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(label)));
|
||||||
|
}
|
||||||
|
result = new FtileAssemblySimple(result, out);
|
||||||
|
final List<Connection> conns = new ArrayList<Connection>();
|
||||||
|
double x = 0;
|
||||||
|
for (Ftile tmp : getList()) {
|
||||||
|
final UTranslate translate0 = new UTranslate(0, barHeight);
|
||||||
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
|
conns.add(new ConnectionOut(translate0, tmp, out, x, tmp.getOutLinkRendering().getRainbow(
|
||||||
|
HtmlColorAndStyle.build(skinParam())), getHeightOfMiddle()));
|
||||||
|
x += dim.getWidth();
|
||||||
|
}
|
||||||
|
result = FtileUtils.addConnection(result, conns);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
|
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
|
||||||
@ -154,10 +159,13 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
|||||||
private final Rainbow arrowColor;
|
private final Rainbow arrowColor;
|
||||||
private final double height;
|
private final double height;
|
||||||
private final Display label;
|
private final Display label;
|
||||||
|
private final UTranslate translate0;
|
||||||
|
|
||||||
public ConnectionOut(Ftile ftile1, Ftile ftile2, double x, Rainbow arrowColor, double height) {
|
public ConnectionOut(UTranslate translate0, Ftile ftile1, Ftile ftile2, double x, Rainbow arrowColor,
|
||||||
|
double height) {
|
||||||
super(ftile1, ftile2);
|
super(ftile1, ftile2);
|
||||||
label = ftile1.getOutLinkRendering().getDisplay();
|
this.translate0 = translate0;
|
||||||
|
this.label = ftile1.getOutLinkRendering().getDisplay();
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.arrowColor = arrowColor;
|
this.arrowColor = arrowColor;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
@ -173,8 +181,10 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
|||||||
if (Display.isNull(label) == false) {
|
if (Display.isNull(label) == false) {
|
||||||
snake.setLabel(getTextBlock(label));
|
snake.setLabel(getTextBlock(label));
|
||||||
}
|
}
|
||||||
snake.addPoint(geo.getLeft(), geo.getOutY());
|
final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY()));
|
||||||
snake.addPoint(geo.getLeft(), height);
|
final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height));
|
||||||
|
snake.addPoint(p1);
|
||||||
|
snake.addPoint(p2);
|
||||||
ug.draw(snake);
|
ug.draw(snake);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,8 +194,8 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
|||||||
if (geo.hasPointOut() == false) {
|
if (geo.hasPointOut() == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Point2D p1 = new Point2D.Double(geo.getLeft(), geo.getOutY());
|
final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY()));
|
||||||
final Point2D p2 = new Point2D.Double(geo.getLeft(), height);
|
final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height));
|
||||||
|
|
||||||
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
|
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
|
||||||
if (Display.isNull(label) == false) {
|
if (Display.isNull(label) == false) {
|
@ -0,0 +1,214 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.activitydiagram3.ftile.vcompact;
|
||||||
|
|
||||||
|
import java.awt.geom.Dimension2D;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||||
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
|
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||||
|
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||||
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
|
public class ParallelBuilderMerge extends ParallelFtilesBuilder {
|
||||||
|
|
||||||
|
public ParallelBuilderMerge(ISkinParam skinParam, StringBounder stringBounder,
|
||||||
|
final List<Ftile> list, Ftile inner, Swimlane swimlane) {
|
||||||
|
super(skinParam, stringBounder, list, inner, swimlane);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Ftile doStep1() {
|
||||||
|
Ftile result = getMiddle();
|
||||||
|
final List<Connection> conns = new ArrayList<Connection>();
|
||||||
|
final HtmlColor colorBar = getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
|
||||||
|
|
||||||
|
final Ftile black = new FtileBlackBlock(skinParam(), colorBar, getList().get(0).getSwimlaneIn());
|
||||||
|
double x = 0;
|
||||||
|
for (Ftile tmp : getList()) {
|
||||||
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
|
conns.add(new ConnectionIn(black, tmp, x, tmp.getInLinkRendering().getRainbow(
|
||||||
|
HtmlColorAndStyle.build(skinParam()))));
|
||||||
|
x += dim.getWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
result = FtileUtils.addConnection(result, conns);
|
||||||
|
((FtileBlackBlock) black).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), barHeight);
|
||||||
|
|
||||||
|
return new FtileAssemblySimple(black, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Ftile doStep2(Ftile result) {
|
||||||
|
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||||
|
final HtmlColor backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBackground);
|
||||||
|
final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlane());
|
||||||
|
result = new FtileAssemblySimple(result, out);
|
||||||
|
final List<Connection> conns = new ArrayList<Connection>();
|
||||||
|
final UTranslate diamondTranslate = result.getTranslateFor(out, getStringBounder());
|
||||||
|
int i = 0;
|
||||||
|
double x = 0;
|
||||||
|
for (Ftile tmp : getList()) {
|
||||||
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
|
final UTranslate translate0 = new UTranslate(x, barHeight);
|
||||||
|
conns.add(new ConnectionHorizontalThenVertical(tmp, out, tmp.getOutLinkRendering().getRainbow(
|
||||||
|
HtmlColorAndStyle.build(skinParam())), translate0, diamondTranslate, i));
|
||||||
|
x += dim.getWidth();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return FtileUtils.addConnection(result, conns);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConnectionHorizontalThenVertical extends AbstractConnection /* implements ConnectionTranslatable */{
|
||||||
|
|
||||||
|
private final Rainbow arrowColor;
|
||||||
|
private final UTranslate diamondTranslate;
|
||||||
|
private final UTranslate translate0;
|
||||||
|
private final int counter;
|
||||||
|
|
||||||
|
public ConnectionHorizontalThenVertical(Ftile tile, Ftile diamond, Rainbow arrowColor, UTranslate translate0,
|
||||||
|
UTranslate diamondTranslate, int counter) {
|
||||||
|
super(tile, diamond);
|
||||||
|
this.arrowColor = arrowColor;
|
||||||
|
this.diamondTranslate = diamondTranslate;
|
||||||
|
this.translate0 = translate0;
|
||||||
|
this.counter = counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawU(UGraphic ug) {
|
||||||
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
|
final Point2D p1 = getP1(stringBounder);
|
||||||
|
final Point2D p2 = getP2(stringBounder);
|
||||||
|
final double x1 = p1.getX();
|
||||||
|
final double y1 = p1.getY();
|
||||||
|
final double x2 = p2.getX();
|
||||||
|
final double y2 = p2.getY();
|
||||||
|
|
||||||
|
UPolygon endDecoration = null;
|
||||||
|
if (counter == 0) {
|
||||||
|
endDecoration = Arrows.asToRight();
|
||||||
|
} else if (counter == 1) {
|
||||||
|
endDecoration = Arrows.asToLeft();
|
||||||
|
}
|
||||||
|
final Snake snake = new Snake(arrowColor, endDecoration);
|
||||||
|
snake.addPoint(x1, y1);
|
||||||
|
snake.addPoint(x1, y2);
|
||||||
|
snake.addPoint(x2, y2);
|
||||||
|
|
||||||
|
ug.draw(snake);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Point2D getP1(StringBounder stringBounder) {
|
||||||
|
return translate0.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Point2D getP2(final StringBounder stringBounder) {
|
||||||
|
final Point2D result = diamondTranslate.getTranslated(getFtile2().calculateDimension(stringBounder)
|
||||||
|
.getPointOut());
|
||||||
|
final Dimension2D dim = getFtile2().calculateDimension(stringBounder);
|
||||||
|
UTranslate arrival = new UTranslate();
|
||||||
|
if (counter == 0) {
|
||||||
|
arrival = new UTranslate(-dim.getWidth() / 2, -dim.getHeight() / 2);
|
||||||
|
} else if (counter == 1) {
|
||||||
|
arrival = new UTranslate(dim.getWidth() / 2, -dim.getHeight() / 2);
|
||||||
|
}
|
||||||
|
return arrival.getTranslated(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
|
||||||
|
|
||||||
|
private final double x;
|
||||||
|
private final Rainbow arrowColor;
|
||||||
|
private final Display label;
|
||||||
|
|
||||||
|
public ConnectionIn(Ftile ftile1, Ftile ftile2, double x, Rainbow arrowColor) {
|
||||||
|
super(ftile1, ftile2);
|
||||||
|
label = ftile2.getInLinkRendering().getDisplay();
|
||||||
|
this.x = x;
|
||||||
|
this.arrowColor = arrowColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawU(UGraphic ug) {
|
||||||
|
ug = ug.apply(new UTranslate(x, 0));
|
||||||
|
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
|
||||||
|
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
|
||||||
|
if (Display.isNull(label) == false) {
|
||||||
|
snake.setLabel(getTextBlock(label));
|
||||||
|
}
|
||||||
|
snake.addPoint(geo.getLeft(), 0);
|
||||||
|
snake.addPoint(geo.getLeft(), geo.getInY());
|
||||||
|
ug.draw(snake);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||||
|
ug = ug.apply(new UTranslate(x, 0));
|
||||||
|
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
|
||||||
|
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
|
||||||
|
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
|
||||||
|
|
||||||
|
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
|
||||||
|
if (Display.isNull(label) == false) {
|
||||||
|
snake.setLabel(getTextBlock(label));
|
||||||
|
}
|
||||||
|
final Point2D mp1a = translate1.getTranslated(p1);
|
||||||
|
final Point2D mp2b = translate2.getTranslated(p2);
|
||||||
|
final double middle = mp1a.getY() + 4;
|
||||||
|
snake.addPoint(mp1a);
|
||||||
|
snake.addPoint(mp1a.getX(), middle);
|
||||||
|
snake.addPoint(mp2b.getX(), middle);
|
||||||
|
snake.addPoint(mp2b);
|
||||||
|
ug.draw(snake);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -32,219 +32,78 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
|||||||
|
|
||||||
import java.awt.geom.Dimension2D;
|
import java.awt.geom.Dimension2D;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import net.sourceforge.plantuml.OptionFlags;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixed;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
|
||||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
public class ParallelBuilderSplit extends ParallelFtilesBuilder {
|
||||||
|
|
||||||
private final double spaceArroundBlackBar = 20;
|
public ParallelBuilderSplit(ISkinParam skinParam, StringBounder stringBounder,
|
||||||
private final double barHeight = 6;
|
final List<Ftile> list, Ftile inner, Swimlane swimlane) {
|
||||||
private final double xMargin = 14;
|
super(skinParam, stringBounder, list, inner, swimlane);
|
||||||
|
|
||||||
private final Rose rose = new Rose();
|
|
||||||
|
|
||||||
public FtileFactoryDelegatorCreateSplit(FtileFactory factory) {
|
|
||||||
super(factory);
|
|
||||||
}
|
|
||||||
|
|
||||||
static private boolean isSimpleSwimlanes(List<Ftile> all) {
|
|
||||||
final Set<Swimlane> already = new HashSet<Swimlane>();
|
|
||||||
for (Ftile ftile : all) {
|
|
||||||
final Set<Swimlane> currents = ftile.getSwimlanes();
|
|
||||||
if (currents.size() != 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
assert currents.size() == 1;
|
|
||||||
final Swimlane current = currents.iterator().next();
|
|
||||||
if (already.contains(current)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
already.add(current);
|
|
||||||
}
|
|
||||||
return already.size() > 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static private boolean isSeveralSwimlanes(List<Ftile> all) {
|
|
||||||
final Set<Swimlane> already = new HashSet<Swimlane>();
|
|
||||||
for (Ftile ftile : all) {
|
|
||||||
final Set<Swimlane> currents = ftile.getSwimlanes();
|
|
||||||
if (currents.size() > 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
assert currents.size() == 0 || currents.size() == 1;
|
|
||||||
if (currents.size() == 1) {
|
|
||||||
final Swimlane current = currents.iterator().next();
|
|
||||||
already.add(current);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return already.size() > 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ftile createSplit(List<Ftile> all) {
|
protected Ftile doStep1() {
|
||||||
// OptionFlags.SWI2
|
Ftile result = getMiddle();
|
||||||
// if (all != null)
|
|
||||||
// return severalSwimlanes(all);
|
|
||||||
// // if (isSimpleSwimlanes(all)) {
|
|
||||||
// return simpleSwimlanes(all);
|
|
||||||
// // return severalSwimlanes(all);
|
|
||||||
// // } else if (isSeveralSwimlanes(all)) {
|
|
||||||
// // return severalSwimlanes(all);
|
|
||||||
// }
|
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
|
||||||
|
|
||||||
final Dimension2D dimSuper = super.createSplit(all).calculateDimension(getStringBounder());
|
|
||||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
|
||||||
|
|
||||||
final List<Ftile> list = new ArrayList<Ftile>();
|
|
||||||
for (Ftile tmp : all) {
|
|
||||||
list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ftile inner = super.createSplit(list);
|
|
||||||
|
|
||||||
final List<Connection> conns = new ArrayList<Connection>();
|
final List<Connection> conns = new ArrayList<Connection>();
|
||||||
|
|
||||||
double x = 0;
|
double x1 = 0;
|
||||||
boolean hasOut = false;
|
for (Ftile tmp : getList()) {
|
||||||
for (Ftile tmp : list) {
|
|
||||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
conns.add(new ConnectionIn(tmp, x, tmp.getInLinkRendering().getRainbow(arrowColor), getTextBlock(tmp
|
conns.add(new ConnectionIn(tmp, x1, tmp.getInLinkRendering().getRainbow(
|
||||||
.getInLinkRendering())));
|
HtmlColorAndStyle.build(skinParam())), getTextBlock(tmp.getInLinkRendering())));
|
||||||
final boolean hasOutTmp = tmp.calculateDimension(getStringBounder()).hasPointOut();
|
x1 += dim.getWidth();
|
||||||
if (hasOutTmp) {
|
|
||||||
conns.add(new ConnectionOut(tmp, x, tmp.getOutLinkRendering().getRainbow(arrowColor), height1,
|
|
||||||
getTextBlock(tmp.getOutLinkRendering())));
|
|
||||||
hasOut = true;
|
|
||||||
}
|
|
||||||
x += dim.getWidth();
|
|
||||||
}
|
}
|
||||||
final double totalWidth = inner.calculateDimension(getStringBounder()).getWidth();
|
final double totalWidth1 = result.calculateDimension(getStringBounder()).getWidth();
|
||||||
conns.add(new ConnectionHline2(inner, OptionFlags.SWI2 ? HtmlColorAndStyle.fromColor(HtmlColorUtils.BLUE)
|
conns.add(new ConnectionHline2(result, HtmlColorAndStyle.build(skinParam()), 0, getList(), totalWidth1));
|
||||||
: arrowColor, 0, list, totalWidth));
|
result = FtileUtils.addConnection(result, conns);
|
||||||
if (hasOut) {
|
return result;
|
||||||
conns.add(new ConnectionHline2(inner, OptionFlags.SWI2 ? HtmlColorAndStyle.fromColor(HtmlColorUtils.GREEN)
|
|
||||||
: arrowColor, height1, list, totalWidth));
|
|
||||||
}
|
|
||||||
|
|
||||||
inner = FtileUtils.addConnection(inner, conns);
|
|
||||||
if (hasOut == false) {
|
|
||||||
inner = new FtileKilled(inner);
|
|
||||||
}
|
|
||||||
return inner;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private Ftile severalSwimlanes(List<Ftile> all) {
|
@Override
|
||||||
// final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
protected Ftile doStep2(Ftile result) {
|
||||||
// final Dimension2D dimSuper = new FtileForkInner1(all).calculateDimension(getStringBounder());
|
final List<Connection> conns2 = new ArrayList<Connection>();
|
||||||
// final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
double x2 = 0;
|
||||||
// final List<Ftile> list = new ArrayList<Ftile>();
|
|
||||||
// for (Ftile tmp : all) {
|
|
||||||
// list.add(new FtileHeightFixed(new FtileMarged(tmp, xMargin), height1));
|
|
||||||
// // list.add(new FtileMarged(tmp, xMargin));
|
|
||||||
// // list.add(tmp);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Ftile inner = new FtileForkInner1(list);
|
|
||||||
// final List<Connection> conns = new ArrayList<Connection>();
|
|
||||||
// boolean hasOut = false;
|
|
||||||
// for (Ftile tmp : list) {
|
|
||||||
// // final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
|
||||||
// final UTranslate translateFor = inner.getTranslateFor(tmp, getStringBounder());
|
|
||||||
// if (translateFor == null) {
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// final double x = translateFor.getDx();
|
|
||||||
// conns.add(new ConnectionIn(tmp, x, arrowColor));
|
|
||||||
// final boolean hasOutTmp = tmp.calculateDimension(getStringBounder()).hasPointOut();
|
|
||||||
// if (hasOutTmp) {
|
|
||||||
// conns.add(new ConnectionOut(tmp, x, arrowColor, height1));
|
|
||||||
// hasOut = true;
|
|
||||||
// }
|
|
||||||
// // x += dim.getWidth();
|
|
||||||
// }
|
|
||||||
// final double totalWidth = inner.calculateDimension(getStringBounder()).getWidth();
|
|
||||||
// conns.add(new ConnectionHline2(inner, arrowColor, 0, list, totalWidth));
|
|
||||||
// if (hasOut) {
|
|
||||||
// conns.add(new ConnectionHline2(inner, arrowColor, height1, list, totalWidth));
|
|
||||||
// }
|
|
||||||
// inner = FtileUtils.addConnection(inner, conns);
|
|
||||||
//
|
|
||||||
// return inner;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private TextBlock getTextBlock(LinkRendering linkRendering) {
|
|
||||||
// DUP1433
|
|
||||||
final Display display = linkRendering.getDisplay();
|
|
||||||
return getTextBlock(display);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Ftile simpleSwimlanes(List<Ftile> all) {
|
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
|
||||||
|
|
||||||
final Dimension2D dimSuper = new FtileSplit1(all).calculateDimension(getStringBounder());
|
|
||||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
|
||||||
|
|
||||||
final List<Ftile> list = new ArrayList<Ftile>();
|
|
||||||
for (Ftile tmp : all) {
|
|
||||||
list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ftile inner = new FtileSplit1(list);
|
|
||||||
|
|
||||||
final List<Connection> conns = new ArrayList<Connection>();
|
|
||||||
|
|
||||||
boolean hasOut = false;
|
boolean hasOut = false;
|
||||||
for (Ftile tmp : list) {
|
for (Ftile tmp : getList()) {
|
||||||
// final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
final double x = inner.getTranslateFor(tmp, getStringBounder()).getDx();
|
|
||||||
conns.add(new ConnectionIn(tmp, x, arrowColor, null));
|
|
||||||
final boolean hasOutTmp = tmp.calculateDimension(getStringBounder()).hasPointOut();
|
final boolean hasOutTmp = tmp.calculateDimension(getStringBounder()).hasPointOut();
|
||||||
if (hasOutTmp) {
|
if (hasOutTmp) {
|
||||||
conns.add(new ConnectionOut(tmp, x, arrowColor, height1, null));
|
conns2.add(new ConnectionOut(tmp, x2, tmp.getOutLinkRendering().getRainbow(
|
||||||
|
HtmlColorAndStyle.build(skinParam())), getHeightOfMiddle(), getTextBlock(tmp
|
||||||
|
.getOutLinkRendering())));
|
||||||
hasOut = true;
|
hasOut = true;
|
||||||
}
|
}
|
||||||
// x += dim.getWidth();
|
x2 += dim.getWidth();
|
||||||
}
|
}
|
||||||
final double totalWidth = inner.calculateDimension(getStringBounder()).getWidth();
|
|
||||||
conns.add(new ConnectionHline3(inner, arrowColor, 0, list, totalWidth));
|
|
||||||
if (hasOut) {
|
|
||||||
conns.add(new ConnectionHline3(inner, arrowColor, height1, list, totalWidth));
|
|
||||||
}
|
|
||||||
//
|
|
||||||
inner = FtileUtils.addConnection(inner, conns);
|
|
||||||
if (hasOut == false) {
|
|
||||||
inner = new FtileKilled(inner);
|
|
||||||
}
|
|
||||||
return inner;
|
|
||||||
|
|
||||||
|
if (hasOut) {
|
||||||
|
final double totalWidth2 = result.calculateDimension(getStringBounder()).getWidth();
|
||||||
|
conns2.add(new ConnectionHline2(result, HtmlColorAndStyle.build(skinParam()), getHeightOfMiddle(),
|
||||||
|
getList(), totalWidth2));
|
||||||
|
result = FtileUtils.addConnection(result, conns2);
|
||||||
|
} else {
|
||||||
|
result = new FtileKilled(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ConnectionHline2 extends AbstractConnection {
|
static class ConnectionHline2 extends AbstractConnection {
|
@ -0,0 +1,126 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.activitydiagram3.ftile.vcompact;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.FontParam;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
|
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.creole.CreoleMode;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||||
|
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||||
|
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||||
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||||
|
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||||
|
|
||||||
|
public abstract class ParallelFtilesBuilder {
|
||||||
|
|
||||||
|
protected final double barHeight = 6;
|
||||||
|
|
||||||
|
private final Rose rose = new Rose();
|
||||||
|
|
||||||
|
private final ISkinParam skinParam;
|
||||||
|
private final StringBounder stringBounder;
|
||||||
|
|
||||||
|
private final List<Ftile> list;
|
||||||
|
private final Ftile middle;
|
||||||
|
private final FtileGeometry middleDimension;
|
||||||
|
private final Swimlane swimlane;
|
||||||
|
|
||||||
|
public ParallelFtilesBuilder(ISkinParam skinParam, StringBounder stringBounder, final List<Ftile> list,
|
||||||
|
Ftile middle, Swimlane swimlane) {
|
||||||
|
this.skinParam = skinParam;
|
||||||
|
this.stringBounder = stringBounder;
|
||||||
|
this.list = list;
|
||||||
|
this.middle = middle;
|
||||||
|
this.middleDimension = middle.calculateDimension(getStringBounder());
|
||||||
|
this.swimlane = swimlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Ftile build() {
|
||||||
|
final Ftile step1 = doStep1();
|
||||||
|
return doStep2(step1);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract Ftile doStep1();
|
||||||
|
|
||||||
|
protected abstract Ftile doStep2(Ftile step1);
|
||||||
|
|
||||||
|
protected StringBounder getStringBounder() {
|
||||||
|
return stringBounder;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Rose getRose() {
|
||||||
|
return rose;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ISkinParam skinParam() {
|
||||||
|
return skinParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final TextBlock getTextBlock(Display display) {
|
||||||
|
// DUP3945
|
||||||
|
if (Display.isNull(display)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||||
|
return display.create(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected TextBlock getTextBlock(LinkRendering linkRendering) {
|
||||||
|
// DUP1433
|
||||||
|
final Display display = linkRendering.getDisplay();
|
||||||
|
return getTextBlock(display);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final List<Ftile> getList() {
|
||||||
|
return Collections.unmodifiableList(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final Ftile getMiddle() {
|
||||||
|
return middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final double getHeightOfMiddle() {
|
||||||
|
return middleDimension.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final Swimlane swimlane() {
|
||||||
|
return swimlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -39,6 +39,7 @@ import net.sourceforge.plantuml.FontParam;
|
|||||||
import net.sourceforge.plantuml.ISkinParam;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.Url;
|
import net.sourceforge.plantuml.Url;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||||
|
import net.sourceforge.plantuml.activitydiagram3.ForkStyle;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
|
||||||
@ -129,11 +130,7 @@ public class VCompactFactory implements FtileFactory {
|
|||||||
return new FtileForkInner(ftiles);
|
return new FtileForkInner(ftiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
public Ftile createParallel(Swimlane swimlane, List<Ftile> all, ForkStyle style, String label) {
|
||||||
return new FtileForkInner(all);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Ftile createSplit(List<Ftile> all) {
|
|
||||||
return new FtileForkInner(all);
|
return new FtileForkInner(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||||
|
|
||||||
|
import java.awt.geom.Dimension2D;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -39,15 +40,21 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
|||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||||
|
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileBlackBlock extends AbstractFtile {
|
public class FtileBlackBlock extends AbstractFtile {
|
||||||
|
|
||||||
|
private final double labelMargin = 5;
|
||||||
|
|
||||||
private double width;
|
private double width;
|
||||||
private double height;
|
private double height;
|
||||||
|
private TextBlock label = TextBlockUtils.empty(0, 0);
|
||||||
private final HtmlColor colorBar;
|
private final HtmlColor colorBar;
|
||||||
private final Swimlane swimlane;
|
private final Swimlane swimlane;
|
||||||
|
|
||||||
@ -57,13 +64,24 @@ public class FtileBlackBlock extends AbstractFtile {
|
|||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDimenstion(double width, double height) {
|
public void setBlackBlockDimension(double width, double height) {
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.width = width;
|
this.width = width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLabel(TextBlock label) {
|
||||||
|
if (label == null) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
public FtileGeometry calculateDimension(StringBounder stringBounder) {
|
public FtileGeometry calculateDimension(StringBounder stringBounder) {
|
||||||
return new FtileGeometry(width, height, width / 2, 0, height);
|
double supp = label.calculateDimension(stringBounder).getWidth();
|
||||||
|
if (supp > 0) {
|
||||||
|
supp += labelMargin;
|
||||||
|
}
|
||||||
|
return new FtileGeometry(width + supp, height, width / 2, 0, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
@ -72,6 +90,8 @@ public class FtileBlackBlock extends AbstractFtile {
|
|||||||
rect.setDeltaShadow(3);
|
rect.setDeltaShadow(3);
|
||||||
}
|
}
|
||||||
ug.apply(new UChangeColor(colorBar)).apply(new UChangeBackColor(colorBar)).draw(rect);
|
ug.apply(new UChangeColor(colorBar)).apply(new UChangeBackColor(colorBar)).draw(rect);
|
||||||
|
final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder());
|
||||||
|
label.drawU(ug.apply(new UTranslate(width + labelMargin, -dimLabel.getHeight() / 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Swimlane> getSwimlanes() {
|
public Set<Swimlane> getSwimlanes() {
|
||||||
|
@ -68,7 +68,7 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
|
|||||||
private static RegexConcat getRegexConcat() {
|
private static RegexConcat getRegexConcat() {
|
||||||
return new RegexConcat(new RegexLeaf("^"), //
|
return new RegexConcat(new RegexLeaf("^"), //
|
||||||
new RegexLeaf("TYPE", //
|
new RegexLeaf("TYPE", //
|
||||||
"(interface|enum|annotation|abstract[%s]+class|abstract|class)[%s]+"), //
|
"(interface|enum|annotation|abstract[%s]+class|abstract|class|entity)[%s]+"), //
|
||||||
new RegexOr(//
|
new RegexOr(//
|
||||||
new RegexConcat(//
|
new RegexConcat(//
|
||||||
new RegexLeaf("DISPLAY1", "[%g](.+)[%g]"), //
|
new RegexLeaf("DISPLAY1", "[%g](.+)[%g]"), //
|
||||||
|
@ -81,7 +81,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
|
|||||||
private static RegexConcat getRegexConcat() {
|
private static RegexConcat getRegexConcat() {
|
||||||
return new RegexConcat(new RegexLeaf("^"), //
|
return new RegexConcat(new RegexLeaf("^"), //
|
||||||
new RegexLeaf("VISIBILITY", "(" + VisibilityModifier.regexForVisibilityCharacter() + ")?"), //
|
new RegexLeaf("VISIBILITY", "(" + VisibilityModifier.regexForVisibilityCharacter() + ")?"), //
|
||||||
new RegexLeaf("TYPE", "(interface|enum|abstract[%s]+class|abstract|class)[%s]+"), //
|
new RegexLeaf("TYPE", "(interface|enum|abstract[%s]+class|abstract|class|entity)[%s]+"), //
|
||||||
new RegexOr(//
|
new RegexOr(//
|
||||||
new RegexConcat(//
|
new RegexConcat(//
|
||||||
new RegexLeaf("DISPLAY1", "[%g](.+)[%g]"), //
|
new RegexLeaf("DISPLAY1", "[%g](.+)[%g]"), //
|
||||||
|
@ -47,6 +47,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
|||||||
import net.sourceforge.plantuml.cucadiagram.IEntity;
|
import net.sourceforge.plantuml.cucadiagram.IEntity;
|
||||||
import net.sourceforge.plantuml.cucadiagram.LeafType;
|
import net.sourceforge.plantuml.cucadiagram.LeafType;
|
||||||
import net.sourceforge.plantuml.cucadiagram.Stereotype;
|
import net.sourceforge.plantuml.cucadiagram.Stereotype;
|
||||||
|
import net.sourceforge.plantuml.descdiagram.command.CommandCreateElementFull;
|
||||||
import net.sourceforge.plantuml.graphic.USymbol;
|
import net.sourceforge.plantuml.graphic.USymbol;
|
||||||
import net.sourceforge.plantuml.graphic.color.ColorParser;
|
import net.sourceforge.plantuml.graphic.color.ColorParser;
|
||||||
import net.sourceforge.plantuml.graphic.color.ColorType;
|
import net.sourceforge.plantuml.graphic.color.ColorType;
|
||||||
@ -66,7 +67,8 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
|
|||||||
|
|
||||||
private static RegexConcat getRegexConcat(Mode mode) {
|
private static RegexConcat getRegexConcat(Mode mode) {
|
||||||
|
|
||||||
String regex = "(?:(actor|usecase|component)[%s]+)";
|
// String regex = "(?:(actor|usecase|component)[%s]+)";
|
||||||
|
String regex = "(?:(state|" + CommandCreateElementFull.ALL_TYPES + ")[%s]+)";
|
||||||
if (mode == Mode.WITH_MIX_PREFIX) {
|
if (mode == Mode.WITH_MIX_PREFIX) {
|
||||||
regex = "mix_" + regex;
|
regex = "mix_" + regex;
|
||||||
}
|
}
|
||||||
@ -130,62 +132,18 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
|
|||||||
if (symbol == null) {
|
if (symbol == null) {
|
||||||
type = LeafType.DESCRIPTION;
|
type = LeafType.DESCRIPTION;
|
||||||
usymbol = USymbol.ACTOR;
|
usymbol = USymbol.ACTOR;
|
||||||
} else if (symbol.equalsIgnoreCase("artifact")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.ARTIFACT;
|
|
||||||
} else if (symbol.equalsIgnoreCase("folder")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.FOLDER;
|
|
||||||
} else if (symbol.equalsIgnoreCase("package")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.PACKAGE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("rectangle")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.RECTANGLE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("node")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.NODE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("frame")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.FRAME;
|
|
||||||
} else if (symbol.equalsIgnoreCase("cloud")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.CLOUD;
|
|
||||||
} else if (symbol.equalsIgnoreCase("database")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.DATABASE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("storage")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.STORAGE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("agent")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.AGENT;
|
|
||||||
} else if (symbol.equalsIgnoreCase("actor")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.ACTOR;
|
|
||||||
} else if (symbol.equalsIgnoreCase("component")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = diagram.getSkinParam().useUml2ForComponent() ? USymbol.COMPONENT2 : USymbol.COMPONENT1;
|
|
||||||
} else if (symbol.equalsIgnoreCase("boundary")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.BOUNDARY;
|
|
||||||
} else if (symbol.equalsIgnoreCase("control")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.CONTROL;
|
|
||||||
} else if (symbol.equalsIgnoreCase("entity")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.ENTITY_DOMAIN;
|
|
||||||
} else if (symbol.equalsIgnoreCase("interface")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.INTERFACE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("()")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.INTERFACE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("usecase")) {
|
} else if (symbol.equalsIgnoreCase("usecase")) {
|
||||||
type = LeafType.USECASE;
|
type = LeafType.USECASE;
|
||||||
usymbol = null;
|
usymbol = null;
|
||||||
|
} else if (symbol.equalsIgnoreCase("state")) {
|
||||||
|
type = LeafType.STATE;
|
||||||
|
usymbol = null;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
type = LeafType.DESCRIPTION;
|
||||||
|
usymbol = USymbol.getFoo1(symbol, diagram.getSkinParam().useUml2ForComponent());
|
||||||
|
if (usymbol == null) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw));
|
final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw));
|
||||||
@ -211,7 +169,8 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
|
|||||||
entity.addUrl(url);
|
entity.addUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
|
entity.setSpecificColorTOBEREMOVED(ColorType.BACK,
|
||||||
|
diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
|
||||||
return CommandExecutionResult.ok();
|
return CommandExecutionResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||||||
|
|
||||||
new RegexConcat(
|
new RegexConcat(
|
||||||
//
|
//
|
||||||
new RegexLeaf("ARROW_HEAD1", "([%s]+[ox]|[#\\[<*+^}]|[<\\[]\\|)?"), //
|
new RegexLeaf("ARROW_HEAD1", "([%s]+[ox]|[#\\[<*+^}]|[<\\[]\\||\\}o|\\}\\||\\|o|\\|\\|)?"), //
|
||||||
new RegexLeaf("ARROW_BODY1", "([-=.]+)"), //
|
new RegexLeaf("ARROW_BODY1", "([-=.]+)"), //
|
||||||
new RegexLeaf("ARROW_STYLE1",
|
new RegexLeaf("ARROW_STYLE1",
|
||||||
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
|
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
|
||||||
@ -90,7 +90,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||||||
new RegexLeaf("ARROW_STYLE2",
|
new RegexLeaf("ARROW_STYLE2",
|
||||||
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
|
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
|
||||||
new RegexLeaf("ARROW_BODY2", "([-=.]*)"), //
|
new RegexLeaf("ARROW_BODY2", "([-=.]*)"), //
|
||||||
new RegexLeaf("ARROW_HEAD2", "([ox][%s]+|[#\\]>*+^{]|\\|[>\\]])?")), //
|
new RegexLeaf("ARROW_HEAD2", "([ox][%s]+|[#\\]>*+^\\{]|\\|[>\\]]|o\\{|\\|\\{|o\\||\\|\\|)?")), //
|
||||||
|
|
||||||
new RegexLeaf("[%s]*"), //
|
new RegexLeaf("[%s]*"), //
|
||||||
new RegexLeaf("SECOND_LABEL", "(?:[%g]([^%g]+)[%g])?"), new RegexLeaf("[%s]*"), //
|
new RegexLeaf("SECOND_LABEL", "(?:[%g]([^%g]+)[%g])?"), new RegexLeaf("[%s]*"), //
|
||||||
@ -119,7 +119,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||||||
|
|
||||||
private static String optionalKeywords(UmlDiagramType type) {
|
private static String optionalKeywords(UmlDiagramType type) {
|
||||||
if (type == UmlDiagramType.CLASS) {
|
if (type == UmlDiagramType.CLASS) {
|
||||||
return "(interface|enum|annotation|abstract[%s]+class|abstract|class|object)";
|
return "(interface|enum|annotation|abstract[%s]+class|abstract|class|object|entity)";
|
||||||
}
|
}
|
||||||
if (type == UmlDiagramType.OBJECT) {
|
if (type == UmlDiagramType.OBJECT) {
|
||||||
return "(object)";
|
return "(object)";
|
||||||
@ -424,6 +424,18 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||||||
if ("}".equals(s)) {
|
if ("}".equals(s)) {
|
||||||
return LinkDecor.CROWFOOT;
|
return LinkDecor.CROWFOOT;
|
||||||
}
|
}
|
||||||
|
if ("}o".equals(s)) {
|
||||||
|
return LinkDecor.CIRCLE_CROWFOOT;
|
||||||
|
}
|
||||||
|
if ("}|".equals(s)) {
|
||||||
|
return LinkDecor.LINE_CROWFOOT;
|
||||||
|
}
|
||||||
|
if ("|o".equals(s)) {
|
||||||
|
return LinkDecor.CIRCLE_LINE;
|
||||||
|
}
|
||||||
|
if ("||".equals(s)) {
|
||||||
|
return LinkDecor.DOUBLE_LINE;
|
||||||
|
}
|
||||||
if ("<".equals(s)) {
|
if ("<".equals(s)) {
|
||||||
return LinkDecor.ARROW;
|
return LinkDecor.ARROW;
|
||||||
}
|
}
|
||||||
@ -462,6 +474,18 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
|
|||||||
if ("{".equals(s)) {
|
if ("{".equals(s)) {
|
||||||
return LinkDecor.CROWFOOT;
|
return LinkDecor.CROWFOOT;
|
||||||
}
|
}
|
||||||
|
if ("o{".equals(s)) {
|
||||||
|
return LinkDecor.CIRCLE_CROWFOOT;
|
||||||
|
}
|
||||||
|
if ("|{".equals(s)) {
|
||||||
|
return LinkDecor.LINE_CROWFOOT;
|
||||||
|
}
|
||||||
|
if ("o|".equals(s)) {
|
||||||
|
return LinkDecor.CIRCLE_LINE;
|
||||||
|
}
|
||||||
|
if ("||".equals(s)) {
|
||||||
|
return LinkDecor.DOUBLE_LINE;
|
||||||
|
}
|
||||||
if ("^".equals(s)) {
|
if ("^".equals(s)) {
|
||||||
return LinkDecor.EXTENDS;
|
return LinkDecor.EXTENDS;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassO
|
|||||||
|
|
||||||
private static String optionalKeywords(UmlDiagramType type) {
|
private static String optionalKeywords(UmlDiagramType type) {
|
||||||
if (type == UmlDiagramType.CLASS) {
|
if (type == UmlDiagramType.CLASS) {
|
||||||
return "(interface|enum|annotation|abstract[%s]+class|abstract|class)";
|
return "(interface|enum|annotation|abstract[%s]+class|abstract|class|entity)";
|
||||||
}
|
}
|
||||||
if (type == UmlDiagramType.OBJECT) {
|
if (type == UmlDiagramType.OBJECT) {
|
||||||
return "(object)";
|
return "(object)";
|
||||||
|
@ -48,7 +48,7 @@ public enum LeafType {
|
|||||||
|
|
||||||
STATE, STATE_CONCURRENT, PSEUDO_STATE, STATE_CHOICE, STATE_FORK_JOIN,
|
STATE, STATE_CONCURRENT, PSEUDO_STATE, STATE_CHOICE, STATE_FORK_JOIN,
|
||||||
|
|
||||||
BLOCK,
|
BLOCK, ENTITY,
|
||||||
|
|
||||||
STILL_UNKNOWN;
|
STILL_UNKNOWN;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public enum LeafType {
|
|||||||
|
|
||||||
public boolean isLikeClass() {
|
public boolean isLikeClass() {
|
||||||
return this == LeafType.ANNOTATION || this == LeafType.ABSTRACT_CLASS || this == LeafType.CLASS
|
return this == LeafType.ANNOTATION || this == LeafType.ABSTRACT_CLASS || this == LeafType.CLASS
|
||||||
|| this == LeafType.INTERFACE || this == LeafType.ENUM;
|
|| this == LeafType.INTERFACE || this == LeafType.ENUM || this == LeafType.ENTITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toHtml() {
|
public String toHtml() {
|
||||||
@ -72,7 +72,7 @@ public enum LeafType {
|
|||||||
|
|
||||||
public boolean manageModifier() {
|
public boolean manageModifier() {
|
||||||
if (this == ANNOTATION || this == ABSTRACT_CLASS || this == CLASS || this == INTERFACE || this == ENUM
|
if (this == ANNOTATION || this == ABSTRACT_CLASS || this == CLASS || this == INTERFACE || this == ENUM
|
||||||
|| this == OBJECT) {
|
|| this == OBJECT || this == ENTITY) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -38,8 +38,12 @@ import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrowAndCircle;
|
|||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircle;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircle;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircleConnect;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircleConnect;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircleCross;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircleCross;
|
||||||
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircleCrowfoot;
|
||||||
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCircleLine;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCrowfoot;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryCrowfoot;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryDiamond;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryDiamond;
|
||||||
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryDoubleLine;
|
||||||
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryLineCrowfoot;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryNotNavigable;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryNotNavigable;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryParenthesis;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryParenthesis;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryPlus;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryPlus;
|
||||||
@ -51,7 +55,10 @@ public enum LinkDecor {
|
|||||||
NONE(2, false, 0), EXTENDS(30, false, 2), COMPOSITION(15, true, 1.3), AGREGATION(15, false, 1.3), NOT_NAVIGABLE(1,
|
NONE(2, false, 0), EXTENDS(30, false, 2), COMPOSITION(15, true, 1.3), AGREGATION(15, false, 1.3), NOT_NAVIGABLE(1,
|
||||||
false, 0.5),
|
false, 0.5),
|
||||||
|
|
||||||
CROWFOOT(10, true, 0.8), ARROW(10, true, 0.5), ARROW_TRIANGLE(10, true, 0.8), ARROW_AND_CIRCLE(10, false, 0.5),
|
CROWFOOT(10, true, 0.8), CIRCLE_CROWFOOT(14, false, 0.8), CIRCLE_LINE(10, false, 0.8),
|
||||||
|
DOUBLE_LINE(7, false, 0.7), LINE_CROWFOOT(10, false, 0.8),
|
||||||
|
|
||||||
|
ARROW(10, true, 0.5), ARROW_TRIANGLE(10, true, 0.8), ARROW_AND_CIRCLE(10, false, 0.5),
|
||||||
|
|
||||||
CIRCLE(0, false, 0.5), CIRCLE_CONNECT(0, false, 0.5), PARENTHESIS(0, false, OptionFlags.USE_INTERFACE_EYE2 ? 0.5
|
CIRCLE(0, false, 0.5), CIRCLE_CONNECT(0, false, 0.5), PARENTHESIS(0, false, OptionFlags.USE_INTERFACE_EYE2 ? 0.5
|
||||||
: 1.0), SQUARRE(0, false, 0.5),
|
: 1.0), SQUARRE(0, false, 0.5),
|
||||||
@ -87,6 +94,14 @@ public enum LinkDecor {
|
|||||||
return new ExtremityFactoryTriangle();
|
return new ExtremityFactoryTriangle();
|
||||||
} else if (this == LinkDecor.CROWFOOT) {
|
} else if (this == LinkDecor.CROWFOOT) {
|
||||||
return new ExtremityFactoryCrowfoot();
|
return new ExtremityFactoryCrowfoot();
|
||||||
|
} else if (this == LinkDecor.CIRCLE_CROWFOOT) {
|
||||||
|
return new ExtremityFactoryCircleCrowfoot();
|
||||||
|
} else if (this == LinkDecor.LINE_CROWFOOT) {
|
||||||
|
return new ExtremityFactoryLineCrowfoot();
|
||||||
|
} else if (this == LinkDecor.CIRCLE_LINE) {
|
||||||
|
return new ExtremityFactoryCircleLine();
|
||||||
|
} else if (this == LinkDecor.DOUBLE_LINE) {
|
||||||
|
return new ExtremityFactoryDoubleLine();
|
||||||
} else if (this == LinkDecor.CIRCLE_CROSS) {
|
} else if (this == LinkDecor.CIRCLE_CROSS) {
|
||||||
return new ExtremityFactoryCircleCross();
|
return new ExtremityFactoryCircleCross();
|
||||||
} else if (this == LinkDecor.ARROW) {
|
} else if (this == LinkDecor.ARROW) {
|
||||||
|
@ -138,6 +138,9 @@ public class MemberImpl implements Member {
|
|||||||
if (isProtected()) {
|
if (isProtected()) {
|
||||||
return "#" + display;
|
return "#" + display;
|
||||||
}
|
}
|
||||||
|
if (isIEMandatory()) {
|
||||||
|
return "*" + display;
|
||||||
|
}
|
||||||
return display;
|
return display;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,6 +183,10 @@ public class MemberImpl implements Member {
|
|||||||
|| visibilityModifier == VisibilityModifier.PACKAGE_PRIVATE_METHOD;
|
|| visibilityModifier == VisibilityModifier.PACKAGE_PRIVATE_METHOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isIEMandatory() {
|
||||||
|
return visibilityModifier == VisibilityModifier.IE_MANDATORY;
|
||||||
|
}
|
||||||
|
|
||||||
public final VisibilityModifier getVisibilityModifier() {
|
public final VisibilityModifier getVisibilityModifier() {
|
||||||
return visibilityModifier;
|
return visibilityModifier;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ import net.sourceforge.plantuml.graphic.color.Colors;
|
|||||||
|
|
||||||
public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiagram> {
|
public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiagram> {
|
||||||
|
|
||||||
public static final String ALL_TYPES = "artifact|actor|folder|file|package|rectangle|node|frame|cloud|database|queue|storage|agent|usecase|component|boundary|control|entity|interface";
|
public static final String ALL_TYPES = "artifact|actor|folder|card|file|package|rectangle|node|frame|cloud|database|queue|storage|agent|usecase|component|boundary|control|entity|interface";
|
||||||
|
|
||||||
public CommandCreateElementFull() {
|
public CommandCreateElementFull() {
|
||||||
super(getRegexConcat());
|
super(getRegexConcat());
|
||||||
@ -137,68 +137,15 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
|
|||||||
if (symbol == null) {
|
if (symbol == null) {
|
||||||
type = LeafType.DESCRIPTION;
|
type = LeafType.DESCRIPTION;
|
||||||
usymbol = USymbol.ACTOR;
|
usymbol = USymbol.ACTOR;
|
||||||
} else if (symbol.equalsIgnoreCase("artifact")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.ARTIFACT;
|
|
||||||
} else if (symbol.equalsIgnoreCase("folder")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.FOLDER;
|
|
||||||
} else if (symbol.equalsIgnoreCase("file")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.FILE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("package")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.PACKAGE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("rectangle")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.RECTANGLE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("node")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.NODE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("frame")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.FRAME;
|
|
||||||
} else if (symbol.equalsIgnoreCase("cloud")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.CLOUD;
|
|
||||||
} else if (symbol.equalsIgnoreCase("database")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.DATABASE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("queue")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.QUEUE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("storage")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.STORAGE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("agent")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.AGENT;
|
|
||||||
} else if (symbol.equalsIgnoreCase("actor")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.ACTOR;
|
|
||||||
} else if (symbol.equalsIgnoreCase("component")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = diagram.getSkinParam().useUml2ForComponent() ? USymbol.COMPONENT2 : USymbol.COMPONENT1;
|
|
||||||
} else if (symbol.equalsIgnoreCase("boundary")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.BOUNDARY;
|
|
||||||
} else if (symbol.equalsIgnoreCase("control")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.CONTROL;
|
|
||||||
} else if (symbol.equalsIgnoreCase("entity")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.ENTITY_DOMAIN;
|
|
||||||
} else if (symbol.equalsIgnoreCase("interface")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.INTERFACE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("()")) {
|
|
||||||
type = LeafType.DESCRIPTION;
|
|
||||||
usymbol = USymbol.INTERFACE;
|
|
||||||
} else if (symbol.equalsIgnoreCase("usecase")) {
|
} else if (symbol.equalsIgnoreCase("usecase")) {
|
||||||
type = LeafType.USECASE;
|
type = LeafType.USECASE;
|
||||||
usymbol = null;
|
usymbol = null;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
type = LeafType.DESCRIPTION;
|
||||||
|
usymbol = USymbol.getFoo1(symbol, diagram.getSkinParam().useUml2ForComponent());
|
||||||
|
if (usymbol == null) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw));
|
final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw));
|
||||||
|
@ -60,7 +60,7 @@ import net.sourceforge.plantuml.version.PSystemVersion;
|
|||||||
|
|
||||||
public class PSystemDonors extends AbstractPSystem {
|
public class PSystemDonors extends AbstractPSystem {
|
||||||
|
|
||||||
public static final String DONORS = "UDfTL4josp0CtUCKN6lIGoXsxDQ_PEmqdSaEbc2BDaMu9ELKFaUlaaLdkki5VAH2RcNIuKeO0k1x3m_AJVR_a8Cd2kHKRWDRZGKyKnOFrp3Z63eFUL-AQnYxU4Kjh6YDFcYqQi6LXToMxDIOAPoe-zni9ADFHmipJ1wo0OQw3xI1FBRc8woQ2A65iSvkZsMOz2WR3wj0Xugi6Z0VXD-mVuSyJEiFfUnWm4PRjUJ64qoQ3_VPZeL87nmqp1FKMAUXF9KR-e6s53a7bPQkMtIjC5rUQTijB5BquGIFHX-bOAYBlI2_tcWB3_xQsYOWCZh2y5Jhu5ermufBX4ad-ck5qZx9oyZ4SSdPjoAJnI1vWazmJVw1f_qDArjAw0hHP8Hhr-xvpU-rD39IzkY2Fi7dc5qop7LHaL7tg4sRCZ2d58ptC26qdoPOV6_8gs6pTYYpD97l2-y25PMQElGO8Mr9B9fCxArpbgIeAHzrQfIBLRv6mXfXcPYtUoBbcUsa-f3OYlUTClViqA8vtAbN2iW73qiXYAvKKzsD5aQ6NQVt_CzlOov3ZuOmYJd5JhEhdHpsQdTJhsuPUNZ2tXvBVGCuDrgj44jP7RSbzOtibjoTckVFNrPvj7R65iPqip8fSrk8HMhr8gY7Ojffp7JKJLQMPKO43yVK-KU4HMn2TGyoIsYC6os-Q6fI8sueH7qB3wDqCXSkqGtsbCecS1TwAnvQwJgke02IJTvqIgDiTG8wCmREFy_lIVlp-_aN3AgRrMvbyPhrvKVWhEp2Nu66JIy0";
|
public static final String DONORS = "UDfTL4josp0CtUCKN6lIGoXsxDI_PEmqdSaEbc29CKMufEHKFaUlaaLdkki5VAH2JcLIuKeO0k1x3mzAJVB_a8D7gicfrDPiDMRmH4auNC62G-Wyf7qfRc7gmXMriA4j-bgZLIikBQGsPwUcJFM9ki_TJZBwTBImmEWXMyDOzu4sa8RMV8HD4o2qCDN9y5Y6MO-oyR2fwL2ILIFcW_0Rz--GXtdrgPGTZDXegzRSU89Py-a-UMKXqWS73Si8DLPnA4-bXdwYpKNEKQcbQu6k5QRhAsrRm2f6Nv_WmUYZ58nrjXVarnjjuSvVMzi8H49769ygNRjMBR3a767MYVvIehIFyX8oOLnozgt8PB6MFC4dk6OVu6a_O6Lp2Lqccanmwzezl_czbaP6oXvShKzm7x9pXgNEIZBg5hLfOmRc58Fn7cQ4ziiCinyDUJLkjWvbbYRmVURNch9IpHrw390A4ej64tlhd2KfQiv77HlbOfLlWR16M4VcxPw8UIQlKds8RCNxJfbRTcZH76xK2zN81mzh8OWkLtFTZHOcXbsdz_Bl7sCkGm-6C94vnKwBgvqSzcftKo-7Z3myOc-FjHu0JerM6yHSLiSLfBwJBSZTg6Nwz7MJ1cidR65AWvM9cTjCB5AfPq4z5jFEGwQZRhAoB0iYk3l6pZyYh48JgdgGIKHZscZnHLEHcd13TT0typ299tFX4jnWJx5i0dUb2_7GHbTX1GMGRFAkKnfbgoFGYJ5m_dL-ZzgVty-_OLGELhkLnMksbn-1ix8Bzpo0CoNUxHorQgKh6Tm_1JvLlG00";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat)
|
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat)
|
||||||
@ -73,7 +73,7 @@ public class PSystemDonors extends AbstractPSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private UDrawable getGraphicStrings() throws IOException {
|
private UDrawable getGraphicStrings() throws IOException {
|
||||||
final List<TextBlock> cols = getCols(getDonors(), 3, 5);
|
final List<TextBlock> cols = getCols(getDonors(), 4, 5);
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
final TextBlockBackcolored header = GraphicStrings.createBlackOnWhite(Arrays
|
final TextBlockBackcolored header = GraphicStrings.createBlackOnWhite(Arrays
|
||||||
|
@ -115,6 +115,9 @@ public class SkinParameter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getUpperCaseName() {
|
public String getUpperCaseName() {
|
||||||
|
if (name.endsWith("1") || name.endsWith("2")) {
|
||||||
|
return name.substring(0, name.length() - 1);
|
||||||
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,4 +176,49 @@ public abstract class USymbol {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static USymbol getFoo1(String symbol, boolean useUml2ForComponent) {
|
||||||
|
USymbol usymbol = null;
|
||||||
|
if (symbol.equalsIgnoreCase("artifact")) {
|
||||||
|
usymbol = USymbol.ARTIFACT;
|
||||||
|
} else if (symbol.equalsIgnoreCase("folder")) {
|
||||||
|
usymbol = USymbol.FOLDER;
|
||||||
|
} else if (symbol.equalsIgnoreCase("file")) {
|
||||||
|
usymbol = USymbol.FILE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("package")) {
|
||||||
|
usymbol = USymbol.PACKAGE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("rectangle")) {
|
||||||
|
usymbol = USymbol.RECTANGLE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("node")) {
|
||||||
|
usymbol = USymbol.NODE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("frame")) {
|
||||||
|
usymbol = USymbol.FRAME;
|
||||||
|
} else if (symbol.equalsIgnoreCase("cloud")) {
|
||||||
|
usymbol = USymbol.CLOUD;
|
||||||
|
} else if (symbol.equalsIgnoreCase("database")) {
|
||||||
|
usymbol = USymbol.DATABASE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("queue")) {
|
||||||
|
usymbol = USymbol.QUEUE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("storage")) {
|
||||||
|
usymbol = USymbol.STORAGE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("agent")) {
|
||||||
|
usymbol = USymbol.AGENT;
|
||||||
|
} else if (symbol.equalsIgnoreCase("actor")) {
|
||||||
|
usymbol = USymbol.ACTOR;
|
||||||
|
} else if (symbol.equalsIgnoreCase("component")) {
|
||||||
|
usymbol = useUml2ForComponent ? USymbol.COMPONENT2 : USymbol.COMPONENT1;
|
||||||
|
} else if (symbol.equalsIgnoreCase("boundary")) {
|
||||||
|
usymbol = USymbol.BOUNDARY;
|
||||||
|
} else if (symbol.equalsIgnoreCase("control")) {
|
||||||
|
usymbol = USymbol.CONTROL;
|
||||||
|
} else if (symbol.equalsIgnoreCase("entity")) {
|
||||||
|
usymbol = USymbol.ENTITY_DOMAIN;
|
||||||
|
} else if (symbol.equalsIgnoreCase("card")) {
|
||||||
|
usymbol = USymbol.CARD;
|
||||||
|
} else if (symbol.equalsIgnoreCase("interface")) {
|
||||||
|
usymbol = USymbol.INTERFACE;
|
||||||
|
} else if (symbol.equalsIgnoreCase("()")) {
|
||||||
|
usymbol = USymbol.INTERFACE;
|
||||||
|
}
|
||||||
|
return usymbol;
|
||||||
|
}
|
||||||
}
|
}
|
@ -55,13 +55,15 @@ public enum VisibilityModifier {
|
|||||||
PRIVATE_METHOD(ColorParam.iconPrivate, ColorParam.iconPrivateBackground), PROTECTED_METHOD(
|
PRIVATE_METHOD(ColorParam.iconPrivate, ColorParam.iconPrivateBackground), PROTECTED_METHOD(
|
||||||
ColorParam.iconProtected, ColorParam.iconProtectedBackground), PACKAGE_PRIVATE_METHOD(
|
ColorParam.iconProtected, ColorParam.iconProtectedBackground), PACKAGE_PRIVATE_METHOD(
|
||||||
ColorParam.iconPackage, ColorParam.iconPackageBackground), PUBLIC_METHOD(ColorParam.iconPublic,
|
ColorParam.iconPackage, ColorParam.iconPackageBackground), PUBLIC_METHOD(ColorParam.iconPublic,
|
||||||
ColorParam.iconPublicBackground);
|
ColorParam.iconPublicBackground),
|
||||||
|
|
||||||
|
IE_MANDATORY(ColorParam.iconIEMandatory, ColorParam.iconIEMandatory);
|
||||||
|
|
||||||
private final ColorParam foregroundParam;
|
private final ColorParam foregroundParam;
|
||||||
private final ColorParam backgroundParam;
|
private final ColorParam backgroundParam;
|
||||||
|
|
||||||
public static String regexForVisibilityCharacter() {
|
public static String regexForVisibilityCharacter() {
|
||||||
return "[-#+~]";
|
return "[-#+~*]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private VisibilityModifier(ColorParam foreground, ColorParam background) {
|
private VisibilityModifier(ColorParam foreground, ColorParam background) {
|
||||||
@ -137,6 +139,10 @@ public enum VisibilityModifier {
|
|||||||
drawCircle(ug, true, size, x, y);
|
drawCircle(ug, true, size, x, y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IE_MANDATORY:
|
||||||
|
drawCircle(ug, true, size, x, y);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
@ -189,6 +195,9 @@ public enum VisibilityModifier {
|
|||||||
if (c == '~') {
|
if (c == '~') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (c == '*') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,6 +221,9 @@ public enum VisibilityModifier {
|
|||||||
if (c == '~') {
|
if (c == '~') {
|
||||||
return VisibilityModifier.PACKAGE_PRIVATE_FIELD;
|
return VisibilityModifier.PACKAGE_PRIVATE_FIELD;
|
||||||
}
|
}
|
||||||
|
if (c == '*') {
|
||||||
|
return VisibilityModifier.IE_MANDATORY;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,6 +240,9 @@ public enum VisibilityModifier {
|
|||||||
if (c == '~') {
|
if (c == '~') {
|
||||||
return VisibilityModifier.PACKAGE_PRIVATE_METHOD;
|
return VisibilityModifier.PACKAGE_PRIVATE_METHOD;
|
||||||
}
|
}
|
||||||
|
if (c == '*') {
|
||||||
|
return VisibilityModifier.IE_MANDATORY;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
|||||||
|
|
||||||
public enum PackageStyle {
|
public enum PackageStyle {
|
||||||
|
|
||||||
FOLDER, RECT, NODE, FRAME, CLOUD, DATABASE, AGENT, STORAGE, COMPONENT1, COMPONENT2, ARTIFACT, CARD;
|
FOLDER, RECTANGLE, NODE, FRAME, CLOUD, DATABASE, AGENT, STORAGE, COMPONENT1, COMPONENT2, ARTIFACT, CARD;
|
||||||
|
|
||||||
public static PackageStyle fromString(String value) {
|
public static PackageStyle fromString(String value) {
|
||||||
for (PackageStyle p : EnumSet.allOf(PackageStyle.class)) {
|
for (PackageStyle p : EnumSet.allOf(PackageStyle.class)) {
|
||||||
@ -54,6 +54,9 @@ public enum PackageStyle {
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ("rect".equalsIgnoreCase(value)) {
|
||||||
|
return RECTANGLE;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +76,7 @@ public enum PackageStyle {
|
|||||||
if (this == FRAME) {
|
if (this == FRAME) {
|
||||||
return USymbol.FRAME;
|
return USymbol.FRAME;
|
||||||
}
|
}
|
||||||
if (this == RECT) {
|
if (this == RECTANGLE) {
|
||||||
return USymbol.RECTANGLE;
|
return USymbol.RECTANGLE;
|
||||||
}
|
}
|
||||||
if (this == FOLDER) {
|
if (this == FOLDER) {
|
||||||
@ -96,7 +99,7 @@ public enum PackageStyle {
|
|||||||
drawFrame(ug, width, height, titleDim, shadowing);
|
drawFrame(ug, width, height, titleDim, shadowing);
|
||||||
} else if (this == CLOUD) {
|
} else if (this == CLOUD) {
|
||||||
drawCloud(ug, width, height, shadowing);
|
drawCloud(ug, width, height, shadowing);
|
||||||
} else if (this == RECT) {
|
} else if (this == RECTANGLE) {
|
||||||
drawRect(ug, width, height, shadowing);
|
drawRect(ug, width, height, shadowing);
|
||||||
} else if (this == COMPONENT1) {
|
} else if (this == COMPONENT1) {
|
||||||
drawComponent1(ug, width, height, shadowing);
|
drawComponent1(ug, width, height, shadowing);
|
||||||
|
@ -0,0 +1,84 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
|
class ExtremityCircleCrowfoot extends Extremity {
|
||||||
|
|
||||||
|
private final Point2D contact;
|
||||||
|
private final double angle;
|
||||||
|
private final double radius = 4;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point2D somePoint() {
|
||||||
|
return contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtremityCircleCrowfoot(Point2D p1, double angle) {
|
||||||
|
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
||||||
|
this.angle = manageround(angle + Math.PI / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawU(UGraphic ug) {
|
||||||
|
final int xAile = 8;
|
||||||
|
final int yOuverture = 6;
|
||||||
|
final AffineTransform rotate = AffineTransform.getRotateInstance(this.angle);
|
||||||
|
Point2D middle = new Point2D.Double(0, 0);
|
||||||
|
Point2D left = new Point2D.Double(0, -yOuverture);
|
||||||
|
Point2D base = new Point2D.Double(-xAile, 0);
|
||||||
|
Point2D right = new Point2D.Double(0, yOuverture);
|
||||||
|
Point2D circleBase = new Point2D.Double(-xAile-radius-2, 0);
|
||||||
|
rotate.transform(left, left);
|
||||||
|
rotate.transform(base, base);
|
||||||
|
rotate.transform(right, right);
|
||||||
|
rotate.transform(circleBase, circleBase);
|
||||||
|
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, left);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, right);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, middle);
|
||||||
|
ug.apply(new UTranslate(contact.getX()+circleBase.getX()-radius, contact.getY()+circleBase.getY()-radius)).draw(new UEllipse(2*radius, 2*radius));
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void drawLine(UGraphic ug, double x, double y, Point2D p1, Point2D p2) {
|
||||||
|
final double dx = p2.getX() - p1.getX();
|
||||||
|
final double dy = p2.getY() - p1.getY();
|
||||||
|
ug.apply(new UTranslate(x + p1.getX(), y + p1.getY())).draw(new ULine(dx, dy));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
|
class ExtremityCircleLine extends Extremity {
|
||||||
|
|
||||||
|
private final Point2D contact;
|
||||||
|
private final double angle;
|
||||||
|
private final double radius = 4;
|
||||||
|
private final double lineHeight = 4;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point2D somePoint() {
|
||||||
|
return contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtremityCircleLine(Point2D p1, double angle) {
|
||||||
|
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
||||||
|
this.angle = manageround(angle + Math.PI / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawU(UGraphic ug) {
|
||||||
|
final int xAile = 4;
|
||||||
|
final AffineTransform rotate = AffineTransform.getRotateInstance(this.angle);
|
||||||
|
Point2D middle = new Point2D.Double(0, 0);
|
||||||
|
Point2D base = new Point2D.Double(-xAile-radius-3, 0);
|
||||||
|
Point2D circleBase = new Point2D.Double(-xAile-radius-3, 0);
|
||||||
|
|
||||||
|
Point2D lineTop = new Point2D.Double(-xAile, -lineHeight);
|
||||||
|
Point2D lineBottom = new Point2D.Double(-xAile, lineHeight);
|
||||||
|
|
||||||
|
rotate.transform(lineTop, lineTop);
|
||||||
|
rotate.transform(lineBottom, lineBottom);
|
||||||
|
rotate.transform(base, base);
|
||||||
|
rotate.transform(circleBase, circleBase);
|
||||||
|
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, middle);
|
||||||
|
ug.apply(new UTranslate(contact.getX()+circleBase.getX()-radius, contact.getY()+circleBase.getY()-radius)).draw(new UEllipse(2*radius, 2*radius));
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), lineTop, lineBottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void drawLine(UGraphic ug, double x, double y, Point2D p1, Point2D p2) {
|
||||||
|
final double dx = p2.getX() - p1.getX();
|
||||||
|
final double dy = p2.getY() - p1.getY();
|
||||||
|
ug.apply(new UTranslate(x + p1.getX(), y + p1.getY())).draw(new ULine(dx, dy));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
|
class ExtremityDoubleLine extends Extremity {
|
||||||
|
|
||||||
|
private final Point2D contact;
|
||||||
|
private final double angle;
|
||||||
|
private final double lineHeight = 4;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point2D somePoint() {
|
||||||
|
return contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtremityDoubleLine(Point2D p1, double angle) {
|
||||||
|
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
||||||
|
this.angle = manageround(angle + Math.PI / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawU(UGraphic ug) {
|
||||||
|
final int xAile = 4;
|
||||||
|
final AffineTransform rotate = AffineTransform.getRotateInstance(this.angle);
|
||||||
|
Point2D firstLineTop = new Point2D.Double(-xAile, -lineHeight);
|
||||||
|
Point2D firstLineBottom = new Point2D.Double(-xAile, lineHeight);
|
||||||
|
Point2D secondLineTop = new Point2D.Double(-xAile - 3, -lineHeight);
|
||||||
|
Point2D secondLineBottom = new Point2D.Double(-xAile - 3, lineHeight);
|
||||||
|
|
||||||
|
Point2D middle = new Point2D.Double(0, 0);
|
||||||
|
Point2D base = new Point2D.Double(-xAile - 4, 0);
|
||||||
|
|
||||||
|
rotate.transform(middle, middle);
|
||||||
|
rotate.transform(base, base);
|
||||||
|
|
||||||
|
rotate.transform(firstLineTop, firstLineTop);
|
||||||
|
rotate.transform(firstLineBottom, firstLineBottom);
|
||||||
|
rotate.transform(secondLineTop, secondLineTop);
|
||||||
|
rotate.transform(secondLineBottom, secondLineBottom);
|
||||||
|
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), firstLineTop, firstLineBottom);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), secondLineTop, secondLineBottom);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, middle);
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void drawLine(UGraphic ug, double x, double y, Point2D p1, Point2D p2) {
|
||||||
|
final double dx = p2.getX() - p1.getX();
|
||||||
|
final double dy = p2.getY() - p1.getY();
|
||||||
|
ug.apply(new UTranslate(x + p1.getX(), y + p1.getY())).draw(new ULine(dx, dy));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||||
|
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
||||||
|
import net.sourceforge.plantuml.svek.Side;
|
||||||
|
|
||||||
|
public class ExtremityFactoryCircleCrowfoot extends AbstractExtremityFactory implements ExtremityFactory {
|
||||||
|
|
||||||
|
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2, Side side) {
|
||||||
|
final double ortho = atan2(p0, p2);
|
||||||
|
return new ExtremityCircleCrowfoot(p1, ortho);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||||
|
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
||||||
|
import net.sourceforge.plantuml.svek.Side;
|
||||||
|
|
||||||
|
public class ExtremityFactoryCircleLine extends AbstractExtremityFactory implements ExtremityFactory {
|
||||||
|
|
||||||
|
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2, Side side) {
|
||||||
|
final double ortho = atan2(p0, p2);
|
||||||
|
return new ExtremityCircleLine(p1, ortho);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||||
|
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
||||||
|
import net.sourceforge.plantuml.svek.Side;
|
||||||
|
|
||||||
|
public class ExtremityFactoryDoubleLine extends AbstractExtremityFactory implements ExtremityFactory {
|
||||||
|
|
||||||
|
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2, Side side) {
|
||||||
|
final double ortho = atan2(p0, p2);
|
||||||
|
return new ExtremityDoubleLine(p1, ortho);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||||
|
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
||||||
|
import net.sourceforge.plantuml.svek.Side;
|
||||||
|
|
||||||
|
public class ExtremityFactoryLineCrowfoot extends AbstractExtremityFactory implements ExtremityFactory {
|
||||||
|
|
||||||
|
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2, Side side) {
|
||||||
|
final double ortho = atan2(p0, p2);
|
||||||
|
return new ExtremityLineCrowfoot(p1, ortho);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.svek.extremity;
|
||||||
|
|
||||||
|
import java.awt.geom.AffineTransform;
|
||||||
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
|
class ExtremityLineCrowfoot extends Extremity {
|
||||||
|
|
||||||
|
private final Point2D contact;
|
||||||
|
private final double angle;
|
||||||
|
private final double lineHeight = 4;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Point2D somePoint() {
|
||||||
|
return contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtremityLineCrowfoot(Point2D p1, double angle) {
|
||||||
|
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
||||||
|
this.angle = manageround(angle + Math.PI / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawU(UGraphic ug) {
|
||||||
|
|
||||||
|
final int xAile = 8;
|
||||||
|
final int yOuverture = 6;
|
||||||
|
final AffineTransform rotate = AffineTransform.getRotateInstance(this.angle);
|
||||||
|
Point2D middle = new Point2D.Double(0, 0);
|
||||||
|
Point2D left = new Point2D.Double(0, -yOuverture);
|
||||||
|
Point2D base = new Point2D.Double(-xAile, 0);
|
||||||
|
Point2D lineTop = new Point2D.Double(-xAile-2, -lineHeight);
|
||||||
|
Point2D lineBottom = new Point2D.Double(-xAile-2, lineHeight);
|
||||||
|
Point2D right = new Point2D.Double(0, yOuverture);
|
||||||
|
rotate.transform(left, left);
|
||||||
|
rotate.transform(base, base);
|
||||||
|
rotate.transform(right, right);
|
||||||
|
rotate.transform(lineTop, lineTop);
|
||||||
|
rotate.transform(lineBottom, lineBottom);
|
||||||
|
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, left);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, right);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), base, middle);
|
||||||
|
drawLine(ug, contact.getX(), contact.getY(), lineTop, lineBottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void drawLine(UGraphic ug, double x, double y, Point2D p1, Point2D p2) {
|
||||||
|
final double dx = p2.getX() - p1.getX();
|
||||||
|
final double dy = p2.getY() - p1.getY();
|
||||||
|
ug.apply(new UTranslate(x + p1.getX(), y + p1.getY())).draw(new ULine(dx, dy));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -165,6 +165,11 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
|
|||||||
getSkinParam(), ColorParam.stereotypeEBackground, stereotype), classBorder,
|
getSkinParam(), ColorParam.stereotypeEBackground, stereotype), classBorder,
|
||||||
SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
|
SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
|
||||||
}
|
}
|
||||||
|
if (entity.getEntityType() == LeafType.ENTITY) {
|
||||||
|
return new CircledCharacter('E', getSkinParam().getCircledCharacterRadius(), font, SkinParamUtils.getColor(
|
||||||
|
getSkinParam(), ColorParam.stereotypeCBackground, stereotype), classBorder,
|
||||||
|
SkinParamUtils.getFontColor(getSkinParam(), FontParam.CIRCLED_CHARACTER, null));
|
||||||
|
}
|
||||||
assert false;
|
assert false;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -103,8 +103,12 @@ public class EntityImageUseCase extends AbstractEntityImage {
|
|||||||
ug.startUrl(url);
|
ug.startUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
ug = ug.apply(stroke).apply(
|
ug = ug.apply(stroke);
|
||||||
new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBorder, getStereo())));
|
HtmlColor linecolor = getEntity().getColors(getSkinParam()).getColor(ColorType.LINE);
|
||||||
|
if (linecolor == null) {
|
||||||
|
linecolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBorder, getStereo());
|
||||||
|
}
|
||||||
|
ug = ug.apply(new UChangeColor(linecolor));
|
||||||
HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
|
HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
|
||||||
if (backcolor == null) {
|
if (backcolor == null) {
|
||||||
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBackground, getStereo());
|
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBackground, getStereo());
|
||||||
|
@ -58,7 +58,7 @@ public class LanguageDescriptor {
|
|||||||
type.add("object");
|
type.add("object");
|
||||||
type.add("artifact");
|
type.add("artifact");
|
||||||
type.add("folder");
|
type.add("folder");
|
||||||
type.add("rect");
|
type.add("rectangle");
|
||||||
type.add("node");
|
type.add("node");
|
||||||
type.add("frame");
|
type.add("frame");
|
||||||
type.add("cloud");
|
type.add("cloud");
|
||||||
@ -69,9 +69,16 @@ public class LanguageDescriptor {
|
|||||||
type.add("control");
|
type.add("control");
|
||||||
type.add("entity");
|
type.add("entity");
|
||||||
type.add("card");
|
type.add("card");
|
||||||
|
type.add("file");
|
||||||
|
type.add("package");
|
||||||
|
type.add("queue");
|
||||||
|
|
||||||
keyword.add("@startuml");
|
keyword.add("@startuml");
|
||||||
keyword.add("@enduml");
|
keyword.add("@enduml");
|
||||||
|
keyword.add("@startdot");
|
||||||
|
keyword.add("@enddot");
|
||||||
|
keyword.add("@startsalt");
|
||||||
|
keyword.add("@endsalt");
|
||||||
keyword.add("as");
|
keyword.add("as");
|
||||||
keyword.add("also");
|
keyword.add("also");
|
||||||
keyword.add("autonumber");
|
keyword.add("autonumber");
|
||||||
@ -137,6 +144,7 @@ public class LanguageDescriptor {
|
|||||||
keyword.add("kill");
|
keyword.add("kill");
|
||||||
|
|
||||||
preproc.add("!include");
|
preproc.add("!include");
|
||||||
|
preproc.add("!pragma");
|
||||||
preproc.add("!define");
|
preproc.add("!define");
|
||||||
preproc.add("!undef");
|
preproc.add("!undef");
|
||||||
preproc.add("!ifdef");
|
preproc.add("!ifdef");
|
||||||
|
@ -36,7 +36,7 @@ import java.util.Date;
|
|||||||
public class Version {
|
public class Version {
|
||||||
|
|
||||||
public static int version() {
|
public static int version() {
|
||||||
return 8053;
|
return 8054;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String versionString() {
|
public static String versionString() {
|
||||||
@ -68,7 +68,7 @@ public class Version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static long compileTime() {
|
public static long compileTime() {
|
||||||
return 1482342693198L;
|
return 1484996122445L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String compileTimeString() {
|
public static String compileTimeString() {
|
||||||
|
@ -41,6 +41,7 @@ import net.sourceforge.plantuml.Log;
|
|||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
|
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
|
||||||
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
|
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
|
||||||
|
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
|
||||||
import net.sourceforge.plantuml.statediagram.StateDiagram;
|
import net.sourceforge.plantuml.statediagram.StateDiagram;
|
||||||
|
|
||||||
public final class CucaDiagramXmiMaker {
|
public final class CucaDiagramXmiMaker {
|
||||||
@ -62,6 +63,8 @@ public final class CucaDiagramXmiMaker {
|
|||||||
final IXmiClassDiagram xmi;
|
final IXmiClassDiagram xmi;
|
||||||
if (diagram instanceof StateDiagram) {
|
if (diagram instanceof StateDiagram) {
|
||||||
xmi = new XmiStateDiagram((StateDiagram) diagram);
|
xmi = new XmiStateDiagram((StateDiagram) diagram);
|
||||||
|
} else if (diagram instanceof DescriptionDiagram) {
|
||||||
|
xmi = new XmiDescriptionDiagram((DescriptionDiagram) diagram);
|
||||||
} else if (fileFormat == FileFormat.XMI_STANDARD) {
|
} else if (fileFormat == FileFormat.XMI_STANDARD) {
|
||||||
xmi = new XmiClassDiagramStandard((ClassDiagram) diagram);
|
xmi = new XmiClassDiagramStandard((ClassDiagram) diagram);
|
||||||
} else if (fileFormat == FileFormat.XMI_ARGO) {
|
} else if (fileFormat == FileFormat.XMI_ARGO) {
|
||||||
|
238
src/net/sourceforge/plantuml/xmi/XmiDescriptionDiagram.java
Normal file
238
src/net/sourceforge/plantuml/xmi/XmiDescriptionDiagram.java
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2017, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: http://plantuml.com
|
||||||
|
*
|
||||||
|
* 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.xmi;
|
||||||
|
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import javax.xml.transform.OutputKeys;
|
||||||
|
import javax.xml.transform.Result;
|
||||||
|
import javax.xml.transform.Source;
|
||||||
|
import javax.xml.transform.Transformer;
|
||||||
|
import javax.xml.transform.TransformerException;
|
||||||
|
import javax.xml.transform.TransformerFactory;
|
||||||
|
import javax.xml.transform.dom.DOMSource;
|
||||||
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.GroupRoot;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.IEntity;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.IGroup;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.Link;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
|
||||||
|
import net.sourceforge.plantuml.cucadiagram.Member;
|
||||||
|
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
|
||||||
|
import net.sourceforge.plantuml.utils.UniqueSequence;
|
||||||
|
import net.sourceforge.plantuml.version.Version;
|
||||||
|
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
public class XmiDescriptionDiagram implements IXmiClassDiagram {
|
||||||
|
|
||||||
|
private final DescriptionDiagram diagram;
|
||||||
|
private final Document document;
|
||||||
|
private final Element ownedElement;
|
||||||
|
|
||||||
|
public XmiDescriptionDiagram(DescriptionDiagram diagram) throws ParserConfigurationException {
|
||||||
|
this.diagram = diagram;
|
||||||
|
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||||
|
|
||||||
|
final DocumentBuilder builder = factory.newDocumentBuilder();
|
||||||
|
this.document = builder.newDocument();
|
||||||
|
document.setXmlVersion("1.0");
|
||||||
|
document.setXmlStandalone(true);
|
||||||
|
|
||||||
|
final Element xmi = document.createElement("XMI");
|
||||||
|
xmi.setAttribute("xmi.version", "1.1");
|
||||||
|
xmi.setAttribute("xmlns:UML", "href://org.omg/UML/1.3");
|
||||||
|
document.appendChild(xmi);
|
||||||
|
|
||||||
|
final Element header = document.createElement("XMI.header");
|
||||||
|
xmi.appendChild(header);
|
||||||
|
|
||||||
|
final Element metamodel = document.createElement("XMI.metamodel");
|
||||||
|
metamodel.setAttribute("xmi.name", "UML");
|
||||||
|
metamodel.setAttribute("xmi.version", "1.3");
|
||||||
|
header.appendChild(metamodel);
|
||||||
|
|
||||||
|
final Element content = document.createElement("XMI.content");
|
||||||
|
xmi.appendChild(content);
|
||||||
|
|
||||||
|
// <UML:Model xmi.id="UMLModel.4" name="Design Model"
|
||||||
|
// visibility="public" isSpecification="false" isRoot="false"
|
||||||
|
// isLeaf="false" isAbstract="false">
|
||||||
|
final Element model = document.createElement("UML:Model");
|
||||||
|
model.setAttribute("xmi.id", CucaDiagramXmiMaker.getModel(diagram));
|
||||||
|
model.setAttribute("name", "PlantUML "+Version.versionString());
|
||||||
|
content.appendChild(model);
|
||||||
|
|
||||||
|
// <UML:Namespace.ownedElement>
|
||||||
|
this.ownedElement = document.createElement("UML:Namespace.ownedElement");
|
||||||
|
model.appendChild(ownedElement);
|
||||||
|
|
||||||
|
for (final IGroup gr : diagram.getGroups(false)) {
|
||||||
|
if (gr.getParentContainer() instanceof GroupRoot) {
|
||||||
|
addState(gr, ownedElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (final IEntity ent : diagram.getLeafsvalues()) {
|
||||||
|
if (ent.getParentContainer() instanceof GroupRoot) {
|
||||||
|
addState(ent, ownedElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (final Link link : diagram.getLinks()) {
|
||||||
|
addLink(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addState(final IEntity tobeAdded, Element container) {
|
||||||
|
final Element elementState = createEntityNode(tobeAdded);
|
||||||
|
container.appendChild(elementState);
|
||||||
|
for (final IEntity ent : diagram.getGroups(false)) {
|
||||||
|
if (ent.getParentContainer() == tobeAdded) {
|
||||||
|
addState(ent, elementState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (final IEntity ent : diagram.getLeafsvalues()) {
|
||||||
|
if (ent.getParentContainer() == tobeAdded) {
|
||||||
|
addState(ent, elementState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String forXMI(String s) {
|
||||||
|
return s.replace(':', ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String forXMI(Display s) {
|
||||||
|
return s.get(0).toString().replace(':', ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addLink(Link link) {
|
||||||
|
final String assId = "ass" + UniqueSequence.getValue();
|
||||||
|
|
||||||
|
final Element association = document.createElement("UML:Association");
|
||||||
|
association.setAttribute("xmi.id", assId);
|
||||||
|
association.setAttribute("namespace", CucaDiagramXmiMaker.getModel(diagram));
|
||||||
|
if (Display.isNull(link.getLabel()) == false) {
|
||||||
|
association.setAttribute("name", forXMI(link.getLabel()));
|
||||||
|
}
|
||||||
|
|
||||||
|
final Element connection = document.createElement("UML:Association.connection");
|
||||||
|
final Element end1 = document.createElement("UML:AssociationEnd");
|
||||||
|
end1.setAttribute("xmi.id", "end" + UniqueSequence.getValue());
|
||||||
|
end1.setAttribute("association", assId);
|
||||||
|
end1.setAttribute("type", link.getEntity1().getUid());
|
||||||
|
if (link.getQualifier1() != null) {
|
||||||
|
end1.setAttribute("name", forXMI(link.getQualifier1()));
|
||||||
|
}
|
||||||
|
final Element endparticipant1 = document.createElement("UML:AssociationEnd.participant");
|
||||||
|
|
||||||
|
if (link.getType().getDecor2() == LinkDecor.COMPOSITION) {
|
||||||
|
end1.setAttribute("aggregation", "composite");
|
||||||
|
}
|
||||||
|
if (link.getType().getDecor2() == LinkDecor.AGREGATION) {
|
||||||
|
end1.setAttribute("aggregation", "aggregate");
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
end1.appendChild(endparticipant1);
|
||||||
|
connection.appendChild(end1);
|
||||||
|
|
||||||
|
final Element end2 = document.createElement("UML:AssociationEnd");
|
||||||
|
end2.setAttribute("xmi.id", "end" + UniqueSequence.getValue());
|
||||||
|
end2.setAttribute("association", assId);
|
||||||
|
end2.setAttribute("type", link.getEntity2().getUid());
|
||||||
|
if (link.getQualifier2() != null) {
|
||||||
|
end2.setAttribute("name", forXMI(link.getQualifier2()));
|
||||||
|
}
|
||||||
|
final Element endparticipant2 = document.createElement("UML:AssociationEnd.participant");
|
||||||
|
if (link.getType().getDecor1() == LinkDecor.COMPOSITION) {
|
||||||
|
end2.setAttribute("aggregation", "composite");
|
||||||
|
}
|
||||||
|
if (link.getType().getDecor1() == LinkDecor.AGREGATION) {
|
||||||
|
end2.setAttribute("aggregation", "aggregate");
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
end2.appendChild(endparticipant2);
|
||||||
|
connection.appendChild(end2);
|
||||||
|
|
||||||
|
association.appendChild(connection);
|
||||||
|
|
||||||
|
ownedElement.appendChild(association);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Element createEntityNode(IEntity entity) {
|
||||||
|
final Element cla = document.createElement("UML:Component");
|
||||||
|
|
||||||
|
cla.setAttribute("xmi.id", entity.getUid());
|
||||||
|
cla.setAttribute("name", entity.getDisplay().get(0).toString());
|
||||||
|
cla.setAttribute("namespace", CucaDiagramXmiMaker.getModel(diagram));
|
||||||
|
|
||||||
|
final Element feature = document.createElement("UML:Classifier.feature");
|
||||||
|
cla.appendChild(feature);
|
||||||
|
|
||||||
|
for (Member m : entity.getBodier().getFieldsToDisplay()) {
|
||||||
|
final Element attribute = document.createElement("UML:Attribute");
|
||||||
|
attribute.setAttribute("xmi.id", "att" + UniqueSequence.getValue());
|
||||||
|
attribute.setAttribute("name", m.getDisplay(false));
|
||||||
|
feature.appendChild(attribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Member m : entity.getBodier().getMethodsToDisplay()) {
|
||||||
|
final Element operation = document.createElement("UML:Operation");
|
||||||
|
operation.setAttribute("xmi.id", "att" + UniqueSequence.getValue());
|
||||||
|
operation.setAttribute("name", m.getDisplay(false));
|
||||||
|
feature.appendChild(operation);
|
||||||
|
}
|
||||||
|
return cla;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void transformerXml(OutputStream os) throws TransformerException, ParserConfigurationException {
|
||||||
|
final Source source = new DOMSource(document);
|
||||||
|
|
||||||
|
final Result resultat = new StreamResult(os);
|
||||||
|
|
||||||
|
final TransformerFactory fabrique = TransformerFactory.newInstance();
|
||||||
|
final Transformer transformer = fabrique.newTransformer();
|
||||||
|
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||||
|
// transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
|
||||||
|
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
|
||||||
|
// tf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
||||||
|
transformer.transform(source, resultat);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user