mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 02:49:06 +00:00
version 8043
This commit is contained in:
parent
fd538b5fe8
commit
446f3d9a18
@ -60,7 +60,7 @@
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
|
||||
<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>
|
||||
</jar>
|
||||
<delete dir="build" />
|
||||
|
2
pom.xml
2
pom.xml
@ -36,7 +36,7 @@
|
||||
|
||||
<groupId>net.sourceforge.plantuml</groupId>
|
||||
<artifactId>plantuml</artifactId>
|
||||
<version>8042-SNAPSHOT</version>
|
||||
<version>8043-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PlantUML</name>
|
||||
|
@ -38,9 +38,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
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.utils.StartUtils;
|
||||
|
||||
public class BlockUml {
|
||||
|
||||
@ -48,8 +47,6 @@ public class BlockUml {
|
||||
private final int startLine;
|
||||
private Diagram system;
|
||||
|
||||
private static final Pattern2 patternFilename = MyPattern.cmpile("^@start[^%s{}%g]+[%s{][%s%g]*([^%g]*?)[%s}%g]*$");
|
||||
|
||||
BlockUml(String... strings) {
|
||||
this(convert(strings), 0);
|
||||
}
|
||||
@ -81,7 +78,7 @@ public class BlockUml {
|
||||
public BlockUml(List<CharSequence2> strings, int startLine) {
|
||||
this.startLine = startLine;
|
||||
final CharSequence2 s0 = strings.get(0).trin();
|
||||
if (s0.startsWith("@start") == false) {
|
||||
if (StartUtils.startsWithSymbolAnd("start", s0) == false) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.data = new ArrayList<CharSequence2>(strings);
|
||||
@ -91,7 +88,7 @@ public class BlockUml {
|
||||
if (OptionFlags.getInstance().isWord()) {
|
||||
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();
|
||||
if (ok == false) {
|
||||
return null;
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19510 $
|
||||
* Revision $Revision: 19978 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -132,6 +132,8 @@ public enum ColorParam {
|
||||
storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
|
||||
boundaryBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||
boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||
collectionsBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||
collectionsBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||
controlBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||
controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
|
||||
entityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19896 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -39,7 +39,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
|
||||
public class FileSystem {
|
||||
|
||||
private final static FileSystem singleton = new FileSystem();
|
||||
@ -92,10 +91,11 @@ public class FileSystem {
|
||||
|
||||
private List<File> getPath(String prop) {
|
||||
final List<File> result = new ArrayList<File>();
|
||||
final String paths = System.getProperty(prop);
|
||||
String paths = System.getProperty(prop);
|
||||
if (paths == null) {
|
||||
return result;
|
||||
}
|
||||
paths = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(paths);
|
||||
final StringTokenizer st = new StringTokenizer(paths, System.getProperty("path.separator"));
|
||||
while (st.hasMoreTokens()) {
|
||||
final File f = new File(st.nextToken());
|
||||
|
@ -42,10 +42,12 @@ public enum LineParam {
|
||||
// sequenceReferenceBorder(0.1),
|
||||
sequenceLifeLineBorder,
|
||||
sequenceParticipantBorder, noteBorder, sequenceGroupBorder, sequenceReferenceBorder,
|
||||
sequenceArrow,
|
||||
classBorder, objectBorder,
|
||||
partitionBorder,
|
||||
packageBorder,
|
||||
swimlaneBorder;
|
||||
swimlaneBorder,
|
||||
activityBorder;
|
||||
// sequenceBoxBorder(0.1);
|
||||
|
||||
}
|
||||
|
@ -68,11 +68,20 @@ public class SourceStringReader {
|
||||
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) {
|
||||
this(defines, source, charset, config, null);
|
||||
}
|
||||
|
||||
public SourceStringReader(Defines defines, String source, String charset, List<String> config, File newCurrentDir) {
|
||||
// WARNING GLOBAL LOCK HERE
|
||||
synchronized (SourceStringReader.class) {
|
||||
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();
|
||||
} catch (IOException e) {
|
||||
Log.error("error " + e);
|
||||
|
@ -35,6 +35,7 @@ package net.sourceforge.plantuml.activitydiagram3;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
@ -118,8 +119,8 @@ public class Branch {
|
||||
return ftile;
|
||||
}
|
||||
|
||||
public boolean shadowing() {
|
||||
return ftile.shadowing();
|
||||
public ISkinParam skinParam() {
|
||||
return ftile.skinParam();
|
||||
}
|
||||
|
||||
public final HtmlColor getColor() {
|
||||
|
@ -48,7 +48,7 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
|
||||
}
|
||||
|
||||
public Ftile createFtile(FtileFactory factory) {
|
||||
return new FtileGoto(factory.shadowing(), getSwimlaneIn(), name);
|
||||
return new FtileGoto(factory.skinParam(), getSwimlaneIn(), name);
|
||||
}
|
||||
|
||||
public void add(Instruction other) {
|
||||
|
@ -48,7 +48,7 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
|
||||
}
|
||||
|
||||
public Ftile createFtile(FtileFactory factory) {
|
||||
return new FtileLabel(factory.shadowing(), getSwimlaneIn(), name);
|
||||
return new FtileLabel(factory.skinParam(), getSwimlaneIn(), name);
|
||||
}
|
||||
|
||||
public void add(Instruction other) {
|
||||
|
@ -78,7 +78,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
|
||||
|
||||
public Ftile createFtile(FtileFactory factory) {
|
||||
if (all.size() == 0) {
|
||||
return new FtileEmpty(factory.shadowing(), defaultSwimlane);
|
||||
return new FtileEmpty(factory.skinParam(), defaultSwimlane);
|
||||
}
|
||||
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn());
|
||||
for (Instruction ins : all) {
|
||||
|
@ -36,21 +36,34 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
|
||||
|
||||
private final boolean shadowing;
|
||||
private final ISkinParam skinParam;
|
||||
|
||||
public AbstractFtile(boolean shadowing) {
|
||||
private AbstractFtile(boolean shadowing) {
|
||||
this.shadowing = shadowing;
|
||||
this.skinParam = null;
|
||||
}
|
||||
|
||||
final public boolean shadowing() {
|
||||
return shadowing;
|
||||
public AbstractFtile(ISkinParam skinParam) {
|
||||
this.shadowing = skinParam.shadowing();
|
||||
this.skinParam = skinParam;
|
||||
}
|
||||
|
||||
final public ISkinParam skinParam() {
|
||||
if (skinParam == null) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
return skinParam;
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
@ -69,4 +82,12 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
|
||||
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 net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public interface Ftile extends Swimable, TextBlock {
|
||||
|
||||
public boolean shadowing();
|
||||
public UStroke getThickness();
|
||||
|
||||
public ISkinParam skinParam();
|
||||
|
||||
public LinkRendering getInLinkRendering();
|
||||
|
||||
|
@ -39,10 +39,12 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
||||
@ -132,8 +134,12 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
||||
return Collections.unmodifiableSet(result);
|
||||
}
|
||||
|
||||
public boolean shadowing() {
|
||||
return tile1.shadowing() || tile2.shadowing();
|
||||
public ISkinParam skinParam() {
|
||||
return tile1.skinParam();
|
||||
}
|
||||
|
||||
public UStroke getThickness() {
|
||||
return tile1.getThickness();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
|
||||
@ -47,12 +48,12 @@ public class FtileEmpty extends AbstractFtile {
|
||||
private final Swimlane swimlaneIn;
|
||||
private final Swimlane swimlaneOut;
|
||||
|
||||
public FtileEmpty(boolean shadowing, double width, double height) {
|
||||
this(shadowing, width, height, null, null);
|
||||
public FtileEmpty(ISkinParam skinParam, double width, double height) {
|
||||
this(skinParam, width, height, null, null);
|
||||
}
|
||||
|
||||
public FtileEmpty(boolean shadowing, double width, double height, Swimlane swimlaneIn, Swimlane swimlaneOut) {
|
||||
super(shadowing);
|
||||
public FtileEmpty(ISkinParam skinParam, double width, double height, Swimlane swimlaneIn, Swimlane swimlaneOut) {
|
||||
super(skinParam);
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.swimlaneIn = swimlaneIn;
|
||||
@ -60,12 +61,12 @@ public class FtileEmpty extends AbstractFtile {
|
||||
|
||||
}
|
||||
|
||||
public FtileEmpty(boolean shadowing) {
|
||||
this(shadowing, 0, 0, null, null);
|
||||
public FtileEmpty(ISkinParam skinParam) {
|
||||
this(skinParam, 0, 0, null, null);
|
||||
}
|
||||
|
||||
public FtileEmpty(boolean shadowing, Swimlane swimlane) {
|
||||
this(shadowing, 0, 0, swimlane, swimlane);
|
||||
public FtileEmpty(ISkinParam skinParam, Swimlane swimlane) {
|
||||
this(skinParam, 0, 0, swimlane, swimlane);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
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.NoteType;
|
||||
|
||||
public interface FtileFactory extends ISkinSimple {
|
||||
public interface FtileFactory {
|
||||
|
||||
public StringBounder getStringBounder();
|
||||
|
||||
public boolean shadowing();
|
||||
public ISkinParam skinParam();
|
||||
|
||||
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.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
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.NoteType;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
|
||||
|
||||
public class FtileFactoryDelegator implements FtileFactory {
|
||||
|
||||
private final FtileFactory factory;
|
||||
private final ISkinParam skinParam;
|
||||
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
protected final Rainbow getInLinkRenderingColor(Ftile tile) {
|
||||
Rainbow color;
|
||||
final LinkRendering linkRendering = tile.getInLinkRendering();
|
||||
if (linkRendering == null) {
|
||||
color = HtmlColorAndStyle.build(getSkinParam());
|
||||
color = HtmlColorAndStyle.build(skinParam());
|
||||
} else {
|
||||
color = linkRendering.getRainbow();
|
||||
}
|
||||
if (color.size() == 0) {
|
||||
color = HtmlColorAndStyle.build(getSkinParam());
|
||||
color = HtmlColorAndStyle.build(skinParam());
|
||||
}
|
||||
return color;
|
||||
}
|
||||
@ -80,9 +78,8 @@ public class FtileFactoryDelegator implements FtileFactory {
|
||||
if (Display.isNull(display)) {
|
||||
return null;
|
||||
}
|
||||
final ISkinParam skinParam = getSkinParam();
|
||||
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.ACTIVITY_ARROW, null);
|
||||
return display.create(fontConfiguration, HorizontalAlignment.LEFT, this, CreoleMode.SIMPLE_LINE);
|
||||
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||
return display.create(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
|
||||
}
|
||||
|
||||
protected Display getInLinkRenderingDisplay(Ftile tile) {
|
||||
@ -93,9 +90,8 @@ public class FtileFactoryDelegator implements FtileFactory {
|
||||
return linkRendering.getDisplay();
|
||||
}
|
||||
|
||||
public FtileFactoryDelegator(FtileFactory factory, ISkinParam skinParam) {
|
||||
public FtileFactoryDelegator(FtileFactory factory) {
|
||||
this.factory = factory;
|
||||
this.skinParam = skinParam;
|
||||
}
|
||||
|
||||
public Ftile start(Swimlane swimlane) {
|
||||
@ -172,48 +168,15 @@ public class FtileFactoryDelegator implements FtileFactory {
|
||||
return factory.getStringBounder();
|
||||
}
|
||||
|
||||
protected final ISkinParam getSkinParam() {
|
||||
return skinParam;
|
||||
}
|
||||
|
||||
protected final Rose getRose() {
|
||||
return rose;
|
||||
}
|
||||
|
||||
public boolean shadowing() {
|
||||
return skinParam.shadowing();
|
||||
public final ISkinParam skinParam() {
|
||||
return factory.skinParam();
|
||||
}
|
||||
|
||||
protected FtileFactory getFactory() {
|
||||
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;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
|
||||
public class FtileGoto extends FtileEmpty {
|
||||
|
||||
private final String name;
|
||||
|
||||
public FtileGoto(boolean shadowing, Swimlane swimlane, String name) {
|
||||
super(shadowing, swimlane);
|
||||
public FtileGoto(ISkinParam skinParam, Swimlane swimlane, String name) {
|
||||
super(skinParam, swimlane);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class FtileHeightFixed extends AbstractFtile {
|
||||
private final double fixedHeight;
|
||||
|
||||
public FtileHeightFixed(Ftile tile, double fixedHeight) {
|
||||
super(tile.shadowing());
|
||||
super(tile.skinParam());
|
||||
this.tile = tile;
|
||||
this.fixedHeight = fixedHeight;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class FtileKilled extends AbstractFtile {
|
||||
private final Ftile tile;
|
||||
|
||||
public FtileKilled(Ftile tileToKill) {
|
||||
super(tileToKill.shadowing());
|
||||
super(tileToKill.skinParam());
|
||||
this.tile = tileToKill;
|
||||
}
|
||||
|
||||
|
@ -33,12 +33,14 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
|
||||
public class FtileLabel extends FtileEmpty {
|
||||
|
||||
private final String name;
|
||||
|
||||
public FtileLabel(boolean shadowing, Swimlane swimlane, String name) {
|
||||
super(shadowing, swimlane);
|
||||
public FtileLabel(ISkinParam skinParam, Swimlane swimlane, String name) {
|
||||
super(skinParam, swimlane);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class FtileMarged extends AbstractFtile {
|
||||
private final double margin2;
|
||||
|
||||
public FtileMarged(Ftile tile, double margin1, double margin2) {
|
||||
super(tile.shadowing());
|
||||
super(tile.skinParam());
|
||||
this.tile = tile;
|
||||
this.margin1 = margin1;
|
||||
this.margin2 = margin2;
|
||||
|
@ -45,7 +45,7 @@ public class FtileMargedRight extends AbstractFtile {
|
||||
private final double maxX;
|
||||
|
||||
public FtileMargedRight(Ftile tile, double maxX) {
|
||||
super(tile.shadowing());
|
||||
super(tile.skinParam());
|
||||
this.tile = tile;
|
||||
this.maxX = maxX;
|
||||
}
|
||||
|
@ -78,11 +78,11 @@ public class FtileUtils {
|
||||
// return new FtileMarged(ftile, margin);
|
||||
// }
|
||||
|
||||
private static Ftile neverNull(Ftile ftile) {
|
||||
if (ftile == null) {
|
||||
return new FtileEmpty(false);
|
||||
}
|
||||
return ftile;
|
||||
}
|
||||
// private static Ftile neverNull(Ftile ftile, ISkinParam skinParam) {
|
||||
// if (ftile == null) {
|
||||
// return new FtileEmpty(skinParam);
|
||||
// }
|
||||
// return ftile;
|
||||
// }
|
||||
|
||||
}
|
||||
|
@ -109,15 +109,15 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
||||
|
||||
private FtileFactory getFtileFactory() {
|
||||
FtileFactory factory = new VCompactFactory(skinParam, TextBlockUtils.getDummyStringBounder());
|
||||
factory = new FtileFactoryDelegatorAddUrl(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorAssembly(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorIf(factory, skinParam, pragma);
|
||||
factory = new FtileFactoryDelegatorWhile(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorRepeat(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorCreateFork(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorCreateSplit(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorAddNote(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorCreateGroup(factory, skinParam);
|
||||
factory = new FtileFactoryDelegatorAddUrl(factory);
|
||||
factory = new FtileFactoryDelegatorAssembly(factory);
|
||||
factory = new FtileFactoryDelegatorIf(factory, pragma);
|
||||
factory = new FtileFactoryDelegatorWhile(factory);
|
||||
factory = new FtileFactoryDelegatorRepeat(factory);
|
||||
factory = new FtileFactoryDelegatorCreateFork(factory);
|
||||
factory = new FtileFactoryDelegatorCreateSplit(factory);
|
||||
factory = new FtileFactoryDelegatorAddNote(factory);
|
||||
factory = new FtileFactoryDelegatorCreateGroup(factory);
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
@ -179,10 +179,16 @@ public class WormMutation {
|
||||
|
||||
public UChange getGlobalTranslate(int size) {
|
||||
final MinMax result = new MinMax();
|
||||
for (UTranslate tr : translations) {
|
||||
result.append(tr.getDx());
|
||||
if (translations.get(0).getDy() == 0) {
|
||||
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) {
|
||||
|
@ -33,7 +33,6 @@
|
||||
*/
|
||||
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.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
@ -44,8 +43,8 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
|
||||
|
||||
public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
|
||||
|
||||
public FtileFactoryDelegatorAddNote(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorAddNote(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,8 +53,8 @@ public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
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;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
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 FtileFactoryDelegatorAddUrl(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorAddUrl(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
@ -50,8 +49,8 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
|
||||
|
||||
public FtileFactoryDelegatorAssembly(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorAssembly(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,7 +39,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||
@ -70,14 +69,14 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
||||
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
public FtileFactoryDelegatorCreateFork(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorCreateFork(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
||||
final HtmlColor colorBar = rose.getHtmlColor(getSkinParam(), ColorParam.activityBar);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
final HtmlColor colorBar = rose.getHtmlColor(skinParam(), ColorParam.activityBar);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||
|
||||
final Dimension2D dimSuper = super.createFork(swimlane, all).calculateDimension(getStringBounder());
|
||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||
@ -91,7 +90,7 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
||||
|
||||
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;
|
||||
for (Ftile tmp : list) {
|
||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
|
@ -34,7 +34,6 @@
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
@ -46,15 +45,15 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
|
||||
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
public FtileFactoryDelegatorCreateGroup(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorCreateGroup(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
|
||||
HtmlColor borderColor) {
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
return new FtileGroup(list, name, headerNote, arrowColor, backColor, titleColor, getSkinParam(), borderColor);
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.activityArrow);
|
||||
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.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.OptionFlags;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
@ -73,8 +72,8 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
public FtileFactoryDelegatorCreateSplit(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorCreateSplit(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
static private boolean isSimpleSwimlanes(List<Ftile> all) {
|
||||
@ -121,7 +120,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
// // } else if (isSeveralSwimlanes(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 double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||
@ -208,7 +207,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
}
|
||||
|
||||
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 double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||
|
@ -37,7 +37,6 @@ import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.Pragma;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
@ -56,8 +55,8 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
||||
|
||||
private final Pragma pragma;
|
||||
|
||||
public FtileFactoryDelegatorIf(FtileFactory factory, ISkinParam skinParam, Pragma pragma) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorIf(FtileFactory factory, Pragma pragma) {
|
||||
super(factory);
|
||||
this.pragma = pragma;
|
||||
}
|
||||
|
||||
@ -65,15 +64,15 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
||||
public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
|
||||
LinkRendering topInlinkRendering) {
|
||||
|
||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
||||
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
|
||||
final Branch branch0 = thens.get(0);
|
||||
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(getSkinParam(),
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
|
||||
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));
|
||||
if (thens.size() > 1) {
|
||||
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
|
||||
: FontParam.ACTIVITY_ARROW;
|
||||
final FontConfiguration fcTest = new FontConfiguration(getSkinParam(), testParam, null)
|
||||
final FontConfiguration fcTest = new FontConfiguration(skinParam(), testParam, null)
|
||||
.changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
|
||||
|
||||
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) {
|
||||
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.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
@ -50,29 +49,28 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
|
||||
public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
|
||||
|
||||
public FtileFactoryDelegatorRepeat(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorRepeat(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
||||
HtmlColor color, LinkRendering backRepeatLinkRendering) {
|
||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
||||
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
|
||||
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
|
||||
ColorParam.activityBackground) : color;
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityBackground)
|
||||
: color;
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
|
||||
|
||||
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
|
||||
final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering
|
||||
.getRainbow();
|
||||
final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getRainbow();
|
||||
|
||||
final FontParam fontParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
||||
: 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,
|
||||
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.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
@ -50,28 +49,28 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
|
||||
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
|
||||
|
||||
public FtileFactoryDelegatorWhile(FtileFactory factory, ISkinParam skinParam) {
|
||||
super(factory, skinParam);
|
||||
public FtileFactoryDelegatorWhile(FtileFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
|
||||
LinkRendering afterEndwhile, HtmlColor color) {
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(),
|
||||
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
|
||||
: 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 Rainbow endInlinkColor = endInlinkRendering == null || endInlinkRendering.getRainbow().size() == 0 ? arrowColor
|
||||
: 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,
|
||||
endInlinkColor, afterEndwhile, fontArrow, getFactory(), conditionStyle, fcTest);
|
||||
|
@ -54,7 +54,7 @@ class FtileForkInner extends AbstractFtile {
|
||||
private final List<Ftile> forks = new ArrayList<Ftile>();
|
||||
|
||||
public FtileForkInner(List<Ftile> forks) {
|
||||
super(forks.get(0).shadowing());
|
||||
super(forks.get(0).skinParam());
|
||||
for (Ftile ftile : forks) {
|
||||
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,
|
||||
HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor) {
|
||||
super(inner.shadowing());
|
||||
super(inner.skinParam());
|
||||
this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
|
||||
this.inner = FtileUtils.addHorizontalMargin(inner, 10);
|
||||
this.arrowColor = arrowColor;
|
||||
@ -185,7 +185,7 @@ public class FtileGroup extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
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);
|
||||
USymbol.FRAME.asBig(name, TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext)
|
||||
.drawU(ug);
|
||||
|
@ -83,7 +83,7 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
private FtileIfAndStop(Ftile diamond1, Ftile tile1, Rainbow arrowColor, Ftile stopFtile) {
|
||||
super(tile1.shadowing());
|
||||
super(tile1.skinParam());
|
||||
this.diamond1 = diamond1;
|
||||
this.tile1 = tile1;
|
||||
this.stop2 = stopFtile;
|
||||
@ -130,14 +130,14 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
final Sheet sheet = new CreoleParser(fcTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
||||
.createSheet(labelTest);
|
||||
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;
|
||||
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);
|
||||
} 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);
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
|
@ -81,7 +81,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
private final 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()) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
@ -148,15 +148,15 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
List<Ftile> diamonds = new ArrayList<Ftile>();
|
||||
for (Branch branch : thens) {
|
||||
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
||||
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
||||
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.shadowing(), backColor, borderColor, swimlane,
|
||||
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.skinParam(), backColor, borderColor, swimlane,
|
||||
tbTest);
|
||||
diamond = diamond.withNorth(tb1);
|
||||
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;
|
||||
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,
|
||||
Ftile lastDiamond) {
|
||||
super(tiles.get(0).shadowing() || tile2.shadowing());
|
||||
super(tiles.get(0).skinParam());
|
||||
if (diamonds.size() != tiles.size()) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
@ -149,21 +149,21 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
List<Ftile> diamonds = new ArrayList<Ftile>();
|
||||
for (Branch branch : thens) {
|
||||
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
||||
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory);
|
||||
FtileDiamondInside3 diamond = new FtileDiamondInside3(branch.shadowing(), backColor, borderColor, swimlane,
|
||||
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
FtileDiamondInside3 diamond = new FtileDiamondInside3(branch.skinParam(), backColor, borderColor, swimlane,
|
||||
tbTest);
|
||||
diamond = diamond.withEast(tb1);
|
||||
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;
|
||||
diamonds.set(last, ((FtileDiamondInside3) diamonds.get(last)).withSouth(tb2));
|
||||
|
||||
// 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);
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil {
|
||||
}
|
||||
|
||||
public FtileNoteAlone(boolean shadow, Display note, ISkinParam skinParam, boolean withOutPoint, Swimlane swimlane) {
|
||||
super(shadow);
|
||||
super(skinParam);
|
||||
this.swimlane = swimlane;
|
||||
this.withOutPoint = withOutPoint;
|
||||
final Rose rose = new Rose();
|
||||
|
@ -78,7 +78,7 @@ class FtileRepeat extends AbstractFtile {
|
||||
private final TextBlock tbTest;
|
||||
|
||||
private FtileRepeat(Ftile repeat, Ftile diamond1, Ftile diamond2, TextBlock tbTest) {
|
||||
super(repeat.shadowing());
|
||||
super(repeat.skinParam());
|
||||
this.repeat = repeat;
|
||||
this.diamond1 = diamond1;
|
||||
this.diamond2 = diamond2;
|
||||
@ -108,20 +108,20 @@ class FtileRepeat extends AbstractFtile {
|
||||
final TextBlock yesTb = yes.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;
|
||||
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);
|
||||
// final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlane,
|
||||
// tbTest).withEast(yesTb).withSouth(outTb);
|
||||
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0));
|
||||
} 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);
|
||||
result = new FtileRepeat(repeat, diamond1, diamond2, tbTest);
|
||||
} 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));
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
|
@ -54,7 +54,7 @@ class FtileSplit1 extends AbstractFtile {
|
||||
private final List<Ftile> forks = new ArrayList<Ftile>();
|
||||
|
||||
public FtileSplit1(List<Ftile> forks) {
|
||||
super(forks.get(0).shadowing());
|
||||
super(forks.get(0).skinParam());
|
||||
for (Ftile ftile : forks) {
|
||||
this.forks.add(ftile);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class FtileWhile extends AbstractFtile {
|
||||
}
|
||||
|
||||
private FtileWhile(Ftile whileBlock, Ftile diamond1, TextBlock supplementarySouthText) {
|
||||
super(whileBlock.shadowing());
|
||||
super(whileBlock.skinParam());
|
||||
this.whileBlock = whileBlock;
|
||||
this.diamond1 = diamond1;
|
||||
this.supplementarySouthText = supplementarySouthText;
|
||||
@ -115,23 +115,23 @@ class FtileWhile extends AbstractFtile {
|
||||
LinkRendering afterEndwhile, FontConfiguration fontArrow, FtileFactory ftileFactory,
|
||||
ConditionStyle conditionStyle, FontConfiguration fcTest) {
|
||||
|
||||
final TextBlock yesTb = yes.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory);
|
||||
final TextBlock testTb = test.create(fcTest, HorizontalAlignment.LEFT, ftileFactory);
|
||||
final TextBlock out = out2.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory);
|
||||
final TextBlock yesTb = yes.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
final TextBlock testTb = test.create(fcTest, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
final TextBlock out = out2.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam());
|
||||
|
||||
final Ftile diamond1;
|
||||
final TextBlock supplementarySouthText;
|
||||
if (conditionStyle == ConditionStyle.INSIDE) {
|
||||
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);
|
||||
} else if (conditionStyle == ConditionStyle.FOO1) {
|
||||
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);
|
||||
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
||||
supplementarySouthText = createLabel1(test, yes, ftileFactory, fontArrow);
|
||||
diamond1 = new FtileDiamond(whileBlock.shadowing(), backColor, borderColor, swimlane).withWest(out)
|
||||
supplementarySouthText = createLabel1(test, yes, ftileFactory.skinParam(), fontArrow);
|
||||
diamond1 = new FtileDiamond(whileBlock.skinParam(), backColor, borderColor, swimlane).withWest(out)
|
||||
.withSouth(supplementarySouthText);
|
||||
} else {
|
||||
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,
|
||||
boolean withLink) {
|
||||
super(tile.shadowing());
|
||||
super(tile.skinParam());
|
||||
this.tile = tile;
|
||||
this.notePosition = notePosition;
|
||||
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.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.color.Colors;
|
||||
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
||||
import net.sourceforge.plantuml.sequencediagram.NoteType;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
|
||||
|
||||
public class VCompactFactory implements FtileFactory {
|
||||
|
||||
@ -81,17 +79,17 @@ public class VCompactFactory implements FtileFactory {
|
||||
|
||||
public Ftile start(Swimlane swimlane) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
@ -99,7 +97,7 @@ public class VCompactFactory implements FtileFactory {
|
||||
// final HtmlColor backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityBackground) :
|
||||
// color;
|
||||
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) {
|
||||
@ -161,36 +159,8 @@ public class VCompactFactory implements FtileFactory {
|
||||
return new FtileDecorateOut(ftile, linkRendering);
|
||||
}
|
||||
|
||||
public boolean shadowing() {
|
||||
return skinParam.shadowing();
|
||||
}
|
||||
|
||||
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();
|
||||
public ISkinParam skinParam() {
|
||||
return skinParam;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
public class ConditionalBuilder {
|
||||
|
||||
@ -79,10 +78,9 @@ public class ConditionalBuilder {
|
||||
private final Ftile tile1;
|
||||
private final Ftile tile2;
|
||||
|
||||
public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor,
|
||||
Rainbow arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
|
||||
Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow,
|
||||
FontConfiguration fontTest) {
|
||||
public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
|
||||
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow, FontConfiguration fontTest) {
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
this.backColor = backColor;
|
||||
@ -101,10 +99,9 @@ public class ConditionalBuilder {
|
||||
|
||||
}
|
||||
|
||||
static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor,
|
||||
Rainbow arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
|
||||
Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow,
|
||||
FontConfiguration fcTest) {
|
||||
static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
|
||||
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow, FontConfiguration fcTest) {
|
||||
final ConditionalBuilder builder = new ConditionalBuilder(swimlane, borderColor, backColor, arrowColor,
|
||||
ftileFactory, conditionStyle, branch1, branch2, skinParam, stringBounder, fcArrow, fcTest);
|
||||
return builder.createWithLinks();
|
||||
@ -159,14 +156,14 @@ public class ConditionalBuilder {
|
||||
final Sheet sheet = new CreoleParser(fontTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
||||
.createSheet(labelTest);
|
||||
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;
|
||||
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);
|
||||
} 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);
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
@ -175,13 +172,13 @@ public class ConditionalBuilder {
|
||||
}
|
||||
|
||||
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);
|
||||
return tb2;
|
||||
}
|
||||
|
||||
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);
|
||||
return tb1;
|
||||
}
|
||||
@ -191,16 +188,16 @@ public class ConditionalBuilder {
|
||||
if (hasTwoBranches()) {
|
||||
final Display out1 = branch1.getFtile().getOutLinkRendering().getDisplay();
|
||||
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 TextBlock tbout2 = out2 == null ? null : out2.create(fontArrow, HorizontalAlignment.LEFT,
|
||||
ftileFactory, CreoleMode.SIMPLE_LINE);
|
||||
diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
|
||||
ftileFactory.skinParam(), CreoleMode.SIMPLE_LINE);
|
||||
diamond2 = new FtileDiamond(tile1.skinParam(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
|
||||
tbout2);
|
||||
} else {
|
||||
// diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2,
|
||||
// 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;
|
||||
}
|
||||
|
@ -33,14 +33,15 @@
|
||||
*/
|
||||
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.FtileGeometry;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
|
||||
public abstract class FtileDimensionMemoize extends AbstractFtile {
|
||||
|
||||
public FtileDimensionMemoize(boolean shadowing) {
|
||||
super(shadowing);
|
||||
public FtileDimensionMemoize(ISkinParam skinParam) {
|
||||
super(skinParam);
|
||||
}
|
||||
|
||||
private FtileGeometry calculateDimensionInternal;
|
||||
|
@ -53,7 +53,7 @@ public class FtileIfNude extends FtileDimensionMemoize {
|
||||
private final Swimlane in;
|
||||
|
||||
FtileIfNude(Ftile tile1, Ftile tile2, Swimlane in) {
|
||||
super(tile1.shadowing() || tile2.shadowing());
|
||||
super(tile1.skinParam());
|
||||
this.tile1 = tile1;
|
||||
this.tile2 = tile2;
|
||||
this.in = in;
|
||||
@ -147,10 +147,10 @@ public class FtileIfNude extends FtileDimensionMemoize {
|
||||
return (dim1.getWidth() - dim1.getLeft()) + dim2.getLeft();
|
||||
}
|
||||
|
||||
// protected double getLeft(StringBounder stringBounder) {
|
||||
// final double left1 = tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft();
|
||||
// final double left2 = tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft();
|
||||
// return (left1 + left2) / 2;
|
||||
// }
|
||||
// protected double getLeft(StringBounder stringBounder) {
|
||||
// final double left1 = tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft();
|
||||
// final double left2 = tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft();
|
||||
// return (left1 + left2) / 2;
|
||||
// }
|
||||
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
@ -53,8 +54,8 @@ public class FtileBlackBlock extends AbstractFtile {
|
||||
private final HtmlColor colorBar;
|
||||
private final Swimlane swimlane;
|
||||
|
||||
public FtileBlackBlock(boolean shadowing, HtmlColor colorBar, Swimlane swimlane) {
|
||||
super(shadowing);
|
||||
public FtileBlackBlock(ISkinParam skinParam, HtmlColor colorBar, Swimlane swimlane) {
|
||||
super(skinParam);
|
||||
this.colorBar = colorBar;
|
||||
this.swimlane = swimlane;
|
||||
}
|
||||
@ -70,7 +71,7 @@ public class FtileBlackBlock extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final URectangle rect = new URectangle(width, height, 5, 5);
|
||||
if (shadowing()) {
|
||||
if (skinParam().shadowing()) {
|
||||
rect.setDeltaShadow(3);
|
||||
}
|
||||
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,
|
||||
ISkinParam skinParam) {
|
||||
super(shadowing);
|
||||
public FtileBox(ISkinParam skinParam, Display label, UFont font, Swimlane swimlane, BoxStyle style) {
|
||||
super(skinParam);
|
||||
this.style = style;
|
||||
this.skinParam = skinParam;
|
||||
this.swimlane = swimlane;
|
||||
@ -136,12 +135,12 @@ public class FtileBox extends AbstractFtile {
|
||||
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
final double widthTotal = dimTotal.getWidth();
|
||||
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 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);
|
||||
|
||||
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.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
@ -57,8 +58,8 @@ public class FtileCircleEnd extends AbstractFtile {
|
||||
private final HtmlColor backColor;
|
||||
private final Swimlane swimlane;
|
||||
|
||||
public FtileCircleEnd(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
|
||||
super(shadowing);
|
||||
public FtileCircleEnd(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane) {
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
}
|
||||
@ -85,7 +86,7 @@ public class FtileCircleEnd extends AbstractFtile {
|
||||
yTheoricalPosition = Math.round(yTheoricalPosition);
|
||||
|
||||
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
||||
if (shadowing()) {
|
||||
if (skinParam().shadowing()) {
|
||||
circle.setDeltaShadow(3);
|
||||
}
|
||||
ug = ug.apply(new UChangeColor(backColor));
|
||||
|
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
@ -53,8 +54,8 @@ public class FtileCircleStart extends AbstractFtile {
|
||||
private final HtmlColor backColor;
|
||||
private final Swimlane swimlane;
|
||||
|
||||
public FtileCircleStart(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
|
||||
super(shadowing);
|
||||
public FtileCircleStart(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane) {
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
}
|
||||
@ -76,7 +77,7 @@ public class FtileCircleStart extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
||||
if (shadowing()) {
|
||||
if (skinParam().shadowing()) {
|
||||
circle.setDeltaShadow(3);
|
||||
}
|
||||
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.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
@ -54,8 +55,8 @@ public class FtileCircleStop extends AbstractFtile {
|
||||
private final HtmlColor backColor;
|
||||
private final Swimlane swimlane;
|
||||
|
||||
public FtileCircleStop(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
|
||||
super(shadowing);
|
||||
public FtileCircleStop(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane) {
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
}
|
||||
@ -82,7 +83,7 @@ public class FtileCircleStop extends AbstractFtile {
|
||||
yTheoricalPosition = Math.round(yTheoricalPosition);
|
||||
|
||||
final UEllipse circle = new UEllipse(SIZE, SIZE);
|
||||
if (shadowing()) {
|
||||
if (skinParam().shadowing()) {
|
||||
circle.setDeltaShadow(3);
|
||||
}
|
||||
ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(null))
|
||||
@ -90,7 +91,7 @@ public class FtileCircleStop extends AbstractFtile {
|
||||
|
||||
final double delta = 4;
|
||||
final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2);
|
||||
if (shadowing()) {
|
||||
if (skinParam().shadowing()) {
|
||||
circleSmall.setDeltaShadow(3);
|
||||
}
|
||||
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.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||
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.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
|
||||
@ -66,7 +68,7 @@ public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
|
||||
public LinkRendering getInLinkRendering() {
|
||||
return ftile.getInLinkRendering();
|
||||
}
|
||||
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
ftile.drawU(ug);
|
||||
}
|
||||
@ -95,10 +97,14 @@ public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
|
||||
return ftile.getSwimlaneOut();
|
||||
}
|
||||
|
||||
public boolean shadowing() {
|
||||
return ftile.shadowing();
|
||||
public ISkinParam skinParam() {
|
||||
return ftile.skinParam();
|
||||
}
|
||||
|
||||
|
||||
public UStroke getThickness() {
|
||||
return ftile.getThickness();
|
||||
}
|
||||
|
||||
protected final Ftile getFtileDelegated() {
|
||||
return ftile;
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||
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.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileDiamond extends AbstractFtile {
|
||||
@ -63,36 +63,36 @@ public class FtileDiamond extends AbstractFtile {
|
||||
private final TextBlock west1;
|
||||
private final TextBlock east1;
|
||||
|
||||
public FtileDiamond(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane) {
|
||||
this(shadowing, backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
|
||||
public FtileDiamond(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane) {
|
||||
this(skinParam, backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
|
||||
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
|
||||
}
|
||||
|
||||
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) {
|
||||
if (west1 == null) {
|
||||
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) {
|
||||
if (east1 == null) {
|
||||
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) {
|
||||
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) {
|
||||
super(shadowing);
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
@ -119,8 +119,8 @@ public class FtileDiamond extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
|
||||
ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor))
|
||||
.draw(Diamond.asPolygon(shadowing()));
|
||||
ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor))
|
||||
.draw(Diamond.asPolygon(skinParam().shadowing()));
|
||||
final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder());
|
||||
north.drawU(ug.apply(new UTranslate(Diamond.diamondHalfSize * 1.5, -dimNorth.getHeight()
|
||||
- Diamond.diamondHalfSize)));
|
||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||
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.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileDiamondFoo1 extends AbstractFtile {
|
||||
@ -62,27 +62,27 @@ public class FtileDiamondFoo1 extends AbstractFtile {
|
||||
private final TextBlock east;
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
super(shadowing);
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
@ -111,8 +111,8 @@ public class FtileDiamondFoo1 extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygonFoo1(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygonFoo1(skinParam().shadowing(), dimTotal.getWidth(), 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 net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||
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.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileDiamondInside extends AbstractFtile {
|
||||
@ -64,22 +64,22 @@ public class FtileDiamondInside extends AbstractFtile {
|
||||
private final TextBlock north;
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
@ -87,12 +87,12 @@ public class FtileDiamondInside extends AbstractFtile {
|
||||
}
|
||||
|
||||
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) {
|
||||
super(shadowing);
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
@ -122,8 +122,8 @@ public class FtileDiamondInside extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), 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())));
|
||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||
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.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileDiamondInside2 extends AbstractFtile {
|
||||
@ -63,31 +63,31 @@ public class FtileDiamondInside2 extends AbstractFtile {
|
||||
private final TextBlock north;
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
super(shadowing);
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
@ -117,8 +117,8 @@ public class FtileDiamondInside2 extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), 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())));
|
||||
|
@ -38,6 +38,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
|
||||
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.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
import net.sourceforge.plantuml.utils.MathUtils;
|
||||
|
||||
@ -65,31 +65,31 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
|
||||
private final TextBlock north;
|
||||
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) {
|
||||
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));
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
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) {
|
||||
super(shadowing);
|
||||
super(skinParam);
|
||||
this.backColor = backColor;
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
@ -119,8 +119,8 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
|
||||
ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), 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())));
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.code;
|
||||
@ -46,6 +46,9 @@ public class AsciiEncoder implements URLEncoder {
|
||||
}
|
||||
|
||||
public String encode(byte data[]) {
|
||||
if (data == null) {
|
||||
return "";
|
||||
}
|
||||
final StringBuilder resu = new StringBuilder((data.length * 4 + 2) / 3);
|
||||
for (int i = 0; i < data.length; i += 3) {
|
||||
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 byte[] compress(byte[] in) {
|
||||
if (in.length == 0) {
|
||||
return null;
|
||||
}
|
||||
int len = in.length * 2;
|
||||
if (len < 100) {
|
||||
len = 100;
|
||||
}
|
||||
byte[] result = null;
|
||||
while (result == null) {
|
||||
result = tryCompress(in, len);
|
||||
|
@ -33,45 +33,47 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.core;
|
||||
|
||||
import net.sourceforge.plantuml.utils.StartUtils;
|
||||
|
||||
public enum DiagramType {
|
||||
UML, DITAA, DOT, PROJECT, JCCKIT, SALT, TURING, FLOW, CREOLE, JUNGLE, CUTE, UNKNOWN;
|
||||
|
||||
static public DiagramType getTypeFromArobaseStart(String s) {
|
||||
s = s.toLowerCase();
|
||||
// if (s.startsWith("@startuml2")) {
|
||||
// return UML2;
|
||||
// }
|
||||
if (s.startsWith("@startuml")) {
|
||||
// if (s.startsWith("@startuml2")) {
|
||||
// return UML2;
|
||||
// }
|
||||
if (StartUtils.startsWithSymbolAnd("startuml", s)) {
|
||||
return UML;
|
||||
}
|
||||
if (s.startsWith("@startdot")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startdot", s)) {
|
||||
return DOT;
|
||||
}
|
||||
if (s.startsWith("@startjcckit")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startjcckit", s)) {
|
||||
return JCCKIT;
|
||||
}
|
||||
if (s.startsWith("@startditaa")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startditaa", s)) {
|
||||
return DITAA;
|
||||
}
|
||||
if (s.startsWith("@startproject")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startproject", s)) {
|
||||
return PROJECT;
|
||||
}
|
||||
if (s.startsWith("@startsalt")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startsalt", s)) {
|
||||
return SALT;
|
||||
}
|
||||
if (s.startsWith("@startturing")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startturing", s)) {
|
||||
return TURING;
|
||||
}
|
||||
if (s.startsWith("@startflow")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startflow", s)) {
|
||||
return FLOW;
|
||||
}
|
||||
if (s.startsWith("@startcreole")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startcreole", s)) {
|
||||
return CREOLE;
|
||||
}
|
||||
if (s.startsWith("@starttree")) {
|
||||
if (StartUtils.startsWithSymbolAnd("starttree", s)) {
|
||||
return JUNGLE;
|
||||
}
|
||||
if (s.startsWith("@startcute")) {
|
||||
if (StartUtils.startsWithSymbolAnd("startcute", s)) {
|
||||
return CUTE;
|
||||
}
|
||||
return UNKNOWN;
|
||||
|
@ -34,6 +34,7 @@
|
||||
package net.sourceforge.plantuml.cucadiagram;
|
||||
|
||||
import net.sourceforge.plantuml.OptionFlags;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
|
||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrow;
|
||||
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrowAndCircle;
|
||||
@ -79,7 +80,7 @@ public enum LinkDecor {
|
||||
return arrowSize;
|
||||
}
|
||||
|
||||
public ExtremityFactory getExtremityFactory() {
|
||||
public ExtremityFactory getExtremityFactory(HtmlColor backgroundColor) {
|
||||
if (this == LinkDecor.PLUS) {
|
||||
return new ExtremityFactoryPlus();
|
||||
} else if (this == LinkDecor.ARROW_TRIANGLE) {
|
||||
@ -91,9 +92,9 @@ public enum LinkDecor {
|
||||
} else if (this == LinkDecor.ARROW_AND_CIRCLE) {
|
||||
return new ExtremityFactoryArrowAndCircle();
|
||||
} else if (this == LinkDecor.AGREGATION) {
|
||||
return new ExtremityFactoryDiamond(false);
|
||||
return new ExtremityFactoryDiamond(false, backgroundColor);
|
||||
} else if (this == LinkDecor.COMPOSITION) {
|
||||
return new ExtremityFactoryDiamond(true);
|
||||
return new ExtremityFactoryDiamond(true, backgroundColor);
|
||||
} else if (this == LinkDecor.CIRCLE) {
|
||||
return new ExtremityFactoryCircle();
|
||||
} else if (this == LinkDecor.SQUARRE) {
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19398 $
|
||||
* Revision $Revision: 19931 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.cucadiagram.dot;
|
||||
@ -44,9 +44,12 @@ import java.util.regex.Pattern;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.vizjs.GraphvizJs;
|
||||
import net.sourceforge.plantuml.vizjs.VizJsEngine;
|
||||
|
||||
public class GraphvizUtils {
|
||||
|
||||
// private static final String VIZJS = "vizjs";
|
||||
private static int DOT_VERSION_LIMIT = 226;
|
||||
|
||||
private static boolean isWindows() {
|
||||
@ -64,6 +67,9 @@ public class GraphvizUtils {
|
||||
}
|
||||
|
||||
public static Graphviz create(ISkinParam skinParam, String dotString, String... type) {
|
||||
if (VizJsEngine.isOk()) {
|
||||
return new GraphvizJs(dotString);
|
||||
}
|
||||
final AbstractGraphviz result;
|
||||
if (isWindows()) {
|
||||
result = new GraphvizWindows(skinParam, dotString, type);
|
||||
@ -157,7 +163,24 @@ public class GraphvizUtils {
|
||||
red = "<b><color:red>";
|
||||
bold = "<b>";
|
||||
}
|
||||
|
||||
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();
|
||||
if (ent == null) {
|
||||
result.add("The environment variable GRAPHVIZ_DOT has not been set");
|
||||
|
@ -38,6 +38,10 @@ public interface GraphvizVersion {
|
||||
|
||||
public boolean useProtectionWhenThereALinkFromOrToGroup();
|
||||
|
||||
public boolean modeSafe();
|
||||
|
||||
public boolean isVizjs();
|
||||
|
||||
// COMMON, V2_34_0
|
||||
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ import net.sourceforge.plantuml.StringUtils;
|
||||
public class GraphvizVersionFinder {
|
||||
|
||||
final private File dotExe;
|
||||
final private static GraphvizVersion DEFAULT = new GraphvizVersion() {
|
||||
final public static GraphvizVersion DEFAULT = new GraphvizVersion() {
|
||||
public boolean useShield() {
|
||||
return true;
|
||||
}
|
||||
@ -50,6 +50,14 @@ public class GraphvizVersionFinder {
|
||||
public boolean useProtectionWhenThereALinkFromOrToGroup() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean modeSafe() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isVizjs() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public GraphvizVersionFinder(File dotExe) {
|
||||
@ -76,6 +84,14 @@ public class GraphvizVersionFinder {
|
||||
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 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 {
|
||||
final GraphicStrings result = getGraphicStrings();
|
||||
|
@ -183,6 +183,7 @@ public class QuoteUtils {
|
||||
"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
|
||||
// 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() {
|
||||
|
@ -115,6 +115,9 @@ class RealLine {
|
||||
}
|
||||
|
||||
private void printCounter(Map<PositiveForce, Integer> counter) {
|
||||
for (PositiveForce f : forces) {
|
||||
System.err.println("force=" + f);
|
||||
}
|
||||
for (Map.Entry<PositiveForce, Integer> ent : counter.entrySet()) {
|
||||
System.err.println("count=" + ent.getValue() + " for " + ent.getKey());
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19978 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram;
|
||||
@ -41,7 +41,8 @@ public enum ParticipantType {
|
||||
BOUNDARY(ColorParam.boundaryBackground), //
|
||||
CONTROL(ColorParam.controlBackground), //
|
||||
ENTITY(ColorParam.entityBackground), //
|
||||
DATABASE(ColorParam.databaseBackground);
|
||||
DATABASE(ColorParam.databaseBackground), //
|
||||
COLLECTIONS(ColorParam.collectionsBackground);
|
||||
|
||||
private final ColorParam background;
|
||||
|
||||
|
@ -62,8 +62,8 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
|
||||
}
|
||||
|
||||
static IRegex getRegexType() {
|
||||
return new RegexOr(new RegexLeaf("TYPE", "(participant|actor|create|boundary|control|entity|database)"), //
|
||||
new RegexLeaf("CREATE", "create[%s](participant|actor|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|collections)"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19885 $
|
||||
* Revision $Revision: 19976 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||
@ -45,6 +45,7 @@ import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
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.ugraphic.UClip;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class DrawableSet {
|
||||
@ -279,7 +281,7 @@ public class DrawableSet {
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
*
|
||||
* Revision $Revision: 19885 $
|
||||
* Revision $Revision: 19978 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||
@ -574,6 +574,9 @@ class DrawableSetInitializer {
|
||||
} else if (p.getType() == ParticipantType.DATABASE) {
|
||||
headType = ComponentType.DATABASE_HEAD;
|
||||
tailType = ComponentType.DATABASE_TAIL;
|
||||
} else if (p.getType() == ParticipantType.COLLECTIONS) {
|
||||
headType = ComponentType.COLLECTIONS_HEAD;
|
||||
tailType = ComponentType.COLLECTIONS_TAIL;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ abstract class Step1Abstract {
|
||||
}
|
||||
|
||||
protected final void setConfig(ArrowConfiguration config) {
|
||||
this.config = config;
|
||||
this.config = config.withThickness(drawingSet.getArrowThickness());
|
||||
}
|
||||
|
||||
protected final Component getNote() {
|
||||
|
@ -109,6 +109,11 @@ public class NotesTile implements Tile {
|
||||
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) {
|
||||
final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
|
||||
final NotePosition position = note.getPosition();
|
||||
@ -145,9 +150,17 @@ public class NotesTile implements Tile {
|
||||
final List<Note> all = notes.asList();
|
||||
for (int i = 0; i < all.size() - 1; i++) {
|
||||
for (int j = i + 1; j < all.size(); j++) {
|
||||
final Real point1 = getX2(stringBounder, all.get(i));
|
||||
final Real point2 = getX(stringBounder, all.get(j));
|
||||
point2.ensureBiggerThan(point1);
|
||||
final double center1 = getXcenter(stringBounder, all.get(i)).getCurrentValue();
|
||||
final double center2 = getXcenter(stringBounder, all.get(j)).getCurrentValue();
|
||||
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
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19945 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin;
|
||||
@ -45,22 +45,22 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public abstract class AbstractComponent implements Component {
|
||||
|
||||
final protected void stroke(Graphics2D g2d, float dash, float thickness) {
|
||||
final float[] style = { dash, dash };
|
||||
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) {
|
||||
return ug.apply(new UStroke(dashVisible, dashSpace, thickness));
|
||||
}
|
||||
|
||||
final protected void stroke(Graphics2D g2d, float dash) {
|
||||
stroke(g2d, dash, 1);
|
||||
}
|
||||
|
||||
final protected UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace) {
|
||||
return stroke(ug, dashVisible, dashSpace, 1);
|
||||
}
|
||||
// final protected void stroke(Graphics2D g2d, float dash, float thickness) {
|
||||
// final float[] style = { dash, dash };
|
||||
// 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) {
|
||||
// return ug.apply(new UStroke(dashVisible, dashSpace, thickness));
|
||||
// }
|
||||
//
|
||||
// final protected void stroke(Graphics2D g2d, float dash) {
|
||||
// stroke(g2d, dash, 1);
|
||||
// }
|
||||
//
|
||||
// final protected UGraphic stroke(UGraphic ug, double dashVisible, double dashSpace) {
|
||||
// return stroke(ug, dashVisible, dashSpace, 1);
|
||||
// }
|
||||
|
||||
abstract protected void drawInternalU(UGraphic ug, Area area);
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19885 $
|
||||
* Revision $Revision: 19971 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin;
|
||||
@ -93,7 +93,7 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
|
||||
return textBlock;
|
||||
}
|
||||
|
||||
final protected double getPureTextWidth(StringBounder stringBounder) {
|
||||
protected double getPureTextWidth(StringBounder stringBounder) {
|
||||
final TextBlock textBlock = getTextBlock();
|
||||
final Dimension2D size = textBlock.calculateDimension(stringBounder);
|
||||
return size.getWidth();
|
||||
|
@ -34,6 +34,8 @@
|
||||
package net.sourceforge.plantuml.skin;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
public class ArrowConfiguration {
|
||||
|
||||
@ -48,12 +50,14 @@ public class ArrowConfiguration {
|
||||
private final HtmlColor color;
|
||||
|
||||
private final boolean isSelf;
|
||||
private final double thickness;
|
||||
|
||||
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) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.thickness = thickness;
|
||||
this.body = body;
|
||||
this.dressing1 = dressing1;
|
||||
this.dressing2 = dressing2;
|
||||
@ -75,19 +79,19 @@ public class ArrowConfiguration {
|
||||
|
||||
public static ArrowConfiguration withDirectionNormal() {
|
||||
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() {
|
||||
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
|
||||
ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
|
||||
false);
|
||||
false, 1);
|
||||
}
|
||||
|
||||
public static ArrowConfiguration withDirectionSelf() {
|
||||
return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
|
||||
ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
|
||||
true);
|
||||
true, 1);
|
||||
}
|
||||
|
||||
public static ArrowConfiguration withDirectionReverse() {
|
||||
@ -95,21 +99,22 @@ public class ArrowConfiguration {
|
||||
}
|
||||
|
||||
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() {
|
||||
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) {
|
||||
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) {
|
||||
final ArrowDressing newDressing1 = addHead(dressing1, 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) {
|
||||
@ -121,33 +126,33 @@ public class ArrowConfiguration {
|
||||
|
||||
public ArrowConfiguration withHead1(ArrowHead head) {
|
||||
return new ArrowConfiguration(body, dressing1.withHead(head), dressing2, decoration1, decoration2, color,
|
||||
isSelf);
|
||||
isSelf, thickness);
|
||||
}
|
||||
|
||||
public ArrowConfiguration withHead2(ArrowHead head) {
|
||||
return new ArrowConfiguration(body, dressing1, dressing2.withHead(head), decoration1, decoration2, color,
|
||||
isSelf);
|
||||
isSelf, thickness);
|
||||
}
|
||||
|
||||
public ArrowConfiguration withPart(ArrowPart part) {
|
||||
if (dressing2.getHead() != ArrowHead.NONE) {
|
||||
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,
|
||||
isSelf);
|
||||
isSelf, thickness);
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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() {
|
||||
@ -213,4 +218,23 @@ public class ArrowConfiguration {
|
||||
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,
|
||||
ENTITY_HEAD, ENTITY_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,
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19873 $
|
||||
* Revision $Revision: 19949 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
@ -56,7 +56,8 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
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) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
||||
}
|
||||
@ -76,7 +77,7 @@ public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
||||
final int x2 = (int) dimensionToUse.getWidth();
|
||||
|
||||
if (getArrowConfiguration().isDotted()) {
|
||||
ug = stroke(ug, 5, 2);
|
||||
ug = ArrowConfiguration.stroke(ug, 5, 2, 1);
|
||||
} else {
|
||||
ug = ug.apply(new UStroke(2));
|
||||
}
|
||||
@ -91,21 +92,21 @@ public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
||||
ug = ug.apply(new UStroke(1.5));
|
||||
if (direction == 1) {
|
||||
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
||||
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(new ULine(getArrowDeltaX2(),
|
||||
getArrowDeltaY2()));
|
||||
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(
|
||||
new ULine(getArrowDeltaX2(), getArrowDeltaY2()));
|
||||
}
|
||||
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
||||
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(new ULine(getArrowDeltaX2(),
|
||||
-getArrowDeltaY2()));
|
||||
ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(
|
||||
new ULine(getArrowDeltaX2(), -getArrowDeltaY2()));
|
||||
}
|
||||
} else {
|
||||
if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) {
|
||||
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(new ULine(-getArrowDeltaX2(),
|
||||
getArrowDeltaY2()));
|
||||
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw(
|
||||
new ULine(-getArrowDeltaX2(), getArrowDeltaY2()));
|
||||
}
|
||||
if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) {
|
||||
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(new ULine(-getArrowDeltaX2(),
|
||||
-getArrowDeltaY2()));
|
||||
ug.apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw(
|
||||
new ULine(-getArrowDeltaX2(), -getArrowDeltaY2()));
|
||||
}
|
||||
}
|
||||
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.skin.AbstractComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
@ -58,7 +59,7 @@ public class ComponentBlueModernDelayLine extends AbstractComponent {
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
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);
|
||||
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
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19946 $
|
||||
*
|
||||
*/
|
||||
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.skin.AbstractComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
@ -54,7 +55,7 @@ public class ComponentBlueModernNewpage extends AbstractComponent {
|
||||
@Override
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19873 $
|
||||
* Revision $Revision: 19949 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
@ -56,7 +56,8 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -72,7 +73,7 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
||||
final double x2 = arrowWidth - 3;
|
||||
|
||||
if (getArrowConfiguration().isDotted()) {
|
||||
ug = stroke(ug, 5, 2);
|
||||
ug = ArrowConfiguration.stroke(ug, 5, 2, 1);
|
||||
} else {
|
||||
ug = ug.apply(new UStroke(2));
|
||||
}
|
||||
@ -90,10 +91,14 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
||||
|
||||
if (getArrowConfiguration().isAsync()) {
|
||||
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) {
|
||||
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 {
|
||||
final UPolygon polygon = getPolygon(textHeight, delta);
|
||||
|
@ -63,9 +63,11 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
||||
private final HorizontalAlignment messagePosition;
|
||||
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) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment, maxMessageSize);
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment,
|
||||
maxMessageSize);
|
||||
this.messagePosition = messagePosition;
|
||||
this.niceArrow = niceArrow;
|
||||
}
|
||||
@ -129,13 +131,7 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
||||
len -= 2 * spaceCrossX;
|
||||
}
|
||||
|
||||
if (getArrowConfiguration().isDotted()) {
|
||||
ug = stroke(ug, 2, 2);
|
||||
}
|
||||
ug.apply(new UTranslate(start, textHeight)).draw(new ULine(len, 0));
|
||||
if (getArrowConfiguration().isDotted()) {
|
||||
ug = ug.apply(new UStroke());
|
||||
}
|
||||
getArrowConfiguration().applyStroke(ug).apply(new UTranslate(start, textHeight)).draw(new ULine(len, 0));
|
||||
|
||||
final ArrowDirection direction2 = getDirection2();
|
||||
final double textPos;
|
||||
@ -169,10 +165,10 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
||||
|
||||
if (dressing.getHead() == ArrowHead.ASYNC) {
|
||||
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) {
|
||||
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) {
|
||||
ug = ug.apply(new UStroke(2));
|
||||
@ -202,10 +198,10 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
||||
|
||||
if (dressing.getHead() == ArrowHead.ASYNC) {
|
||||
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) {
|
||||
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) {
|
||||
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.skin.AbstractComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -56,7 +57,7 @@ public class ComponentRoseDelayLine extends AbstractComponent {
|
||||
@Override
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
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);
|
||||
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
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19946 $
|
||||
*
|
||||
*/
|
||||
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.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -76,7 +77,7 @@ public class ComponentRoseGroupingElse extends AbstractTextualComponent {
|
||||
@Override
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
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 = ug.apply(new UStroke());
|
||||
getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY())));
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19945 $
|
||||
*
|
||||
*/
|
||||
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.skin.AbstractComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
@ -64,7 +65,7 @@ public class ComponentRoseLine extends AbstractComponent {
|
||||
if (continueLine) {
|
||||
ug = ug.apply(new UStroke());
|
||||
} else {
|
||||
ug = stroke(ug, 5, 5, stroke.getThickness());
|
||||
ug = ArrowConfiguration.stroke(ug, 5, 5, stroke.getThickness());
|
||||
}
|
||||
final int x = (int) (dimensionToUse.getWidth() / 2);
|
||||
ug.apply(new UTranslate(x, 0)).draw(new ULine(0, dimensionToUse.getHeight()));
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19946 $
|
||||
*
|
||||
*/
|
||||
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.skin.AbstractComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
@ -54,7 +55,7 @@ public class ComponentRoseNewpage extends AbstractComponent {
|
||||
@Override
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19978 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -58,12 +58,16 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
|
||||
private final double deltaShadow;
|
||||
private final double roundCorner;
|
||||
private final UStroke stroke;
|
||||
private final double minWidth;
|
||||
private final boolean collections;
|
||||
|
||||
public ComponentRoseParticipant(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay,
|
||||
ISkinSimple spriteContainer, double roundCorner, UFont fontForStereotype,
|
||||
HtmlColor htmlColorForStereotype) {
|
||||
ISkinSimple spriteContainer, double roundCorner, UFont fontForStereotype, HtmlColor htmlColorForStereotype,
|
||||
double minWidth, boolean collections) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.minWidth = minWidth;
|
||||
this.collections = collections;
|
||||
this.back = biColor.getBackColor();
|
||||
this.roundCorner = roundCorner;
|
||||
this.deltaShadow = biColor.getDeltaShadow();
|
||||
@ -79,19 +83,40 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
|
||||
final URectangle rect = new URectangle(getTextWidth(stringBounder), getTextHeight(stringBounder), roundCorner,
|
||||
roundCorner);
|
||||
rect.setDeltaShadow(deltaShadow);
|
||||
if (collections) {
|
||||
ug.apply(new UTranslate(getDeltaCollection(), 0)).draw(rect);
|
||||
ug = ug.apply(new UTranslate(0, getDeltaCollection()));
|
||||
}
|
||||
ug.draw(rect);
|
||||
ug = ug.apply(new UStroke());
|
||||
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
|
||||
public double getPreferredHeight(StringBounder stringBounder) {
|
||||
return getTextHeight(stringBounder) + deltaShadow + 1;
|
||||
return getTextHeight(stringBounder) + deltaShadow + 1 + getDeltaCollection();
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
*
|
||||
* Revision $Revision: 19873 $
|
||||
* Revision $Revision: 19972 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -62,8 +62,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
||||
private final boolean niceArrow;
|
||||
|
||||
public ComponentRoseSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
||||
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize,
|
||||
boolean niceArrow) {
|
||||
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize, boolean niceArrow) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, HorizontalAlignment.LEFT,
|
||||
maxMessageSize);
|
||||
this.niceArrow = niceArrow;
|
||||
@ -80,9 +79,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
||||
ug = ug.apply(new UChangeColor(getForegroundColor()));
|
||||
final double xRight = arrowWidth - 3;
|
||||
|
||||
if (getArrowConfiguration().isDotted()) {
|
||||
ug = stroke(ug, 2, 2);
|
||||
}
|
||||
final UGraphic ug2 = getArrowConfiguration().applyStroke(ug);
|
||||
|
||||
double x1 = area.getDeltaX1() < 0 ? area.getDeltaX1() : 0;
|
||||
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 UEllipse circle = new UEllipse(ComponentRoseArrow.diamCircle, ComponentRoseArrow.diamCircle);
|
||||
if (getArrowConfiguration().getDecoration1() == ArrowDecoration.CIRCLE) {
|
||||
ug.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
||||
ug2.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
||||
.apply(new UChangeColor(getForegroundColor()))
|
||||
.apply(new UTranslate(x1 + 1 - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle,
|
||||
textHeight - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle / 2))
|
||||
@ -98,7 +95,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
||||
x1 += ComponentRoseArrow.diamCircle / 2;
|
||||
}
|
||||
if (getArrowConfiguration().getDecoration2() == ArrowDecoration.CIRCLE) {
|
||||
ug.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
||||
ug2.apply(new UStroke(ComponentRoseArrow.thinCircle))
|
||||
.apply(new UChangeColor(getForegroundColor()))
|
||||
.apply(new UTranslate(x2 - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle,
|
||||
textAndArrowHeight - ComponentRoseArrow.diamCircle / 2 - ComponentRoseArrow.thinCircle / 2))
|
||||
@ -111,20 +108,18 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
||||
}
|
||||
|
||||
final double arrowHeight = textAndArrowHeight - textHeight;
|
||||
ug.apply(new UTranslate(x1, textHeight)).draw(new ULine(xRight - x1, 0));
|
||||
ug.apply(new UTranslate(xRight, textHeight)).draw(new ULine(0, arrowHeight));
|
||||
ug.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(xRight - x2, 0));
|
||||
|
||||
if (getArrowConfiguration().isDotted()) {
|
||||
ug = ug.apply(new UStroke());
|
||||
}
|
||||
ug2.apply(new UTranslate(x1, textHeight)).draw(new ULine(xRight - x1, 0));
|
||||
ug2.apply(new UTranslate(xRight, textHeight)).draw(new ULine(0, arrowHeight));
|
||||
ug2.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(xRight - x2, 0));
|
||||
|
||||
if (getArrowConfiguration().isAsync()) {
|
||||
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) {
|
||||
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) {
|
||||
ug = ug.apply(new UStroke(2));
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19510 $
|
||||
* Revision $Revision: 19978 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -110,12 +110,22 @@ public class Rose implements Skin {
|
||||
if (type == ComponentType.PARTICIPANT_HEAD) {
|
||||
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||
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) {
|
||||
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||
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) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
|
@ -693,6 +693,10 @@ public class Cluster implements Moveable {
|
||||
protection0 = false;
|
||||
protection1 = false;
|
||||
}
|
||||
// if (graphvizVersion.modeSafe()) {
|
||||
// protection0 = false;
|
||||
// protection1 = false;
|
||||
// }
|
||||
if (protection0) {
|
||||
subgraphCluster(sb, "p0");
|
||||
}
|
||||
|
@ -178,8 +178,7 @@ public final class CucaDiagramFileMakerSvek2 {
|
||||
final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.GENERIC_ARROW, null);
|
||||
|
||||
final Line line = new Line(shapeUid1, shapeUid2, link, colorSequence, ltail, lhead, skinParam,
|
||||
stringBounder, labelFont, getBibliotekon(), dotStringFactory.getGraphvizVersion(),
|
||||
dotData.getPragma());
|
||||
stringBounder, labelFont, getBibliotekon(), dotData.getPragma());
|
||||
|
||||
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.TextBlock;
|
||||
import net.sourceforge.plantuml.posimo.Moveable;
|
||||
import net.sourceforge.plantuml.vizjs.GraphvizJs;
|
||||
import net.sourceforge.plantuml.vizjs.GraphvizJsRuntimeException;
|
||||
|
||||
public class DotStringFactory implements Moveable {
|
||||
|
||||
@ -202,14 +204,14 @@ public class DotStringFactory implements Moveable {
|
||||
|
||||
root.printCluster1(sb, bibliotekon.allLines());
|
||||
for (Line line : bibliotekon.lines0()) {
|
||||
line.appendLine(sb);
|
||||
line.appendLine(getGraphvizVersion(), sb);
|
||||
}
|
||||
root.fillRankMin(rankMin);
|
||||
root.printCluster2(sb, bibliotekon.allLines(), stringBounder, dotMode, getGraphvizVersion(), umlDiagramType);
|
||||
printMinRanking(sb);
|
||||
|
||||
for (Line line : bibliotekon.lines1()) {
|
||||
line.appendLine(sb);
|
||||
line.appendLine(getGraphvizVersion(), sb);
|
||||
}
|
||||
SvekUtils.println(sb);
|
||||
sb.append("}");
|
||||
@ -268,26 +270,51 @@ public class DotStringFactory implements Moveable {
|
||||
return 35;
|
||||
}
|
||||
|
||||
private GraphvizVersion graphvizVersion;
|
||||
|
||||
public GraphvizVersion getGraphvizVersion() {
|
||||
if (graphvizVersion == null) {
|
||||
graphvizVersion = getGraphvizVersionInternal();
|
||||
}
|
||||
return graphvizVersion;
|
||||
}
|
||||
|
||||
private GraphvizVersion getGraphvizVersionInternal() {
|
||||
final Graphviz graphviz = GraphvizUtils.create(skinParam, "foo;", "svg");
|
||||
if (graphviz instanceof GraphvizJs) {
|
||||
return GraphvizJs.getGraphvizVersion(false);
|
||||
}
|
||||
final File f = graphviz.getDotExe();
|
||||
return GraphvizVersions.getInstance().getVersion(f);
|
||||
}
|
||||
|
||||
public String getSvg(BaseFile basefile, String[] dotStrings) throws IOException {
|
||||
final String dotString = createDotString(dotStrings);
|
||||
public String getSvg(BaseFile basefile, String[] dotOptions) throws IOException {
|
||||
String dotString = createDotString(dotOptions);
|
||||
|
||||
if (basefile != null) {
|
||||
final File f = basefile.getTraceFile("svek.dot");
|
||||
SvekUtils.traceString(f, dotString);
|
||||
}
|
||||
|
||||
final Graphviz graphviz = GraphvizUtils.create(skinParam, dotString, "svg");
|
||||
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
final ProcessState state = graphviz.createFile3(baos);
|
||||
baos.close();
|
||||
if (state.differs(ProcessState.TERMINATED_OK())) {
|
||||
throw new IllegalStateException("Timeout4 " + state, state.getCause());
|
||||
Graphviz graphviz = GraphvizUtils.create(skinParam, dotString, "svg");
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try {
|
||||
final ProcessState state = graphviz.createFile3(baos);
|
||||
baos.close();
|
||||
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 String s = new String(result, "UTF-8");
|
||||
@ -302,6 +329,9 @@ public class DotStringFactory implements Moveable {
|
||||
|
||||
public boolean illegalDotExe() {
|
||||
final Graphviz graphviz = GraphvizUtils.create(skinParam, "svg");
|
||||
if (graphviz instanceof GraphvizJs) {
|
||||
return false;
|
||||
}
|
||||
final File dotExe = graphviz.getDotExe();
|
||||
return dotExe == null || dotExe.isFile() == false || dotExe.canRead() == false;
|
||||
}
|
||||
|
@ -119,20 +119,9 @@ public class Line implements Moveable, Hideable {
|
||||
|
||||
private boolean opale;
|
||||
private Cluster projectionCluster;
|
||||
private final GraphvizVersion graphvizVersion;
|
||||
|
||||
private final Pragma pragma;
|
||||
|
||||
// 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;
|
||||
// }
|
||||
private final HtmlColor backgroundColor;
|
||||
|
||||
@Override
|
||||
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,
|
||||
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration labelFont, Bibliotekon bibliotekon,
|
||||
GraphvizVersion graphvizVersion, Pragma pragma) {
|
||||
Pragma pragma) {
|
||||
if (startUid == null || endUid == null || link == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
@ -213,7 +202,7 @@ public class Line implements Moveable, Hideable {
|
||||
skinParam = link.getColors().mute(skinParam);
|
||||
labelFont = labelFont.mute(link.getColors());
|
||||
}
|
||||
this.graphvizVersion = graphvizVersion;
|
||||
this.backgroundColor = skinParam.getBackgroundColor();
|
||||
this.pragma = pragma;
|
||||
this.bibliotekon = bibliotekon;
|
||||
this.stringBounder = stringBounder;
|
||||
@ -308,7 +297,7 @@ public class Line implements Moveable, Hideable {
|
||||
return link.getLinkArrow();
|
||||
}
|
||||
|
||||
public void appendLine(StringBuilder sb) {
|
||||
public void appendLine(GraphvizVersion graphvizVersion, StringBuilder sb) {
|
||||
// Log.println("inverted=" + isInverted());
|
||||
// if (isInverted()) {
|
||||
// sb.append(endUid);
|
||||
@ -332,14 +321,20 @@ public class Line implements Moveable, Hideable {
|
||||
// length = 2;
|
||||
// }
|
||||
if (pragma.horizontalLineBetweenDifferentPackageAllowed() || link.isInvis() || length != 1) {
|
||||
// if (graphvizVersion.isJs() == false) {
|
||||
sb.append("minlen=" + (length - 1));
|
||||
sb.append(",");
|
||||
// }
|
||||
}
|
||||
sb.append("color=\"" + StringUtils.getAsHtml(lineColor) + "\"");
|
||||
if (labelText != null) {
|
||||
sb.append(",");
|
||||
sb.append("label=<");
|
||||
appendTable(sb, labelText.calculateDimension(stringBounder), noteLabelColor);
|
||||
if (graphvizVersion.modeSafe()) {
|
||||
sb.append("xlabel=<");
|
||||
} else {
|
||||
sb.append("label=<");
|
||||
}
|
||||
appendTable(sb, labelText.calculateDimension(stringBounder), noteLabelColor, graphvizVersion);
|
||||
sb.append(">");
|
||||
// sb.append(",labelfloat=true");
|
||||
}
|
||||
@ -347,14 +342,14 @@ public class Line implements Moveable, Hideable {
|
||||
if (startTailText != null) {
|
||||
sb.append(",");
|
||||
sb.append("taillabel=<");
|
||||
appendTable(sb, startTailText.calculateDimension(stringBounder), startTailColor);
|
||||
appendTable(sb, startTailText.calculateDimension(stringBounder), startTailColor, graphvizVersion);
|
||||
sb.append(">");
|
||||
// sb.append(",labelangle=0");
|
||||
}
|
||||
if (endHeadText != null) {
|
||||
sb.append(",");
|
||||
sb.append("headlabel=<");
|
||||
appendTable(sb, endHeadText.calculateDimension(stringBounder), endHeadColor);
|
||||
appendTable(sb, endHeadText.calculateDimension(stringBounder), endHeadColor, graphvizVersion);
|
||||
sb.append(">");
|
||||
// sb.append(",labelangle=0");
|
||||
}
|
||||
@ -380,13 +375,14 @@ public class Line implements Moveable, Hideable {
|
||||
// if (graphvizVersion == GraphvizVersion.V2_34_0) {
|
||||
// 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 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 h = (int) dim.getHeight();
|
||||
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,
|
||||
Cluster cluster) {
|
||||
final ExtremityFactory extremityFactory = decor.getExtremityFactory();
|
||||
final ExtremityFactory extremityFactory = decor.getExtremityFactory(backgroundColor);
|
||||
|
||||
if (cluster != null) {
|
||||
if (extremityFactory != null) {
|
||||
|
@ -35,6 +35,7 @@ package net.sourceforge.plantuml.svek.extremity;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -45,15 +46,16 @@ class ExtremityDiamond extends Extremity {
|
||||
private UPolygon polygon = new UPolygon();
|
||||
private final boolean fill;
|
||||
private final Point2D contact;
|
||||
|
||||
private final HtmlColor backgroundColor;
|
||||
|
||||
@Override
|
||||
public Point2D somePoint() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
|
||||
public ExtremityDiamond(Point2D p1, double angle, boolean fill) {
|
||||
public ExtremityDiamond(Point2D p1, double angle, boolean fill, HtmlColor backgroundColor) {
|
||||
this.fill = fill;
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.contact = new Point2D.Double(p1.getX(), p1.getY());
|
||||
angle = manageround(angle);
|
||||
polygon.addPoint(0, 0);
|
||||
@ -71,7 +73,7 @@ class ExtremityDiamond extends Extremity {
|
||||
if (fill) {
|
||||
ug = ug.apply(new UChangeBackColor(ug.getParam().getColor()));
|
||||
} else {
|
||||
ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
|
||||
ug = ug.apply(new UChangeBackColor(backgroundColor));
|
||||
}
|
||||
ug.draw(polygon);
|
||||
}
|
||||
|
@ -35,25 +35,28 @@ package net.sourceforge.plantuml.svek.extremity;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
|
||||
|
||||
public class ExtremityFactoryDiamond extends AbstractExtremityFactory implements ExtremityFactory {
|
||||
|
||||
private final boolean fill;
|
||||
private final HtmlColor backgroundColor;
|
||||
|
||||
@Override
|
||||
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.backgroundColor = backgroundColor;
|
||||
}
|
||||
|
||||
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D 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.MyPattern;
|
||||
import net.sourceforge.plantuml.command.regex.Pattern2;
|
||||
import net.sourceforge.plantuml.core.DiagramType;
|
||||
|
||||
public class StartUtils {
|
||||
|
||||
public static final String PAUSE_PATTERN = "(?i)((?:\\W|\\<[^<>]*\\>)*)@unpause";
|
||||
public static final String START_PATTERN = "(?i)((?:[^\\w~]|\\<[^<>]*\\>)*)@start";
|
||||
public static final Pattern2 patternFilename = MyPattern
|
||||
.cmpile("^[@\\\\]start[^%s{}%g]+[%s{][%s%g]*([^%g]*?)[%s}%g]*$");
|
||||
|
||||
public static boolean isArobaseStartDiagram(CharSequence s) {
|
||||
return StringUtils.trinNoTrace(s).startsWith("@start");
|
||||
}
|
||||
public static final String PAUSE_PATTERN = "(?i)((?:\\W|\\<[^<>]*\\>)*)[@\\\\]unpause";
|
||||
public static final String START_PATTERN = "(?i)((?:[^\\w~]|\\<[^<>]*\\>)*)[@\\\\]start";
|
||||
|
||||
public static String beforeStartUml(final CharSequence2 result) {
|
||||
boolean inside = false;
|
||||
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();
|
||||
if (inside) {
|
||||
if (single.equals(">")) {
|
||||
@ -58,9 +62,6 @@ public class StartUtils {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (result.subSequence(i, result.length()).startsWith("@start")) {
|
||||
return result.subSequence(0, i).toString();
|
||||
}
|
||||
if (single.equals("<")) {
|
||||
inside = true;
|
||||
} else if (single.matches("[\\w~]")) {
|
||||
@ -75,19 +76,35 @@ public class StartUtils {
|
||||
// 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) {
|
||||
return StringUtils.trinNoTrace(s).startsWith("@end");
|
||||
final String s2 = StringUtils.trinNoTrace(s);
|
||||
return startsWithSymbolAnd("end", s2);
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
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>Word Macro</u>: Alain Bertucat & Matthieu Sabatier");
|
||||
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>Servlet & XWiki</u>: Maxime Sinclair");
|
||||
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