1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-03 09:00:48 +00:00
This commit is contained in:
Arnaud Roques 2022-03-19 13:48:23 +01:00
parent 73d13f9bf7
commit ebf1b1b622
209 changed files with 612 additions and 558 deletions

View File

@ -97,6 +97,7 @@ import static smetana.core.Macro.GD_n_nodes;
import static smetana.core.Macro.GD_nlist; import static smetana.core.Macro.GD_nlist;
import static smetana.core.Macro.GD_rank; import static smetana.core.Macro.GD_rank;
import static smetana.core.Macro.GD_rankleader; import static smetana.core.Macro.GD_rankleader;
import static smetana.core.Macro.N;
import static smetana.core.Macro.ND_UF_size; import static smetana.core.Macro.ND_UF_size;
import static smetana.core.Macro.ND_clust; import static smetana.core.Macro.ND_clust;
import static smetana.core.Macro.ND_in; import static smetana.core.Macro.ND_in;
@ -363,8 +364,8 @@ try {
flat_edge(g, e); flat_edge(g, e);
prev = e; prev = e;
} else if (NEQ(e, fe)) { } else if (NEQ(e, fe)) {
UNSUPPORTED("ckfinb4h4twp1ry02y9peyhz"); // safe_other_edge(e); safe_other_edge(e);
UNSUPPORTED("dg3e0udctqa7xtfynplc7wdpj"); // if (!ED_to_virt(e)) merge_oneway(e, fe); if (N(ED_to_virt(e))) merge_oneway(e, fe);
} }
continue; continue;
} }

View File

@ -196,7 +196,7 @@ try {
for (i = 0; i < L.size; i++) for (i = 0; i < L.size; i++)
if (EQ(e, L.list.get_(i))) if (EQ(e, L.list.get_(i)))
return; return;
UNSUPPORTED("cslejjtgepjdwlcykfas4fmvz"); // elist_append(e, (*L)); elist_append(e, L);
} finally { } finally {
LEAVING("cttswsffgmw1g710jzvdd3wzn","safe_list_append"); LEAVING("cttswsffgmw1g710jzvdd3wzn","safe_list_append");
} }

View File

@ -106,12 +106,12 @@ public class AnnotatedWorker {
final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame) final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame)
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
deltaShadow = style.value(PName.Shadowing).asDouble(); deltaShadow = style.value(PName.Shadowing).asDouble();
fontConfiguration = new FontConfiguration(getSkinParam(), style); fontConfiguration = FontConfiguration.create(getSkinParam(), style);
stroke = style.getStroke(); stroke = style.getStroke();
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else { } else {
deltaShadow = getSkinParam().shadowing(null) ? 3 : 0; deltaShadow = getSkinParam().shadowing(null) ? 3 : 0;
fontConfiguration = new FontConfiguration(getSkinParam(), FontParam.CAPTION, null); fontConfiguration = FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null);
stroke = new UStroke(); stroke = new UStroke();
borderColor = HColorUtils.BLACK; borderColor = HColorUtils.BLACK;
} }
@ -193,7 +193,7 @@ public class AnnotatedWorker {
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam);
} }
return caption.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null), return caption.getDisplay().create(FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null),
HorizontalAlignment.CENTER, getSkinParam()); HorizontalAlignment.CENTER, getSkinParam());
} }
@ -209,7 +209,7 @@ public class AnnotatedWorker {
block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(), skinParam);
} else { } else {
final ISkinParam skinParam = getSkinParam(); final ISkinParam skinParam = getSkinParam();
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.TITLE, null); final FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.TITLE, null);
block = TextBlockUtils.title(fontConfiguration, title.getDisplay(), skinParam); block = TextBlockUtils.title(fontConfiguration, title.getDisplay(), skinParam);
} }
@ -229,7 +229,7 @@ public class AnnotatedWorker {
style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer) style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer)
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
} }
textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null), textFooter = footer.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.FOOTER, null),
getSkinParam(), style); getSkinParam(), style);
} }
TextBlock textHeader = null; TextBlock textHeader = null;
@ -239,7 +239,7 @@ public class AnnotatedWorker {
style = StyleSignatureBasic.of(SName.root, SName.document, SName.header) style = StyleSignatureBasic.of(SName.root, SName.document, SName.header)
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
} }
textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null), textHeader = header.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.HEADER, null),
getSkinParam(), style); getSkinParam(), style);
} }

View File

@ -42,14 +42,14 @@ public class BaseFile {
private final String basename; private final String basename;
private final SFile basedir; private final SFile basedir;
public BaseFile() {
this.basedir = null;
this.basename = null;
}
public BaseFile(SFile file) { public BaseFile(SFile file) {
this.basedir = file.getParentFile(); if (file == null) {
this.basename = extractBasename(file.getName()); this.basedir = null;
this.basename = null;
} else {
this.basedir = file.getParentFile();
this.basename = extractBasename(file.getName());
}
} }
private static String extractBasename(String name) { private static String extractBasename(String name) {

View File

@ -77,6 +77,7 @@ public class BlockUml {
return Collections.unmodifiableSet(included); return Collections.unmodifiableSet(included);
} }
@Deprecated
BlockUml(ThemeStyle style, String... strings) { BlockUml(ThemeStyle style, String... strings) {
this(style, convert(strings), Defines.createEmpty(), null, null, null); this(style, convert(strings), Defines.createEmpty(), null, null, null);
} }

View File

@ -35,11 +35,13 @@
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
@HaxeIgnored
public enum ColorParam { public enum ColorParam {
background(HColorUtils.WHITE, true, ColorType.BACK), background(HColorUtils.WHITE, true, ColorType.BACK),
hyperlink(HColorUtils.BLUE), hyperlink(HColorUtils.BLUE),

View File

@ -47,15 +47,15 @@ public class Dimension2DDouble extends Dimension2D {
final private double height; final private double height;
public Dimension2DDouble(double width, double height) { public Dimension2DDouble(double width, double height) {
if (Double.isNaN(width) || Double.isNaN(height)) { if (Double.isNaN(width) || Double.isNaN(height))
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
this.width = width; this.width = width;
this.height = height; this.height = height;
} }
public Dimension2DDouble(Point2D point) { private static Dimension2DDouble fromPoint(Point2D point) {
this(point.getX(), point.getY()); return new Dimension2DDouble(point.getX(), point.getY());
} }
@Override @Override

View File

@ -60,9 +60,13 @@ public class EmptyImageBuilder {
private final Color background; private final Color background;
private final StringBounder stringBounder; private final StringBounder stringBounder;
public EmptyImageBuilder(String watermark, double width, double height, Color background, private static EmptyImageBuilder create(String watermark, int width, int height, Color background,
StringBounder stringBounder) { StringBounder stringBounder, double dpiFactor) {
this(watermark, (int) width, (int) height, background, stringBounder); EmptyImageBuilder result = new EmptyImageBuilder(watermark, (int) (width * dpiFactor),
(int) (height * dpiFactor), background, stringBounder);
if (dpiFactor != 1.0)
result.g2d.setTransform(AffineTransform.getScaleInstance(dpiFactor, dpiFactor));
return result;
} }
public EmptyImageBuilder(String watermark, int width, int height, Color background, StringBounder stringBounder) { public EmptyImageBuilder(String watermark, int width, int height, Color background, StringBounder stringBounder) {
@ -156,14 +160,6 @@ public class EmptyImageBuilder {
return result; return result;
} }
public EmptyImageBuilder(String watermark, int width, int height, Color background, StringBounder stringBounder,
double dpiFactor) {
this(watermark, width * dpiFactor, height * dpiFactor, background, stringBounder);
if (dpiFactor != 1.0) {
g2d.setTransform(AffineTransform.getScaleInstance(dpiFactor, dpiFactor));
}
}
public BufferedImage getBufferedImage() { public BufferedImage getBufferedImage() {
return im; return im;
} }

View File

@ -39,6 +39,7 @@ import java.awt.geom.AffineTransform;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
@ -66,10 +67,12 @@ public final class FileFormatOption implements Serializable {
return scale; return scale;
} }
@HaxeIgnored
public FileFormatOption(FileFormat fileFormat) { public FileFormatOption(FileFormat fileFormat) {
this(fileFormat, true, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null, ThemeStyle.LIGHT_REGULAR); this(fileFormat, true, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null, ThemeStyle.LIGHT_REGULAR);
} }
@HaxeIgnored
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) { public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
this(fileFormat, withMetadata, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null, ThemeStyle.LIGHT_REGULAR); this(fileFormat, withMetadata, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null, ThemeStyle.LIGHT_REGULAR);
} }

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import java.awt.Font; import java.awt.Font;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
@ -46,6 +47,7 @@ interface FontParamConstant {
String COLOR = "black"; String COLOR = "black";
} }
@HaxeIgnored
public enum FontParam { public enum FontParam {
TIMING(12, Font.PLAIN), // TIMING(12, Font.PLAIN), //
ACTIVITY(12, Font.PLAIN), // ACTIVITY(12, Font.PLAIN), //
@ -184,7 +186,7 @@ public enum FontParam {
} }
public FontConfiguration getFontConfiguration(ISkinParam skinParam) { public FontConfiguration getFontConfiguration(ISkinParam skinParam) {
return new FontConfiguration(skinParam, this, null); return FontConfiguration.create(skinParam, this, null);
} }
public StyleSignatureBasic getStyleDefinition(SName diagramType) { public StyleSignatureBasic getStyleDefinition(SName diagramType) {

View File

@ -37,6 +37,8 @@ package net.sourceforge.plantuml;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
public class LineLocationImpl implements LineLocation { public class LineLocationImpl implements LineLocation {
private final String desc; private final String desc;
@ -52,6 +54,7 @@ public class LineLocationImpl implements LineLocation {
this(desc, parent, -1); this(desc, parent, -1);
} }
@HaxeIgnored
private LineLocationImpl(String desc, LineLocation parent, int position) { private LineLocationImpl(String desc, LineLocation parent, int position) {
this.parent = parent; this.parent = parent;
this.desc = Objects.requireNonNull(desc); this.desc = Objects.requireNonNull(desc);

View File

@ -46,6 +46,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ApiWarning; import net.sourceforge.plantuml.api.ApiWarning;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
@ -55,6 +56,7 @@ import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.stats.StatsUtils; import net.sourceforge.plantuml.stats.StatsUtils;
@HaxeIgnored
public class Option { public class Option {
private final List<String> excludes = new ArrayList<>(); private final List<String> excludes = new ArrayList<>();

View File

@ -114,7 +114,7 @@ public class PSystemBuilder {
Diagram result = null; Diagram result = null;
try { try {
final DiagramType type = DiagramType.getTypeFromArobaseStart(source.get(0).getString()); final DiagramType type = DiagramType.getTypeFromArobaseStart(source.get(0).getString());
final UmlSource umlSource = new UmlSource(source, type == DiagramType.UML, rawSource); final UmlSource umlSource = UmlSource.createWithRaw(source, type == DiagramType.UML, rawSource);
for (StringLocated s : source) { for (StringLocated s : source) {
if (s.getPreprocessorError() != null) { if (s.getPreprocessorError() != null) {

View File

@ -38,9 +38,11 @@ package net.sourceforge.plantuml;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@HaxeIgnored
public class SkinParamBackcolored extends SkinParamDelegator { public class SkinParamBackcolored extends SkinParamDelegator {
final private HColor backColorElement; final private HColor backColorElement;

View File

@ -41,9 +41,11 @@ import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SFile;
@HaxeIgnored
public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader { public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader {
public SourceFileReader(File file) throws IOException { public SourceFileReader(File file) throws IOException {

View File

@ -47,6 +47,7 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.DiagramDescription;
@ -56,6 +57,7 @@ import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.svek.TextBlockBackcolored;
@HaxeIgnored
public class SourceStringReader { public class SourceStringReader {
final private List<BlockUml> blocks; final private List<BlockUml> blocks;

View File

@ -46,8 +46,8 @@ public class SplitParam {
private final HColor externalColor; private final HColor externalColor;
private final int externalMargin; private final int externalMargin;
public SplitParam() { private static SplitParam empty() {
this(null, null, 0); return new SplitParam(null, null, 0);
} }
public SplitParam(HColor borderColor, HColor externalColor, int externalMargin) { public SplitParam(HColor borderColor, HColor externalColor, int externalMargin) {

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.command.regex.FoxSignature; import net.sourceforge.plantuml.command.regex.FoxSignature;
import net.sourceforge.plantuml.tim.TLineType; import net.sourceforge.plantuml.tim.TLineType;
@ -50,10 +51,17 @@ final public class StringLocated {
private long fox = -1; private long fox = -1;
private TLineType type; private TLineType type;
@HaxeIgnored
public StringLocated(String s, LineLocation location) { public StringLocated(String s, LineLocation location) {
this(s, location, null); this(s, location, null);
} }
public StringLocated(String s, LineLocation location, String preprocessorError) {
this.s = Objects.requireNonNull(s);
this.location = location;
this.preprocessorError = preprocessorError;
}
@Override @Override
public String toString() { public String toString() {
return s; return s;
@ -70,12 +78,6 @@ final public class StringLocated {
return new StringLocated(s.substring(0, s.length() - 1) + next.s, location, preprocessorError); return new StringLocated(s.substring(0, s.length() - 1) + next.s, location, preprocessorError);
} }
public StringLocated(String s, LineLocation location, String preprocessorError) {
this.s = Objects.requireNonNull(s);
this.location = location;
this.preprocessorError = preprocessorError;
}
public StringLocated withErrorPreprocessor(String preprocessorError) { public StringLocated withErrorPreprocessor(String preprocessorError) {
return new StringLocated(s, location, preprocessorError); return new StringLocated(s, location, preprocessorError);
} }

View File

@ -87,23 +87,25 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
return pragma; return pragma;
} }
public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) { // public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) {
// super(source);
// this.type = type;
// this.skinParam = SkinParam.create(type, style);
// }
public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) {
super(source); super(source);
this.type = type; this.type = type;
this.skinParam = SkinParam.create(type, style); this.skinParam = SkinParam.create(type, style);
if (orig != null)
this.skinParam.copyAllFrom(orig);
} }
public final StyleBuilder getCurrentStyleBuilder() { public final StyleBuilder getCurrentStyleBuilder() {
return skinParam.getCurrentStyleBuilder(); return skinParam.getCurrentStyleBuilder();
} }
public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) {
this(style, source, type);
if (orig != null) {
this.skinParam.copyAllFrom(orig);
}
}
final public UmlDiagramType getUmlDiagramType() { final public UmlDiagramType getUmlDiagramType() {
return type; return type;
} }
@ -274,7 +276,8 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
public HColor calculateBackColor() { public HColor calculateBackColor() {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = StyleSignatureBasic.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName()) final Style style = StyleSignatureBasic
.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName())
.getMergedStyle(this.getSkinParam().getCurrentStyleBuilder()); .getMergedStyle(this.getSkinParam().getCurrentStyleBuilder());
HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(), HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(),

View File

@ -87,9 +87,9 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
private int minwidth = Integer.MAX_VALUE; private int minwidth = Integer.MAX_VALUE;
public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) { // public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) {
super(style, source, type); // super(style, source, type);
} // }
public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) { public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) {
super(style, source, type, orig); super(style, source, type, orig);

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import java.util.Comparator; import java.util.Comparator;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.cucadiagram.dot.DotMaker2; import net.sourceforge.plantuml.cucadiagram.dot.DotMaker2;
public class Url implements EnsureVisible { public class Url implements EnsureVisible {
@ -46,6 +47,7 @@ public class Url implements EnsureVisible {
private final String label; private final String label;
private boolean member; private boolean member;
@HaxeIgnored
public Url(String url, String tooltip) { public Url(String url, String tooltip) {
this(url, tooltip, null); this(url, tooltip, null);
} }

View File

@ -364,7 +364,7 @@ public class ActivityDiagram3 extends UmlDiagram {
manageSwimlaneStrategy(); manageSwimlaneStrategy();
if (current() instanceof InstructionRepeat) { if (current() instanceof InstructionRepeat) {
final InstructionRepeat instructionRepeat = (InstructionRepeat) current(); final InstructionRepeat instructionRepeat = (InstructionRepeat) current();
final LinkRendering back = new LinkRendering(linkColor).withDisplay(linkLabel); final LinkRendering back = LinkRendering.create(linkColor).withDisplay(linkLabel);
instructionRepeat.setTest(label, yes, out, nextLinkRenderer(), back, swinlanes.getCurrentSwimlane()); instructionRepeat.setTest(label, yes, out, nextLinkRenderer(), back, swinlanes.getCurrentSwimlane());
setCurrent(instructionRepeat.getParent()); setCurrent(instructionRepeat.getParent());
this.setNextLinkRendererInternal(LinkRendering.none()); this.setNextLinkRendererInternal(LinkRendering.none());
@ -471,7 +471,7 @@ public class ActivityDiagram3 extends UmlDiagram {
if (color == null) if (color == null)
return; return;
final LinkRendering link = new LinkRendering(color); final LinkRendering link = LinkRendering.create(color);
setNextLink(link); setNextLink(link);
} }

View File

@ -113,11 +113,11 @@ public class ActivityDiagramFactory3 extends PSystemCommandFactory {
cmds.add(new CommandActivity3()); cmds.add(new CommandActivity3());
cmds.add(new CommandIf4()); cmds.add(new CommandIf4());
cmds.add(new CommandIf2()); cmds.add(new CommandIf2());
cmds.add(new CommandDecoratorMultine(new CommandIf2(), 50)); cmds.add(CommandDecoratorMultine.create(new CommandIf2(), 50));
cmds.add(new CommandIfLegacy1()); cmds.add(new CommandIfLegacy1());
cmds.add(new CommandElseIf2()); cmds.add(new CommandElseIf2());
cmds.add(new CommandElse3()); cmds.add(new CommandElse3());
cmds.add(new CommandDecoratorMultine(new CommandElse3(), 50)); cmds.add(CommandDecoratorMultine.create(new CommandElse3(), 50));
cmds.add(new CommandElseLegacy1()); cmds.add(new CommandElseLegacy1());
cmds.add(new CommandEndif3()); cmds.add(new CommandEndif3());
@ -156,7 +156,7 @@ public class ActivityDiagramFactory3 extends PSystemCommandFactory {
cmds.add(new CommandLabel()); cmds.add(new CommandLabel());
cmds.add(new CommandGoto()); cmds.add(new CommandGoto());
cmds.add(new CommandDecoratorMultine(new CommandElseIf2(), 50)); cmds.add(CommandDecoratorMultine.create(new CommandElseIf2(), 50));
return cmds; return cmds;
} }

View File

@ -255,7 +255,7 @@ public class Branch {
lineBreak = style.wrapWidth(); lineBreak = style.wrapWidth();
fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null); fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
} }
return display.create0(fcArrow, HorizontalAlignment.LEFT, skinParam(), lineBreak, CreoleMode.SIMPLE_LINE, null, return display.create0(fcArrow, HorizontalAlignment.LEFT, skinParam(), lineBreak, CreoleMode.SIMPLE_LINE, null,

View File

@ -85,7 +85,7 @@ public class InstructionFork extends WithNote implements Instruction {
this.skinParam = skinParam; this.skinParam = skinParam;
this.swimlaneIn = swimlane; this.swimlaneIn = swimlane;
this.swimlaneOut = swimlane; this.swimlaneOut = swimlane;
this.forks.add(new InstructionList()); this.forks.add(InstructionList.empty());
} }
private InstructionList getLastList() { private InstructionList getLastList() {
@ -109,14 +109,13 @@ public class InstructionFork extends WithNote implements Instruction {
return new GtileSplit(all, swimlaneIn, getInLinkRenderingColor(skinParam).getColor()); return new GtileSplit(all, swimlaneIn, getInLinkRenderingColor(skinParam).getColor());
} }
private Rainbow getInLinkRenderingColor(ISkinParam skinParam) { private Rainbow getInLinkRenderingColor(ISkinParam skinParam) {
Rainbow color; Rainbow color;
color = Rainbow.build(skinParam); color = Rainbow.build(skinParam);
return color; return color;
} }
@Override @Override
public Ftile createFtile(FtileFactory factory) { public Ftile createFtile(FtileFactory factory) {
final List<Ftile> all = new ArrayList<>(); final List<Ftile> all = new ArrayList<>();
@ -136,7 +135,7 @@ public class InstructionFork extends WithNote implements Instruction {
public void forkAgain(Swimlane swimlane) { public void forkAgain(Swimlane swimlane) {
this.swimlaneOut = swimlane; this.swimlaneOut = swimlane;
this.forks.add(new InstructionList()); this.forks.add(InstructionList.empty());
} }
@Override @Override

View File

@ -125,7 +125,7 @@ public class InstructionGroup extends AbstractInstruction implements Instruction
@Override @Override
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
if (list.isEmpty()) { if (list.isEmpty()) {
this.note = new PositionedNote(note, position, type, colors, swimlaneNote); this.note = new PositionedNote(note, position, type, swimlaneNote, colors);
return true; return true;
} }
return list.addNote(note, position, type, colors, swimlaneNote); return list.addNote(note, position, type, colors, swimlaneNote);

View File

@ -73,8 +73,12 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return false; return false;
} }
public InstructionList() { public static InstructionList empty() {
this(null); return new InstructionList(null);
}
public InstructionList(Swimlane defaultSwimlane) {
this.defaultSwimlane = defaultSwimlane;
} }
public boolean isEmpty() { public boolean isEmpty() {
@ -91,10 +95,6 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return getLast() instanceof InstructionStop && ((InstructionStop) getLast()).hasNotes() == false; return getLast() instanceof InstructionStop && ((InstructionStop) getLast()).hasNotes() == false;
} }
public InstructionList(Swimlane defaultSwimlane) {
this.defaultSwimlane = defaultSwimlane;
}
@Override @Override
public CommandExecutionResult add(Instruction ins) { public CommandExecutionResult add(Instruction ins) {
all.add(ins); all.add(ins);

View File

@ -48,7 +48,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
public class InstructionPartition extends AbstractInstruction implements Instruction { public class InstructionPartition extends AbstractInstruction implements Instruction {
private final InstructionList list = new InstructionList(); private final InstructionList list = InstructionList.empty();
private final Instruction parent; private final Instruction parent;
public InstructionPartition(Instruction parent, String partitionTitle) { public InstructionPartition(Instruction parent, String partitionTitle) {

View File

@ -204,7 +204,7 @@ public class InstructionRepeat extends AbstractInstruction implements Instructio
if (Display.isNull(backward)) if (Display.isNull(backward))
return repeatList.addNote(note, position, type, colors, swimlaneNote); return repeatList.addNote(note, position, type, colors, swimlaneNote);
this.backwardNotes.add(new PositionedNote(note, position, type, colors, swimlaneNote)); this.backwardNotes.add(new PositionedNote(note, position, type, swimlaneNote, colors));
return true; return true;
} }

View File

@ -58,7 +58,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionWhile extends WithNote implements Instruction, InstructionCollection { public class InstructionWhile extends WithNote implements Instruction, InstructionCollection {
private final InstructionList repeatList = new InstructionList(); private final InstructionList repeatList = InstructionList.empty();
private final Instruction parent; private final Instruction parent;
private final LinkRendering nextLinkRenderer; private final LinkRendering nextLinkRenderer;
private final HColor color; private final HColor color;

View File

@ -45,8 +45,12 @@ public class LinkRendering {
private final Rainbow rainbow; private final Rainbow rainbow;
private final Display display; private final Display display;
public LinkRendering(Rainbow rainbow) { public static LinkRendering create(Rainbow rainbow) {
this(rainbow, Display.NULL); return new LinkRendering(rainbow, Display.NULL);
}
public static LinkRendering none() {
return LinkRendering.create(Rainbow.none());
} }
private LinkRendering(Rainbow rainbow, Display display) { private LinkRendering(Rainbow rainbow, Display display) {
@ -54,10 +58,6 @@ public class LinkRendering {
this.display = display; this.display = display;
} }
public static LinkRendering none() {
return new LinkRendering(Rainbow.none());
}
public LinkRendering withRainbow(Rainbow rainbow) { public LinkRendering withRainbow(Rainbow rainbow) {
return new LinkRendering(rainbow, display); return new LinkRendering(rainbow, display);
} }

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.activitydiagram3; package net.sourceforge.plantuml.activitydiagram3;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
@ -49,7 +50,7 @@ public class PositionedNote {
private final Colors colors; private final Colors colors;
private final Swimlane swimlaneNote; private final Swimlane swimlaneNote;
public PositionedNote(Display display, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { public PositionedNote(Display display, NotePosition position, NoteType type, Swimlane swimlaneNote, Colors colors) {
this.display = display; this.display = display;
this.notePosition = position; this.notePosition = position;
this.type = type; this.type = type;
@ -57,15 +58,16 @@ public class PositionedNote {
this.swimlaneNote = swimlaneNote; this.swimlaneNote = swimlaneNote;
} }
@HaxeIgnored
public PositionedNote(Display note, NotePosition position, NoteType type, Swimlane swimlaneNote) {
this(note, position, type, swimlaneNote, null);
}
@Override @Override
public String toString() { public String toString() {
return "type=" + type + " notePosition=" + notePosition + " " + display; return "type=" + type + " notePosition=" + notePosition + " " + display;
} }
public PositionedNote(Display note, NotePosition position, NoteType type, Swimlane swimlaneNote) {
this(note, position, type, null, swimlaneNote);
}
public Display getDisplay() { public Display getDisplay() {
return display; return display;
} }

View File

@ -52,7 +52,7 @@ abstract class WithNote extends AbstractInstruction {
private final Collection<PositionedNote> notes = new ArrayList<>(); private final Collection<PositionedNote> notes = new ArrayList<>();
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
this.notes.add(new PositionedNote(note, position, type, colors, swimlaneNote)); this.notes.add(new PositionedNote(note, position, type, swimlaneNote, colors));
return true; return true;
} }

View File

@ -110,7 +110,7 @@ public class CommandBackward3 extends SingleLineCommand2<ActivityDiagram3> {
if (incomingColor == null) if (incomingColor == null)
in = LinkRendering.none(); in = LinkRendering.none();
else else
in = new LinkRendering(incomingColor); in = LinkRendering.create(incomingColor);
final String label = arg.get(name, 0); final String label = arg.get(name, 0);
return in.withDisplay(Display.getWithNewlines(label)); return in.withDisplay(Display.getWithNewlines(label));
} }

View File

@ -41,6 +41,7 @@ import java.awt.geom.Line2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UBackground; import net.sourceforge.plantuml.ugraphic.UBackground;
@ -56,6 +57,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
@HaxeIgnored
public class CollisionDetector extends UGraphicNo { public class CollisionDetector extends UGraphicNo {
@Override @Override
@ -65,16 +67,24 @@ public class CollisionDetector extends UGraphicNo {
private final Context context; private final Context context;
public CollisionDetector(StringBounder stringBounder) { private static CollisionDetector create(StringBounder stringBounder) {
super(stringBounder); return new CollisionDetector(stringBounder, new UTranslate(), new Context());
this.context = new Context(); }
private CollisionDetector(StringBounder stringBounder, UTranslate translate, Context context) {
super(stringBounder, translate);
this.context = context;
} }
private CollisionDetector(CollisionDetector other, UChange change) { private CollisionDetector(CollisionDetector other, UChange change) {
super(other, change); // this(other.stringBounder,
if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class)) { // change instanceof UTranslate ? other.translate.compose((UTranslate) change) :
// other.translate);
super(other.getStringBounder(), change instanceof UTranslate ? other.getTranslate().compose((UTranslate) change)
: other.getTranslate());
if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class))
throw new UnsupportedOperationException(change.getClass().toString()); throw new UnsupportedOperationException(change.getClass().toString());
}
this.context = other.context; this.context = other.context;
} }

View File

@ -63,7 +63,7 @@ public class EntityImageLegend {
return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam); return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam);
} }
final TextBlock textBlock = note.create(new FontConfiguration(skinParam, FontParam.LEGEND, null), final TextBlock textBlock = note.create(FontConfiguration.create(skinParam, FontParam.LEGEND, null),
HorizontalAlignment.LEFT, skinParam); HorizontalAlignment.LEFT, skinParam);
final Rose rose = new Rose(); final Rose rose = new Rose();
final HColor legendBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground); final HColor legendBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground);

View File

@ -118,7 +118,7 @@ public class FtileFactoryDelegator implements FtileFactory {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
} }
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
} }

View File

@ -100,7 +100,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private final List<LaneDivider> dividers = new ArrayList<>(); private final List<LaneDivider> dividers = new ArrayList<>();
private Swimlane currentSwimlane = null; private Swimlane currentSwimlane = null;
private final Instruction root = new InstructionList(); private final Instruction root = InstructionList.empty();
private Instruction currentInstruction = root; private Instruction currentInstruction = root;
private LinkRendering nextLinkRenderer = LinkRendering.none(); private LinkRendering nextLinkRenderer = LinkRendering.none();
@ -215,7 +215,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
} }
public final void computeSize(StringBounder stringBounder) { public final void computeSize(StringBounder stringBounder) {
final SlotFinder ug = new SlotFinder(CompressionMode.ON_Y, stringBounder); final SlotFinder ug = SlotFinder.create(CompressionMode.ON_Y, stringBounder);
if (swimlanes().size() > 1) { if (swimlanes().size() > 1) {
TextBlock full = root.createFtile(getFtileFactory(stringBounder)); TextBlock full = root.createFtile(getFtileFactory(stringBounder));
computeSizeInternal(ug, full); computeSizeInternal(ug, full);
@ -258,7 +258,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private TextBlock getTitle(Swimlane swimlane) { private TextBlock getTitle(Swimlane swimlane) {
final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT;
FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.SWIMLANE_TITLE, null); FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.SWIMLANE_TITLE, null);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(), fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
@ -359,7 +359,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private void computeDrawingWidths(UGraphic ug, TextBlock full) { private void computeDrawingWidths(UGraphic ug, TextBlock full) {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
for (Swimlane swimlane : swimlanes()) { for (Swimlane swimlane : swimlanes()) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false); final LimitFinder limitFinder = LimitFinder.create(stringBounder, false);
final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane( final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane(
new UGraphicForSnake(limitFinder), swimlane, swimlanes()); new UGraphicForSnake(limitFinder), swimlane, swimlanes());
full.drawU(interceptor); full.drawU(interceptor);

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import static net.sourceforge.plantuml.utils.ObjectUtils.instanceOfAny; import static net.sourceforge.plantuml.utils.ObjectUtils.instanceOfAny;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UBackground; import net.sourceforge.plantuml.ugraphic.UBackground;
@ -49,6 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@HaxeIgnored
public class ZadBuilder extends UGraphicNo { public class ZadBuilder extends UGraphicNo {
@Override @Override
@ -63,20 +65,17 @@ public class ZadBuilder extends UGraphicNo {
} }
public ZadBuilder(StringBounder stringBounder) { public ZadBuilder(StringBounder stringBounder) {
super(stringBounder); super(stringBounder, new UTranslate());
this.context = new Context(); this.context = new Context();
} }
private ZadBuilder(ZadBuilder other, UChange change) { private ZadBuilder(ZadBuilder other, UChange change) {
super(other, change); // super(other, change);
if (!instanceOfAny(change, super(other.getStringBounder(), change instanceof UTranslate ? other.getTranslate().compose((UTranslate) change)
UBackground.class, : other.getTranslate());
HColor.class, if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class))
UStroke.class,
UTranslate.class
)) {
throw new UnsupportedOperationException(change.getClass().toString()); throw new UnsupportedOperationException(change.getClass().toString());
}
this.context = other.context; this.context = other.context;
} }

View File

@ -139,7 +139,7 @@ public abstract class AbstractParallelFtilesBuilder {
final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
} }
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
} }

View File

@ -82,7 +82,7 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note) final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note)
.getMergedStyle(skinParam.getCurrentStyleBuilder()); .getMergedStyle(skinParam.getCurrentStyleBuilder());
wrapWidth = style.wrapWidth(); wrapWidth = style.wrapWidth();
fc = new FontConfiguration(skinParam, style); fc = FontConfiguration.create(skinParam, style);
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
@ -92,7 +92,7 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
shadowing = skinParam.shadowing(null) ? 4 : 0; shadowing = skinParam.shadowing(null) ? 4 : 0;
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null); fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();
} }

View File

@ -99,9 +99,9 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: branch0.getColor(); : branch0.getColor();
arrowColor = Rainbow.build(skinParam()); arrowColor = Rainbow.build(skinParam());
fcTest = new FontConfiguration(skinParam(), testParam, null) fcTest = FontConfiguration.create(skinParam(), testParam, null)
.changeColor(fontColor(FontParam.ACTIVITY_DIAMOND)); .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null); fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
} }
if (thens.size() > 1) { if (thens.size() > 1) {

View File

@ -107,8 +107,8 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
diamondColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground); diamondColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground);
} }
arrowColor = Rainbow.build(skinParam()); arrowColor = Rainbow.build(skinParam());
fcDiamond = new FontConfiguration(skinParam(), FontParam.ACTIVITY_DIAMOND, null); fcDiamond = FontConfiguration.create(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null); fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
} }
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering(); final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();

View File

@ -145,7 +145,7 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor) backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor)
.asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor(); .asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor();
} else { } else {
fcDiamond = new FontConfiguration(skinParam(), FontParam.ACTIVITY_DIAMOND, null); fcDiamond = FontConfiguration.create(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder); borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
backColor = branch0.getColor() == null backColor = branch0.getColor() == null
? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)

View File

@ -99,8 +99,8 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground) backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: color; : color;
arrowColor = Rainbow.build(skinParam()); arrowColor = Rainbow.build(skinParam());
fontArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
fcTest = new FontConfiguration(skinParam(), testParam, null); fcTest = FontConfiguration.create(skinParam(), testParam, null);
} }
incoming1 = ensureColor(incoming1, arrowColor); incoming1 = ensureColor(incoming1, arrowColor);

View File

@ -118,7 +118,7 @@ public class FtileGroup extends AbstractFtile {
style = null; style = null;
final UFont font = skinParam.getFont(null, false, FontParam.PARTITION); final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION); final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(), fc = FontConfiguration.create(font, fontColor, skinParam.getHyperlinkColor(),
skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
this.shadowing = skinParam().shadowing(null) ? 3 : 0; this.shadowing = skinParam().shadowing(null) ? 3 : 0;
thickness = skinParam.getThickness(LineParam.partitionBorder, null); thickness = skinParam.getThickness(LineParam.partitionBorder, null);
@ -169,7 +169,7 @@ public class FtileGroup extends AbstractFtile {
} }
private MinMax getInnerMinMax(StringBounder stringBounder) { private MinMax getInnerMinMax(StringBounder stringBounder) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false); final LimitFinder limitFinder = LimitFinder.create(stringBounder, false);
final UGraphicForSnake interceptor = new UGraphicForSnake(limitFinder); final UGraphicForSnake interceptor = new UGraphicForSnake(limitFinder);
final UGraphicInterceptorUDrawable interceptor2 = new UGraphicInterceptorUDrawable(interceptor); final UGraphicInterceptorUDrawable interceptor2 = new UGraphicInterceptorUDrawable(interceptor);

View File

@ -128,10 +128,10 @@ class FtileIfAndStop extends AbstractFtile {
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder());
thickness = tileNonStop.getThickness(style); thickness = tileNonStop.getThickness(style);
fcTest = new FontConfiguration(skinParam, style); fcTest = FontConfiguration.create(skinParam, style);
} else { } else {
thickness = tileNonStop.getThickness(null); thickness = tileNonStop.getThickness(null);
fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null); fcTest = FontConfiguration.create(skinParam, FontParam.ACTIVITY_DIAMOND, null);
} }
final Sheet sheet = Parser final Sheet sheet = Parser

View File

@ -127,7 +127,7 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();
} }
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null); final FontConfiguration fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
final Sheet sheet = Parser final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL) .build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)

View File

@ -158,7 +158,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null); fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0; shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();
} }

View File

@ -130,7 +130,7 @@ public class FtileWithNotes extends AbstractFtile {
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null); fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0; shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();
} }

View File

@ -160,7 +160,7 @@ public class FtileBox extends AbstractFtile {
final FontConfiguration fc; final FontConfiguration fc;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering( this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null; Colors specBack = null;
if (skinParam instanceof SkinParamColors) { if (skinParam instanceof SkinParamColors) {
@ -180,10 +180,10 @@ public class FtileBox extends AbstractFtile {
} else { } else {
this.padding = ClockwiseTopRightBottomLeft.same(10); this.padding = ClockwiseTopRightBottomLeft.same(10);
this.margin = ClockwiseTopRightBottomLeft.same(0); this.margin = ClockwiseTopRightBottomLeft.same(0);
this.inRendering = new LinkRendering(Rainbow.build(skinParam)); this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT; this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();

View File

@ -161,7 +161,7 @@ public class FtileBox2 extends AbstractFtile {
final FontConfiguration fc; final FontConfiguration fc;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering( this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null; Colors specBack = null;
if (skinParam instanceof SkinParamColors) { if (skinParam instanceof SkinParamColors) {
@ -181,10 +181,10 @@ public class FtileBox2 extends AbstractFtile {
} else { } else {
this.padding = ClockwiseTopRightBottomLeft.same(10); this.padding = ClockwiseTopRightBottomLeft.same(10);
this.margin = ClockwiseTopRightBottomLeft.same(0); this.margin = ClockwiseTopRightBottomLeft.same(0);
this.inRendering = new LinkRendering(Rainbow.build(skinParam)); this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT; this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();

View File

@ -186,7 +186,7 @@ public class FtileBoxOld extends AbstractFtile {
final FontConfiguration fc; final FontConfiguration fc;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering( this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null; Colors specBack = null;
if (skinParam instanceof SkinParamColors) if (skinParam instanceof SkinParamColors)
@ -204,10 +204,10 @@ public class FtileBoxOld extends AbstractFtile {
this.minimumWidth = style.value(PName.MinimumWidth).asDouble(); this.minimumWidth = style.value(PName.MinimumWidth).asDouble();
} else { } else {
this.padding = ClockwiseTopRightBottomLeft.same(10); this.padding = ClockwiseTopRightBottomLeft.same(10);
this.inRendering = new LinkRendering(Rainbow.build(skinParam)); this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT; this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();

View File

@ -77,9 +77,9 @@ public class FtileCircleSpot extends AbstractFtile {
this.swimlane = swimlane; this.swimlane = swimlane;
this.backColor = backColor; this.backColor = backColor;
if (UseStyle.useBetaStyle()) if (UseStyle.useBetaStyle())
this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
else else
this.fc = new FontConfiguration(skinParam, style); this.fc = FontConfiguration.create(skinParam, style);
} }
@Override @Override

View File

@ -93,7 +93,7 @@ public class GtileAssembly extends GtileTopDown {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else { } else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
} }
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE); return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
} }

View File

@ -140,7 +140,7 @@ public class GtileBox extends AbstractGtile {
final FontConfiguration fc; final FontConfiguration fc;
final LineBreakStrategy wrapWidth; final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering( this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle())); Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null; Colors specBack = null;
if (skinParam instanceof SkinParamColors) { if (skinParam instanceof SkinParamColors) {
@ -160,10 +160,10 @@ public class GtileBox extends AbstractGtile {
} else { } else {
this.padding = ClockwiseTopRightBottomLeft.same(10); this.padding = ClockwiseTopRightBottomLeft.same(10);
this.margin = ClockwiseTopRightBottomLeft.same(0); this.margin = ClockwiseTopRightBottomLeft.same(0);
this.inRendering = new LinkRendering(Rainbow.build(skinParam)); this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder); this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground); this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT; this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0; this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();

View File

@ -75,7 +75,7 @@ public class GtileCircleSpot extends AbstractGtile {
super(stringBounder, skinParam, swimlane); super(stringBounder, skinParam, swimlane);
this.spot = spot; this.spot = spot;
this.backColor = backColor; this.backColor = backColor;
this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null); this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
if (UseStyle.useBetaStyle()) { if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder());
this.shadowing = style.value(PName.Shadowing).asDouble(); this.shadowing = style.value(PName.Shadowing).asDouble();

View File

@ -114,7 +114,7 @@ public class GtileGroup extends AbstractGtileRoot {
style = null; style = null;
final UFont font = skinParam.getFont(null, false, FontParam.PARTITION); final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION); final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(), fc = FontConfiguration.create(font, fontColor, skinParam.getHyperlinkColor(),
skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
this.shadowing = skinParam().shadowing(null) ? 3 : 0; this.shadowing = skinParam().shadowing(null) ? 3 : 0;
} }

View File

@ -205,7 +205,7 @@ public class GtileIfHexagon extends GtileColumns {
// final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder()); // final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
// fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()); // fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
// } else { // } else {
// fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null); // fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
// } // }
// //
// return branch.getDisplayPositive().create0(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), // return branch.getDisplayPositive().create0(fontConfiguration, HorizontalAlignment.LEFT, skinParam(),

View File

@ -133,7 +133,7 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null); fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0; shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();
} }

View File

@ -134,7 +134,7 @@ public class GtileWithNotes extends AbstractGtile {
} else { } else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground); noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder); borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null); fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0; shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth(); wrapWidth = skinParam.wrapWidth();
} }

View File

@ -85,7 +85,7 @@ public class Gtiles {
borderColor = rose.getHtmlColor(skinParam, ColorParam.activityDiamondBorder); borderColor = rose.getHtmlColor(skinParam, ColorParam.activityDiamondBorder);
backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityDiamondBackground) : color; backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityDiamondBackground) : color;
fcTest = new FontConfiguration(skinParam, testParam, null) fcTest = FontConfiguration.create(skinParam, testParam, null)
.changeColor(fontColor(skinParam, FontParam.ACTIVITY_DIAMOND)); .changeColor(fontColor(skinParam, FontParam.ACTIVITY_DIAMOND));
} }

View File

@ -0,0 +1,11 @@
package net.sourceforge.plantuml.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE })
public @interface HaxeIgnored {
}

View File

@ -35,6 +35,7 @@
*/ */
package net.sourceforge.plantuml.api; package net.sourceforge.plantuml.api;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
@ -49,7 +50,8 @@ public abstract class ImageDataAbstract implements ImageData {
this.width = width; this.width = width;
this.height = height; this.height = height;
} }
@HaxeIgnored
public ImageDataAbstract(Dimension2D dim) { public ImageDataAbstract(Dimension2D dim) {
this((int) dim.getWidth(), (int) dim.getHeight()); this((int) dim.getWidth(), (int) dim.getHeight());
} }

View File

@ -38,6 +38,7 @@ package net.sourceforge.plantuml.api;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.CMapData; import net.sourceforge.plantuml.CMapData;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
public class ImageDataComplex extends ImageDataAbstract { public class ImageDataComplex extends ImageDataAbstract {
@ -45,6 +46,7 @@ public class ImageDataComplex extends ImageDataAbstract {
private final String warningOrError; private final String warningOrError;
@SuppressWarnings("unused") // available publicly so retained for backwards compatibility @SuppressWarnings("unused") // available publicly so retained for backwards compatibility
@HaxeIgnored
public ImageDataComplex(Dimension2D info, CMapData cmap, String warningOrError) { public ImageDataComplex(Dimension2D info, CMapData cmap, String warningOrError) {
super(info); super(info);
this.cmap = cmap; this.cmap = cmap;

View File

@ -35,16 +35,19 @@
*/ */
package net.sourceforge.plantuml.api; package net.sourceforge.plantuml.api;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
public class ImageDataSimple extends ImageDataAbstract { public class ImageDataSimple extends ImageDataAbstract {
@HaxeIgnored
public ImageDataSimple(int width, int height) { public ImageDataSimple(int width, int height) {
super(width, height); super(width, height);
} }
@HaxeIgnored
public ImageDataSimple(Dimension2D dim) { public ImageDataSimple(Dimension2D dim) {
super(dim); super(dim);
} }
@ -54,6 +57,7 @@ public class ImageDataSimple extends ImageDataAbstract {
setStatus(status); setStatus(status);
} }
@HaxeIgnored
private ImageDataSimple() { private ImageDataSimple() {
this(0, 0); this(0, 0);
} }

View File

@ -34,7 +34,8 @@ import java.util.concurrent.locks.ReentrantLock;
import java.util.prefs.Preferences; import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
@HaxeIgnored
public class NumberAnalyzed implements INumberAnalyzed { public class NumberAnalyzed implements INumberAnalyzed {
private static final int SLIDING_WINDOW = 1024; private static final int SLIDING_WINDOW = 1024;

View File

@ -33,7 +33,9 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.prefs.Preferences; import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
@HaxeIgnored
public class NumberAnalyzed2 implements INumberAnalyzed { public class NumberAnalyzed2 implements INumberAnalyzed {
private static final int SLIDING_WINDOW = 512; private static final int SLIDING_WINDOW = 512;

View File

@ -33,7 +33,9 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.prefs.Preferences; import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
@HaxeIgnored
public class NumberAnalyzedDated extends NumberAnalyzed { public class NumberAnalyzedDated extends NumberAnalyzed {
private final AtomicLong created = new AtomicLong(); private final AtomicLong created = new AtomicLong();

View File

@ -71,7 +71,7 @@ public class BoardDiagram extends UmlDiagram {
} }
public BoardDiagram(ThemeStyle style, UmlSource source) { public BoardDiagram(ThemeStyle style, UmlSource source) {
super(style, source, UmlDiagramType.BOARD); super(style, source, UmlDiagramType.BOARD, null);
} }
@Override @Override

View File

@ -76,7 +76,7 @@ public class BpmDiagram extends UmlDiagram {
} }
public BpmDiagram(ThemeStyle style, UmlSource source) { public BpmDiagram(ThemeStyle style, UmlSource source) {
super(style, source, UmlDiagramType.BPM); super(style, source, UmlDiagramType.BPM, null);
} }
@Override @Override

View File

@ -167,7 +167,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
return FtileBox.create(skinParam, display, null, BoxStyle.PLAIN, null); return FtileBox.create(skinParam, display, null, BoxStyle.PLAIN, null);
} }
final UFont font = UFont.serif(14); final UFont font = UFont.serif(14);
final FontConfiguration fc = new FontConfiguration(font, HColorUtils.RED, HColorUtils.RED, false); final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.RED, HColorUtils.RED, false);
if (Display.isNull(display)) { if (Display.isNull(display)) {
return Display.getWithNewlines(type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam); return Display.getWithNewlines(type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam);
} }

View File

@ -132,8 +132,8 @@ public class BlocLines implements Iterable<StringLocated> {
return new BlocLines(result); return new BlocLines(result);
} }
public BlocLines() { public static BlocLines create() {
this(new ArrayList<StringLocated>()); return new BlocLines(new ArrayList<StringLocated>());
} }
public BlocLines add(StringLocated s) { public BlocLines add(StringLocated s) {

View File

@ -42,40 +42,40 @@ public class CommandDecoratorMultine<D extends Diagram> implements Command<D> {
private final SingleLineCommand2<D> cmd; private final SingleLineCommand2<D> cmd;
private final boolean removeEmptyColumn; private final boolean removeEmptyColumn;
private final int nbMaxLines; private final int nbMaxLines;
public CommandDecoratorMultine(SingleLineCommand2<D> cmd, int nbMaxLines) { public static <D extends Diagram> CommandDecoratorMultine<D> create(SingleLineCommand2<D> cmd, int nbMaxLines) {
this(cmd, false, nbMaxLines); return new CommandDecoratorMultine<D>(cmd, false, nbMaxLines);
} }
public CommandDecoratorMultine(SingleLineCommand2<D> cmd, boolean removeEmptyColumn, int nbMaxLines) { private CommandDecoratorMultine(SingleLineCommand2<D> cmd, boolean removeEmptyColumn, int nbMaxLines) {
this.cmd = cmd; this.cmd = cmd;
this.removeEmptyColumn = removeEmptyColumn; this.removeEmptyColumn = removeEmptyColumn;
this.nbMaxLines = nbMaxLines; this.nbMaxLines = nbMaxLines;
} }
public CommandExecutionResult execute(D diagram, BlocLines lines) { public CommandExecutionResult execute(D diagram, BlocLines lines) {
if (removeEmptyColumn) { if (removeEmptyColumn)
lines = lines.removeEmptyColumns(); lines = lines.removeEmptyColumns();
}
lines = lines.toSingleLineWithHiddenNewLine(); lines = lines.toSingleLineWithHiddenNewLine();
return cmd.execute(diagram, lines); return cmd.execute(diagram, lines);
} }
public CommandControl isValid(BlocLines lines) { public CommandControl isValid(BlocLines lines) {
if (cmd.isCommandForbidden()) { if (cmd.isCommandForbidden())
return CommandControl.NOT_OK; return CommandControl.NOT_OK;
}
lines = lines.toSingleLineWithHiddenNewLine(); lines = lines.toSingleLineWithHiddenNewLine();
if (cmd.isForbidden(lines.getFirst().getString())) { if (cmd.isForbidden(lines.getFirst().getString()))
return CommandControl.NOT_OK; return CommandControl.NOT_OK;
}
final CommandControl tmp = cmd.isValid(lines); final CommandControl tmp = cmd.isValid(lines);
if (tmp == CommandControl.OK_PARTIAL) { if (tmp == CommandControl.OK_PARTIAL)
throw new IllegalStateException(); throw new IllegalStateException();
}
if (tmp == CommandControl.OK) { if (tmp == CommandControl.OK)
return tmp; return tmp;
}
return CommandControl.OK_PARTIAL; return CommandControl.OK_PARTIAL;
} }

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.ErrorUml;
import net.sourceforge.plantuml.ErrorUmlType; import net.sourceforge.plantuml.ErrorUmlType;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.DiagramType;
@ -54,6 +55,7 @@ public abstract class PSystemBasicFactory<P extends AbstractPSystem> extends PSy
super(diagramType); super(diagramType);
} }
@HaxeIgnored
public PSystemBasicFactory() { public PSystemBasicFactory() {
this(DiagramType.UML); this(DiagramType.UML);
} }

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.ErrorUmlType;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.DiagramType;
@ -60,6 +61,7 @@ public abstract class PSystemCommandFactory extends PSystemAbstractFactory {
public abstract AbstractPSystem createEmptyDiagram(ThemeStyle style, UmlSource source, ISkinSimple skinParam); public abstract AbstractPSystem createEmptyDiagram(ThemeStyle style, UmlSource source, ISkinSimple skinParam);
@HaxeIgnored
protected PSystemCommandFactory() { protected PSystemCommandFactory() {
this(DiagramType.UML); this(DiagramType.UML);
} }
@ -171,7 +173,7 @@ public abstract class PSystemCommandFactory extends PSystemAbstractFactory {
} }
private BlocLines isMultilineCommandOk(IteratorCounter2 it, Command cmd) { private BlocLines isMultilineCommandOk(IteratorCounter2 it, Command cmd) {
BlocLines lines = new BlocLines(); BlocLines lines = BlocLines.create();
int nb = 0; int nb = 0;
while (it.hasNext()) { while (it.hasNext()) {
lines = addOneSingleLineManageEmbedded2(it, lines); lines = addOneSingleLineManageEmbedded2(it, lines);

View File

@ -39,6 +39,7 @@ import java.util.Objects;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.Diagram;
@ -50,6 +51,7 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
private final IRegex pattern; private final IRegex pattern;
private final boolean doTrim; private final boolean doTrim;
@HaxeIgnored
public SingleLineCommand2(IRegex pattern) { public SingleLineCommand2(IRegex pattern) {
this(true, pattern); this(true, pattern);
} }

View File

@ -44,6 +44,7 @@ import java.util.StringTokenizer;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
public class RegexLeaf implements IRegex { public class RegexLeaf implements IRegex {
@ -54,10 +55,16 @@ public class RegexLeaf implements IRegex {
private int count = -1; private int count = -1;
@HaxeIgnored
public RegexLeaf(String regex) { public RegexLeaf(String regex) {
this(null, regex); this(null, regex);
} }
public RegexLeaf(String name, String regex) {
this.pattern = regex;
this.name = name;
}
public static RegexLeaf spaceZeroOrMore() { public static RegexLeaf spaceZeroOrMore() {
return new RegexLeaf("[%s]*"); return new RegexLeaf("[%s]*");
} }
@ -74,11 +81,6 @@ public class RegexLeaf implements IRegex {
return END; return END;
} }
public RegexLeaf(String name, String regex) {
this.pattern = regex;
this.name = name;
}
@Override @Override
public String toString() { public String toString() {
return super.toString() + " " + name + " " + pattern; return super.toString() + " " + name + " " + pattern;

View File

@ -40,11 +40,13 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
public class RegexOr extends RegexComposed implements IRegex { public class RegexOr extends RegexComposed implements IRegex {
private final String name; private final String name;
@HaxeIgnored
public RegexOr(IRegex... partial) { public RegexOr(IRegex... partial) {
this(null, partial); this(null, partial);
} }

View File

@ -67,22 +67,21 @@ final public class UmlSource {
final private List<StringLocated> rawSource; final private List<StringLocated> rawSource;
public UmlSource removeInitialSkinparam() { public UmlSource removeInitialSkinparam() {
if (hasInitialSkinparam(source) == false) { if (hasInitialSkinparam(source) == false)
return this; return this;
}
final List<StringLocated> copy = new ArrayList<>(source); final List<StringLocated> copy = new ArrayList<>(source);
while (hasInitialSkinparam(copy)) { while (hasInitialSkinparam(copy))
copy.remove(1); copy.remove(1);
}
return new UmlSource(copy, rawSource); return new UmlSource(copy, rawSource);
} }
public boolean containsIgnoreCase(String searched) { public boolean containsIgnoreCase(String searched) {
for (StringLocated s : source) { for (StringLocated s : source)
if (StringUtils.goLowerCase(s.getString()).contains(searched)) { if (StringUtils.goLowerCase(s.getString()).contains(searched))
return true; return true;
}
}
return false; return false;
} }
@ -96,24 +95,29 @@ final public class UmlSource {
this.rawSource = rawSource; this.rawSource = rawSource;
} }
public UmlSource(List<StringLocated> data, boolean checkEndingBackslash) { public static UmlSource create(List<StringLocated> source, boolean checkEndingBackslash) {
this(data, checkEndingBackslash, new ArrayList<StringLocated>()); return createWithRaw(source, checkEndingBackslash, new ArrayList<StringLocated>());
} }
/** /**
* Build the source from a text. * Build the source from a text.
* *
* @param data the source of the diagram * @param source the source of the diagram
* @param checkEndingBackslash <code>true</code> if an ending backslash means * @param checkEndingBackslash <code>true</code> if an ending backslash means
* that a line has to be collapsed with the * that a line has to be collapsed with the
* following one. * following one.
*/ */
public UmlSource(List<StringLocated> data, boolean checkEndingBackslash, List<StringLocated> rawSource) { public static UmlSource createWithRaw(List<StringLocated> source, boolean checkEndingBackslash,
this(new ArrayList<StringLocated>(), rawSource); List<StringLocated> rawSource) {
final UmlSource result = new UmlSource(new ArrayList<StringLocated>(), rawSource);
result.loadInternal(source, checkEndingBackslash);
return result;
}
private void loadInternal(List<StringLocated> source, boolean checkEndingBackslash) {
if (checkEndingBackslash) { if (checkEndingBackslash) {
final StringBuilder pending = new StringBuilder(); final StringBuilder pending = new StringBuilder();
for (StringLocated cs : data) { for (StringLocated cs : source) {
final String s = cs.getString(); final String s = cs.getString();
if (StringUtils.endsWithBackslash(s)) { if (StringUtils.endsWithBackslash(s)) {
pending.append(s.substring(0, s.length() - 1)); pending.append(s.substring(0, s.length() - 1));
@ -124,7 +128,7 @@ final public class UmlSource {
} }
} }
} else { } else {
this.source.addAll(data); this.source.addAll(source);
} }
} }
@ -181,11 +185,10 @@ final public class UmlSource {
} }
public String getLine(LineLocation n) { public String getLine(LineLocation n) {
for (StringLocated s : source) { for (StringLocated s : source)
if (s.getLocation().compareTo(n) == 0) { if (s.getLocation().compareTo(n) == 0)
return s.getString(); return s.getString();
}
}
return null; return null;
} }
@ -208,18 +211,18 @@ final public class UmlSource {
*/ */
public boolean isEmpty() { public boolean isEmpty() {
for (StringLocated s : source) { for (StringLocated s : source) {
if (StartUtils.isArobaseStartDiagram(s.getString())) { if (StartUtils.isArobaseStartDiagram(s.getString()))
continue; continue;
}
if (StartUtils.isArobaseEndDiagram(s.getString())) { if (StartUtils.isArobaseEndDiagram(s.getString()))
continue; continue;
}
if (s.getString().matches("\\s*'.*")) { if (s.getString().matches("\\s*'.*"))
continue; continue;
}
if (StringUtils.trin(s.getString()).length() != 0) { if (StringUtils.trin(s.getString()).length() != 0)
return false; return false;
}
} }
return true; return true;
} }
@ -233,9 +236,8 @@ final public class UmlSource {
for (StringLocated s : source) { for (StringLocated s : source) {
final Matcher2 m = p.matcher(s.getString()); final Matcher2 m = p.matcher(s.getString());
final boolean ok = m.matches(); final boolean ok = m.matches();
if (ok) { if (ok)
return Display.create(m.group(1)); return Display.create(m.group(1));
}
} }
return Display.empty(); return Display.empty();
} }
@ -247,9 +249,9 @@ final public class UmlSource {
public String getId() { public String getId() {
final Pattern p = Pattern.compile("id=([\\w]+)\\b"); final Pattern p = Pattern.compile("id=([\\w]+)\\b");
final Matcher m = p.matcher(source.get(0).getString()); final Matcher m = p.matcher(source.get(0).getString());
if (m.find()) { if (m.find())
return m.group(1); return m.group(1);
}
return null; return null;
} }

View File

@ -45,6 +45,7 @@ import java.util.Objects;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.creole.atom.Atom; import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.creole.legacy.StripeSimple; import net.sourceforge.plantuml.creole.legacy.StripeSimple;
import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.AbstractTextBlock;
@ -73,6 +74,7 @@ public class SheetBlock1 extends AbstractTextBlock implements TextBlock, Atom, S
private final double marginX1; private final double marginX1;
private final double marginX2; private final double marginX2;
@HaxeIgnored
public SheetBlock1(Sheet sheet, LineBreakStrategy maxWidth, double padding) { public SheetBlock1(Sheet sheet, LineBreakStrategy maxWidth, double padding) {
this(sheet, maxWidth, padding, 0, 0); this(sheet, maxWidth, padding, 0, 0);
} }

View File

@ -81,9 +81,9 @@ public class Body3 extends AbstractTextBlock implements TextBlock, WithPorts {
FontConfiguration config; FontConfiguration config;
if (style != null) { if (style != null) {
config = new FontConfiguration(skinParam, style); config = FontConfiguration.create(skinParam, style);
} else { } else {
config = new FontConfiguration(skinParam, fontParam, stereotype); config = FontConfiguration.create(skinParam, fontParam, stereotype);
} }
TextBlock foo = display.create(config, HorizontalAlignment.LEFT, skinParam); TextBlock foo = display.create(config, HorizontalAlignment.LEFT, skinParam);

View File

@ -77,7 +77,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam,
Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
super(align, UseStyle.useBetaStyle() == false ? new FontConfiguration(skinParam, fontParam, stereotype) super(align, UseStyle.useBetaStyle() == false ? FontConfiguration.create(skinParam, fontParam, stereotype)
: style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
this.style = style; this.style = style;
this.rawBody2 = Display.create(rawBody); this.rawBody2 = Display.create(rawBody);
@ -93,7 +93,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam,
Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
super(align, style == null ? new FontConfiguration(skinParam, fontParam, stereotype) super(align, style == null ? FontConfiguration.create(skinParam, fontParam, stereotype)
: style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
this.style = style; this.style = style;

View File

@ -93,7 +93,7 @@ public class LinkConstraint {
ug = ug.apply(new UStroke(3, 3, 1)); ug = ug.apply(new UStroke(3, 3, 1));
ug.apply(new UTranslate(x1, y1)).draw(line); ug.apply(new UTranslate(x1, y1)).draw(line);
final TextBlock label = display.create(new FontConfiguration(skinParam, FontParam.ARROW, null), final TextBlock label = display.create(FontConfiguration.create(skinParam, FontParam.ARROW, null),
HorizontalAlignment.CENTER, skinParam); HorizontalAlignment.CENTER, skinParam);
final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder()); final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder());
final double x = (x1 + x2) / 2 - dimLabel.getWidth() / 2; final double x = (x1 + x2) / 2 - dimLabel.getWidth() / 2;

View File

@ -182,9 +182,9 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock,
FontConfiguration config; FontConfiguration config;
if (style != null) if (style != null)
config = new FontConfiguration(skinParam, style); config = FontConfiguration.create(skinParam, style);
else else
config = new FontConfiguration(skinParam, fontParam, stereotype); config = FontConfiguration.create(skinParam, fontParam, stereotype);
if (cs instanceof Member) { if (cs instanceof Member) {
final Member m = (Member) cs; final Member m = (Member) cs;

View File

@ -226,7 +226,7 @@ public class TextBlockCucaJSon extends AbstractTextBlock implements WithPorts {
private FontConfiguration getFontConfiguration() { private FontConfiguration getFontConfiguration() {
if (fontConfiguration == null) if (fontConfiguration == null)
return new FontConfiguration(skinParam, fontParam, null); return FontConfiguration.create(skinParam, fontParam, null);
return fontConfiguration; return fontConfiguration;
} }

View File

@ -203,7 +203,7 @@ public class TextBlockMap extends AbstractTextBlock implements WithPorts {
private FontConfiguration getFontConfiguration() { private FontConfiguration getFontConfiguration() {
if (fontConfiguration == null) if (fontConfiguration == null)
return new FontConfiguration(skinParam, fontParam, null); return FontConfiguration.create(skinParam, fontParam, null);
return fontConfiguration; return fontConfiguration;
} }

View File

@ -676,7 +676,7 @@ final public class EntityImpl implements ILeaf, IGroup {
final FontParam fontParam = getTitleFontParam(); final FontParam fontParam = getTitleFontParam();
final HColor fontHtmlColor = skinParam.getFontHtmlColor(getStereotype(), fontParam, FontParam.PACKAGE); final HColor fontHtmlColor = skinParam.getFontHtmlColor(getStereotype(), fontParam, FontParam.PACKAGE);
final UFont font = skinParam.getFont(getStereotype(), true, fontParam, FontParam.PACKAGE); final UFont font = skinParam.getFont(getStereotype(), true, fontParam, FontParam.PACKAGE);
final FontConfiguration fontConfiguration = new FontConfiguration(font, fontHtmlColor, final FontConfiguration fontConfiguration = FontConfiguration.create(font, fontHtmlColor,
skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
return fontConfiguration; return fontConfiguration;
} }

View File

@ -73,7 +73,7 @@ public class PSystemDefinition extends PlainDiagram implements UDrawable {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UFont font = UFont.sansSerif(14); final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false); final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
Display.getWithNewlines(startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug); Display.getWithNewlines(startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug);
} }

View File

@ -73,13 +73,13 @@ public class EntityImageDesignedDomain extends AbstractEntityImage {
super(entity, skinParam); super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
this.name = TextBlockUtils.withMargin( this.name = TextBlockUtils.withMargin(
entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN, stereotype), entity.getDisplay().create(FontConfiguration.create(getSkinParam(), FontParam.DESIGNED_DOMAIN, stereotype),
HorizontalAlignment.CENTER, skinParam), 2, 2); HorizontalAlignment.CENTER, skinParam), 2, 2);
if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) {
this.stereo = null; this.stereo = null;
} else { } else {
this.stereo = Display.create(stereotype.getLabels(skinParam.guillemet())).create( this.stereo = Display.create(stereotype.getLabels(skinParam.guillemet())).create(
new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN_STEREOTYPE, stereotype), FontConfiguration.create(getSkinParam(), FontParam.DESIGNED_DOMAIN_STEREOTYPE, stereotype),
HorizontalAlignment.CENTER, skinParam); HorizontalAlignment.CENTER, skinParam);
} }
this.url = entity.getUrl99(); this.url = entity.getUrl99();

View File

@ -74,14 +74,14 @@ public class EntityImageDomain extends AbstractEntityImage {
public EntityImageDomain(ILeaf entity, ISkinParam skinParam, char typeLetter) { public EntityImageDomain(ILeaf entity, ISkinParam skinParam, char typeLetter) {
super(entity, skinParam); super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
FontConfiguration fc = new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN, stereotype); FontConfiguration fc = FontConfiguration.create(getSkinParam(), FontParam.DESIGNED_DOMAIN, stereotype);
this.name = TextBlockUtils.withMargin(entity.getDisplay().create(fc, HorizontalAlignment.CENTER, skinParam), 2, this.name = TextBlockUtils.withMargin(entity.getDisplay().create(fc, HorizontalAlignment.CENTER, skinParam), 2,
2); 2);
if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) {
this.stereo = null; this.stereo = null;
} else { } else {
this.stereo = Display.create(stereotype.getLabels(skinParam.guillemet())).create( this.stereo = Display.create(stereotype.getLabels(skinParam.guillemet())).create(
new FontConfiguration(getSkinParam(), FontParam.DESIGNED_DOMAIN_STEREOTYPE, stereotype), FontConfiguration.create(getSkinParam(), FontParam.DESIGNED_DOMAIN_STEREOTYPE, stereotype),
HorizontalAlignment.CENTER, skinParam); HorizontalAlignment.CENTER, skinParam);
} }
this.tag = new BoxedCharacter(typeLetter, 8, UFont.byDefault(8), stereotype.getHtmlColor(), null, fc.getColor()); this.tag = new BoxedCharacter(typeLetter, 8, UFont.byDefault(8), stereotype.getHtmlColor(), null, fc.getColor());

View File

@ -73,13 +73,13 @@ public class EntityImageMachine extends AbstractEntityImage {
super(entity, skinParam); super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
this.name = TextBlockUtils.withMargin( this.name = TextBlockUtils.withMargin(
entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.MACHINE, stereotype), entity.getDisplay().create(FontConfiguration.create(getSkinParam(), FontParam.MACHINE, stereotype),
HorizontalAlignment.CENTER, skinParam), 2, 2); HorizontalAlignment.CENTER, skinParam), 2, 2);
if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) {
this.stereo = null; this.stereo = null;
} else { } else {
this.stereo = Display.create(stereotype.getLabels(skinParam.guillemet())).create( this.stereo = Display.create(stereotype.getLabels(skinParam.guillemet())).create(
new FontConfiguration(getSkinParam(), FontParam.MACHINE_STEREOTYPE, stereotype), FontConfiguration.create(getSkinParam(), FontParam.MACHINE_STEREOTYPE, stereotype),
HorizontalAlignment.CENTER, skinParam); HorizontalAlignment.CENTER, skinParam);
} }
this.url = entity.getUrl99(); this.url = entity.getUrl99();

View File

@ -84,7 +84,7 @@ public class EntityImageRequirement extends AbstractEntityImage {
this.desc = tmp; this.desc = tmp;
} else { } else {
final TextBlock stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().guillemet())).create( final TextBlock stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().guillemet())).create(
new FontConfiguration(getSkinParam(), FontParam.REQUIREMENT_STEREOTYPE, stereotype), FontConfiguration.create(getSkinParam(), FontParam.REQUIREMENT_STEREOTYPE, stereotype),
HorizontalAlignment.CENTER, skinParam); HorizontalAlignment.CENTER, skinParam);
this.desc = TextBlockUtils.mergeTB(stereo, tmp, HorizontalAlignment.CENTER); this.desc = TextBlockUtils.mergeTB(stereo, tmp, HorizontalAlignment.CENTER);
} }

View File

@ -260,7 +260,7 @@ public class PSystemColors extends PlainDiagram implements UDrawable {
private TextBlock getTextName(final UFont font, String name, final HColorSimple color) { private TextBlock getTextName(final UFont font, String name, final HColorSimple color) {
final HColorSimple opposite = color.opposite(); final HColorSimple opposite = color.opposite();
final FontConfiguration fc = new FontConfiguration(font, opposite, HColorUtils.BLUE, true); final FontConfiguration fc = FontConfiguration.create(font, opposite, HColorUtils.BLUE, true);
final TextBlock tt = Display.getWithNewlines(name).create(fc, HorizontalAlignment.CENTER, final TextBlock tt = Display.getWithNewlines(name).create(fc, HorizontalAlignment.CENTER,
new SpriteContainerEmpty()); new SpriteContainerEmpty());
return tt; return tt;

View File

@ -166,7 +166,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
return null; return null;
} }
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.ARROW, null); final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null);
final TextBlock label = link.getLabel().create(labelFont, final TextBlock label = link.getLabel().create(labelFont,
skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam);
if (TextBlockUtils.isEmpty(label, stringBounder)) { if (TextBlockUtils.isEmpty(label, stringBounder)) {
@ -181,7 +181,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
return null; return null;
} }
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();
final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.ARROW, null); final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null);
final TextBlock label = Display.getWithNewlines(tmp).create(labelFont, final TextBlock label = Display.getWithNewlines(tmp).create(labelFont,
skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam);
if (TextBlockUtils.isEmpty(label, stringBounder)) { if (TextBlockUtils.isEmpty(label, stringBounder)) {

View File

@ -353,7 +353,7 @@ public abstract class PSystemError extends PlainDiagram {
"Details on <i>[[https://plantuml.com/dedication]]"); "Details on <i>[[https://plantuml.com/dedication]]");
final UFont font = UFont.sansSerif(14); final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false); final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
final TextBlock text = TextBlockUtils final TextBlock text = TextBlockUtils
.withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0); .withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
final TextBlock result; final TextBlock result;
@ -374,7 +374,7 @@ public abstract class PSystemError extends PlainDiagram {
"Details on <i>[[http://plantuml.com/adopt]]", " "); "Details on <i>[[http://plantuml.com/adopt]]", " ");
final UFont font = UFont.sansSerif(14); final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false); final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
final TextBlock text = TextBlockUtils final TextBlock text = TextBlockUtils
.withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0); .withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
final TextBlock result; final TextBlock result;

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.core.UmlSource;
public class PSystemErrorPreprocessor extends PSystemError { public class PSystemErrorPreprocessor extends PSystemError {
public PSystemErrorPreprocessor(List<StringLocated> input, List<StringLocated> trace) { public PSystemErrorPreprocessor(List<StringLocated> input, List<StringLocated> trace) {
super(new UmlSource(input, DiagramType.getTypeFromArobaseStart(input.get(0).getString()) == DiagramType.UML)); super(UmlSource.create(input, DiagramType.getTypeFromArobaseStart(input.get(0).getString()) == DiagramType.UML));
this.trace = trace; this.trace = trace;
this.singleError = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, getLastLine().getPreprocessorError(), 0, this.singleError = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, getLastLine().getPreprocessorError(), 0,
getLastLine().getLocation()); getLastLine().getLocation());

View File

@ -91,7 +91,7 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
} }
public FlowDiagram(ThemeStyle style, UmlSource source) { public FlowDiagram(ThemeStyle style, UmlSource source) {
super(style, source, UmlDiagramType.FLOW); super(style, source, UmlDiagramType.FLOW, null);
} }
public void lineSimple(TileGeometry orientation, String idDest, String label) { public void lineSimple(TileGeometry orientation, String idDest, String label) {

View File

@ -59,7 +59,7 @@ public class GitDiagram extends UmlDiagram {
private final Collection<GNode> gnodes; private final Collection<GNode> gnodes;
public GitDiagram(ThemeStyle style, UmlSource source, GitTextArea textArea) { public GitDiagram(ThemeStyle style, UmlSource source, GitTextArea textArea) {
super(style, source, UmlDiagramType.GIT); super(style, source, UmlDiagramType.GIT, null);
this.gnodes = new GNodeBuilder(textArea.getAllCommits()).getAllNodes(); this.gnodes = new GNodeBuilder(textArea.getAllCommits()).getAllNodes();
new GNodeBuilder(textArea.getAllCommits()); new GNodeBuilder(textArea.getAllCommits());
} }

View File

@ -70,13 +70,13 @@ public class MagicBox {
} }
private TextBlock getSmallBlock() { private TextBlock getSmallBlock() {
final FontConfiguration fc = new FontConfiguration(UFont.monospaced(15).bold(), fontColor, fontColor, false); final FontConfiguration fc = FontConfiguration.create(UFont.monospaced(15).bold(), fontColor, fontColor, false);
return node.getDisplay().create(fc, HorizontalAlignment.CENTER, skinParam); return node.getDisplay().create(fc, HorizontalAlignment.CENTER, skinParam);
} }
private TextBlock getCommentBlock() { private TextBlock getCommentBlock() {
if (node.getComment() != null && node.isTop()) { if (node.getComment() != null && node.isTop()) {
final FontConfiguration tag = new FontConfiguration(UFont.sansSerif(13), fontColor, fontColor, false); final FontConfiguration tag = FontConfiguration.create(UFont.sansSerif(13), fontColor, fontColor, false);
return Display.create(node.getComment()).create(tag, HorizontalAlignment.CENTER, skinParam); return Display.create(node.getComment()).create(tag, HorizontalAlignment.CENTER, skinParam);
} }
return TextBlockUtils.empty(0, 0); return TextBlockUtils.empty(0, 0);

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