mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 10:59:01 +00:00
version 8043
This commit is contained in:
parent
fd538b5fe8
commit
446f3d9a18
@ -60,7 +60,7 @@
|
|||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
|
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
|
||||||
<attribute name="SplashScreen-Image" value="net/sourceforge/plantuml/version/logo.png" />
|
<attribute name="SplashScreen-Image" value="net/sourceforge/plantuml/version/logo.png" />
|
||||||
<attribute name="Class-Path" value="batik-all-1.7.jar fop.jar" />
|
<attribute name="Class-Path" value="batik-all-1.7.jar fop.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
|
||||||
</manifest>
|
</manifest>
|
||||||
</jar>
|
</jar>
|
||||||
<delete dir="build" />
|
<delete dir="build" />
|
||||||
|
2
pom.xml
2
pom.xml
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<groupId>net.sourceforge.plantuml</groupId>
|
<groupId>net.sourceforge.plantuml</groupId>
|
||||||
<artifactId>plantuml</artifactId>
|
<artifactId>plantuml</artifactId>
|
||||||
<version>8042-SNAPSHOT</version>
|
<version>8043-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>PlantUML</name>
|
<name>PlantUML</name>
|
||||||
|
@ -38,9 +38,8 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.command.regex.Matcher2;
|
import net.sourceforge.plantuml.command.regex.Matcher2;
|
||||||
import net.sourceforge.plantuml.command.regex.MyPattern;
|
|
||||||
import net.sourceforge.plantuml.command.regex.Pattern2;
|
|
||||||
import net.sourceforge.plantuml.core.Diagram;
|
import net.sourceforge.plantuml.core.Diagram;
|
||||||
|
import net.sourceforge.plantuml.utils.StartUtils;
|
||||||
|
|
||||||
public class BlockUml {
|
public class BlockUml {
|
||||||
|
|
||||||
@ -48,8 +47,6 @@ public class BlockUml {
|
|||||||
private final int startLine;
|
private final int startLine;
|
||||||
private Diagram system;
|
private Diagram system;
|
||||||
|
|
||||||
private static final Pattern2 patternFilename = MyPattern.cmpile("^@start[^%s{}%g]+[%s{][%s%g]*([^%g]*?)[%s}%g]*$");
|
|
||||||
|
|
||||||
BlockUml(String... strings) {
|
BlockUml(String... strings) {
|
||||||
this(convert(strings), 0);
|
this(convert(strings), 0);
|
||||||
}
|
}
|
||||||
@ -81,7 +78,7 @@ public class BlockUml {
|
|||||||
public BlockUml(List<CharSequence2> strings, int startLine) {
|
public BlockUml(List<CharSequence2> strings, int startLine) {
|
||||||
this.startLine = startLine;
|
this.startLine = startLine;
|
||||||
final CharSequence2 s0 = strings.get(0).trin();
|
final CharSequence2 s0 = strings.get(0).trin();
|
||||||
if (s0.startsWith("@start") == false) {
|
if (StartUtils.startsWithSymbolAnd("start", s0) == false) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
this.data = new ArrayList<CharSequence2>(strings);
|
this.data = new ArrayList<CharSequence2>(strings);
|
||||||
@ -91,7 +88,7 @@ public class BlockUml {
|
|||||||
if (OptionFlags.getInstance().isWord()) {
|
if (OptionFlags.getInstance().isWord()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final Matcher2 m = patternFilename.matcher(StringUtils.trin(data.get(0).toString()));
|
final Matcher2 m = StartUtils.patternFilename.matcher(StringUtils.trin(data.get(0).toString()));
|
||||||
final boolean ok = m.find();
|
final boolean ok = m.find();
|
||||||
if (ok == false) {
|
if (ok == false) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19510 $
|
* Revision $Revision: 19978 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml;
|
package net.sourceforge.plantuml;
|
||||||
@ -132,6 +132,8 @@ public enum ColorParam {
|
|||||||
storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||||
boundaryBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
boundaryBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||||
boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
|
collectionsBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||||
|
collectionsBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
controlBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
controlBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||||
controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||||
entityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
entityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19896 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml;
|
package net.sourceforge.plantuml;
|
||||||
@ -39,7 +39,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
|
||||||
public class FileSystem {
|
public class FileSystem {
|
||||||
|
|
||||||
private final static FileSystem singleton = new FileSystem();
|
private final static FileSystem singleton = new FileSystem();
|
||||||
@ -92,10 +91,11 @@ public class FileSystem {
|
|||||||
|
|
||||||
private List<File> getPath(String prop) {
|
private List<File> getPath(String prop) {
|
||||||
final List<File> result = new ArrayList<File>();
|
final List<File> result = new ArrayList<File>();
|
||||||
final String paths = System.getProperty(prop);
|
String paths = System.getProperty(prop);
|
||||||
if (paths == null) {
|
if (paths == null) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
paths = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(paths);
|
||||||
final StringTokenizer st = new StringTokenizer(paths, System.getProperty("path.separator"));
|
final StringTokenizer st = new StringTokenizer(paths, System.getProperty("path.separator"));
|
||||||
while (st.hasMoreTokens()) {
|
while (st.hasMoreTokens()) {
|
||||||
final File f = new File(st.nextToken());
|
final File f = new File(st.nextToken());
|
||||||
|
@ -42,10 +42,12 @@ public enum LineParam {
|
|||||||
// sequenceReferenceBorder(0.1),
|
// sequenceReferenceBorder(0.1),
|
||||||
sequenceLifeLineBorder,
|
sequenceLifeLineBorder,
|
||||||
sequenceParticipantBorder, noteBorder, sequenceGroupBorder, sequenceReferenceBorder,
|
sequenceParticipantBorder, noteBorder, sequenceGroupBorder, sequenceReferenceBorder,
|
||||||
|
sequenceArrow,
|
||||||
classBorder, objectBorder,
|
classBorder, objectBorder,
|
||||||
partitionBorder,
|
partitionBorder,
|
||||||
packageBorder,
|
packageBorder,
|
||||||
swimlaneBorder;
|
swimlaneBorder,
|
||||||
|
activityBorder;
|
||||||
// sequenceBoxBorder(0.1);
|
// sequenceBoxBorder(0.1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -68,11 +68,20 @@ public class SourceStringReader {
|
|||||||
this(defines, source, "UTF-8", config);
|
this(defines, source, "UTF-8", config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SourceStringReader(String source, File newCurrentDir) {
|
||||||
|
this(new Defines(), source, "UTF-8", Collections.<String> emptyList(), newCurrentDir);
|
||||||
|
}
|
||||||
|
|
||||||
public SourceStringReader(Defines defines, String source, String charset, List<String> config) {
|
public SourceStringReader(Defines defines, String source, String charset, List<String> config) {
|
||||||
|
this(defines, source, charset, config, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SourceStringReader(Defines defines, String source, String charset, List<String> config, File newCurrentDir) {
|
||||||
// WARNING GLOBAL LOCK HERE
|
// WARNING GLOBAL LOCK HERE
|
||||||
synchronized (SourceStringReader.class) {
|
synchronized (SourceStringReader.class) {
|
||||||
try {
|
try {
|
||||||
final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source));
|
final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source),
|
||||||
|
newCurrentDir, null);
|
||||||
this.blocks = builder.getBlockUmls();
|
this.blocks = builder.getBlockUmls();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.error("error " + e);
|
Log.error("error " + e);
|
||||||
|
@ -35,6 +35,7 @@ package net.sourceforge.plantuml.activitydiagram3;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
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.FtileFactory;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
@ -118,8 +119,8 @@ public class Branch {
|
|||||||
return ftile;
|
return ftile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shadowing() {
|
public ISkinParam skinParam() {
|
||||||
return ftile.shadowing();
|
return ftile.skinParam();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final HtmlColor getColor() {
|
public final HtmlColor getColor() {
|
||||||
|
@ -48,7 +48,7 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Ftile createFtile(FtileFactory factory) {
|
public Ftile createFtile(FtileFactory factory) {
|
||||||
return new FtileGoto(factory.shadowing(), getSwimlaneIn(), name);
|
return new FtileGoto(factory.skinParam(), getSwimlaneIn(), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Instruction other) {
|
public void add(Instruction other) {
|
||||||
|
@ -48,7 +48,7 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Ftile createFtile(FtileFactory factory) {
|
public Ftile createFtile(FtileFactory factory) {
|
||||||
return new FtileLabel(factory.shadowing(), getSwimlaneIn(), name);
|
return new FtileLabel(factory.skinParam(), getSwimlaneIn(), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Instruction other) {
|
public void add(Instruction other) {
|
||||||
|
@ -78,7 +78,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
|
|||||||
|
|
||||||
public Ftile createFtile(FtileFactory factory) {
|
public Ftile createFtile(FtileFactory factory) {
|
||||||
if (all.size() == 0) {
|
if (all.size() == 0) {
|
||||||
return new FtileEmpty(factory.shadowing(), defaultSwimlane);
|
return new FtileEmpty(factory.skinParam(), defaultSwimlane);
|
||||||
}
|
}
|
||||||
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn());
|
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn());
|
||||||
for (Instruction ins : all) {
|
for (Instruction ins : all) {
|
||||||
|
@ -36,21 +36,34 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
|
import net.sourceforge.plantuml.LineParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
|
public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
|
||||||
|
|
||||||
private final boolean shadowing;
|
private final boolean shadowing;
|
||||||
|
private final ISkinParam skinParam;
|
||||||
|
|
||||||
public AbstractFtile(boolean shadowing) {
|
private AbstractFtile(boolean shadowing) {
|
||||||
this.shadowing = shadowing;
|
this.shadowing = shadowing;
|
||||||
|
this.skinParam = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public boolean shadowing() {
|
public AbstractFtile(ISkinParam skinParam) {
|
||||||
return shadowing;
|
this.shadowing = skinParam.shadowing();
|
||||||
|
this.skinParam = skinParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
final public ISkinParam skinParam() {
|
||||||
|
if (skinParam == null) {
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
return skinParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LinkRendering getInLinkRendering() {
|
public LinkRendering getInLinkRendering() {
|
||||||
@ -69,4 +82,12 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final UStroke getThickness() {
|
||||||
|
UStroke thickness = skinParam.getThickness(LineParam.activityBorder, null);
|
||||||
|
if (thickness == null) {
|
||||||
|
thickness = new UStroke(1.5);
|
||||||
|
}
|
||||||
|
return thickness;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,14 +35,18 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
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.ugraphic.UStroke;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public interface Ftile extends Swimable, TextBlock {
|
public interface Ftile extends Swimable, TextBlock {
|
||||||
|
|
||||||
public boolean shadowing();
|
public UStroke getThickness();
|
||||||
|
|
||||||
|
public ISkinParam skinParam();
|
||||||
|
|
||||||
public LinkRendering getInLinkRendering();
|
public LinkRendering getInLinkRendering();
|
||||||
|
|
||||||
|
@ -39,10 +39,12 @@ import java.util.Collections;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
||||||
@ -132,8 +134,12 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
|||||||
return Collections.unmodifiableSet(result);
|
return Collections.unmodifiableSet(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shadowing() {
|
public ISkinParam skinParam() {
|
||||||
return tile1.shadowing() || tile2.shadowing();
|
return tile1.skinParam();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UStroke getThickness() {
|
||||||
|
return tile1.getThickness();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ import java.util.Collections;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
|
||||||
@ -47,12 +48,12 @@ public class FtileEmpty extends AbstractFtile {
|
|||||||
private final Swimlane swimlaneIn;
|
private final Swimlane swimlaneIn;
|
||||||
private final Swimlane swimlaneOut;
|
private final Swimlane swimlaneOut;
|
||||||
|
|
||||||
public FtileEmpty(boolean shadowing, double width, double height) {
|
public FtileEmpty(ISkinParam skinParam, double width, double height) {
|
||||||
this(shadowing, width, height, null, null);
|
this(skinParam, width, height, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileEmpty(boolean shadowing, double width, double height, Swimlane swimlaneIn, Swimlane swimlaneOut) {
|
public FtileEmpty(ISkinParam skinParam, double width, double height, Swimlane swimlaneIn, Swimlane swimlaneOut) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.swimlaneIn = swimlaneIn;
|
this.swimlaneIn = swimlaneIn;
|
||||||
@ -60,12 +61,12 @@ public class FtileEmpty extends AbstractFtile {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileEmpty(boolean shadowing) {
|
public FtileEmpty(ISkinParam skinParam) {
|
||||||
this(shadowing, 0, 0, null, null);
|
this(skinParam, 0, 0, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileEmpty(boolean shadowing, Swimlane swimlane) {
|
public FtileEmpty(ISkinParam skinParam, Swimlane swimlane) {
|
||||||
this(shadowing, 0, 0, swimlane, swimlane);
|
this(skinParam, 0, 0, swimlane, swimlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -35,7 +35,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ISkinSimple;
|
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.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
@ -46,11 +46,11 @@ import net.sourceforge.plantuml.graphic.color.Colors;
|
|||||||
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
||||||
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
||||||
|
|
||||||
public interface FtileFactory extends ISkinSimple {
|
public interface FtileFactory {
|
||||||
|
|
||||||
public StringBounder getStringBounder();
|
public StringBounder getStringBounder();
|
||||||
|
|
||||||
public boolean shadowing();
|
public ISkinParam skinParam();
|
||||||
|
|
||||||
public Ftile start(Swimlane swimlane);
|
public Ftile start(Swimlane swimlane);
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ 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.HtmlColorAndStyle;
|
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
|
||||||
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;
|
||||||
@ -54,24 +53,23 @@ import net.sourceforge.plantuml.graphic.color.Colors;
|
|||||||
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
||||||
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
||||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||||
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
|
|
||||||
|
|
||||||
public class FtileFactoryDelegator implements FtileFactory {
|
public class FtileFactoryDelegator implements FtileFactory {
|
||||||
|
|
||||||
private final FtileFactory factory;
|
private final FtileFactory factory;
|
||||||
private final ISkinParam skinParam;
|
|
||||||
private final Rose rose = new Rose();
|
private final Rose rose = new Rose();
|
||||||
|
|
||||||
protected final Rainbow getInLinkRenderingColor(Ftile tile) {
|
protected final Rainbow getInLinkRenderingColor(Ftile tile) {
|
||||||
Rainbow color;
|
Rainbow color;
|
||||||
final LinkRendering linkRendering = tile.getInLinkRendering();
|
final LinkRendering linkRendering = tile.getInLinkRendering();
|
||||||
if (linkRendering == null) {
|
if (linkRendering == null) {
|
||||||
color = HtmlColorAndStyle.build(getSkinParam());
|
color = HtmlColorAndStyle.build(skinParam());
|
||||||
} else {
|
} else {
|
||||||
color = linkRendering.getRainbow();
|
color = linkRendering.getRainbow();
|
||||||
}
|
}
|
||||||
if (color.size() == 0) {
|
if (color.size() == 0) {
|
||||||
color = HtmlColorAndStyle.build(getSkinParam());
|
color = HtmlColorAndStyle.build(skinParam());
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
@ -80,9 +78,8 @@ public class FtileFactoryDelegator implements FtileFactory {
|
|||||||
if (Display.isNull(display)) {
|
if (Display.isNull(display)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final ISkinParam skinParam = getSkinParam();
|
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||||
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.ACTIVITY_ARROW, null);
|
return display.create(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
|
||||||
return display.create(fontConfiguration, HorizontalAlignment.LEFT, this, CreoleMode.SIMPLE_LINE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Display getInLinkRenderingDisplay(Ftile tile) {
|
protected Display getInLinkRenderingDisplay(Ftile tile) {
|
||||||
@ -93,9 +90,8 @@ public class FtileFactoryDelegator implements FtileFactory {
|
|||||||
return linkRendering.getDisplay();
|
return linkRendering.getDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileFactoryDelegator(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegator(FtileFactory factory) {
|
||||||
this.factory = factory;
|
this.factory = factory;
|
||||||
this.skinParam = skinParam;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile start(Swimlane swimlane) {
|
public Ftile start(Swimlane swimlane) {
|
||||||
@ -172,48 +168,15 @@ public class FtileFactoryDelegator implements FtileFactory {
|
|||||||
return factory.getStringBounder();
|
return factory.getStringBounder();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final ISkinParam getSkinParam() {
|
|
||||||
return skinParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final Rose getRose() {
|
protected final Rose getRose() {
|
||||||
return rose;
|
return rose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shadowing() {
|
public final ISkinParam skinParam() {
|
||||||
return skinParam.shadowing();
|
return factory.skinParam();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FtileFactory getFactory() {
|
protected FtileFactory getFactory() {
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sprite getSprite(String name) {
|
|
||||||
return skinParam.getSprite(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue(String key) {
|
|
||||||
return skinParam.getValue(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getPadding() {
|
|
||||||
return skinParam.getPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean useGuillemet() {
|
|
||||||
return skinParam.useGuillemet();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMonospacedFamily() {
|
|
||||||
return skinParam.getMonospacedFamily();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTabSize() {
|
|
||||||
return skinParam.getTabSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IHtmlColorSet getIHtmlColorSet() {
|
|
||||||
return skinParam.getIHtmlColorSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,15 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
|
|
||||||
public class FtileGoto extends FtileEmpty {
|
public class FtileGoto extends FtileEmpty {
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public FtileGoto(boolean shadowing, Swimlane swimlane, String name) {
|
public FtileGoto(ISkinParam skinParam, Swimlane swimlane, String name) {
|
||||||
super(shadowing, swimlane);
|
super(skinParam, swimlane);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class FtileHeightFixed extends AbstractFtile {
|
|||||||
private final double fixedHeight;
|
private final double fixedHeight;
|
||||||
|
|
||||||
public FtileHeightFixed(Ftile tile, double fixedHeight) {
|
public FtileHeightFixed(Ftile tile, double fixedHeight) {
|
||||||
super(tile.shadowing());
|
super(tile.skinParam());
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
this.fixedHeight = fixedHeight;
|
this.fixedHeight = fixedHeight;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public class FtileKilled extends AbstractFtile {
|
|||||||
private final Ftile tile;
|
private final Ftile tile;
|
||||||
|
|
||||||
public FtileKilled(Ftile tileToKill) {
|
public FtileKilled(Ftile tileToKill) {
|
||||||
super(tileToKill.shadowing());
|
super(tileToKill.skinParam());
|
||||||
this.tile = tileToKill;
|
this.tile = tileToKill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,12 +33,14 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
|
|
||||||
public class FtileLabel extends FtileEmpty {
|
public class FtileLabel extends FtileEmpty {
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public FtileLabel(boolean shadowing, Swimlane swimlane, String name) {
|
public FtileLabel(ISkinParam skinParam, Swimlane swimlane, String name) {
|
||||||
super(shadowing, swimlane);
|
super(skinParam, swimlane);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class FtileMarged extends AbstractFtile {
|
|||||||
private final double margin2;
|
private final double margin2;
|
||||||
|
|
||||||
public FtileMarged(Ftile tile, double margin1, double margin2) {
|
public FtileMarged(Ftile tile, double margin1, double margin2) {
|
||||||
super(tile.shadowing());
|
super(tile.skinParam());
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
this.margin1 = margin1;
|
this.margin1 = margin1;
|
||||||
this.margin2 = margin2;
|
this.margin2 = margin2;
|
||||||
|
@ -45,7 +45,7 @@ public class FtileMargedRight extends AbstractFtile {
|
|||||||
private final double maxX;
|
private final double maxX;
|
||||||
|
|
||||||
public FtileMargedRight(Ftile tile, double maxX) {
|
public FtileMargedRight(Ftile tile, double maxX) {
|
||||||
super(tile.shadowing());
|
super(tile.skinParam());
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
this.maxX = maxX;
|
this.maxX = maxX;
|
||||||
}
|
}
|
||||||
|
@ -78,11 +78,11 @@ public class FtileUtils {
|
|||||||
// return new FtileMarged(ftile, margin);
|
// return new FtileMarged(ftile, margin);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private static Ftile neverNull(Ftile ftile) {
|
// private static Ftile neverNull(Ftile ftile, ISkinParam skinParam) {
|
||||||
if (ftile == null) {
|
// if (ftile == null) {
|
||||||
return new FtileEmpty(false);
|
// return new FtileEmpty(skinParam);
|
||||||
}
|
// }
|
||||||
return ftile;
|
// return ftile;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -109,15 +109,15 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
|||||||
|
|
||||||
private FtileFactory getFtileFactory() {
|
private FtileFactory getFtileFactory() {
|
||||||
FtileFactory factory = new VCompactFactory(skinParam, TextBlockUtils.getDummyStringBounder());
|
FtileFactory factory = new VCompactFactory(skinParam, TextBlockUtils.getDummyStringBounder());
|
||||||
factory = new FtileFactoryDelegatorAddUrl(factory, skinParam);
|
factory = new FtileFactoryDelegatorAddUrl(factory);
|
||||||
factory = new FtileFactoryDelegatorAssembly(factory, skinParam);
|
factory = new FtileFactoryDelegatorAssembly(factory);
|
||||||
factory = new FtileFactoryDelegatorIf(factory, skinParam, pragma);
|
factory = new FtileFactoryDelegatorIf(factory, pragma);
|
||||||
factory = new FtileFactoryDelegatorWhile(factory, skinParam);
|
factory = new FtileFactoryDelegatorWhile(factory);
|
||||||
factory = new FtileFactoryDelegatorRepeat(factory, skinParam);
|
factory = new FtileFactoryDelegatorRepeat(factory);
|
||||||
factory = new FtileFactoryDelegatorCreateFork(factory, skinParam);
|
factory = new FtileFactoryDelegatorCreateFork(factory);
|
||||||
factory = new FtileFactoryDelegatorCreateSplit(factory, skinParam);
|
factory = new FtileFactoryDelegatorCreateSplit(factory);
|
||||||
factory = new FtileFactoryDelegatorAddNote(factory, skinParam);
|
factory = new FtileFactoryDelegatorAddNote(factory);
|
||||||
factory = new FtileFactoryDelegatorCreateGroup(factory, skinParam);
|
factory = new FtileFactoryDelegatorCreateGroup(factory);
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,10 +179,16 @@ public class WormMutation {
|
|||||||
|
|
||||||
public UChange getGlobalTranslate(int size) {
|
public UChange getGlobalTranslate(int size) {
|
||||||
final MinMax result = new MinMax();
|
final MinMax result = new MinMax();
|
||||||
for (UTranslate tr : translations) {
|
if (translations.get(0).getDy() == 0) {
|
||||||
result.append(tr.getDx());
|
for (UTranslate tr : translations) {
|
||||||
|
result.append(tr.getDx());
|
||||||
|
}
|
||||||
|
return new UTranslate(-result.getExtreme() * (size - 1) / 2.0, 0);
|
||||||
}
|
}
|
||||||
return new UTranslate(-result.getExtreme() * (size - 1) / 2.0, 0);
|
for (UTranslate tr : translations) {
|
||||||
|
result.append(tr.getDy());
|
||||||
|
}
|
||||||
|
return new UTranslate(0, -result.getExtreme() * (size - 1) / 2.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Worm mute(Worm original) {
|
public Worm mute(Worm original) {
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
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.FtileFactory;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||||
@ -44,8 +43,8 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
|
|||||||
|
|
||||||
public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
|
public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
|
||||||
|
|
||||||
public FtileFactoryDelegatorAddNote(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorAddNote(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -54,8 +53,8 @@ public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
|
|||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
if (ftile == null) {
|
if (ftile == null) {
|
||||||
return new FtileNoteAlone(getSkinParam().shadowing(), note, getSkinParam(), type == NoteType.NOTE, swimlane);
|
return new FtileNoteAlone(skinParam().shadowing(), note, skinParam(), type == NoteType.NOTE, swimlane);
|
||||||
}
|
}
|
||||||
return new FtileWithNoteOpale(ftile, note, notePosition, type, getSkinParam(), true);
|
return new FtileWithNoteOpale(ftile, note, notePosition, type, skinParam(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
import net.sourceforge.plantuml.Url;
|
import net.sourceforge.plantuml.Url;
|
||||||
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.FtileFactory;
|
||||||
@ -43,8 +42,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBox;
|
|||||||
|
|
||||||
public class FtileFactoryDelegatorAddUrl extends FtileFactoryDelegator {
|
public class FtileFactoryDelegatorAddUrl extends FtileFactoryDelegator {
|
||||||
|
|
||||||
public FtileFactoryDelegatorAddUrl(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorAddUrl(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
|||||||
|
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
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.FtileFactory;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||||
@ -50,8 +49,8 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
|||||||
|
|
||||||
public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
|
public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
|
||||||
|
|
||||||
public FtileFactoryDelegatorAssembly(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorAssembly(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,7 +39,6 @@ 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;
|
||||||
@ -70,14 +69,14 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
|||||||
|
|
||||||
private final Rose rose = new Rose();
|
private final Rose rose = new Rose();
|
||||||
|
|
||||||
public FtileFactoryDelegatorCreateFork(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorCreateFork(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
||||||
final HtmlColor colorBar = rose.getHtmlColor(getSkinParam(), ColorParam.activityBar);
|
final HtmlColor colorBar = rose.getHtmlColor(skinParam(), ColorParam.activityBar);
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||||
|
|
||||||
final Dimension2D dimSuper = super.createFork(swimlane, all).calculateDimension(getStringBounder());
|
final Dimension2D dimSuper = super.createFork(swimlane, all).calculateDimension(getStringBounder());
|
||||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||||
@ -91,7 +90,7 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
|||||||
|
|
||||||
final List<Connection> conns = new ArrayList<Connection>();
|
final List<Connection> conns = new ArrayList<Connection>();
|
||||||
|
|
||||||
final Ftile black = new FtileBlackBlock(shadowing(), colorBar, list.get(0).getSwimlaneIn());
|
final Ftile black = new FtileBlackBlock(skinParam(), colorBar, list.get(0).getSwimlaneIn());
|
||||||
double x = 0;
|
double x = 0;
|
||||||
for (Ftile tmp : list) {
|
for (Ftile tmp : list) {
|
||||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ColorParam;
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
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.FtileFactory;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||||
@ -46,15 +45,15 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
|
|||||||
|
|
||||||
private final Rose rose = new Rose();
|
private final Rose rose = new Rose();
|
||||||
|
|
||||||
public FtileFactoryDelegatorCreateGroup(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorCreateGroup(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
|
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
|
||||||
HtmlColor borderColor) {
|
HtmlColor borderColor) {
|
||||||
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
final HtmlColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.activityArrow);
|
||||||
return new FtileGroup(list, name, headerNote, arrowColor, backColor, titleColor, getSkinParam(), borderColor);
|
return new FtileGroup(list, name, headerNote, arrowColor, backColor, titleColor, skinParam(), borderColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
import net.sourceforge.plantuml.OptionFlags;
|
import net.sourceforge.plantuml.OptionFlags;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||||
@ -73,8 +72,8 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
|||||||
|
|
||||||
private final Rose rose = new Rose();
|
private final Rose rose = new Rose();
|
||||||
|
|
||||||
public FtileFactoryDelegatorCreateSplit(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorCreateSplit(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
static private boolean isSimpleSwimlanes(List<Ftile> all) {
|
static private boolean isSimpleSwimlanes(List<Ftile> all) {
|
||||||
@ -121,7 +120,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
|||||||
// // } else if (isSeveralSwimlanes(all)) {
|
// // } else if (isSeveralSwimlanes(all)) {
|
||||||
// // return severalSwimlanes(all);
|
// // return severalSwimlanes(all);
|
||||||
// }
|
// }
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||||
|
|
||||||
final Dimension2D dimSuper = super.createSplit(all).calculateDimension(getStringBounder());
|
final Dimension2D dimSuper = super.createSplit(all).calculateDimension(getStringBounder());
|
||||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||||
@ -208,7 +207,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Ftile simpleSwimlanes(List<Ftile> all) {
|
private Ftile simpleSwimlanes(List<Ftile> all) {
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||||
|
|
||||||
final Dimension2D dimSuper = new FtileSplit1(all).calculateDimension(getStringBounder());
|
final Dimension2D dimSuper = new FtileSplit1(all).calculateDimension(getStringBounder());
|
||||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||||
|
@ -37,7 +37,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import net.sourceforge.plantuml.ColorParam;
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
import net.sourceforge.plantuml.FontParam;
|
import net.sourceforge.plantuml.FontParam;
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
import net.sourceforge.plantuml.Pragma;
|
import net.sourceforge.plantuml.Pragma;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
@ -56,8 +55,8 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
|||||||
|
|
||||||
private final Pragma pragma;
|
private final Pragma pragma;
|
||||||
|
|
||||||
public FtileFactoryDelegatorIf(FtileFactory factory, ISkinParam skinParam, Pragma pragma) {
|
public FtileFactoryDelegatorIf(FtileFactory factory, Pragma pragma) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
this.pragma = pragma;
|
this.pragma = pragma;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,15 +64,15 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
|||||||
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) {
|
||||||
|
|
||||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
|
||||||
final Branch branch0 = thens.get(0);
|
final Branch branch0 = thens.get(0);
|
||||||
|
|
||||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||||
final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(getSkinParam(),
|
final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
|
||||||
ColorParam.activityBackground) : branch0.getColor();
|
ColorParam.activityBackground) : branch0.getColor();
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||||
|
|
||||||
final FontConfiguration fcArrow = new FontConfiguration(getSkinParam(), FontParam.ACTIVITY_ARROW, null);
|
final FontConfiguration fcArrow = new FontConfiguration(skinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||||
// .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
|
// .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
|
||||||
if (thens.size() > 1) {
|
if (thens.size() > 1) {
|
||||||
if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */)
|
if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */)
|
||||||
@ -84,15 +83,15 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
|||||||
}
|
}
|
||||||
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
||||||
: FontParam.ACTIVITY_ARROW;
|
: FontParam.ACTIVITY_ARROW;
|
||||||
final FontConfiguration fcTest = new FontConfiguration(getSkinParam(), testParam, null)
|
final FontConfiguration fcTest = new FontConfiguration(skinParam(), testParam, null)
|
||||||
.changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
|
.changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
|
||||||
|
|
||||||
return ConditionalBuilder.create(swimlane, borderColor, backColor, arrowColor, getFactory(), conditionStyle,
|
return ConditionalBuilder.create(swimlane, borderColor, backColor, arrowColor, getFactory(), conditionStyle,
|
||||||
thens.get(0), elseBranch, getSkinParam(), getStringBounder(), fcArrow, fcTest);
|
thens.get(0), elseBranch, skinParam(), getStringBounder(), fcArrow, fcTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HtmlColor fontColor(FontParam param) {
|
private HtmlColor fontColor(FontParam param) {
|
||||||
return getSkinParam().getFontHtmlColor(null, param);
|
return skinParam().getFontHtmlColor(null, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
|||||||
|
|
||||||
import net.sourceforge.plantuml.ColorParam;
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
import net.sourceforge.plantuml.FontParam;
|
import net.sourceforge.plantuml.FontParam;
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
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.FtileFactory;
|
||||||
@ -50,29 +49,28 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
|
|||||||
|
|
||||||
public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
|
public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
|
||||||
|
|
||||||
public FtileFactoryDelegatorRepeat(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorRepeat(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
||||||
HtmlColor color, LinkRendering backRepeatLinkRendering) {
|
HtmlColor color, LinkRendering backRepeatLinkRendering) {
|
||||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
|
||||||
|
|
||||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
|
final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityBackground)
|
||||||
ColorParam.activityBackground) : color;
|
: color;
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||||
|
|
||||||
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
|
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
|
||||||
final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering
|
final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getRainbow();
|
||||||
.getRainbow();
|
|
||||||
|
|
||||||
final FontParam fontParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
final FontParam fontParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
||||||
: FontParam.ACTIVITY_ARROW;
|
: FontParam.ACTIVITY_ARROW;
|
||||||
final FontConfiguration fc = new FontConfiguration(getSkinParam(), fontParam, null);
|
final FontConfiguration fc = new FontConfiguration(skinParam(), fontParam, null);
|
||||||
|
|
||||||
return FtileRepeat.create(backRepeatLinkRendering, swimlane, swimlaneOut, repeat, test, yes, out, borderColor,
|
return FtileRepeat.create(backRepeatLinkRendering, swimlane, swimlaneOut, repeat, test, yes, out, borderColor,
|
||||||
backColor, arrowColor, endRepeatLinkColor, conditionStyle, this, fc);
|
backColor, arrowColor, endRepeatLinkColor, conditionStyle, this.skinParam(), fc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
|||||||
|
|
||||||
import net.sourceforge.plantuml.ColorParam;
|
import net.sourceforge.plantuml.ColorParam;
|
||||||
import net.sourceforge.plantuml.FontParam;
|
import net.sourceforge.plantuml.FontParam;
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
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.FtileFactory;
|
||||||
@ -50,28 +49,28 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
|
|||||||
|
|
||||||
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
|
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
|
||||||
|
|
||||||
public FtileFactoryDelegatorWhile(FtileFactory factory, ISkinParam skinParam) {
|
public FtileFactoryDelegatorWhile(FtileFactory factory) {
|
||||||
super(factory, skinParam);
|
super(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
|
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
|
||||||
LinkRendering afterEndwhile, HtmlColor color) {
|
LinkRendering afterEndwhile, HtmlColor color) {
|
||||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
|
final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(),
|
||||||
ColorParam.activityBackground) : color;
|
ColorParam.activityBackground) : color;
|
||||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||||
|
|
||||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
|
||||||
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
||||||
: FontParam.ACTIVITY_ARROW;
|
: FontParam.ACTIVITY_ARROW;
|
||||||
final FontConfiguration fcTest = new FontConfiguration(getSkinParam(), testParam, null);
|
final FontConfiguration fcTest = new FontConfiguration(skinParam(), testParam, null);
|
||||||
|
|
||||||
final LinkRendering endInlinkRendering = whileBlock.getOutLinkRendering();
|
final LinkRendering endInlinkRendering = whileBlock.getOutLinkRendering();
|
||||||
final Rainbow endInlinkColor = endInlinkRendering == null || endInlinkRendering.getRainbow().size() == 0 ? arrowColor
|
final Rainbow endInlinkColor = endInlinkRendering == null || endInlinkRendering.getRainbow().size() == 0 ? arrowColor
|
||||||
: endInlinkRendering.getRainbow();
|
: endInlinkRendering.getRainbow();
|
||||||
|
|
||||||
final FontConfiguration fontArrow = new FontConfiguration(getSkinParam(), FontParam.ACTIVITY_ARROW, null);
|
final FontConfiguration fontArrow = new FontConfiguration(skinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||||
|
|
||||||
return FtileWhile.create(swimlane, whileBlock, test, borderColor, backColor, arrowColor, yes, out,
|
return FtileWhile.create(swimlane, whileBlock, test, borderColor, backColor, arrowColor, yes, out,
|
||||||
endInlinkColor, afterEndwhile, fontArrow, getFactory(), conditionStyle, fcTest);
|
endInlinkColor, afterEndwhile, fontArrow, getFactory(), conditionStyle, fcTest);
|
||||||
|
@ -54,7 +54,7 @@ class FtileForkInner extends AbstractFtile {
|
|||||||
private final List<Ftile> forks = new ArrayList<Ftile>();
|
private final List<Ftile> forks = new ArrayList<Ftile>();
|
||||||
|
|
||||||
public FtileForkInner(List<Ftile> forks) {
|
public FtileForkInner(List<Ftile> forks) {
|
||||||
super(forks.get(0).shadowing());
|
super(forks.get(0).skinParam());
|
||||||
for (Ftile ftile : forks) {
|
for (Ftile ftile : forks) {
|
||||||
this.forks.add(ftile);
|
this.forks.add(ftile);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class FtileGroup extends AbstractFtile {
|
|||||||
|
|
||||||
public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor arrowColor, HtmlColor backColor,
|
public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor arrowColor, HtmlColor backColor,
|
||||||
HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor) {
|
HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor) {
|
||||||
super(inner.shadowing());
|
super(inner.skinParam());
|
||||||
this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
|
this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
|
||||||
this.inner = FtileUtils.addHorizontalMargin(inner, 10);
|
this.inner = FtileUtils.addHorizontalMargin(inner, 10);
|
||||||
this.arrowColor = arrowColor;
|
this.arrowColor = arrowColor;
|
||||||
@ -185,7 +185,7 @@ public class FtileGroup extends AbstractFtile {
|
|||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||||
|
|
||||||
final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(shadowing())
|
final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(skinParam().shadowing())
|
||||||
.withStroke(stroke);
|
.withStroke(stroke);
|
||||||
USymbol.FRAME.asBig(name, TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext)
|
USymbol.FRAME.asBig(name, TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext)
|
||||||
.drawU(ug);
|
.drawU(ug);
|
||||||
|
@ -83,7 +83,7 @@ class FtileIfAndStop extends AbstractFtile {
|
|||||||
private final Rainbow arrowColor;
|
private final Rainbow arrowColor;
|
||||||
|
|
||||||
private FtileIfAndStop(Ftile diamond1, Ftile tile1, Rainbow arrowColor, Ftile stopFtile) {
|
private FtileIfAndStop(Ftile diamond1, Ftile tile1, Rainbow arrowColor, Ftile stopFtile) {
|
||||||
super(tile1.shadowing());
|
super(tile1.skinParam());
|
||||||
this.diamond1 = diamond1;
|
this.diamond1 = diamond1;
|
||||||
this.tile1 = tile1;
|
this.tile1 = tile1;
|
||||||
this.stop2 = stopFtile;
|
this.stop2 = stopFtile;
|
||||||
@ -130,14 +130,14 @@ class FtileIfAndStop extends AbstractFtile {
|
|||||||
final Sheet sheet = new CreoleParser(fcTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
final Sheet sheet = new CreoleParser(fcTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
||||||
.createSheet(labelTest);
|
.createSheet(labelTest);
|
||||||
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
|
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
|
||||||
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), new UStroke(1.5));
|
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), tileNonStop.getThickness());
|
||||||
|
|
||||||
final Ftile diamond1;
|
final Ftile diamond1;
|
||||||
if (conditionStyle == ConditionStyle.INSIDE) {
|
if (conditionStyle == ConditionStyle.INSIDE) {
|
||||||
diamond1 = new FtileDiamondInside(tileNonStop.shadowing(), backColor, borderColor, swimlane, tbTest);
|
diamond1 = new FtileDiamondInside(tileNonStop.skinParam(), backColor, borderColor, swimlane, tbTest);
|
||||||
// .withWest(tb1).withEast(tb2);
|
// .withWest(tb1).withEast(tb2);
|
||||||
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
||||||
diamond1 = new FtileDiamond(tileNonStop.shadowing(), backColor, borderColor, swimlane).withNorth(tbTest);
|
diamond1 = new FtileDiamond(tileNonStop.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest);
|
||||||
// .withWest(tb1).withEast(tb2).withNorth(tbTest);
|
// .withWest(tb1).withEast(tb2).withNorth(tbTest);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
@ -81,7 +81,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
|||||||
private final Rainbow arrowColor;
|
private final Rainbow arrowColor;
|
||||||
|
|
||||||
private FtileIfLongHorizontal(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, Rainbow arrowColor) {
|
private FtileIfLongHorizontal(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, Rainbow arrowColor) {
|
||||||
super(tiles.get(0).shadowing() || tile2.shadowing());
|
super(tiles.get(0).skinParam());
|
||||||
if (diamonds.size() != tiles.size()) {
|
if (diamonds.size() != tiles.size()) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
@ -148,15 +148,15 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
|||||||
|
|
||||||
List<Ftile> diamonds = new ArrayList<Ftile>();
|
List<Ftile> diamonds = new ArrayList<Ftile>();
|
||||||
for (Branch branch : thens) {
|
for (Branch branch : thens) {
|
||||||
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.shadowing(), backColor, borderColor, swimlane,
|
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.skinParam(), backColor, borderColor, swimlane,
|
||||||
tbTest);
|
tbTest);
|
||||||
diamond = diamond.withNorth(tb1);
|
diamond = diamond.withNorth(tb1);
|
||||||
diamonds.add(diamond);
|
diamonds.add(diamond);
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
final int last = diamonds.size() - 1;
|
final int last = diamonds.size() - 1;
|
||||||
diamonds.set(last, ((FtileDiamondInside2) diamonds.get(last)).withEast(tb2));
|
diamonds.set(last, ((FtileDiamondInside2) diamonds.get(last)).withEast(tb2));
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class FtileIfLongVertical extends AbstractFtile {
|
|||||||
|
|
||||||
private FtileIfLongVertical(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, Rainbow arrowColor,
|
private FtileIfLongVertical(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, Rainbow arrowColor,
|
||||||
Ftile lastDiamond) {
|
Ftile lastDiamond) {
|
||||||
super(tiles.get(0).shadowing() || tile2.shadowing());
|
super(tiles.get(0).skinParam());
|
||||||
if (diamonds.size() != tiles.size()) {
|
if (diamonds.size() != tiles.size()) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
@ -149,21 +149,21 @@ class FtileIfLongVertical extends AbstractFtile {
|
|||||||
|
|
||||||
List<Ftile> diamonds = new ArrayList<Ftile>();
|
List<Ftile> diamonds = new ArrayList<Ftile>();
|
||||||
for (Branch branch : thens) {
|
for (Branch branch : thens) {
|
||||||
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
FtileDiamondInside3 diamond = new FtileDiamondInside3(branch.shadowing(), backColor, borderColor, swimlane,
|
FtileDiamondInside3 diamond = new FtileDiamondInside3(branch.skinParam(), backColor, borderColor, swimlane,
|
||||||
tbTest);
|
tbTest);
|
||||||
diamond = diamond.withEast(tb1);
|
diamond = diamond.withEast(tb1);
|
||||||
diamonds.add(diamond);
|
diamonds.add(diamond);
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
final int last = diamonds.size() - 1;
|
final int last = diamonds.size() - 1;
|
||||||
diamonds.set(last, ((FtileDiamondInside3) diamonds.get(last)).withSouth(tb2));
|
diamonds.set(last, ((FtileDiamondInside3) diamonds.get(last)).withSouth(tb2));
|
||||||
|
|
||||||
// diamonds = alignDiamonds(diamonds, ftileFactory.getStringBounder());
|
// diamonds = alignDiamonds(diamonds, ftileFactory.getStringBounder());
|
||||||
|
|
||||||
final Ftile lastDiamond = new FtileDiamond(tiles.get(0).shadowing(), backColor, borderColor, swimlane);
|
final Ftile lastDiamond = new FtileDiamond(tiles.get(0).skinParam(), backColor, borderColor, swimlane);
|
||||||
|
|
||||||
final FtileIfLongVertical result = new FtileIfLongVertical(diamonds, tiles, tile2, arrowColor, lastDiamond);
|
final FtileIfLongVertical result = new FtileIfLongVertical(diamonds, tiles, tile2, arrowColor, lastDiamond);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FtileNoteAlone(boolean shadow, Display note, ISkinParam skinParam, boolean withOutPoint, Swimlane swimlane) {
|
public FtileNoteAlone(boolean shadow, Display note, ISkinParam skinParam, boolean withOutPoint, Swimlane swimlane) {
|
||||||
super(shadow);
|
super(skinParam);
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.withOutPoint = withOutPoint;
|
this.withOutPoint = withOutPoint;
|
||||||
final Rose rose = new Rose();
|
final Rose rose = new Rose();
|
||||||
|
@ -78,7 +78,7 @@ class FtileRepeat extends AbstractFtile {
|
|||||||
private final TextBlock tbTest;
|
private final TextBlock tbTest;
|
||||||
|
|
||||||
private FtileRepeat(Ftile repeat, Ftile diamond1, Ftile diamond2, TextBlock tbTest) {
|
private FtileRepeat(Ftile repeat, Ftile diamond1, Ftile diamond2, TextBlock tbTest) {
|
||||||
super(repeat.shadowing());
|
super(repeat.skinParam());
|
||||||
this.repeat = repeat;
|
this.repeat = repeat;
|
||||||
this.diamond1 = diamond1;
|
this.diamond1 = diamond1;
|
||||||
this.diamond2 = diamond2;
|
this.diamond2 = diamond2;
|
||||||
@ -108,20 +108,20 @@ class FtileRepeat extends AbstractFtile {
|
|||||||
final TextBlock yesTb = yes.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
|
final TextBlock yesTb = yes.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
|
||||||
final TextBlock outTb = out.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
|
final TextBlock outTb = out.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
|
||||||
|
|
||||||
final Ftile diamond1 = new FtileDiamond(repeat.shadowing(), backColor, borderColor, swimlane);
|
final Ftile diamond1 = new FtileDiamond(repeat.skinParam(), backColor, borderColor, swimlane);
|
||||||
final FtileRepeat result;
|
final FtileRepeat result;
|
||||||
if (conditionStyle == ConditionStyle.INSIDE) {
|
if (conditionStyle == ConditionStyle.INSIDE) {
|
||||||
final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlaneOut,
|
final Ftile diamond2 = new FtileDiamondInside(repeat.skinParam(), backColor, borderColor, swimlaneOut,
|
||||||
tbTest).withEast(yesTb).withSouth(outTb);
|
tbTest).withEast(yesTb).withSouth(outTb);
|
||||||
// final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlane,
|
// final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlane,
|
||||||
// tbTest).withEast(yesTb).withSouth(outTb);
|
// tbTest).withEast(yesTb).withSouth(outTb);
|
||||||
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0));
|
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0));
|
||||||
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
||||||
final Ftile diamond2 = new FtileDiamond(repeat.shadowing(), backColor, borderColor, swimlane)
|
final Ftile diamond2 = new FtileDiamond(repeat.skinParam(), backColor, borderColor, swimlane)
|
||||||
.withEast(tbTest);
|
.withEast(tbTest);
|
||||||
result = new FtileRepeat(repeat, diamond1, diamond2, tbTest);
|
result = new FtileRepeat(repeat, diamond1, diamond2, tbTest);
|
||||||
} else if (conditionStyle == ConditionStyle.FOO1) {
|
} else if (conditionStyle == ConditionStyle.FOO1) {
|
||||||
final Ftile diamond2 = new FtileDiamondFoo1(repeat.shadowing(), backColor, borderColor, swimlane, tbTest);
|
final Ftile diamond2 = new FtileDiamondFoo1(repeat.skinParam(), backColor, borderColor, swimlane, tbTest);
|
||||||
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0));
|
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
@ -54,7 +54,7 @@ class FtileSplit1 extends AbstractFtile {
|
|||||||
private final List<Ftile> forks = new ArrayList<Ftile>();
|
private final List<Ftile> forks = new ArrayList<Ftile>();
|
||||||
|
|
||||||
public FtileSplit1(List<Ftile> forks) {
|
public FtileSplit1(List<Ftile> forks) {
|
||||||
super(forks.get(0).shadowing());
|
super(forks.get(0).skinParam());
|
||||||
for (Ftile ftile : forks) {
|
for (Ftile ftile : forks) {
|
||||||
this.forks.add(ftile);
|
this.forks.add(ftile);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ class FtileWhile extends AbstractFtile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private FtileWhile(Ftile whileBlock, Ftile diamond1, TextBlock supplementarySouthText) {
|
private FtileWhile(Ftile whileBlock, Ftile diamond1, TextBlock supplementarySouthText) {
|
||||||
super(whileBlock.shadowing());
|
super(whileBlock.skinParam());
|
||||||
this.whileBlock = whileBlock;
|
this.whileBlock = whileBlock;
|
||||||
this.diamond1 = diamond1;
|
this.diamond1 = diamond1;
|
||||||
this.supplementarySouthText = supplementarySouthText;
|
this.supplementarySouthText = supplementarySouthText;
|
||||||
@ -115,23 +115,23 @@ class FtileWhile extends AbstractFtile {
|
|||||||
LinkRendering afterEndwhile, FontConfiguration fontArrow, FtileFactory ftileFactory,
|
LinkRendering afterEndwhile, FontConfiguration fontArrow, FtileFactory ftileFactory,
|
||||||
ConditionStyle conditionStyle, FontConfiguration fcTest) {
|
ConditionStyle conditionStyle, FontConfiguration fcTest) {
|
||||||
|
|
||||||
final TextBlock yesTb = yes.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock yesTb = yes.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
final TextBlock testTb = test.create(fcTest, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock testTb = test.create(fcTest, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
final TextBlock out = out2.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory);
|
final TextBlock out = out2.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||||
|
|
||||||
final Ftile diamond1;
|
final Ftile diamond1;
|
||||||
final TextBlock supplementarySouthText;
|
final TextBlock supplementarySouthText;
|
||||||
if (conditionStyle == ConditionStyle.INSIDE) {
|
if (conditionStyle == ConditionStyle.INSIDE) {
|
||||||
supplementarySouthText = TextBlockUtils.empty(0, 0);
|
supplementarySouthText = TextBlockUtils.empty(0, 0);
|
||||||
diamond1 = new FtileDiamondInside(whileBlock.shadowing(), backColor, borderColor, swimlane, testTb)
|
diamond1 = new FtileDiamondInside(whileBlock.skinParam(), backColor, borderColor, swimlane, testTb)
|
||||||
.withNorth(yesTb).withWest(out);
|
.withNorth(yesTb).withWest(out);
|
||||||
} else if (conditionStyle == ConditionStyle.FOO1) {
|
} else if (conditionStyle == ConditionStyle.FOO1) {
|
||||||
supplementarySouthText = TextBlockUtils.empty(0, 0);
|
supplementarySouthText = TextBlockUtils.empty(0, 0);
|
||||||
diamond1 = new FtileDiamondFoo1(whileBlock.shadowing(), backColor, borderColor, swimlane, testTb)
|
diamond1 = new FtileDiamondFoo1(whileBlock.skinParam(), backColor, borderColor, swimlane, testTb)
|
||||||
.withNorth(yesTb).withWest(out);
|
.withNorth(yesTb).withWest(out);
|
||||||
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
||||||
supplementarySouthText = createLabel1(test, yes, ftileFactory, fontArrow);
|
supplementarySouthText = createLabel1(test, yes, ftileFactory.skinParam(), fontArrow);
|
||||||
diamond1 = new FtileDiamond(whileBlock.shadowing(), backColor, borderColor, swimlane).withWest(out)
|
diamond1 = new FtileDiamond(whileBlock.skinParam(), backColor, borderColor, swimlane).withWest(out)
|
||||||
.withSouth(supplementarySouthText);
|
.withSouth(supplementarySouthText);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
@ -89,7 +89,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil {
|
|||||||
|
|
||||||
public FtileWithNoteOpale(Ftile tile, Display note, NotePosition notePosition, NoteType type, ISkinParam skinParam,
|
public FtileWithNoteOpale(Ftile tile, Display note, NotePosition notePosition, NoteType type, ISkinParam skinParam,
|
||||||
boolean withLink) {
|
boolean withLink) {
|
||||||
super(tile.shadowing());
|
super(tile.skinParam());
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
this.notePosition = notePosition;
|
this.notePosition = notePosition;
|
||||||
if (type == NoteType.FLOATING_NOTE) {
|
if (type == NoteType.FLOATING_NOTE) {
|
||||||
|
@ -55,14 +55,12 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateIn;
|
|||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOut;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOut;
|
||||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.graphic.color.Colors;
|
import net.sourceforge.plantuml.graphic.color.Colors;
|
||||||
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
||||||
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
||||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||||
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
|
|
||||||
|
|
||||||
public class VCompactFactory implements FtileFactory {
|
public class VCompactFactory implements FtileFactory {
|
||||||
|
|
||||||
@ -81,17 +79,17 @@ public class VCompactFactory implements FtileFactory {
|
|||||||
|
|
||||||
public Ftile start(Swimlane swimlane) {
|
public Ftile start(Swimlane swimlane) {
|
||||||
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityStart);
|
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityStart);
|
||||||
return new FtileCircleStart(shadowing(), color, swimlane);
|
return new FtileCircleStart(skinParam(), color, swimlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile stop(Swimlane swimlane) {
|
public Ftile stop(Swimlane swimlane) {
|
||||||
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
|
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
|
||||||
return new FtileCircleStop(shadowing(), color, swimlane);
|
return new FtileCircleStop(skinParam(), color, swimlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile end(Swimlane swimlane) {
|
public Ftile end(Swimlane swimlane) {
|
||||||
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
|
final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
|
||||||
return new FtileCircleEnd(shadowing(), color, swimlane);
|
return new FtileCircleEnd(skinParam(), color, swimlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors) {
|
public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors) {
|
||||||
@ -99,7 +97,7 @@ public class VCompactFactory implements FtileFactory {
|
|||||||
// final HtmlColor backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityBackground) :
|
// final HtmlColor backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityBackground) :
|
||||||
// color;
|
// color;
|
||||||
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
|
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
|
||||||
return new FtileBox(shadowing(), label, font, swimlane, style, colors.mute(skinParam));
|
return new FtileBox(colors.mute(skinParam), label, font, swimlane, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile addNote(Ftile ftile, Display note, NotePosition notePosition, NoteType type, Swimlane swimlane) {
|
public Ftile addNote(Ftile ftile, Display note, NotePosition notePosition, NoteType type, Swimlane swimlane) {
|
||||||
@ -161,36 +159,8 @@ public class VCompactFactory implements FtileFactory {
|
|||||||
return new FtileDecorateOut(ftile, linkRendering);
|
return new FtileDecorateOut(ftile, linkRendering);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shadowing() {
|
public ISkinParam skinParam() {
|
||||||
return skinParam.shadowing();
|
return skinParam;
|
||||||
}
|
|
||||||
|
|
||||||
public Sprite getSprite(String name) {
|
|
||||||
return skinParam.getSprite(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue(String key) {
|
|
||||||
return skinParam.getValue(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getPadding() {
|
|
||||||
return skinParam.getPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean useGuillemet() {
|
|
||||||
return skinParam.useGuillemet();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMonospacedFamily() {
|
|
||||||
return skinParam.getMonospacedFamily();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTabSize() {
|
|
||||||
return skinParam.getTabSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IHtmlColorSet getIHtmlColorSet() {
|
|
||||||
return skinParam.getIHtmlColorSet();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,6 @@ 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.svek.ConditionStyle;
|
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
|
||||||
|
|
||||||
public class ConditionalBuilder {
|
public class ConditionalBuilder {
|
||||||
|
|
||||||
@ -79,10 +78,9 @@ public class ConditionalBuilder {
|
|||||||
private final Ftile tile1;
|
private final Ftile tile1;
|
||||||
private final Ftile tile2;
|
private final Ftile tile2;
|
||||||
|
|
||||||
public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor,
|
public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||||
Rainbow arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
|
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
|
||||||
Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow,
|
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow, FontConfiguration fontTest) {
|
||||||
FontConfiguration fontTest) {
|
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
@ -101,10 +99,9 @@ public class ConditionalBuilder {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor,
|
static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||||
Rainbow arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
|
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
|
||||||
Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow,
|
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow, FontConfiguration fcTest) {
|
||||||
FontConfiguration fcTest) {
|
|
||||||
final ConditionalBuilder builder = new ConditionalBuilder(swimlane, borderColor, backColor, arrowColor,
|
final ConditionalBuilder builder = new ConditionalBuilder(swimlane, borderColor, backColor, arrowColor,
|
||||||
ftileFactory, conditionStyle, branch1, branch2, skinParam, stringBounder, fcArrow, fcTest);
|
ftileFactory, conditionStyle, branch1, branch2, skinParam, stringBounder, fcArrow, fcTest);
|
||||||
return builder.createWithLinks();
|
return builder.createWithLinks();
|
||||||
@ -159,14 +156,14 @@ public class ConditionalBuilder {
|
|||||||
final Sheet sheet = new CreoleParser(fontTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
final Sheet sheet = new CreoleParser(fontTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
||||||
.createSheet(labelTest);
|
.createSheet(labelTest);
|
||||||
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
|
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
|
||||||
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), new UStroke(1.5));
|
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), tile1.getThickness());
|
||||||
|
|
||||||
final Ftile diamond1;
|
final Ftile diamond1;
|
||||||
if (conditionStyle == ConditionStyle.INSIDE) {
|
if (conditionStyle == ConditionStyle.INSIDE) {
|
||||||
diamond1 = new FtileDiamondInside(tile1.shadowing(), backColor, borderColor, swimlane, tbTest)
|
diamond1 = new FtileDiamondInside(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
|
||||||
.withWestAndEast(tb1, tb2);
|
.withWestAndEast(tb1, tb2);
|
||||||
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
||||||
diamond1 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withNorth(tbTest)
|
diamond1 = new FtileDiamond(tile1.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest)
|
||||||
.withWestAndEast(tb1, tb2);
|
.withWestAndEast(tb1, tb2);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
@ -175,13 +172,13 @@ public class ConditionalBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TextBlock getLabelBranch2() {
|
private TextBlock getLabelBranch2() {
|
||||||
final TextBlock tb2 = branch2.getLabelPositive().create(fontArrow, HorizontalAlignment.LEFT, ftileFactory,
|
final TextBlock tb2 = branch2.getLabelPositive().create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam(),
|
||||||
CreoleMode.SIMPLE_LINE);
|
CreoleMode.SIMPLE_LINE);
|
||||||
return tb2;
|
return tb2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlock getLabelBranch1() {
|
private TextBlock getLabelBranch1() {
|
||||||
final TextBlock tb1 = branch1.getLabelPositive().create(fontArrow, HorizontalAlignment.LEFT, ftileFactory,
|
final TextBlock tb1 = branch1.getLabelPositive().create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam(),
|
||||||
CreoleMode.SIMPLE_LINE);
|
CreoleMode.SIMPLE_LINE);
|
||||||
return tb1;
|
return tb1;
|
||||||
}
|
}
|
||||||
@ -191,16 +188,16 @@ public class ConditionalBuilder {
|
|||||||
if (hasTwoBranches()) {
|
if (hasTwoBranches()) {
|
||||||
final Display out1 = branch1.getFtile().getOutLinkRendering().getDisplay();
|
final Display out1 = branch1.getFtile().getOutLinkRendering().getDisplay();
|
||||||
final TextBlock tbout1 = out1 == null ? null : out1.create(fontArrow, HorizontalAlignment.LEFT,
|
final TextBlock tbout1 = out1 == null ? null : out1.create(fontArrow, HorizontalAlignment.LEFT,
|
||||||
ftileFactory, CreoleMode.SIMPLE_LINE);
|
ftileFactory.skinParam(), CreoleMode.SIMPLE_LINE);
|
||||||
final Display out2 = branch2.getFtile().getOutLinkRendering().getDisplay();
|
final Display out2 = branch2.getFtile().getOutLinkRendering().getDisplay();
|
||||||
final TextBlock tbout2 = out2 == null ? null : out2.create(fontArrow, HorizontalAlignment.LEFT,
|
final TextBlock tbout2 = out2 == null ? null : out2.create(fontArrow, HorizontalAlignment.LEFT,
|
||||||
ftileFactory, CreoleMode.SIMPLE_LINE);
|
ftileFactory.skinParam(), CreoleMode.SIMPLE_LINE);
|
||||||
diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
|
diamond2 = new FtileDiamond(tile1.skinParam(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
|
||||||
tbout2);
|
tbout2);
|
||||||
} else {
|
} else {
|
||||||
// diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2,
|
// diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2,
|
||||||
// swimlane, swimlane);
|
// swimlane, swimlane);
|
||||||
diamond2 = new FtileEmpty(tile1.shadowing(), 0, Diamond.diamondHalfSize / 2, swimlane, swimlane);
|
diamond2 = new FtileEmpty(tile1.skinParam(), 0, Diamond.diamondHalfSize / 2, swimlane, swimlane);
|
||||||
}
|
}
|
||||||
return diamond2;
|
return diamond2;
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,15 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
|
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
|
|
||||||
public abstract class FtileDimensionMemoize extends AbstractFtile {
|
public abstract class FtileDimensionMemoize extends AbstractFtile {
|
||||||
|
|
||||||
public FtileDimensionMemoize(boolean shadowing) {
|
public FtileDimensionMemoize(ISkinParam skinParam) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FtileGeometry calculateDimensionInternal;
|
private FtileGeometry calculateDimensionInternal;
|
||||||
|
@ -53,7 +53,7 @@ public class FtileIfNude extends FtileDimensionMemoize {
|
|||||||
private final Swimlane in;
|
private final Swimlane in;
|
||||||
|
|
||||||
FtileIfNude(Ftile tile1, Ftile tile2, Swimlane in) {
|
FtileIfNude(Ftile tile1, Ftile tile2, Swimlane in) {
|
||||||
super(tile1.shadowing() || tile2.shadowing());
|
super(tile1.skinParam());
|
||||||
this.tile1 = tile1;
|
this.tile1 = tile1;
|
||||||
this.tile2 = tile2;
|
this.tile2 = tile2;
|
||||||
this.in = in;
|
this.in = in;
|
||||||
@ -147,10 +147,10 @@ public class FtileIfNude extends FtileDimensionMemoize {
|
|||||||
return (dim1.getWidth() - dim1.getLeft()) + dim2.getLeft();
|
return (dim1.getWidth() - dim1.getLeft()) + dim2.getLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected double getLeft(StringBounder stringBounder) {
|
// protected double getLeft(StringBounder stringBounder) {
|
||||||
// final double left1 = tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft();
|
// final double left1 = tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft();
|
||||||
// final double left2 = tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft();
|
// final double left2 = tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft();
|
||||||
// return (left1 + left2) / 2;
|
// return (left1 + left2) / 2;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
@ -53,8 +54,8 @@ public class FtileBlackBlock extends AbstractFtile {
|
|||||||
private final HtmlColor colorBar;
|
private final HtmlColor colorBar;
|
||||||
private final Swimlane swimlane;
|
private final Swimlane swimlane;
|
||||||
|
|
||||||
public FtileBlackBlock(boolean shadowing, HtmlColor colorBar, Swimlane swimlane) {
|
public FtileBlackBlock(ISkinParam skinParam, HtmlColor colorBar, Swimlane swimlane) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.colorBar = colorBar;
|
this.colorBar = colorBar;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
}
|
}
|
||||||
@ -70,7 +71,7 @@ public class FtileBlackBlock extends AbstractFtile {
|
|||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
final URectangle rect = new URectangle(width, height, 5, 5);
|
final URectangle rect = new URectangle(width, height, 5, 5);
|
||||||
if (shadowing()) {
|
if (skinParam().shadowing()) {
|
||||||
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);
|
||||||
|
@ -111,9 +111,8 @@ public class FtileBox extends AbstractFtile {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileBox(boolean shadowing, Display label, UFont font, Swimlane swimlane, BoxStyle style,
|
public FtileBox(ISkinParam skinParam, Display label, UFont font, Swimlane swimlane, BoxStyle style) {
|
||||||
ISkinParam skinParam) {
|
super(skinParam);
|
||||||
super(shadowing);
|
|
||||||
this.style = style;
|
this.style = style;
|
||||||
this.skinParam = skinParam;
|
this.skinParam = skinParam;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
@ -136,12 +135,12 @@ public class FtileBox extends AbstractFtile {
|
|||||||
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||||
final double widthTotal = dimTotal.getWidth();
|
final double widthTotal = dimTotal.getWidth();
|
||||||
final double heightTotal = dimTotal.getHeight();
|
final double heightTotal = dimTotal.getHeight();
|
||||||
final UDrawable rect = style.getUDrawable(widthTotal, heightTotal, shadowing());
|
final UDrawable rect = style.getUDrawable(widthTotal, heightTotal, skinParam().shadowing());
|
||||||
|
|
||||||
final HtmlColor borderColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBorder, null);
|
final HtmlColor borderColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBorder, null);
|
||||||
final HtmlColor backColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBackground, null);
|
final HtmlColor backColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBackground, null);
|
||||||
|
|
||||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UChangeBackColor(backColor)).apply(new UStroke(1.5));
|
ug = ug.apply(new UChangeColor(borderColor)).apply(new UChangeBackColor(backColor)).apply(getThickness());
|
||||||
rect.drawU(ug);
|
rect.drawU(ug);
|
||||||
|
|
||||||
tb.drawU(ug.apply(new UTranslate(MARGIN, MARGIN)));
|
tb.drawU(ug.apply(new UTranslate(MARGIN, MARGIN)));
|
||||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
@ -57,8 +58,8 @@ public class FtileCircleEnd extends AbstractFtile {
|
|||||||
private final HtmlColor backColor;
|
private final HtmlColor backColor;
|
||||||
private final Swimlane swimlane;
|
private final Swimlane swimlane;
|
||||||
|
|
||||||
public FtileCircleEnd(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
|
public FtileCircleEnd(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
}
|
}
|
||||||
@ -85,7 +86,7 @@ public class FtileCircleEnd extends AbstractFtile {
|
|||||||
yTheoricalPosition = Math.round(yTheoricalPosition);
|
yTheoricalPosition = Math.round(yTheoricalPosition);
|
||||||
|
|
||||||
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
||||||
if (shadowing()) {
|
if (skinParam().shadowing()) {
|
||||||
circle.setDeltaShadow(3);
|
circle.setDeltaShadow(3);
|
||||||
}
|
}
|
||||||
ug = ug.apply(new UChangeColor(backColor));
|
ug = ug.apply(new UChangeColor(backColor));
|
||||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
@ -53,8 +54,8 @@ public class FtileCircleStart extends AbstractFtile {
|
|||||||
private final HtmlColor backColor;
|
private final HtmlColor backColor;
|
||||||
private final Swimlane swimlane;
|
private final Swimlane swimlane;
|
||||||
|
|
||||||
public FtileCircleStart(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
|
public FtileCircleStart(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
}
|
}
|
||||||
@ -76,7 +77,7 @@ public class FtileCircleStart extends AbstractFtile {
|
|||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
||||||
if (shadowing()) {
|
if (skinParam().shadowing()) {
|
||||||
circle.setDeltaShadow(3);
|
circle.setDeltaShadow(3);
|
||||||
}
|
}
|
||||||
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor)).draw(circle);
|
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor)).draw(circle);
|
||||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||||
@ -54,8 +55,8 @@ public class FtileCircleStop extends AbstractFtile {
|
|||||||
private final HtmlColor backColor;
|
private final HtmlColor backColor;
|
||||||
private final Swimlane swimlane;
|
private final Swimlane swimlane;
|
||||||
|
|
||||||
public FtileCircleStop(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
|
public FtileCircleStop(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
}
|
}
|
||||||
@ -82,7 +83,7 @@ public class FtileCircleStop extends AbstractFtile {
|
|||||||
yTheoricalPosition = Math.round(yTheoricalPosition);
|
yTheoricalPosition = Math.round(yTheoricalPosition);
|
||||||
|
|
||||||
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
||||||
if (shadowing()) {
|
if (skinParam().shadowing()) {
|
||||||
circle.setDeltaShadow(3);
|
circle.setDeltaShadow(3);
|
||||||
}
|
}
|
||||||
ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(null))
|
ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(null))
|
||||||
@ -90,7 +91,7 @@ public class FtileCircleStop extends AbstractFtile {
|
|||||||
|
|
||||||
final double delta = 4;
|
final double delta = 4;
|
||||||
final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2);
|
final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2);
|
||||||
if (shadowing()) {
|
if (skinParam().shadowing()) {
|
||||||
circleSmall.setDeltaShadow(3);
|
circleSmall.setDeltaShadow(3);
|
||||||
}
|
}
|
||||||
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor))
|
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor))
|
||||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
@ -44,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
|||||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
|
public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
|
||||||
@ -95,8 +97,12 @@ public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
|
|||||||
return ftile.getSwimlaneOut();
|
return ftile.getSwimlaneOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shadowing() {
|
public ISkinParam skinParam() {
|
||||||
return ftile.shadowing();
|
return ftile.skinParam();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UStroke getThickness() {
|
||||||
|
return ftile.getThickness();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final Ftile getFtileDelegated() {
|
protected final Ftile getFtileDelegated() {
|
||||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
@ -50,7 +51,6 @@ 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.UStroke;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileDiamond extends AbstractFtile {
|
public class FtileDiamond extends AbstractFtile {
|
||||||
@ -63,36 +63,36 @@ public class FtileDiamond extends AbstractFtile {
|
|||||||
private final TextBlock west1;
|
private final TextBlock west1;
|
||||||
private final TextBlock east1;
|
private final TextBlock east1;
|
||||||
|
|
||||||
public FtileDiamond(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane) {
|
public FtileDiamond(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane) {
|
||||||
this(shadowing, backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
|
this(skinParam, backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
|
||||||
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamond withNorth(TextBlock north) {
|
public FtileDiamond withNorth(TextBlock north) {
|
||||||
return new FtileDiamond(shadowing(), backColor, borderColor, swimlane, north, south, east1, west1);
|
return new FtileDiamond(skinParam(), backColor, borderColor, swimlane, north, south, east1, west1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamond withWest(TextBlock west1) {
|
public FtileDiamond withWest(TextBlock west1) {
|
||||||
if (west1 == null) {
|
if (west1 == null) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
return new FtileDiamond(shadowing(), backColor, borderColor, swimlane, north, south, east1, west1);
|
return new FtileDiamond(skinParam(), backColor, borderColor, swimlane, north, south, east1, west1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamond withEast(TextBlock east1) {
|
public FtileDiamond withEast(TextBlock east1) {
|
||||||
if (east1 == null) {
|
if (east1 == null) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
return new FtileDiamond(shadowing(), backColor, borderColor, swimlane, north, south, east1, west1);
|
return new FtileDiamond(skinParam(), backColor, borderColor, swimlane, north, south, east1, west1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamond withSouth(TextBlock south) {
|
public FtileDiamond withSouth(TextBlock south) {
|
||||||
return new FtileDiamond(shadowing(), backColor, borderColor, swimlane, north, south, east1, west1);
|
return new FtileDiamond(skinParam(), backColor, borderColor, swimlane, north, south, east1, west1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FtileDiamond(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
private FtileDiamond(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock north, TextBlock south, TextBlock east1, TextBlock west1) {
|
TextBlock north, TextBlock south, TextBlock east1, TextBlock west1) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
@ -119,8 +119,8 @@ public class FtileDiamond extends AbstractFtile {
|
|||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
|
|
||||||
ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor))
|
ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor))
|
||||||
.draw(Diamond.asPolygon(shadowing()));
|
.draw(Diamond.asPolygon(skinParam().shadowing()));
|
||||||
final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder());
|
final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder());
|
||||||
north.drawU(ug.apply(new UTranslate(Diamond.diamondHalfSize * 1.5, -dimNorth.getHeight()
|
north.drawU(ug.apply(new UTranslate(Diamond.diamondHalfSize * 1.5, -dimNorth.getHeight()
|
||||||
- Diamond.diamondHalfSize)));
|
- Diamond.diamondHalfSize)));
|
||||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
@ -49,7 +50,6 @@ 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.UStroke;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileDiamondFoo1 extends AbstractFtile {
|
public class FtileDiamondFoo1 extends AbstractFtile {
|
||||||
@ -62,27 +62,27 @@ public class FtileDiamondFoo1 extends AbstractFtile {
|
|||||||
private final TextBlock east;
|
private final TextBlock east;
|
||||||
private final TextBlock north;
|
private final TextBlock north;
|
||||||
|
|
||||||
public FtileDiamondFoo1(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
public FtileDiamondFoo1(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label) {
|
TextBlock label) {
|
||||||
this(shadowing, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
||||||
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondFoo1 withNorth(TextBlock north) {
|
public FtileDiamondFoo1 withNorth(TextBlock north) {
|
||||||
return new FtileDiamondFoo1(shadowing(), backColor, borderColor, swimlane, label, north, west, east);
|
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondFoo1 withWest(TextBlock west) {
|
public FtileDiamondFoo1 withWest(TextBlock west) {
|
||||||
return new FtileDiamondFoo1(shadowing(), backColor, borderColor, swimlane, label, north, west, east);
|
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondFoo1 withEast(TextBlock east) {
|
public FtileDiamondFoo1 withEast(TextBlock east) {
|
||||||
return new FtileDiamondFoo1(shadowing(), backColor, borderColor, swimlane, label, north, west, east);
|
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FtileDiamondFoo1(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
private FtileDiamondFoo1(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label, TextBlock north, TextBlock west, TextBlock east) {
|
TextBlock label, TextBlock north, TextBlock west, TextBlock east) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
@ -111,8 +111,8 @@ public class FtileDiamondFoo1 extends AbstractFtile {
|
|||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||||
ug.draw(Diamond.asPolygonFoo1(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
ug.draw(Diamond.asPolygonFoo1(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||||
|
|
||||||
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||||
@ -50,7 +51,6 @@ 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.UStroke;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileDiamondInside extends AbstractFtile {
|
public class FtileDiamondInside extends AbstractFtile {
|
||||||
@ -64,22 +64,22 @@ public class FtileDiamondInside extends AbstractFtile {
|
|||||||
private final TextBlock north;
|
private final TextBlock north;
|
||||||
private final TextBlock south;
|
private final TextBlock south;
|
||||||
|
|
||||||
public FtileDiamondInside(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
public FtileDiamondInside(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label) {
|
TextBlock label) {
|
||||||
this(shadowing, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
||||||
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside withNorth(TextBlock north) {
|
public FtileDiamondInside withNorth(TextBlock north) {
|
||||||
return new FtileDiamondInside(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside withWest(TextBlock west) {
|
public FtileDiamondInside withWest(TextBlock west) {
|
||||||
return new FtileDiamondInside(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside withEast(TextBlock east) {
|
public FtileDiamondInside withEast(TextBlock east) {
|
||||||
return new FtileDiamondInside(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ftile withWestAndEast(TextBlock tb1, TextBlock tb2) {
|
public Ftile withWestAndEast(TextBlock tb1, TextBlock tb2) {
|
||||||
@ -87,12 +87,12 @@ public class FtileDiamondInside extends AbstractFtile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside withSouth(TextBlock south) {
|
public FtileDiamondInside withSouth(TextBlock south) {
|
||||||
return new FtileDiamondInside(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FtileDiamondInside(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
private FtileDiamondInside(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
|
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
@ -122,8 +122,8 @@ public class FtileDiamondInside extends AbstractFtile {
|
|||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||||
ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||||
|
|
||||||
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
@ -49,7 +50,6 @@ 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.UStroke;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class FtileDiamondInside2 extends AbstractFtile {
|
public class FtileDiamondInside2 extends AbstractFtile {
|
||||||
@ -63,31 +63,31 @@ public class FtileDiamondInside2 extends AbstractFtile {
|
|||||||
private final TextBlock north;
|
private final TextBlock north;
|
||||||
private final TextBlock south;
|
private final TextBlock south;
|
||||||
|
|
||||||
public FtileDiamondInside2(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
public FtileDiamondInside2(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label) {
|
TextBlock label) {
|
||||||
this(shadowing, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
||||||
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside2 withNorth(TextBlock north) {
|
public FtileDiamondInside2 withNorth(TextBlock north) {
|
||||||
return new FtileDiamondInside2(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside2(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside2 withWest(TextBlock west) {
|
public FtileDiamondInside2 withWest(TextBlock west) {
|
||||||
return new FtileDiamondInside2(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside2(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside2 withEast(TextBlock east) {
|
public FtileDiamondInside2 withEast(TextBlock east) {
|
||||||
return new FtileDiamondInside2(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside2(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside2 withSouth(TextBlock south) {
|
public FtileDiamondInside2 withSouth(TextBlock south) {
|
||||||
return new FtileDiamondInside2(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside2(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FtileDiamondInside2(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
private FtileDiamondInside2(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
|
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
@ -117,8 +117,8 @@ public class FtileDiamondInside2 extends AbstractFtile {
|
|||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||||
ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||||
|
|
||||||
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||||
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||||
@ -50,7 +51,6 @@ 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.UStroke;
|
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
import net.sourceforge.plantuml.utils.MathUtils;
|
import net.sourceforge.plantuml.utils.MathUtils;
|
||||||
|
|
||||||
@ -65,31 +65,31 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
|
|||||||
private final TextBlock north;
|
private final TextBlock north;
|
||||||
private final TextBlock south;
|
private final TextBlock south;
|
||||||
|
|
||||||
public FtileDiamondInside3(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
public FtileDiamondInside3(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label) {
|
TextBlock label) {
|
||||||
this(shadowing, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
|
||||||
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside3 withNorth(TextBlock north) {
|
public FtileDiamondInside3 withNorth(TextBlock north) {
|
||||||
return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside3(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside3 withWest(TextBlock west) {
|
public FtileDiamondInside3 withWest(TextBlock west) {
|
||||||
return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside3(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside3 withEast(TextBlock east) {
|
public FtileDiamondInside3 withEast(TextBlock east) {
|
||||||
return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside3(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FtileDiamondInside3 withSouth(TextBlock south) {
|
public FtileDiamondInside3 withSouth(TextBlock south) {
|
||||||
return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
|
return new FtileDiamondInside3(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FtileDiamondInside3(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
private FtileDiamondInside3(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
|
||||||
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
|
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
|
||||||
super(shadowing);
|
super(skinParam);
|
||||||
this.backColor = backColor;
|
this.backColor = backColor;
|
||||||
this.swimlane = swimlane;
|
this.swimlane = swimlane;
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
@ -119,8 +119,8 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
|
|||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||||
ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||||
|
|
||||||
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19934 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.code;
|
package net.sourceforge.plantuml.code;
|
||||||
@ -46,6 +46,9 @@ public class AsciiEncoder implements URLEncoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String encode(byte data[]) {
|
public String encode(byte data[]) {
|
||||||
|
if (data == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
final StringBuilder resu = new StringBuilder((data.length * 4 + 2) / 3);
|
final StringBuilder resu = new StringBuilder((data.length * 4 + 2) / 3);
|
||||||
for (int i = 0; i < data.length; i += 3) {
|
for (int i = 0; i < data.length; i += 3) {
|
||||||
append3bytes(resu, data[i] & 0xFF, i + 1 < data.length ? data[i + 1] & 0xFF : 0,
|
append3bytes(resu, data[i] & 0xFF, i + 1 < data.length ? data[i + 1] & 0xFF : 0,
|
||||||
|
@ -41,7 +41,13 @@ import java.util.zip.Inflater;
|
|||||||
public class CompressionZlib implements Compression {
|
public class CompressionZlib implements Compression {
|
||||||
|
|
||||||
public byte[] compress(byte[] in) {
|
public byte[] compress(byte[] in) {
|
||||||
|
if (in.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
int len = in.length * 2;
|
int len = in.length * 2;
|
||||||
|
if (len < 100) {
|
||||||
|
len = 100;
|
||||||
|
}
|
||||||
byte[] result = null;
|
byte[] result = null;
|
||||||
while (result == null) {
|
while (result == null) {
|
||||||
result = tryCompress(in, len);
|
result = tryCompress(in, len);
|
||||||
|
@ -33,45 +33,47 @@
|
|||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.core;
|
package net.sourceforge.plantuml.core;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.utils.StartUtils;
|
||||||
|
|
||||||
public enum DiagramType {
|
public enum DiagramType {
|
||||||
UML, DITAA, DOT, PROJECT, JCCKIT, SALT, TURING, FLOW, CREOLE, JUNGLE, CUTE, UNKNOWN;
|
UML, DITAA, DOT, PROJECT, JCCKIT, SALT, TURING, FLOW, CREOLE, JUNGLE, CUTE, UNKNOWN;
|
||||||
|
|
||||||
static public DiagramType getTypeFromArobaseStart(String s) {
|
static public DiagramType getTypeFromArobaseStart(String s) {
|
||||||
s = s.toLowerCase();
|
s = s.toLowerCase();
|
||||||
// if (s.startsWith("@startuml2")) {
|
// if (s.startsWith("@startuml2")) {
|
||||||
// return UML2;
|
// return UML2;
|
||||||
// }
|
// }
|
||||||
if (s.startsWith("@startuml")) {
|
if (StartUtils.startsWithSymbolAnd("startuml", s)) {
|
||||||
return UML;
|
return UML;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startdot")) {
|
if (StartUtils.startsWithSymbolAnd("startdot", s)) {
|
||||||
return DOT;
|
return DOT;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startjcckit")) {
|
if (StartUtils.startsWithSymbolAnd("startjcckit", s)) {
|
||||||
return JCCKIT;
|
return JCCKIT;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startditaa")) {
|
if (StartUtils.startsWithSymbolAnd("startditaa", s)) {
|
||||||
return DITAA;
|
return DITAA;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startproject")) {
|
if (StartUtils.startsWithSymbolAnd("startproject", s)) {
|
||||||
return PROJECT;
|
return PROJECT;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startsalt")) {
|
if (StartUtils.startsWithSymbolAnd("startsalt", s)) {
|
||||||
return SALT;
|
return SALT;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startturing")) {
|
if (StartUtils.startsWithSymbolAnd("startturing", s)) {
|
||||||
return TURING;
|
return TURING;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startflow")) {
|
if (StartUtils.startsWithSymbolAnd("startflow", s)) {
|
||||||
return FLOW;
|
return FLOW;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startcreole")) {
|
if (StartUtils.startsWithSymbolAnd("startcreole", s)) {
|
||||||
return CREOLE;
|
return CREOLE;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@starttree")) {
|
if (StartUtils.startsWithSymbolAnd("starttree", s)) {
|
||||||
return JUNGLE;
|
return JUNGLE;
|
||||||
}
|
}
|
||||||
if (s.startsWith("@startcute")) {
|
if (StartUtils.startsWithSymbolAnd("startcute", s)) {
|
||||||
return CUTE;
|
return CUTE;
|
||||||
}
|
}
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
package net.sourceforge.plantuml.cucadiagram;
|
package net.sourceforge.plantuml.cucadiagram;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.OptionFlags;
|
import net.sourceforge.plantuml.OptionFlags;
|
||||||
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrow;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrow;
|
||||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrowAndCircle;
|
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrowAndCircle;
|
||||||
@ -79,7 +80,7 @@ public enum LinkDecor {
|
|||||||
return arrowSize;
|
return arrowSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExtremityFactory getExtremityFactory() {
|
public ExtremityFactory getExtremityFactory(HtmlColor backgroundColor) {
|
||||||
if (this == LinkDecor.PLUS) {
|
if (this == LinkDecor.PLUS) {
|
||||||
return new ExtremityFactoryPlus();
|
return new ExtremityFactoryPlus();
|
||||||
} else if (this == LinkDecor.ARROW_TRIANGLE) {
|
} else if (this == LinkDecor.ARROW_TRIANGLE) {
|
||||||
@ -91,9 +92,9 @@ public enum LinkDecor {
|
|||||||
} else if (this == LinkDecor.ARROW_AND_CIRCLE) {
|
} else if (this == LinkDecor.ARROW_AND_CIRCLE) {
|
||||||
return new ExtremityFactoryArrowAndCircle();
|
return new ExtremityFactoryArrowAndCircle();
|
||||||
} else if (this == LinkDecor.AGREGATION) {
|
} else if (this == LinkDecor.AGREGATION) {
|
||||||
return new ExtremityFactoryDiamond(false);
|
return new ExtremityFactoryDiamond(false, backgroundColor);
|
||||||
} else if (this == LinkDecor.COMPOSITION) {
|
} else if (this == LinkDecor.COMPOSITION) {
|
||||||
return new ExtremityFactoryDiamond(true);
|
return new ExtremityFactoryDiamond(true, backgroundColor);
|
||||||
} else if (this == LinkDecor.CIRCLE) {
|
} else if (this == LinkDecor.CIRCLE) {
|
||||||
return new ExtremityFactoryCircle();
|
return new ExtremityFactoryCircle();
|
||||||
} else if (this == LinkDecor.SQUARRE) {
|
} else if (this == LinkDecor.SQUARRE) {
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19398 $
|
* Revision $Revision: 19931 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.cucadiagram.dot;
|
package net.sourceforge.plantuml.cucadiagram.dot;
|
||||||
@ -44,9 +44,12 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
import net.sourceforge.plantuml.StringUtils;
|
import net.sourceforge.plantuml.StringUtils;
|
||||||
|
import net.sourceforge.plantuml.vizjs.GraphvizJs;
|
||||||
|
import net.sourceforge.plantuml.vizjs.VizJsEngine;
|
||||||
|
|
||||||
public class GraphvizUtils {
|
public class GraphvizUtils {
|
||||||
|
|
||||||
|
// private static final String VIZJS = "vizjs";
|
||||||
private static int DOT_VERSION_LIMIT = 226;
|
private static int DOT_VERSION_LIMIT = 226;
|
||||||
|
|
||||||
private static boolean isWindows() {
|
private static boolean isWindows() {
|
||||||
@ -64,6 +67,9 @@ public class GraphvizUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Graphviz create(ISkinParam skinParam, String dotString, String... type) {
|
public static Graphviz create(ISkinParam skinParam, String dotString, String... type) {
|
||||||
|
if (VizJsEngine.isOk()) {
|
||||||
|
return new GraphvizJs(dotString);
|
||||||
|
}
|
||||||
final AbstractGraphviz result;
|
final AbstractGraphviz result;
|
||||||
if (isWindows()) {
|
if (isWindows()) {
|
||||||
result = new GraphvizWindows(skinParam, dotString, type);
|
result = new GraphvizWindows(skinParam, dotString, type);
|
||||||
@ -157,7 +163,24 @@ public class GraphvizUtils {
|
|||||||
red = "<b><color:red>";
|
red = "<b><color:red>";
|
||||||
bold = "<b>";
|
bold = "<b>";
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<String> result = new ArrayList<String>();
|
final List<String> result = new ArrayList<String>();
|
||||||
|
if (VizJsEngine.isOk()) {
|
||||||
|
result.add("VizJs library is used!");
|
||||||
|
try {
|
||||||
|
final String err = getTestCreateSimpleFile();
|
||||||
|
if (err == null) {
|
||||||
|
result.add(bold + "Installation seems OK. File generation OK");
|
||||||
|
} else {
|
||||||
|
result.add(red + err);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.add(red + e.toString());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return Collections.unmodifiableList(result);
|
||||||
|
}
|
||||||
|
|
||||||
final String ent = GraphvizUtils.getenvGraphvizDot();
|
final String ent = GraphvizUtils.getenvGraphvizDot();
|
||||||
if (ent == null) {
|
if (ent == null) {
|
||||||
result.add("The environment variable GRAPHVIZ_DOT has not been set");
|
result.add("The environment variable GRAPHVIZ_DOT has not been set");
|
||||||
|
@ -38,6 +38,10 @@ public interface GraphvizVersion {
|
|||||||
|
|
||||||
public boolean useProtectionWhenThereALinkFromOrToGroup();
|
public boolean useProtectionWhenThereALinkFromOrToGroup();
|
||||||
|
|
||||||
|
public boolean modeSafe();
|
||||||
|
|
||||||
|
public boolean isVizjs();
|
||||||
|
|
||||||
// COMMON, V2_34_0
|
// COMMON, V2_34_0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ import net.sourceforge.plantuml.StringUtils;
|
|||||||
public class GraphvizVersionFinder {
|
public class GraphvizVersionFinder {
|
||||||
|
|
||||||
final private File dotExe;
|
final private File dotExe;
|
||||||
final private static GraphvizVersion DEFAULT = new GraphvizVersion() {
|
final public static GraphvizVersion DEFAULT = new GraphvizVersion() {
|
||||||
public boolean useShield() {
|
public boolean useShield() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -50,6 +50,14 @@ public class GraphvizVersionFinder {
|
|||||||
public boolean useProtectionWhenThereALinkFromOrToGroup() {
|
public boolean useProtectionWhenThereALinkFromOrToGroup() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean modeSafe() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVizjs() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public GraphvizVersionFinder(File dotExe) {
|
public GraphvizVersionFinder(File dotExe) {
|
||||||
@ -76,6 +84,14 @@ public class GraphvizVersionFinder {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean modeSafe() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVizjs() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ import net.sourceforge.plantuml.version.PSystemVersion;
|
|||||||
|
|
||||||
public class PSystemDonors extends AbstractPSystem {
|
public class PSystemDonors extends AbstractPSystem {
|
||||||
|
|
||||||
public static final String DONORS = "UDfTKyjosp0ClEChUDQa7w7OhLlPJZ9Msixa1bk8H9icL99oAtrRR_snGcvbKkP96Bns5wlSPFyVENYXG4xbDh3LU81NokBZCsmuXiv3FhNY7bOkfgY7alReWqQhdhYnaDkAdLenXO76p_TtgPZAqS86aqKsm59FWJQGnz5yWRAB47fOwMp-B4CneUmyb87QXgnQCBV2Rpdj8G_hyrqhErYmqLRjkFC4HNUNpuuiHAQWrR1DKECv3MLLRkWNsahaN3HQfjReUc6wkz6sDJobwCC0pqPVf66f3oT1Vije2n_zRRHDG6HqWULmri7rQeCDLmZ5AFfRWp8-gSl8n7F9E_KYayKWTO9FS1N_mDDfnifMi_3QgMMGaRPd5_G0dsEwOjZgGqD6FQ8sVSh032aOx--X5OJsGu677nrvjUps3kMq9jB_niT0XqQj7NgCa6eInoO7_3aQJKhKcYywzStLELyZVusmIxmyhfZnF4ftcxYCJwDGZ-pGecaVr1i5vDR3JlYYgzHQZvU6JuRTAF_spszZhXw8_Z29LyLTcvkx74xYZoPevenyOfXHg1USlBFJC_YvqQf4hEI_SZMfxsHhSWzgcxz-AVFe-umjh2XLvIzt3mXu";
|
public static final String DONORS = "UDfTayzosZ0Gnk_x53fxaeTmS4fh8Cb0cixajjWRB11QLv99pRFrrXVhcjP8HYVlQFzyt-hdt6J_3pbueK1EvJQmrLZ1AsNny16M74Fd8HzBSGjp5w-eXmrjqGUDLZrnOo6tDJirPmfd6Zu_FYHZJ4SBIqm6sG257WDj88-j-GIRBaheOQwpwR4CvQYoyx09r3ParOov5N_5E8SyB8utfUnWnaPRjURE4vJTpNssPp4o1gs6LQ8QZsaeet93lz3MiivPewNh3bqlJjTNstO7JwdwS8PdeqzIKEZg8CglDzh2ex-sjec8Z4vGd8ywk5ujiU4QeHoM_jwWj4_oCZBnkUGSUbcJnI1veazqbV_4qs7YojQJy5AffP6HicSNz1c-nkkQOQMhXenwG6twr84vfsAylvLM4jhx4gkV7NbLT5k7yhGcsd_ZVQ2gKGk77gEa7GcnoGD-3g19YbhmIQVSNCZv7lrhX7N2yZ1YudClrMr26H-6HJsmGukclLFl591R3slnYwvM2psyD7mnx8Rrh_xyDkR2GEJ39AmANSihNGx7vGyGD5D7FW5cMDGBZkoizKH-RhJQ8DRoNxaTgHzaT-Jkr2f__RR98_SPMvZJv7zAzs0huUUetiH38KJ_1SHA3uG0";
|
||||||
|
|
||||||
public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
|
public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
|
||||||
final GraphicStrings result = getGraphicStrings();
|
final GraphicStrings result = getGraphicStrings();
|
||||||
|
@ -183,6 +183,7 @@ public class QuoteUtils {
|
|||||||
"You know that thing you just did? Don't do that"
|
"You know that thing you just did? Don't do that"
|
||||||
// Well I never, was there ever, A cat so clever, as magical Mr Mistoffelees
|
// Well I never, was there ever, A cat so clever, as magical Mr Mistoffelees
|
||||||
// Do you like your morning tea weak or strong ?
|
// Do you like your morning tea weak or strong ?
|
||||||
|
// It took me a long time to understand that if you want to do this job well you have to stay detached.
|
||||||
);
|
);
|
||||||
|
|
||||||
private QuoteUtils() {
|
private QuoteUtils() {
|
||||||
|
@ -115,6 +115,9 @@ class RealLine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void printCounter(Map<PositiveForce, Integer> counter) {
|
private void printCounter(Map<PositiveForce, Integer> counter) {
|
||||||
|
for (PositiveForce f : forces) {
|
||||||
|
System.err.println("force=" + f);
|
||||||
|
}
|
||||||
for (Map.Entry<PositiveForce, Integer> ent : counter.entrySet()) {
|
for (Map.Entry<PositiveForce, Integer> ent : counter.entrySet()) {
|
||||||
System.err.println("count=" + ent.getValue() + " for " + ent.getKey());
|
System.err.println("count=" + ent.getValue() + " for " + ent.getKey());
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19978 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram;
|
package net.sourceforge.plantuml.sequencediagram;
|
||||||
@ -41,7 +41,8 @@ public enum ParticipantType {
|
|||||||
BOUNDARY(ColorParam.boundaryBackground), //
|
BOUNDARY(ColorParam.boundaryBackground), //
|
||||||
CONTROL(ColorParam.controlBackground), //
|
CONTROL(ColorParam.controlBackground), //
|
||||||
ENTITY(ColorParam.entityBackground), //
|
ENTITY(ColorParam.entityBackground), //
|
||||||
DATABASE(ColorParam.databaseBackground);
|
DATABASE(ColorParam.databaseBackground), //
|
||||||
|
COLLECTIONS(ColorParam.collectionsBackground);
|
||||||
|
|
||||||
private final ColorParam background;
|
private final ColorParam background;
|
||||||
|
|
||||||
|
@ -62,8 +62,8 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
|
|||||||
}
|
}
|
||||||
|
|
||||||
static IRegex getRegexType() {
|
static IRegex getRegexType() {
|
||||||
return new RegexOr(new RegexLeaf("TYPE", "(participant|actor|create|boundary|control|entity|database)"), //
|
return new RegexOr(new RegexLeaf("TYPE", "(participant|actor|create|boundary|control|entity|database|collections)"), //
|
||||||
new RegexLeaf("CREATE", "create[%s](participant|actor|boundary|control|entity|database)"));
|
new RegexLeaf("CREATE", "create[%s](participant|actor|boundary|control|entity|database|collections)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19885 $
|
* Revision $Revision: 19976 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||||
@ -45,6 +45,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||||
import net.sourceforge.plantuml.ISkinParam;
|
import net.sourceforge.plantuml.ISkinParam;
|
||||||
|
import net.sourceforge.plantuml.LineParam;
|
||||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||||
import net.sourceforge.plantuml.Url;
|
import net.sourceforge.plantuml.Url;
|
||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
@ -61,6 +62,7 @@ import net.sourceforge.plantuml.skin.SimpleContext2D;
|
|||||||
import net.sourceforge.plantuml.skin.Skin;
|
import net.sourceforge.plantuml.skin.Skin;
|
||||||
import net.sourceforge.plantuml.ugraphic.UClip;
|
import net.sourceforge.plantuml.ugraphic.UClip;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||||
|
|
||||||
public class DrawableSet {
|
public class DrawableSet {
|
||||||
@ -279,7 +281,7 @@ public class DrawableSet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
final double myDelta = page.getNewpage1() - page.getHeaderHeight();
|
final double myDelta = page.getNewpage1() - page.getHeaderHeight();
|
||||||
box.drawLineU22(ug, start, endMax, showTail, myDelta);
|
box.drawLineU22(ug, start, endMax, showTail, myDelta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,4 +419,12 @@ public class DrawableSet {
|
|||||||
return list.get(max);
|
return list.get(max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getArrowThickness() {
|
||||||
|
final UStroke result = skinParam.getThickness(LineParam.sequenceArrow, null);
|
||||||
|
if (result == null) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return result.getThickness();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19885 $
|
* Revision $Revision: 19978 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||||
@ -574,6 +574,9 @@ class DrawableSetInitializer {
|
|||||||
} else if (p.getType() == ParticipantType.DATABASE) {
|
} else if (p.getType() == ParticipantType.DATABASE) {
|
||||||
headType = ComponentType.DATABASE_HEAD;
|
headType = ComponentType.DATABASE_HEAD;
|
||||||
tailType = ComponentType.DATABASE_TAIL;
|
tailType = ComponentType.DATABASE_TAIL;
|
||||||
|
} else if (p.getType() == ParticipantType.COLLECTIONS) {
|
||||||
|
headType = ComponentType.COLLECTIONS_HEAD;
|
||||||
|
tailType = ComponentType.COLLECTIONS_TAIL;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ abstract class Step1Abstract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected final void setConfig(ArrowConfiguration config) {
|
protected final void setConfig(ArrowConfiguration config) {
|
||||||
this.config = config;
|
this.config = config.withThickness(drawingSet.getArrowThickness());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final Component getNote() {
|
protected final Component getNote() {
|
||||||
|
@ -109,6 +109,11 @@ public class NotesTile implements Tile {
|
|||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Real getXcenter(StringBounder stringBounder, Note note) {
|
||||||
|
final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
|
||||||
|
return livingSpace1.getPosC(stringBounder);
|
||||||
|
}
|
||||||
|
|
||||||
private Real getX(StringBounder stringBounder, Note note) {
|
private Real getX(StringBounder stringBounder, Note note) {
|
||||||
final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
|
final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
|
||||||
final NotePosition position = note.getPosition();
|
final NotePosition position = note.getPosition();
|
||||||
@ -145,9 +150,17 @@ public class NotesTile implements Tile {
|
|||||||
final List<Note> all = notes.asList();
|
final List<Note> all = notes.asList();
|
||||||
for (int i = 0; i < all.size() - 1; i++) {
|
for (int i = 0; i < all.size() - 1; i++) {
|
||||||
for (int j = i + 1; j < all.size(); j++) {
|
for (int j = i + 1; j < all.size(); j++) {
|
||||||
final Real point1 = getX2(stringBounder, all.get(i));
|
final double center1 = getXcenter(stringBounder, all.get(i)).getCurrentValue();
|
||||||
final Real point2 = getX(stringBounder, all.get(j));
|
final double center2 = getXcenter(stringBounder, all.get(j)).getCurrentValue();
|
||||||
point2.ensureBiggerThan(point1);
|
if (center2 > center1) {
|
||||||
|
final Real point1b = getX2(stringBounder, all.get(i));
|
||||||
|
final Real point2 = getX(stringBounder, all.get(j));
|
||||||
|
point2.ensureBiggerThan(point1b);
|
||||||
|
} else {
|
||||||
|
final Real point1 = getX(stringBounder, all.get(i));
|
||||||
|
final Real point2b = getX2(stringBounder, all.get(j));
|
||||||
|
point1.ensureBiggerThan(point2b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19945 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin;
|
package net.sourceforge.plantuml.skin;
|
||||||
@ -45,22 +45,22 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
|||||||
|
|
||||||
public abstract class AbstractComponent implements Component {
|
public abstract class AbstractComponent implements Component {
|
||||||
|
|
||||||
final protected void stroke(Graphics2D g2d, float dash, float thickness) {
|
// final protected void stroke(Graphics2D g2d, float dash, float thickness) {
|
||||||
final float[] style = { dash, dash };
|
// final float[] style = { dash, dash };
|
||||||
g2d.setStroke(new BasicStroke(thickness, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, style, 0));
|
// g2d.setStroke(new BasicStroke(thickness, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, style, 0));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
final protected UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace, double thickness) {
|
// final protected UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace, double thickness) {
|
||||||
return ug.apply(new UStroke(dashVisible, dashSpace, thickness));
|
// return ug.apply(new UStroke(dashVisible, dashSpace, thickness));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
final protected void stroke(Graphics2D g2d, float dash) {
|
// final protected void stroke(Graphics2D g2d, float dash) {
|
||||||
stroke(g2d, dash, 1);
|
// stroke(g2d, dash, 1);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
final protected UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace) {
|
// final protected UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace) {
|
||||||
return stroke(ug, dashVisible, dashSpace, 1);
|
// return stroke(ug, dashVisible, dashSpace, 1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
abstract protected void drawInternalU(UGraphic ug, Area area);
|
abstract protected void drawInternalU(UGraphic ug, Area area);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19885 $
|
* Revision $Revision: 19971 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin;
|
package net.sourceforge.plantuml.skin;
|
||||||
@ -93,7 +93,7 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
|
|||||||
return textBlock;
|
return textBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
final protected double getPureTextWidth(StringBounder stringBounder) {
|
protected double getPureTextWidth(StringBounder stringBounder) {
|
||||||
final TextBlock textBlock = getTextBlock();
|
final TextBlock textBlock = getTextBlock();
|
||||||
final Dimension2D size = textBlock.calculateDimension(stringBounder);
|
final Dimension2D size = textBlock.calculateDimension(stringBounder);
|
||||||
return size.getWidth();
|
return size.getWidth();
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
package net.sourceforge.plantuml.skin;
|
package net.sourceforge.plantuml.skin;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
|
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||||
|
|
||||||
public class ArrowConfiguration {
|
public class ArrowConfiguration {
|
||||||
|
|
||||||
@ -48,12 +50,14 @@ public class ArrowConfiguration {
|
|||||||
private final HtmlColor color;
|
private final HtmlColor color;
|
||||||
|
|
||||||
private final boolean isSelf;
|
private final boolean isSelf;
|
||||||
|
private final double thickness;
|
||||||
|
|
||||||
private ArrowConfiguration(ArrowBody body, ArrowDressing dressing1, ArrowDressing dressing2,
|
private ArrowConfiguration(ArrowBody body, ArrowDressing dressing1, ArrowDressing dressing2,
|
||||||
ArrowDecoration decoration1, ArrowDecoration decoration2, HtmlColor color, boolean isSelf) {
|
ArrowDecoration decoration1, ArrowDecoration decoration2, HtmlColor color, boolean isSelf, double thickness) {
|
||||||
if (body == null || dressing1 == null || dressing2 == null) {
|
if (body == null || dressing1 == null || dressing2 == null) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
this.thickness = thickness;
|
||||||
this.body = body;
|
this.body = body;
|
||||||
this.dressing1 = dressing1;
|
this.dressing1 = dressing1;
|
||||||
this.dressing2 = dressing2;
|
this.dressing2 = dressing2;
|
||||||
@ -75,19 +79,19 @@ public class ArrowConfiguration {
|
|||||||
|
|
||||||
public static ArrowConfiguration withDirectionNormal() {
|
public static ArrowConfiguration withDirectionNormal() {
|
||||||
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create(), ArrowDressing.create().withHead(
|
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create(), ArrowDressing.create().withHead(
|
||||||
ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, false);
|
ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, false, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrowConfiguration withDirectionBoth() {
|
public static ArrowConfiguration withDirectionBoth() {
|
||||||
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
|
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
|
||||||
ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
|
ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
|
||||||
false);
|
false, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrowConfiguration withDirectionSelf() {
|
public static ArrowConfiguration withDirectionSelf() {
|
||||||
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
|
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
|
||||||
ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
|
ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
|
||||||
true);
|
true, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrowConfiguration withDirectionReverse() {
|
public static ArrowConfiguration withDirectionReverse() {
|
||||||
@ -95,21 +99,22 @@ public class ArrowConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration reverse() {
|
public ArrowConfiguration reverse() {
|
||||||
return new ArrowConfiguration(body, dressing2, dressing1, decoration2, decoration1, color, isSelf);
|
return new ArrowConfiguration(body, dressing2, dressing1, decoration2, decoration1, color, isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration self() {
|
public ArrowConfiguration self() {
|
||||||
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, true);
|
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, true, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withBody(ArrowBody type) {
|
public ArrowConfiguration withBody(ArrowBody type) {
|
||||||
return new ArrowConfiguration(type, dressing1, dressing2, decoration1, decoration2, color, isSelf);
|
return new ArrowConfiguration(type, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withHead(ArrowHead head) {
|
public ArrowConfiguration withHead(ArrowHead head) {
|
||||||
final ArrowDressing newDressing1 = addHead(dressing1, head);
|
final ArrowDressing newDressing1 = addHead(dressing1, head);
|
||||||
final ArrowDressing newDressing2 = addHead(dressing2, head);
|
final ArrowDressing newDressing2 = addHead(dressing2, head);
|
||||||
return new ArrowConfiguration(body, newDressing1, newDressing2, decoration1, decoration2, color, isSelf);
|
return new ArrowConfiguration(body, newDressing1, newDressing2, decoration1, decoration2, color, isSelf,
|
||||||
|
thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ArrowDressing addHead(ArrowDressing dressing, ArrowHead head) {
|
private static ArrowDressing addHead(ArrowDressing dressing, ArrowHead head) {
|
||||||
@ -121,33 +126,33 @@ public class ArrowConfiguration {
|
|||||||
|
|
||||||
public ArrowConfiguration withHead1(ArrowHead head) {
|
public ArrowConfiguration withHead1(ArrowHead head) {
|
||||||
return new ArrowConfiguration(body, dressing1.withHead(head), dressing2, decoration1, decoration2, color,
|
return new ArrowConfiguration(body, dressing1.withHead(head), dressing2, decoration1, decoration2, color,
|
||||||
isSelf);
|
isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withHead2(ArrowHead head) {
|
public ArrowConfiguration withHead2(ArrowHead head) {
|
||||||
return new ArrowConfiguration(body, dressing1, dressing2.withHead(head), decoration1, decoration2, color,
|
return new ArrowConfiguration(body, dressing1, dressing2.withHead(head), decoration1, decoration2, color,
|
||||||
isSelf);
|
isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withPart(ArrowPart part) {
|
public ArrowConfiguration withPart(ArrowPart part) {
|
||||||
if (dressing2.getHead() != ArrowHead.NONE) {
|
if (dressing2.getHead() != ArrowHead.NONE) {
|
||||||
return new ArrowConfiguration(body, dressing1, dressing2.withPart(part), decoration1, decoration2, color,
|
return new ArrowConfiguration(body, dressing1, dressing2.withPart(part), decoration1, decoration2, color,
|
||||||
isSelf);
|
isSelf, thickness);
|
||||||
}
|
}
|
||||||
return new ArrowConfiguration(body, dressing1.withPart(part), dressing2, decoration1, decoration2, color,
|
return new ArrowConfiguration(body, dressing1.withPart(part), dressing2, decoration1, decoration2, color,
|
||||||
isSelf);
|
isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withDecoration1(ArrowDecoration decoration1) {
|
public ArrowConfiguration withDecoration1(ArrowDecoration decoration1) {
|
||||||
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf);
|
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withDecoration2(ArrowDecoration decoration2) {
|
public ArrowConfiguration withDecoration2(ArrowDecoration decoration2) {
|
||||||
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf);
|
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrowConfiguration withColor(HtmlColor color) {
|
public ArrowConfiguration withColor(HtmlColor color) {
|
||||||
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf);
|
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final ArrowDecoration getDecoration1() {
|
public final ArrowDecoration getDecoration1() {
|
||||||
@ -213,4 +218,23 @@ public class ArrowConfiguration {
|
|||||||
return dressing2;
|
return dressing2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace, double thickness) {
|
||||||
|
return ug.apply(new UStroke(dashVisible, dashSpace, thickness));
|
||||||
|
}
|
||||||
|
|
||||||
|
public UGraphic applyStroke(UGraphic ug) {
|
||||||
|
if (isDotted()) {
|
||||||
|
return ug.apply(new UStroke(2, 2, thickness));
|
||||||
|
}
|
||||||
|
return ug.apply(new UStroke(thickness));
|
||||||
|
}
|
||||||
|
|
||||||
|
public UGraphic applyThicknessOnly(UGraphic ug) {
|
||||||
|
return ug.apply(new UStroke(thickness));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrowConfiguration withThickness(double thickness) {
|
||||||
|
return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ public enum ComponentType {
|
|||||||
CONTROL_HEAD, CONTROL_TAIL,
|
CONTROL_HEAD, CONTROL_TAIL,
|
||||||
ENTITY_HEAD, ENTITY_TAIL,
|
ENTITY_HEAD, ENTITY_TAIL,
|
||||||
DATABASE_HEAD, DATABASE_TAIL,
|
DATABASE_HEAD, DATABASE_TAIL,
|
||||||
|
COLLECTIONS_HEAD, COLLECTIONS_TAIL,
|
||||||
|
|
||||||
//
|
//
|
||||||
ALIVE_BOX_CLOSE_CLOSE, ALIVE_BOX_CLOSE_OPEN, ALIVE_BOX_OPEN_CLOSE, ALIVE_BOX_OPEN_OPEN,
|
ALIVE_BOX_CLOSE_CLOSE, ALIVE_BOX_CLOSE_OPEN, ALIVE_BOX_OPEN_CLOSE, ALIVE_BOX_OPEN_OPEN,
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19873 $
|
* Revision $Revision: 19949 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.bluemodern;
|
package net.sourceforge.plantuml.skin.bluemodern;
|
||||||
@ -56,7 +56,8 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
|||||||
|
|
||||||
public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
||||||
|
|
||||||
public ComponentBlueModernArrow(HtmlColor foregroundColor, boolean useUnderlineForHyperlink, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration,
|
public ComponentBlueModernArrow(HtmlColor foregroundColor, boolean useUnderlineForHyperlink,
|
||||||
|
FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration,
|
||||||
ISkinSimple spriteContainer) {
|
ISkinSimple spriteContainer) {
|
||||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
||||||
}
|
}
|
||||||
@ -76,7 +77,7 @@ public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
|||||||
final int x2 = (int) dimensionToUse.getWidth();
|
final int x2 = (int) dimensionToUse.getWidth();
|
||||||
|
|
||||||
if (getArrowConfiguration().isDotted()) {
|
if (getArrowConfiguration().isDotted()) {
|
||||||
ug = stroke(ug, 5, 2);
|
ug = ArrowConfiguration.stroke(ug, 5, 2, 1);
|
||||||
} else {
|
} else {
|
||||||
ug = ug.apply(new UStroke(2));
|
ug = ug.apply(new UStroke(2));
|
||||||
}
|
}
|
||||||
@ -91,21 +92,21 @@ public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
|||||||
ug = ug.apply(new UStroke(1.5));
|
ug = ug.apply(new UStroke(1.5));
|
||||||
if (direction == 1) {
|
if (direction == 1) {
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
||||||
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(new ULine(getArrowDeltaX2(),
|
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(
|
||||||
getArrowDeltaY2()));
|
new ULine(getArrowDeltaX2(), getArrowDeltaY2()));
|
||||||
}
|
}
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
||||||
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(new ULine(getArrowDeltaX2(),
|
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(
|
||||||
-getArrowDeltaY2()));
|
new ULine(getArrowDeltaX2(), -getArrowDeltaY2()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
||||||
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(new ULine(-getArrowDeltaX2(),
|
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(
|
||||||
getArrowDeltaY2()));
|
new ULine(-getArrowDeltaX2(), getArrowDeltaY2()));
|
||||||
}
|
}
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
||||||
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(new ULine(-getArrowDeltaX2(),
|
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(
|
||||||
-getArrowDeltaY2()));
|
new ULine(-getArrowDeltaX2(), -getArrowDeltaY2()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ug = ug.apply(new UStroke());
|
ug = ug.apply(new UStroke());
|
||||||
|
@ -39,6 +39,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.skin.AbstractComponent;
|
import net.sourceforge.plantuml.skin.AbstractComponent;
|
||||||
import net.sourceforge.plantuml.skin.Area;
|
import net.sourceforge.plantuml.skin.Area;
|
||||||
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||||
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
|
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||||
@ -58,7 +59,7 @@ public class ComponentBlueModernDelayLine extends AbstractComponent {
|
|||||||
protected void drawInternalU(UGraphic ug, Area area) {
|
protected void drawInternalU(UGraphic ug, Area area) {
|
||||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||||
ug = ug.apply(new UChangeColor(color));
|
ug = ug.apply(new UChangeColor(color));
|
||||||
ug = stroke(ug, 1, 4);
|
ug = ArrowConfiguration.stroke(ug, 1, 4, 1);
|
||||||
final int x = (int) (dimensionToUse.getWidth() / 2);
|
final int x = (int) (dimensionToUse.getWidth() / 2);
|
||||||
ug.apply(new UChangeBackColor(color)).apply(UAntiAliasing.ANTI_ALIASING_OFF).apply(new UTranslate(x + 1, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
ug.apply(new UChangeBackColor(color)).apply(UAntiAliasing.ANTI_ALIASING_OFF).apply(new UTranslate(x + 1, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19946 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.bluemodern;
|
package net.sourceforge.plantuml.skin.bluemodern;
|
||||||
@ -39,6 +39,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.skin.AbstractComponent;
|
import net.sourceforge.plantuml.skin.AbstractComponent;
|
||||||
import net.sourceforge.plantuml.skin.Area;
|
import net.sourceforge.plantuml.skin.Area;
|
||||||
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||||
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.ULine;
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
@ -54,7 +55,7 @@ public class ComponentBlueModernNewpage extends AbstractComponent {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawInternalU(UGraphic ug, Area area) {
|
protected void drawInternalU(UGraphic ug, Area area) {
|
||||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||||
ug = stroke(ug, 10, 2);
|
ug = ArrowConfiguration.stroke(ug, 10, 2, 1);
|
||||||
ug.apply(new UChangeColor(foregroundColor)).draw(new ULine(dimensionToUse.getWidth(), 0));
|
ug.apply(new UChangeColor(foregroundColor)).draw(new ULine(dimensionToUse.getWidth(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19873 $
|
* Revision $Revision: 19949 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.bluemodern;
|
package net.sourceforge.plantuml.skin.bluemodern;
|
||||||
@ -56,7 +56,8 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
|||||||
|
|
||||||
private final double arrowWidth = 45;
|
private final double arrowWidth = 45;
|
||||||
|
|
||||||
public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
|
public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
||||||
|
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
|
||||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +73,7 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
|||||||
final double x2 = arrowWidth - 3;
|
final double x2 = arrowWidth - 3;
|
||||||
|
|
||||||
if (getArrowConfiguration().isDotted()) {
|
if (getArrowConfiguration().isDotted()) {
|
||||||
ug = stroke(ug, 5, 2);
|
ug = ArrowConfiguration.stroke(ug, 5, 2, 1);
|
||||||
} else {
|
} else {
|
||||||
ug = ug.apply(new UStroke(2));
|
ug = ug.apply(new UStroke(2));
|
||||||
}
|
}
|
||||||
@ -90,10 +91,14 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
|||||||
|
|
||||||
if (getArrowConfiguration().isAsync()) {
|
if (getArrowConfiguration().isAsync()) {
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
||||||
ug.apply(new UStroke(1.5)).apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2() + delta)).draw(new ULine(-getArrowDeltaX2(), getArrowDeltaY2()));
|
ug.apply(new UStroke(1.5))
|
||||||
|
.apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2() + delta))
|
||||||
|
.draw(new ULine(-getArrowDeltaX2(), getArrowDeltaY2()));
|
||||||
}
|
}
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
||||||
ug.apply(new UStroke(1.5)).apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2() + delta)).draw(new ULine(-getArrowDeltaX2(), -getArrowDeltaY2()));
|
ug.apply(new UStroke(1.5))
|
||||||
|
.apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2() + delta))
|
||||||
|
.draw(new ULine(-getArrowDeltaX2(), -getArrowDeltaY2()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final UPolygon polygon = getPolygon(textHeight, delta);
|
final UPolygon polygon = getPolygon(textHeight, delta);
|
||||||
|
@ -63,9 +63,11 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
|||||||
private final HorizontalAlignment messagePosition;
|
private final HorizontalAlignment messagePosition;
|
||||||
private final boolean niceArrow;
|
private final boolean niceArrow;
|
||||||
|
|
||||||
public ComponentRoseArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
|
public ComponentRoseArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
||||||
|
ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
|
||||||
HorizontalAlignment textHorizontalAlignment, double maxMessageSize, boolean niceArrow) {
|
HorizontalAlignment textHorizontalAlignment, double maxMessageSize, boolean niceArrow) {
|
||||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment, maxMessageSize);
|
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment,
|
||||||
|
maxMessageSize);
|
||||||
this.messagePosition = messagePosition;
|
this.messagePosition = messagePosition;
|
||||||
this.niceArrow = niceArrow;
|
this.niceArrow = niceArrow;
|
||||||
}
|
}
|
||||||
@ -129,13 +131,7 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
|||||||
len -= 2 * spaceCrossX;
|
len -= 2 * spaceCrossX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getArrowConfiguration().isDotted()) {
|
getArrowConfiguration().applyStroke(ug).apply(new UTranslate(start, textHeight)).draw(new ULine(len, 0));
|
||||||
ug = stroke(ug, 2, 2);
|
|
||||||
}
|
|
||||||
ug.apply(new UTranslate(start, textHeight)).draw(new ULine(len, 0));
|
|
||||||
if (getArrowConfiguration().isDotted()) {
|
|
||||||
ug = ug.apply(new UStroke());
|
|
||||||
}
|
|
||||||
|
|
||||||
final ArrowDirection direction2 = getDirection2();
|
final ArrowDirection direction2 = getDirection2();
|
||||||
final double textPos;
|
final double textPos;
|
||||||
@ -169,10 +165,10 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
|||||||
|
|
||||||
if (dressing.getHead() == ArrowHead.ASYNC) {
|
if (dressing.getHead() == ArrowHead.ASYNC) {
|
||||||
if (dressing.getPart() != ArrowPart.BOTTOM_PART) {
|
if (dressing.getPart() != ArrowPart.BOTTOM_PART) {
|
||||||
ug.apply(new UTranslate(x - 1, textHeight)).draw(new ULine(getArrowDeltaX(), -getArrowDeltaY()));
|
getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x - 1, textHeight)).draw(new ULine(getArrowDeltaX(), -getArrowDeltaY()));
|
||||||
}
|
}
|
||||||
if (dressing.getPart() != ArrowPart.TOP_PART) {
|
if (dressing.getPart() != ArrowPart.TOP_PART) {
|
||||||
ug.apply(new UTranslate(x - 1, textHeight)).draw(new ULine(getArrowDeltaX(), getArrowDeltaY()));
|
getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x - 1, textHeight)).draw(new ULine(getArrowDeltaX(), getArrowDeltaY()));
|
||||||
}
|
}
|
||||||
} else if (dressing.getHead() == ArrowHead.CROSSX) {
|
} else if (dressing.getHead() == ArrowHead.CROSSX) {
|
||||||
ug = ug.apply(new UStroke(2));
|
ug = ug.apply(new UStroke(2));
|
||||||
@ -202,10 +198,10 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
|||||||
|
|
||||||
if (dressing.getHead() == ArrowHead.ASYNC) {
|
if (dressing.getHead() == ArrowHead.ASYNC) {
|
||||||
if (dressing.getPart() != ArrowPart.BOTTOM_PART) {
|
if (dressing.getPart() != ArrowPart.BOTTOM_PART) {
|
||||||
ug.apply(new UTranslate(x, textHeight)).draw(new ULine(-getArrowDeltaX(), -getArrowDeltaY()));
|
getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x, textHeight)).draw(new ULine(-getArrowDeltaX(), -getArrowDeltaY()));
|
||||||
}
|
}
|
||||||
if (dressing.getPart() != ArrowPart.TOP_PART) {
|
if (dressing.getPart() != ArrowPart.TOP_PART) {
|
||||||
ug.apply(new UTranslate(x, textHeight)).draw(new ULine(-getArrowDeltaX(), getArrowDeltaY()));
|
getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x, textHeight)).draw(new ULine(-getArrowDeltaX(), getArrowDeltaY()));
|
||||||
}
|
}
|
||||||
} else if (dressing.getHead() == ArrowHead.CROSSX) {
|
} else if (dressing.getHead() == ArrowHead.CROSSX) {
|
||||||
ug = ug.apply(new UStroke(2));
|
ug = ug.apply(new UStroke(2));
|
||||||
|
@ -39,6 +39,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.skin.AbstractComponent;
|
import net.sourceforge.plantuml.skin.AbstractComponent;
|
||||||
import net.sourceforge.plantuml.skin.Area;
|
import net.sourceforge.plantuml.skin.Area;
|
||||||
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||||
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
|
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
@ -56,7 +57,7 @@ public class ComponentRoseDelayLine extends AbstractComponent {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawInternalU(UGraphic ug, Area area) {
|
protected void drawInternalU(UGraphic ug, Area area) {
|
||||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||||
ug = stroke(ug, 1, 4).apply(new UChangeColor(color));
|
ug = ArrowConfiguration.stroke(ug, 1, 4, 1).apply(new UChangeColor(color));
|
||||||
final int x = (int) (dimensionToUse.getWidth() / 2);
|
final int x = (int) (dimensionToUse.getWidth() / 2);
|
||||||
ug.apply(UAntiAliasing.ANTI_ALIASING_OFF).apply(new UTranslate(x, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
ug.apply(UAntiAliasing.ANTI_ALIASING_OFF).apply(new UTranslate(x, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19946 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.rose;
|
package net.sourceforge.plantuml.skin.rose;
|
||||||
@ -42,6 +42,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||||
import net.sourceforge.plantuml.skin.Area;
|
import net.sourceforge.plantuml.skin.Area;
|
||||||
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||||
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;
|
||||||
@ -76,7 +77,7 @@ public class ComponentRoseGroupingElse extends AbstractTextualComponent {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawInternalU(UGraphic ug, Area area) {
|
protected void drawInternalU(UGraphic ug, Area area) {
|
||||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||||
ug = stroke(ug, 2, 2).apply(new UChangeColor(groupBorder));
|
ug = ArrowConfiguration.stroke(ug, 2, 2, 1).apply(new UChangeColor(groupBorder));
|
||||||
ug.apply(new UTranslate(0, 1)).draw(new ULine(dimensionToUse.getWidth(), 0));
|
ug.apply(new UTranslate(0, 1)).draw(new ULine(dimensionToUse.getWidth(), 0));
|
||||||
ug = ug.apply(new UStroke());
|
ug = ug.apply(new UStroke());
|
||||||
getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY())));
|
getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY())));
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19945 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.rose;
|
package net.sourceforge.plantuml.skin.rose;
|
||||||
@ -39,6 +39,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.skin.AbstractComponent;
|
import net.sourceforge.plantuml.skin.AbstractComponent;
|
||||||
import net.sourceforge.plantuml.skin.Area;
|
import net.sourceforge.plantuml.skin.Area;
|
||||||
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||||
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.ULine;
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
@ -64,7 +65,7 @@ public class ComponentRoseLine extends AbstractComponent {
|
|||||||
if (continueLine) {
|
if (continueLine) {
|
||||||
ug = ug.apply(new UStroke());
|
ug = ug.apply(new UStroke());
|
||||||
} else {
|
} else {
|
||||||
ug = stroke(ug, 5, 5, stroke.getThickness());
|
ug = ArrowConfiguration.stroke(ug, 5, 5, stroke.getThickness());
|
||||||
}
|
}
|
||||||
final int x = (int) (dimensionToUse.getWidth() / 2);
|
final int x = (int) (dimensionToUse.getWidth() / 2);
|
||||||
ug.apply(new UTranslate(x, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
ug.apply(new UTranslate(x, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19946 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.rose;
|
package net.sourceforge.plantuml.skin.rose;
|
||||||
@ -39,6 +39,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
|||||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||||
import net.sourceforge.plantuml.skin.AbstractComponent;
|
import net.sourceforge.plantuml.skin.AbstractComponent;
|
||||||
import net.sourceforge.plantuml.skin.Area;
|
import net.sourceforge.plantuml.skin.Area;
|
||||||
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||||
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.ULine;
|
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||||
@ -54,7 +55,7 @@ public class ComponentRoseNewpage extends AbstractComponent {
|
|||||||
@Override
|
@Override
|
||||||
protected void drawInternalU(UGraphic ug, Area area) {
|
protected void drawInternalU(UGraphic ug, Area area) {
|
||||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||||
ug = stroke(ug, 2, 2).apply(new UChangeColor(foregroundColor));
|
ug = ArrowConfiguration.stroke(ug, 2, 2, 1).apply(new UChangeColor(foregroundColor));
|
||||||
ug.draw(new ULine(dimensionToUse.getWidth(), 0));
|
ug.draw(new ULine(dimensionToUse.getWidth(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19109 $
|
* Revision $Revision: 19978 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.rose;
|
package net.sourceforge.plantuml.skin.rose;
|
||||||
@ -58,12 +58,16 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
|
|||||||
private final double deltaShadow;
|
private final double deltaShadow;
|
||||||
private final double roundCorner;
|
private final double roundCorner;
|
||||||
private final UStroke stroke;
|
private final UStroke stroke;
|
||||||
|
private final double minWidth;
|
||||||
|
private final boolean collections;
|
||||||
|
|
||||||
public ComponentRoseParticipant(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay,
|
public ComponentRoseParticipant(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay,
|
||||||
ISkinSimple spriteContainer, double roundCorner, UFont fontForStereotype,
|
ISkinSimple spriteContainer, double roundCorner, UFont fontForStereotype, HtmlColor htmlColorForStereotype,
|
||||||
HtmlColor htmlColorForStereotype) {
|
double minWidth, boolean collections) {
|
||||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7, spriteContainer, 0, false,
|
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7, spriteContainer, 0, false,
|
||||||
fontForStereotype, htmlColorForStereotype);
|
fontForStereotype, htmlColorForStereotype);
|
||||||
|
this.minWidth = minWidth;
|
||||||
|
this.collections = collections;
|
||||||
this.back = biColor.getBackColor();
|
this.back = biColor.getBackColor();
|
||||||
this.roundCorner = roundCorner;
|
this.roundCorner = roundCorner;
|
||||||
this.deltaShadow = biColor.getDeltaShadow();
|
this.deltaShadow = biColor.getDeltaShadow();
|
||||||
@ -79,19 +83,40 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
|
|||||||
final URectangle rect = new URectangle(getTextWidth(stringBounder), getTextHeight(stringBounder), roundCorner,
|
final URectangle rect = new URectangle(getTextWidth(stringBounder), getTextHeight(stringBounder), roundCorner,
|
||||||
roundCorner);
|
roundCorner);
|
||||||
rect.setDeltaShadow(deltaShadow);
|
rect.setDeltaShadow(deltaShadow);
|
||||||
|
if (collections) {
|
||||||
|
ug.apply(new UTranslate(getDeltaCollection(), 0)).draw(rect);
|
||||||
|
ug = ug.apply(new UTranslate(0, getDeltaCollection()));
|
||||||
|
}
|
||||||
ug.draw(rect);
|
ug.draw(rect);
|
||||||
ug = ug.apply(new UStroke());
|
ug = ug.apply(new UStroke());
|
||||||
final TextBlock textBlock = getTextBlock();
|
final TextBlock textBlock = getTextBlock();
|
||||||
textBlock.drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY())));
|
textBlock.drawU(ug.apply(new UTranslate(getMarginX1() + suppWidth(stringBounder) / 2, getMarginY())));
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getDeltaCollection() {
|
||||||
|
if (collections) {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getPreferredHeight(StringBounder stringBounder) {
|
public double getPreferredHeight(StringBounder stringBounder) {
|
||||||
return getTextHeight(stringBounder) + deltaShadow + 1;
|
return getTextHeight(stringBounder) + deltaShadow + 1 + getDeltaCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getPreferredWidth(StringBounder stringBounder) {
|
public double getPreferredWidth(StringBounder stringBounder) {
|
||||||
return getTextWidth(stringBounder) + deltaShadow;
|
return getTextWidth(stringBounder) + deltaShadow + getDeltaCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected double getPureTextWidth(StringBounder stringBounder) {
|
||||||
|
return Math.max(super.getPureTextWidth(stringBounder), minWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final double suppWidth(StringBounder stringBounder) {
|
||||||
|
return getPureTextWidth(stringBounder) - super.getPureTextWidth(stringBounder);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19873 $
|
* Revision $Revision: 19972 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.rose;
|
package net.sourceforge.plantuml.skin.rose;
|
||||||
@ -62,8 +62,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
|||||||
private final boolean niceArrow;
|
private final boolean niceArrow;
|
||||||
|
|
||||||
public ComponentRoseSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
public ComponentRoseSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
||||||
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize,
|
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize, boolean niceArrow) {
|
||||||
boolean niceArrow) {
|
|
||||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, HorizontalAlignment.LEFT,
|
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, HorizontalAlignment.LEFT,
|
||||||
maxMessageSize);
|
maxMessageSize);
|
||||||
this.niceArrow = niceArrow;
|
this.niceArrow = niceArrow;
|
||||||
@ -80,9 +79,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
|||||||
ug = ug.apply(new UChangeColor(getForegroundColor()));
|
ug = ug.apply(new UChangeColor(getForegroundColor()));
|
||||||
final double xRight = arrowWidth - 3;
|
final double xRight = arrowWidth - 3;
|
||||||
|
|
||||||
if (getArrowConfiguration().isDotted()) {
|
final UGraphic ug2 = getArrowConfiguration().applyStroke(ug);
|
||||||
ug = stroke(ug, 2, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
double x1 = area.getDeltaX1() < 0 ? area.getDeltaX1() : 0;
|
double x1 = area.getDeltaX1() < 0 ? area.getDeltaX1() : 0;
|
||||||
double x2 = area.getDeltaX1() > 0 ? -area.getDeltaX1() : 0 + 1;
|
double x2 = area.getDeltaX1() > 0 ? -area.getDeltaX1() : 0 + 1;
|
||||||
@ -90,7 +87,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
|||||||
final double textAndArrowHeight = textHeight + getArrowOnlyHeight(stringBounder);
|
final double textAndArrowHeight = textHeight + getArrowOnlyHeight(stringBounder);
|
||||||
final UEllipse circle = new UEllipse(ComponentRoseArrow.diamCircle, ComponentRoseArrow.diamCircle);
|
final UEllipse circle = new UEllipse(ComponentRoseArrow.diamCircle, ComponentRoseArrow.diamCircle);
|
||||||
if (getArrowConfiguration().getDecoration1() == ArrowDecoration.CIRCLE) {
|
if (getArrowConfiguration().getDecoration1() == ArrowDecoration.CIRCLE) {
|
||||||
ug.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
ug2.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
||||||
.apply(new UChangeColor(getForegroundColor()))
|
.apply(new UChangeColor(getForegroundColor()))
|
||||||
.apply(new UTranslate(x1 + 1 - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle,
|
.apply(new UTranslate(x1 + 1 - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle,
|
||||||
textHeight - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle / 2))
|
textHeight - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle / 2))
|
||||||
@ -98,7 +95,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
|||||||
x1 += ComponentRoseArrow.diamCircle / 2;
|
x1 += ComponentRoseArrow.diamCircle / 2;
|
||||||
}
|
}
|
||||||
if (getArrowConfiguration().getDecoration2() == ArrowDecoration.CIRCLE) {
|
if (getArrowConfiguration().getDecoration2() == ArrowDecoration.CIRCLE) {
|
||||||
ug.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
ug2.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
||||||
.apply(new UChangeColor(getForegroundColor()))
|
.apply(new UChangeColor(getForegroundColor()))
|
||||||
.apply(new UTranslate(x2 - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle,
|
.apply(new UTranslate(x2 - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle,
|
||||||
textAndArrowHeight - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle / 2))
|
textAndArrowHeight - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle / 2))
|
||||||
@ -111,20 +108,18 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final double arrowHeight = textAndArrowHeight - textHeight;
|
final double arrowHeight = textAndArrowHeight - textHeight;
|
||||||
ug.apply(new UTranslate(x1, textHeight)).draw(new ULine(xRight - x1, 0));
|
ug2.apply(new UTranslate(x1, textHeight)).draw(new ULine(xRight - x1, 0));
|
||||||
ug.apply(new UTranslate(xRight, textHeight)).draw(new ULine(0, arrowHeight));
|
ug2.apply(new UTranslate(xRight, textHeight)).draw(new ULine(0, arrowHeight));
|
||||||
ug.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(xRight - x2, 0));
|
ug2.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(xRight - x2, 0));
|
||||||
|
|
||||||
if (getArrowConfiguration().isDotted()) {
|
|
||||||
ug = ug.apply(new UStroke());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getArrowConfiguration().isAsync()) {
|
if (getArrowConfiguration().isAsync()) {
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
||||||
ug.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(getArrowDeltaX(), -getArrowDeltaY()));
|
getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x2, textAndArrowHeight))
|
||||||
|
.draw(new ULine(getArrowDeltaX(), -getArrowDeltaY()));
|
||||||
}
|
}
|
||||||
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
||||||
ug.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(getArrowDeltaX(), getArrowDeltaY()));
|
getArrowConfiguration().applyThicknessOnly(ug).apply(new UTranslate(x2, textAndArrowHeight))
|
||||||
|
.draw(new ULine(getArrowDeltaX(), getArrowDeltaY()));
|
||||||
}
|
}
|
||||||
} else if (hasFinalCrossX) {
|
} else if (hasFinalCrossX) {
|
||||||
ug = ug.apply(new UStroke(2));
|
ug = ug.apply(new UStroke(2));
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* Original Author: Arnaud Roques
|
* Original Author: Arnaud Roques
|
||||||
*
|
*
|
||||||
* Revision $Revision: 19510 $
|
* Revision $Revision: 19978 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.skin.rose;
|
package net.sourceforge.plantuml.skin.rose;
|
||||||
@ -110,12 +110,22 @@ public class Rose implements Skin {
|
|||||||
if (type == ComponentType.PARTICIPANT_HEAD) {
|
if (type == ComponentType.PARTICIPANT_HEAD) {
|
||||||
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||||
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
||||||
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), false);
|
||||||
}
|
}
|
||||||
if (type == ComponentType.PARTICIPANT_TAIL) {
|
if (type == ComponentType.PARTICIPANT_TAIL) {
|
||||||
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||||
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
||||||
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), false);
|
||||||
|
}
|
||||||
|
if (type == ComponentType.COLLECTIONS_HEAD) {
|
||||||
|
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||||
|
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
||||||
|
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), true);
|
||||||
|
}
|
||||||
|
if (type == ComponentType.COLLECTIONS_TAIL) {
|
||||||
|
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||||
|
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
||||||
|
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), true);
|
||||||
}
|
}
|
||||||
if (type == ComponentType.PARTICIPANT_LINE) {
|
if (type == ComponentType.PARTICIPANT_LINE) {
|
||||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||||
|
@ -693,6 +693,10 @@ public class Cluster implements Moveable {
|
|||||||
protection0 = false;
|
protection0 = false;
|
||||||
protection1 = false;
|
protection1 = false;
|
||||||
}
|
}
|
||||||
|
// if (graphvizVersion.modeSafe()) {
|
||||||
|
// protection0 = false;
|
||||||
|
// protection1 = false;
|
||||||
|
// }
|
||||||
if (protection0) {
|
if (protection0) {
|
||||||
subgraphCluster(sb, "p0");
|
subgraphCluster(sb, "p0");
|
||||||
}
|
}
|
||||||
|
@ -178,8 +178,7 @@ public final class CucaDiagramFileMakerSvek2 {
|
|||||||
final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.GENERIC_ARROW, null);
|
final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.GENERIC_ARROW, null);
|
||||||
|
|
||||||
final Line line = new Line(shapeUid1, shapeUid2, link, colorSequence, ltail, lhead, skinParam,
|
final Line line = new Line(shapeUid1, shapeUid2, link, colorSequence, ltail, lhead, skinParam,
|
||||||
stringBounder, labelFont, getBibliotekon(), dotStringFactory.getGraphvizVersion(),
|
stringBounder, labelFont, getBibliotekon(), dotData.getPragma());
|
||||||
dotData.getPragma());
|
|
||||||
|
|
||||||
getBibliotekon().addLine(line);
|
getBibliotekon().addLine(line);
|
||||||
|
|
||||||
|
@ -61,6 +61,8 @@ import net.sourceforge.plantuml.cucadiagram.dot.ProcessState;
|
|||||||
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.posimo.Moveable;
|
import net.sourceforge.plantuml.posimo.Moveable;
|
||||||
|
import net.sourceforge.plantuml.vizjs.GraphvizJs;
|
||||||
|
import net.sourceforge.plantuml.vizjs.GraphvizJsRuntimeException;
|
||||||
|
|
||||||
public class DotStringFactory implements Moveable {
|
public class DotStringFactory implements Moveable {
|
||||||
|
|
||||||
@ -202,14 +204,14 @@ public class DotStringFactory implements Moveable {
|
|||||||
|
|
||||||
root.printCluster1(sb, bibliotekon.allLines());
|
root.printCluster1(sb, bibliotekon.allLines());
|
||||||
for (Line line : bibliotekon.lines0()) {
|
for (Line line : bibliotekon.lines0()) {
|
||||||
line.appendLine(sb);
|
line.appendLine(getGraphvizVersion(), sb);
|
||||||
}
|
}
|
||||||
root.fillRankMin(rankMin);
|
root.fillRankMin(rankMin);
|
||||||
root.printCluster2(sb, bibliotekon.allLines(), stringBounder, dotMode, getGraphvizVersion(), umlDiagramType);
|
root.printCluster2(sb, bibliotekon.allLines(), stringBounder, dotMode, getGraphvizVersion(), umlDiagramType);
|
||||||
printMinRanking(sb);
|
printMinRanking(sb);
|
||||||
|
|
||||||
for (Line line : bibliotekon.lines1()) {
|
for (Line line : bibliotekon.lines1()) {
|
||||||
line.appendLine(sb);
|
line.appendLine(getGraphvizVersion(), sb);
|
||||||
}
|
}
|
||||||
SvekUtils.println(sb);
|
SvekUtils.println(sb);
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
@ -268,26 +270,51 @@ public class DotStringFactory implements Moveable {
|
|||||||
return 35;
|
return 35;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GraphvizVersion graphvizVersion;
|
||||||
|
|
||||||
public GraphvizVersion getGraphvizVersion() {
|
public GraphvizVersion getGraphvizVersion() {
|
||||||
|
if (graphvizVersion == null) {
|
||||||
|
graphvizVersion = getGraphvizVersionInternal();
|
||||||
|
}
|
||||||
|
return graphvizVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
private GraphvizVersion getGraphvizVersionInternal() {
|
||||||
final Graphviz graphviz = GraphvizUtils.create(skinParam, "foo;", "svg");
|
final Graphviz graphviz = GraphvizUtils.create(skinParam, "foo;", "svg");
|
||||||
|
if (graphviz instanceof GraphvizJs) {
|
||||||
|
return GraphvizJs.getGraphvizVersion(false);
|
||||||
|
}
|
||||||
final File f = graphviz.getDotExe();
|
final File f = graphviz.getDotExe();
|
||||||
return GraphvizVersions.getInstance().getVersion(f);
|
return GraphvizVersions.getInstance().getVersion(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSvg(BaseFile basefile, String[] dotStrings) throws IOException {
|
public String getSvg(BaseFile basefile, String[] dotOptions) throws IOException {
|
||||||
final String dotString = createDotString(dotStrings);
|
String dotString = createDotString(dotOptions);
|
||||||
|
|
||||||
if (basefile != null) {
|
if (basefile != null) {
|
||||||
final File f = basefile.getTraceFile("svek.dot");
|
final File f = basefile.getTraceFile("svek.dot");
|
||||||
SvekUtils.traceString(f, dotString);
|
SvekUtils.traceString(f, dotString);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Graphviz graphviz = GraphvizUtils.create(skinParam, dotString, "svg");
|
Graphviz graphviz = GraphvizUtils.create(skinParam, dotString, "svg");
|
||||||
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
final ProcessState state = graphviz.createFile3(baos);
|
try {
|
||||||
baos.close();
|
final ProcessState state = graphviz.createFile3(baos);
|
||||||
if (state.differs(ProcessState.TERMINATED_OK())) {
|
baos.close();
|
||||||
throw new IllegalStateException("Timeout4 " + state, state.getCause());
|
if (state.differs(ProcessState.TERMINATED_OK())) {
|
||||||
|
throw new IllegalStateException("Timeout4 " + state, state.getCause());
|
||||||
|
}
|
||||||
|
} catch (GraphvizJsRuntimeException e) {
|
||||||
|
System.err.println("GraphvizJsRuntimeException");
|
||||||
|
graphvizVersion = GraphvizJs.getGraphvizVersion(true);
|
||||||
|
dotString = createDotString(dotOptions);
|
||||||
|
graphviz = GraphvizUtils.create(skinParam, dotString, "svg");
|
||||||
|
baos = new ByteArrayOutputStream();
|
||||||
|
final ProcessState state = graphviz.createFile3(baos);
|
||||||
|
baos.close();
|
||||||
|
if (state.differs(ProcessState.TERMINATED_OK())) {
|
||||||
|
throw new IllegalStateException("Timeout4 " + state, state.getCause());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final byte[] result = baos.toByteArray();
|
final byte[] result = baos.toByteArray();
|
||||||
final String s = new String(result, "UTF-8");
|
final String s = new String(result, "UTF-8");
|
||||||
@ -302,6 +329,9 @@ public class DotStringFactory implements Moveable {
|
|||||||
|
|
||||||
public boolean illegalDotExe() {
|
public boolean illegalDotExe() {
|
||||||
final Graphviz graphviz = GraphvizUtils.create(skinParam, "svg");
|
final Graphviz graphviz = GraphvizUtils.create(skinParam, "svg");
|
||||||
|
if (graphviz instanceof GraphvizJs) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final File dotExe = graphviz.getDotExe();
|
final File dotExe = graphviz.getDotExe();
|
||||||
return dotExe == null || dotExe.isFile() == false || dotExe.canRead() == false;
|
return dotExe == null || dotExe.isFile() == false || dotExe.canRead() == false;
|
||||||
}
|
}
|
||||||
|
@ -119,20 +119,9 @@ public class Line implements Moveable, Hideable {
|
|||||||
|
|
||||||
private boolean opale;
|
private boolean opale;
|
||||||
private Cluster projectionCluster;
|
private Cluster projectionCluster;
|
||||||
private final GraphvizVersion graphvizVersion;
|
|
||||||
|
|
||||||
private final Pragma pragma;
|
private final Pragma pragma;
|
||||||
|
private final HtmlColor backgroundColor;
|
||||||
// private GraphvizVersion getGraphvizVersion() {
|
|
||||||
// if (pragma.isDefine("graphviz")==false) {
|
|
||||||
// return GraphvizVersion.COMMON;
|
|
||||||
// }
|
|
||||||
// final String value = pragma.getValue("graphviz");
|
|
||||||
// if ("2.34".equals(value)) {
|
|
||||||
// return GraphvizVersion.V2_34_0;
|
|
||||||
// }
|
|
||||||
// return GraphvizVersion.COMMON;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
@ -205,7 +194,7 @@ public class Line implements Moveable, Hideable {
|
|||||||
|
|
||||||
public Line(String startUid, String endUid, Link link, ColorSequence colorSequence, Cluster ltail, Cluster lhead,
|
public Line(String startUid, String endUid, Link link, ColorSequence colorSequence, Cluster ltail, Cluster lhead,
|
||||||
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration labelFont, Bibliotekon bibliotekon,
|
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration labelFont, Bibliotekon bibliotekon,
|
||||||
GraphvizVersion graphvizVersion, Pragma pragma) {
|
Pragma pragma) {
|
||||||
if (startUid == null || endUid == null || link == null) {
|
if (startUid == null || endUid == null || link == null) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
@ -213,7 +202,7 @@ public class Line implements Moveable, Hideable {
|
|||||||
skinParam = link.getColors().mute(skinParam);
|
skinParam = link.getColors().mute(skinParam);
|
||||||
labelFont = labelFont.mute(link.getColors());
|
labelFont = labelFont.mute(link.getColors());
|
||||||
}
|
}
|
||||||
this.graphvizVersion = graphvizVersion;
|
this.backgroundColor = skinParam.getBackgroundColor();
|
||||||
this.pragma = pragma;
|
this.pragma = pragma;
|
||||||
this.bibliotekon = bibliotekon;
|
this.bibliotekon = bibliotekon;
|
||||||
this.stringBounder = stringBounder;
|
this.stringBounder = stringBounder;
|
||||||
@ -308,7 +297,7 @@ public class Line implements Moveable, Hideable {
|
|||||||
return link.getLinkArrow();
|
return link.getLinkArrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendLine(StringBuilder sb) {
|
public void appendLine(GraphvizVersion graphvizVersion, StringBuilder sb) {
|
||||||
// Log.println("inverted=" + isInverted());
|
// Log.println("inverted=" + isInverted());
|
||||||
// if (isInverted()) {
|
// if (isInverted()) {
|
||||||
// sb.append(endUid);
|
// sb.append(endUid);
|
||||||
@ -332,14 +321,20 @@ public class Line implements Moveable, Hideable {
|
|||||||
// length = 2;
|
// length = 2;
|
||||||
// }
|
// }
|
||||||
if (pragma.horizontalLineBetweenDifferentPackageAllowed() || link.isInvis() || length != 1) {
|
if (pragma.horizontalLineBetweenDifferentPackageAllowed() || link.isInvis() || length != 1) {
|
||||||
|
// if (graphvizVersion.isJs() == false) {
|
||||||
sb.append("minlen=" + (length - 1));
|
sb.append("minlen=" + (length - 1));
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
sb.append("color=\"" + StringUtils.getAsHtml(lineColor) + "\"");
|
sb.append("color=\"" + StringUtils.getAsHtml(lineColor) + "\"");
|
||||||
if (labelText != null) {
|
if (labelText != null) {
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
sb.append("label=<");
|
if (graphvizVersion.modeSafe()) {
|
||||||
appendTable(sb, labelText.calculateDimension(stringBounder), noteLabelColor);
|
sb.append("xlabel=<");
|
||||||
|
} else {
|
||||||
|
sb.append("label=<");
|
||||||
|
}
|
||||||
|
appendTable(sb, labelText.calculateDimension(stringBounder), noteLabelColor, graphvizVersion);
|
||||||
sb.append(">");
|
sb.append(">");
|
||||||
// sb.append(",labelfloat=true");
|
// sb.append(",labelfloat=true");
|
||||||
}
|
}
|
||||||
@ -347,14 +342,14 @@ public class Line implements Moveable, Hideable {
|
|||||||
if (startTailText != null) {
|
if (startTailText != null) {
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
sb.append("taillabel=<");
|
sb.append("taillabel=<");
|
||||||
appendTable(sb, startTailText.calculateDimension(stringBounder), startTailColor);
|
appendTable(sb, startTailText.calculateDimension(stringBounder), startTailColor, graphvizVersion);
|
||||||
sb.append(">");
|
sb.append(">");
|
||||||
// sb.append(",labelangle=0");
|
// sb.append(",labelangle=0");
|
||||||
}
|
}
|
||||||
if (endHeadText != null) {
|
if (endHeadText != null) {
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
sb.append("headlabel=<");
|
sb.append("headlabel=<");
|
||||||
appendTable(sb, endHeadText.calculateDimension(stringBounder), endHeadColor);
|
appendTable(sb, endHeadText.calculateDimension(stringBounder), endHeadColor, graphvizVersion);
|
||||||
sb.append(">");
|
sb.append(">");
|
||||||
// sb.append(",labelangle=0");
|
// sb.append(",labelangle=0");
|
||||||
}
|
}
|
||||||
@ -380,13 +375,14 @@ public class Line implements Moveable, Hideable {
|
|||||||
// if (graphvizVersion == GraphvizVersion.V2_34_0) {
|
// if (graphvizVersion == GraphvizVersion.V2_34_0) {
|
||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
if (pragma.horizontalLineBetweenDifferentPackageAllowed() == false && link.getLength() == 1) {
|
if (pragma.horizontalLineBetweenDifferentPackageAllowed() == false && link.getLength() == 1
|
||||||
|
/* && graphvizVersion.isJs() == false */) {
|
||||||
return "{rank=same; " + getStartUid() + "; " + getEndUid() + "}";
|
return "{rank=same; " + getStartUid() + "; " + getEndUid() + "}";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void appendTable(StringBuilder sb, Dimension2D dim, int col) {
|
public static void appendTable(StringBuilder sb, Dimension2D dim, int col, GraphvizVersion graphvizVersion) {
|
||||||
final int w = (int) dim.getWidth();
|
final int w = (int) dim.getWidth();
|
||||||
final int h = (int) dim.getHeight();
|
final int h = (int) dim.getHeight();
|
||||||
appendTable(sb, w, h, col);
|
appendTable(sb, w, h, col);
|
||||||
@ -423,7 +419,7 @@ public class Line implements Moveable, Hideable {
|
|||||||
|
|
||||||
private UDrawable getExtremity(LinkDecor decor, PointListIterator pointListIterator, Point2D center, double angle,
|
private UDrawable getExtremity(LinkDecor decor, PointListIterator pointListIterator, Point2D center, double angle,
|
||||||
Cluster cluster) {
|
Cluster cluster) {
|
||||||
final ExtremityFactory extremityFactory = decor.getExtremityFactory();
|
final ExtremityFactory extremityFactory = decor.getExtremityFactory(backgroundColor);
|
||||||
|
|
||||||
if (cluster != null) {
|
if (cluster != null) {
|
||||||
if (extremityFactory != null) {
|
if (extremityFactory != null) {
|
||||||
|
@ -35,6 +35,7 @@ package net.sourceforge.plantuml.svek.extremity;
|
|||||||
|
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||||
@ -45,15 +46,16 @@ class ExtremityDiamond extends Extremity {
|
|||||||
private UPolygon polygon = new UPolygon();
|
private UPolygon polygon = new UPolygon();
|
||||||
private final boolean fill;
|
private final boolean fill;
|
||||||
private final Point2D contact;
|
private final Point2D contact;
|
||||||
|
private final HtmlColor backgroundColor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Point2D somePoint() {
|
public Point2D somePoint() {
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ExtremityDiamond(Point2D p1, double angle, boolean fill, HtmlColor backgroundColor) {
|
||||||
public ExtremityDiamond(Point2D p1, double angle, boolean fill) {
|
|
||||||
this.fill = fill;
|
this.fill = fill;
|
||||||
|
this.backgroundColor = backgroundColor;
|
||||||
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
||||||
angle = manageround(angle);
|
angle = manageround(angle);
|
||||||
polygon.addPoint(0, 0);
|
polygon.addPoint(0, 0);
|
||||||
@ -71,7 +73,7 @@ class ExtremityDiamond extends Extremity {
|
|||||||
if (fill) {
|
if (fill) {
|
||||||
ug = ug.apply(new UChangeBackColor(ug.getParam().getColor()));
|
ug = ug.apply(new UChangeBackColor(ug.getParam().getColor()));
|
||||||
} else {
|
} else {
|
||||||
ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
|
ug = ug.apply(new UChangeBackColor(backgroundColor));
|
||||||
}
|
}
|
||||||
ug.draw(polygon);
|
ug.draw(polygon);
|
||||||
}
|
}
|
||||||
|
@ -35,25 +35,28 @@ package net.sourceforge.plantuml.svek.extremity;
|
|||||||
|
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||||
import net.sourceforge.plantuml.graphic.UDrawable;
|
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||||
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
||||||
|
|
||||||
public class ExtremityFactoryDiamond extends AbstractExtremityFactory implements ExtremityFactory {
|
public class ExtremityFactoryDiamond extends AbstractExtremityFactory implements ExtremityFactory {
|
||||||
|
|
||||||
private final boolean fill;
|
private final boolean fill;
|
||||||
|
private final HtmlColor backgroundColor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UDrawable createUDrawable(Point2D p0, double angle) {
|
public UDrawable createUDrawable(Point2D p0, double angle) {
|
||||||
return new ExtremityDiamond(p0, angle - Math.PI / 2, fill);
|
return new ExtremityDiamond(p0, angle - Math.PI / 2, fill, backgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExtremityFactoryDiamond(boolean fill) {
|
public ExtremityFactoryDiamond(boolean fill, HtmlColor backgroundColor) {
|
||||||
this.fill = fill;
|
this.fill = fill;
|
||||||
|
this.backgroundColor = backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2) {
|
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2) {
|
||||||
final double ortho = atan2(p0, p2);
|
final double ortho = atan2(p0, p2);
|
||||||
return new ExtremityDiamond(p1, ortho, fill);
|
return new ExtremityDiamond(p1, ortho, fill, backgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,19 +38,23 @@ import net.sourceforge.plantuml.StringUtils;
|
|||||||
import net.sourceforge.plantuml.command.regex.Matcher2;
|
import net.sourceforge.plantuml.command.regex.Matcher2;
|
||||||
import net.sourceforge.plantuml.command.regex.MyPattern;
|
import net.sourceforge.plantuml.command.regex.MyPattern;
|
||||||
import net.sourceforge.plantuml.command.regex.Pattern2;
|
import net.sourceforge.plantuml.command.regex.Pattern2;
|
||||||
|
import net.sourceforge.plantuml.core.DiagramType;
|
||||||
|
|
||||||
public class StartUtils {
|
public class StartUtils {
|
||||||
|
|
||||||
public static final String PAUSE_PATTERN = "(?i)((?:\\W|\\<[^<>]*\\>)*)@unpause";
|
public static final Pattern2 patternFilename = MyPattern
|
||||||
public static final String START_PATTERN = "(?i)((?:[^\\w~]|\\<[^<>]*\\>)*)@start";
|
.cmpile("^[@\\\\]start[^%s{}%g]+[%s{][%s%g]*([^%g]*?)[%s}%g]*$");
|
||||||
|
|
||||||
public static boolean isArobaseStartDiagram(CharSequence s) {
|
public static final String PAUSE_PATTERN = "(?i)((?:\\W|\\<[^<>]*\\>)*)[@\\\\]unpause";
|
||||||
return StringUtils.trinNoTrace(s).startsWith("@start");
|
public static final String START_PATTERN = "(?i)((?:[^\\w~]|\\<[^<>]*\\>)*)[@\\\\]start";
|
||||||
}
|
|
||||||
|
|
||||||
public static String beforeStartUml(final CharSequence2 result) {
|
public static String beforeStartUml(final CharSequence2 result) {
|
||||||
boolean inside = false;
|
boolean inside = false;
|
||||||
for (int i = 0; i < result.length(); i++) {
|
for (int i = 0; i < result.length(); i++) {
|
||||||
|
final CharSequence2 tmp = result.subSequence(i, result.length());
|
||||||
|
if (startsWithSymbolAnd("start", tmp)) {
|
||||||
|
return result.subSequence(0, i).toString();
|
||||||
|
}
|
||||||
final String single = result.subSequence(i, i + 1).toString();
|
final String single = result.subSequence(i, i + 1).toString();
|
||||||
if (inside) {
|
if (inside) {
|
||||||
if (single.equals(">")) {
|
if (single.equals(">")) {
|
||||||
@ -58,9 +62,6 @@ public class StartUtils {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (result.subSequence(i, result.length()).startsWith("@start")) {
|
|
||||||
return result.subSequence(0, i).toString();
|
|
||||||
}
|
|
||||||
if (single.equals("<")) {
|
if (single.equals("<")) {
|
||||||
inside = true;
|
inside = true;
|
||||||
} else if (single.matches("[\\w~]")) {
|
} else if (single.matches("[\\w~]")) {
|
||||||
@ -75,19 +76,35 @@ public class StartUtils {
|
|||||||
// return null;
|
// return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isArobaseStartDiagram(CharSequence s) {
|
||||||
|
final String s2 = StringUtils.trinNoTrace(s);
|
||||||
|
return DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean startsWithSymbolAnd(String value, final CharSequence2 tmp) {
|
||||||
|
return tmp.startsWith("@" + value) || tmp.startsWith("\\" + value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean startsWithSymbolAnd(String value, final String tmp) {
|
||||||
|
return tmp.startsWith("@" + value) || tmp.startsWith("\\" + value);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isArobaseEndDiagram(CharSequence s) {
|
public static boolean isArobaseEndDiagram(CharSequence s) {
|
||||||
return StringUtils.trinNoTrace(s).startsWith("@end");
|
final String s2 = StringUtils.trinNoTrace(s);
|
||||||
|
return startsWithSymbolAnd("end", s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isArobasePauseDiagram(CharSequence s) {
|
public static boolean isArobasePauseDiagram(CharSequence s) {
|
||||||
return StringUtils.trinNoTrace(s).startsWith("@pause");
|
final String s2 = StringUtils.trinNoTrace(s);
|
||||||
|
return startsWithSymbolAnd("pause", s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isArobaseUnpauseDiagram(CharSequence s) {
|
public static boolean isArobaseUnpauseDiagram(CharSequence s) {
|
||||||
return StringUtils.trinNoTrace(s).startsWith("@unpause");
|
final String s2 = StringUtils.trinNoTrace(s);
|
||||||
|
return startsWithSymbolAnd("unpause", s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Pattern2 append = MyPattern.cmpile("^\\W*@append");
|
private static final Pattern2 append = MyPattern.cmpile("^\\W*[@\\\\]append");
|
||||||
|
|
||||||
public static CharSequence2 getPossibleAppend(CharSequence2 s) {
|
public static CharSequence2 getPossibleAppend(CharSequence2 s) {
|
||||||
final Matcher2 m = append.matcher(s);
|
final Matcher2 m = append.matcher(s);
|
||||||
|
@ -169,6 +169,7 @@ public class PSystemVersion extends AbstractPSystem {
|
|||||||
strings.add("<u>Original idea</u>: Arnaud Roques");
|
strings.add("<u>Original idea</u>: Arnaud Roques");
|
||||||
strings.add("<u>Word Macro</u>: Alain Bertucat & Matthieu Sabatier");
|
strings.add("<u>Word Macro</u>: Alain Bertucat & Matthieu Sabatier");
|
||||||
strings.add("<u>Word Add-in</u>: Adriaan van den Brand");
|
strings.add("<u>Word Add-in</u>: Adriaan van den Brand");
|
||||||
|
strings.add("<u>J2V8 & viz.js integration</u>: Andreas Studer");
|
||||||
strings.add("<u>Eclipse Plugin</u>: Claude Durif & Anne Pecoil");
|
strings.add("<u>Eclipse Plugin</u>: Claude Durif & Anne Pecoil");
|
||||||
strings.add("<u>Servlet & XWiki</u>: Maxime Sinclair");
|
strings.add("<u>Servlet & XWiki</u>: Maxime Sinclair");
|
||||||
strings.add("<u>Site design</u>: Raphael Cotisson");
|
strings.add("<u>Site design</u>: Raphael Cotisson");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user