1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 13:05:09 +00:00
This commit is contained in:
Arnaud Roques 2023-02-06 22:04:53 +01:00
parent 1c650bb2f9
commit 678949b44c
351 changed files with 1357 additions and 2665 deletions

View File

@ -66,7 +66,7 @@ public class Canvas {
private static int frameWidth; private static int frameWidth;
private static int frameHeight; private static int frameHeight;
public static int initCanvas(int width, int height) throws IOException { public static int initCanvas(int width, int height) {
WasmLog.start = System.currentTimeMillis(); WasmLog.start = System.currentTimeMillis();
WasmLog.log("initCanvas"); WasmLog.log("initCanvas");
if (g2d == null) { if (g2d == null) {
@ -85,6 +85,37 @@ public class Canvas {
return 47; return 47;
} }
public static int convert(String text) throws IOException {
WasmLog.start = System.currentTimeMillis();
final BlockUmlBuilder builder = new BlockUmlBuilder(Collections.<String>emptyList(), UTF_8,
Defines.createEmpty(), new StringReader(text), null, "string");
List<BlockUml> blocks = builder.getBlockUmls();
WasmLog.log("...loading data...");
final Diagram system = blocks.get(0).getDiagram();
if (system instanceof PSystemError) {
final ErrorUml error = ((PSystemError) system).getFirstError();
WasmLog.log("[" + error.getPosition() + "] " + error.getError());
return -242;
}
WasmLog.log("...processing...");
final HColor back = HColors.simple(Color.WHITE);
final StringBounder stringBounder = new StringBounderCanvas(g2d);
final UGraphicG2d ug = new UGraphicG2d(back, ColorMapper.IDENTITY, stringBounder, g2d, 1.0);
// ug.apply(back).apply(back.bg()).draw(new URectangle(frameWidth,
// frameHeight));
ug.apply(HColors.RED).apply(back.bg()).draw(new URectangle(frameWidth, frameHeight));
WasmLog.log("system= " + system.getClass().getName());
system.exportDiagramGraphic(ug);
return 45;
}
public static int convertCanvas(int width, int height, String text) throws IOException { public static int convertCanvas(int width, int height, String text) throws IOException {
WasmLog.start = System.currentTimeMillis(); WasmLog.start = System.currentTimeMillis();

View File

@ -35,7 +35,7 @@
*/ */
package com.plantuml.wasm; package com.plantuml.wasm;
//::uncomment when WASM //::uncomment when CORE
//import com.leaningtech.client.Document; //import com.leaningtech.client.Document;
//import com.leaningtech.client.Element; //import com.leaningtech.client.Element;
//import com.leaningtech.client.Global; //import com.leaningtech.client.Global;
@ -46,7 +46,7 @@ public class WasmLog {
public static long start; public static long start;
public static void log(String message) { public static void log(String message) {
// ::uncomment when WASM // ::uncomment when CORE
// if (start > 0) { // if (start > 0) {
// final long duration = System.currentTimeMillis() - start; // final long duration = System.currentTimeMillis() - start;
// message = "(" + duration + " ms) " + message; // message = "(" + duration + " ms) " + message;

View File

@ -97,7 +97,7 @@ import ext.plantuml.com.ctreber.aclib.sort.QuickSort;
* @author Christian Treber, ct@ctreber.com * @author Christian Treber, ct@ctreber.com
*/ */
public class ACearth { public class ACearth {
// :: remove folder when WASM // :: remove folder when CORE
public static final String VERSION = "1.1"; public static final String VERSION = "1.1";
public static final String BUILD = "22.11.2002 004"; public static final String BUILD = "22.11.2002 004";

View File

@ -9,7 +9,7 @@ package ext.plantuml.com.ctreber.aclib.gui;
*/ */
public class MOBoolean extends MonitoredObject public class MOBoolean extends MonitoredObject
{ {
// :: remove folder when WASM // :: remove folder when CORE
private boolean fBoolean; private boolean fBoolean;
public MOBoolean() public MOBoolean()

View File

@ -11,7 +11,7 @@ import java.util.Comparator;
*/ */
abstract public class CTSort abstract public class CTSort
{ {
// :: remove folder when WASM // :: remove folder when CORE
public void sort(Object[] items) public void sort(Object[] items)
{ {
sort(items, new DefaultComparator()); sort(items, new DefaultComparator());

View File

@ -24,7 +24,7 @@ import java.util.Hashtable;
* @author Sean Owen * @author Sean Owen
*/ */
public final class BarcodeFormat { public final class BarcodeFormat {
// :: remove folder when WASM // :: remove folder when CORE
// No, we can't use an enum here. J2ME doesn't support it. // No, we can't use an enum here. J2ME doesn't support it.

View File

@ -48,7 +48,7 @@ import jcckit.util.Factory;
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public class GraphicsPlotCanvas extends PlotCanvas { public class GraphicsPlotCanvas extends PlotCanvas {
// ::remove folder when WASM // ::remove folder when CORE
/** Key of a configuration parameter. */ /** Key of a configuration parameter. */
public static final String BACKGROUND_KEY = "background"; public static final String BACKGROUND_KEY = "background";
public static final String FOREGROUND_KEY = "foreground"; public static final String FOREGROUND_KEY = "foreground";

View File

@ -85,7 +85,7 @@ public abstract class AbstractPSystem implements Diagram {
toAppend.append(Version.versionString()); toAppend.append(Version.versionString());
toAppend.append("(" + Version.compileTimeString() + ")\n"); toAppend.append("(" + Version.compileTimeString() + ")\n");
toAppend.append("(" + License.getCurrent() + " source distribution)\n"); toAppend.append("(" + License.getCurrent() + " source distribution)\n");
// ::comment when WASM // ::comment when CORE
for (String name : OptionPrint.interestingProperties()) { for (String name : OptionPrint.interestingProperties()) {
toAppend.append(name); toAppend.append(name);
toAppend.append(BackSlash.CHAR_NEWLINE); toAppend.append(BackSlash.CHAR_NEWLINE);
@ -187,7 +187,7 @@ public abstract class AbstractPSystem implements Diagram {
// } // }
return exportDiagramNow(os, index, fileFormatOption); return exportDiagramNow(os, index, fileFormatOption);
} finally { } finally {
// ::comment when WASM // ::comment when CORE
if (OptionFlags.getInstance().isEnableStats()) if (OptionFlags.getInstance().isEnableStats())
StatsUtilsIncrement.onceMoreGenerate(System.currentTimeMillis() - now, getClass(), StatsUtilsIncrement.onceMoreGenerate(System.currentTimeMillis() - now, getClass(),
fileFormatOption.getFileFormat()); fileFormatOption.getFileFormat());

View File

@ -49,7 +49,7 @@ import net.sourceforge.plantuml.preproc.FileWithSuffix;
@Deprecated @Deprecated
public class DirWatcher { public class DirWatcher {
// ::remove file when WASM // ::remove file when CORE
final private File dir; final private File dir;
final private Option option; final private Option option;

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.log.Logme;
import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.FileWithSuffix;
public class DirWatcher2 { public class DirWatcher2 {
// ::remove file when WASM // ::remove file when CORE
final private File dir; final private File dir;
final private Option option; final private Option option;

View File

@ -74,7 +74,7 @@ public class EmptyImageBuilder {
if (width <= 0 || height <= 0) if (width <= 0 || height <= 0)
throw new IllegalArgumentException("width and height must be positive"); throw new IllegalArgumentException("width and height must be positive");
// ::comment when WASM // ::comment when CORE
if (width > GraphvizUtils.getenvImageLimit()) { if (width > GraphvizUtils.getenvImageLimit()) {
Log.info("Width too large " + width + ". You should set PLANTUML_LIMIT_SIZE"); Log.info("Width too large " + width + ". You should set PLANTUML_LIMIT_SIZE");
width = GraphvizUtils.getenvImageLimit(); width = GraphvizUtils.getenvImageLimit();

View File

@ -64,7 +64,7 @@ import net.sourceforge.plantuml.ugraphic.debug.StringBounderDebug;
*/ */
public enum FileFormat { public enum FileFormat {
// ::comment when WASM // ::comment when CORE
EPS("application/postscript"), // EPS("application/postscript"), //
EPS_TEXT("application/postscript"), // EPS_TEXT("application/postscript"), //
ATXT("text/plain"), // ATXT("text/plain"), //
@ -106,7 +106,7 @@ public enum FileFormat {
* @return a string starting by a point. * @return a string starting by a point.
*/ */
public String getFileSuffix() { public String getFileSuffix() {
// ::comment when WASM // ::comment when CORE
if (name().startsWith("XMI")) if (name().startsWith("XMI"))
return ".xmi"; return ".xmi";
@ -141,7 +141,7 @@ public enum FileFormat {
} }
public StringBounder getDefaultStringBounder(TikzFontDistortion tikzFontDistortion, SvgCharSizeHack charSizeHack) { public StringBounder getDefaultStringBounder(TikzFontDistortion tikzFontDistortion, SvgCharSizeHack charSizeHack) {
// ::comment when WASM // ::comment when CORE
if (this == LATEX || this == LATEX_NO_PREAMBLE) if (this == LATEX || this == LATEX_NO_PREAMBLE)
return getTikzStringBounder(tikzFontDistortion); return getTikzStringBounder(tikzFontDistortion);
@ -200,7 +200,7 @@ public enum FileFormat {
return new XDimension2D(rect.getWidth(), rect.getHeight()); return new XDimension2D(rect.getWidth(), rect.getHeight());
} }
// ::comment when WASM // ::comment when CORE
private StringBounder getBrailleStringBounder() { private StringBounder getBrailleStringBounder() {
return new StringBounderRaw(FileFormat.gg.getFontRenderContext()) { return new StringBounderRaw(FileFormat.gg.getFontRenderContext()) {
public String toString() { public String toString() {

View File

@ -65,7 +65,7 @@ public class FileSystem {
} }
public SFile getCurrentDir() { public SFile getCurrentDir() {
// ::comment when WASM // ::comment when CORE
final String path = this.currentDir.get(); final String path = this.currentDir.get();
if (path != null) if (path != null)
return new SFile(path); return new SFile(path);
@ -75,11 +75,11 @@ public class FileSystem {
} }
public SFile getFile(String nameOrPath) throws IOException { public SFile getFile(String nameOrPath) throws IOException {
// ::uncomment when WASM // ::uncomment when CORE
// return null; // return null;
// ::done // ::done
// ::comment when WASM // ::comment when CORE
if (isAbsolute(nameOrPath)) { if (isAbsolute(nameOrPath)) {
final SFile result = new SFile(nameOrPath); final SFile result = new SFile(nameOrPath);
Log.info("Trying " + result.getAbsolutePath()); Log.info("Trying " + result.getAbsolutePath());
@ -117,7 +117,7 @@ public class FileSystem {
// ::done // ::done
} }
// ::comment when WASM // ::comment when CORE
private boolean isAbsolute(String nameOrPath) { private boolean isAbsolute(String nameOrPath) {
final SFile f = new SFile(nameOrPath); final SFile f = new SFile(nameOrPath);
return f.isAbsolute(); return f.isAbsolute();

View File

@ -39,7 +39,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
public interface ISourceFileReader { public interface ISourceFileReader {
// ::remove file when WASM // ::remove file when CORE
public List<GeneratedImage> getGeneratedImages() throws IOException; public List<GeneratedImage> getGeneratedImages() throws IOException;

View File

@ -115,7 +115,7 @@ public class Option {
this.fileFormatOption = newFormat; this.fileFormatOption = newFormat;
} }
// ::comment when WASM // ::comment when CORE
public Option(String... arg) throws InterruptedException, IOException { public Option(String... arg) throws InterruptedException, IOException {
if (arg.length == 0) if (arg.length == 0)
OptionFlags.getInstance().setGui(true); OptionFlags.getInstance().setGui(true);
@ -407,7 +407,7 @@ public class Option {
// ::done // ::done
public Stdrpt getStdrpt() { public Stdrpt getStdrpt() {
// ::comment when WASM // ::comment when CORE
if (stdrpt == 1) if (stdrpt == 1)
return new StdrptV1(); return new StdrptV1();

View File

@ -77,7 +77,7 @@ public class OptionFlags {
// static public final boolean LINK_BETWEEN_FIELDS = true; // static public final boolean LINK_BETWEEN_FIELDS = true;
// ::comment when WASM // ::comment when CORE
public void reset() { public void reset() {
reset(false); reset(false);
GraphvizUtils.setDotExecutable(null); GraphvizUtils.setDotExecutable(null);
@ -197,7 +197,7 @@ public class OptionFlags {
private final AtomicBoolean logDataInitized = new AtomicBoolean(false); private final AtomicBoolean logDataInitized = new AtomicBoolean(false);
public void logData(final SFile file, Diagram system) { public void logData(final SFile file, Diagram system) {
// ::comment when WASM // ::comment when CORE
final String warnOrError = system.getWarningOrError(); final String warnOrError = system.getWarningOrError();
if (warnOrError == null) { if (warnOrError == null) {
return; return;
@ -228,7 +228,7 @@ public class OptionFlags {
// ::done // ::done
} }
// ::comment when WASM // ::comment when CORE
public final void setLogData(SFile logData) { public final void setLogData(SFile logData) {
this.logData = logData; this.logData = logData;
logData.delete(); logData.delete();

View File

@ -56,7 +56,7 @@ import net.sourceforge.plantuml.version.PSystemVersion;
import net.sourceforge.plantuml.version.Version; import net.sourceforge.plantuml.version.Version;
public class OptionPrint { public class OptionPrint {
//::remove file when WASM //::remove file when CORE
static public void printTestDot() throws InterruptedException { static public void printTestDot() throws InterruptedException {
final List<String> result = new ArrayList<>(); final List<String> result = new ArrayList<>();

View File

@ -153,7 +153,7 @@ public class PSystemBuilder {
result = PSystemErrorUtils.merge(errors); result = PSystemErrorUtils.merge(errors);
return result; return result;
} finally { } finally {
// ::comment when WASM // ::comment when CORE
if (result != null && OptionFlags.getInstance().isEnableStats()) { if (result != null && OptionFlags.getInstance().isEnableStats()) {
StatsUtilsIncrement.onceMoreParse(System.currentTimeMillis() - now, result.getClass()); StatsUtilsIncrement.onceMoreParse(System.currentTimeMillis() - now, result.getClass());
} }
@ -175,7 +175,7 @@ public class PSystemBuilder {
factories.add(new StateDiagramFactory()); factories.add(new StateDiagramFactory());
factories.add(new ActivityDiagramFactory3()); factories.add(new ActivityDiagramFactory3());
// ::comment when WASM // ::comment when CORE
factories.add(new BpmDiagramFactory(DiagramType.BPM)); factories.add(new BpmDiagramFactory(DiagramType.BPM));
// ::done // ::done
@ -183,7 +183,7 @@ public class PSystemBuilder {
factories.add(new PSystemLicenseFactory()); factories.add(new PSystemLicenseFactory());
factories.add(new PSystemVersionFactory()); factories.add(new PSystemVersionFactory());
factories.add(new PSystemDonorsFactory()); factories.add(new PSystemDonorsFactory());
// ::comment when WASM // ::comment when CORE
factories.add(new PSystemSkinparameterListFactory()); factories.add(new PSystemSkinparameterListFactory());
factories.add(new PSystemListFontsFactory()); factories.add(new PSystemListFontsFactory());
factories.add(new PSystemListEmojiFactory()); factories.add(new PSystemListEmojiFactory());
@ -193,7 +193,7 @@ public class PSystemBuilder {
// ::done // ::done
factories.add(new PSystemSaltFactory(DiagramType.UML)); factories.add(new PSystemSaltFactory(DiagramType.UML));
factories.add(new PSystemSaltFactory(DiagramType.SALT)); factories.add(new PSystemSaltFactory(DiagramType.SALT));
// ::comment when WASM // ::comment when CORE
factories.add(new PSystemDotFactory(DiagramType.DOT)); factories.add(new PSystemDotFactory(DiagramType.DOT));
factories.add(new PSystemDotFactory(DiagramType.UML)); factories.add(new PSystemDotFactory(DiagramType.UML));
// ::done // ::done
@ -201,17 +201,17 @@ public class PSystemBuilder {
factories.add(new NwDiagramFactory(DiagramType.NW)); factories.add(new NwDiagramFactory(DiagramType.NW));
factories.add(new MindMapDiagramFactory()); factories.add(new MindMapDiagramFactory());
factories.add(new WBSDiagramFactory()); factories.add(new WBSDiagramFactory());
// ::comment when WASM // ::comment when CORE
factories.add(new PSystemDitaaFactory()); factories.add(new PSystemDitaaFactory());
// ::done // ::done
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) { if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
// ::comment when WASM // ::comment when CORE
factories.add(new PSystemJcckitFactory()); factories.add(new PSystemJcckitFactory());
// ::done // ::done
// factories.add(new PSystemLogoFactory()); // factories.add(new PSystemLogoFactory());
factories.add(new PSystemSudokuFactory()); factories.add(new PSystemSudokuFactory());
} }
// ::comment when WASM // ::comment when CORE
factories.add(new PSystemDefinitionFactory()); factories.add(new PSystemDefinitionFactory());
factories.add(new ListSpriteDiagramFactory()); factories.add(new ListSpriteDiagramFactory());
factories.add(new StdlibDiagramFactory()); factories.add(new StdlibDiagramFactory());
@ -228,7 +228,7 @@ public class PSystemBuilder {
factories.add(new PSystemOregonFactory()); factories.add(new PSystemOregonFactory());
// ::done // ::done
factories.add(new PSystemCharlieFactory()); factories.add(new PSystemCharlieFactory());
// ::comment when WASM // ::comment when CORE
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) { if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
factories.add(new PSystemXearthFactory()); factories.add(new PSystemXearthFactory());
} }
@ -237,17 +237,17 @@ public class PSystemBuilder {
factories.add(new FlowDiagramFactory()); factories.add(new FlowDiagramFactory());
// factories.add(new PSystemTreeFactory(DiagramType.JUNGLE)); // factories.add(new PSystemTreeFactory(DiagramType.JUNGLE));
// factories.add(new PSystemCuteFactory(DiagramType.CUTE)); // factories.add(new PSystemCuteFactory(DiagramType.CUTE));
// ::comment when WASM // ::comment when CORE
factories.add(new PSystemDedicationFactory()); factories.add(new PSystemDedicationFactory());
// ::done // ::done
factories.add(new TimingDiagramFactory()); factories.add(new TimingDiagramFactory());
// ::comment when WASM // ::comment when CORE
factories.add(new HelpFactory()); factories.add(new HelpFactory());
factories.add(new WireDiagramFactory()); factories.add(new WireDiagramFactory());
// ::done // ::done
factories.add(new JsonDiagramFactory()); factories.add(new JsonDiagramFactory());
factories.add(new GitDiagramFactory()); factories.add(new GitDiagramFactory());
// ::comment when WASM // ::comment when CORE
factories.add(new BoardDiagramFactory()); factories.add(new BoardDiagramFactory());
// ::done // ::done
factories.add(new YamlDiagramFactory()); factories.add(new YamlDiagramFactory());

View File

@ -56,7 +56,7 @@ import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
import net.sourceforge.plantuml.utils.Log; import net.sourceforge.plantuml.utils.Log;
public class PSystemUtils { public class PSystemUtils {
// :: remove file when WASM // :: remove file when CORE
public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggested, public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggested,
FileFormatOption fileFormatOption) throws IOException { FileFormatOption fileFormatOption) throws IOException {
@ -66,7 +66,7 @@ public class PSystemUtils {
public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggestedFile, public static List<FileImageData> exportDiagrams(Diagram system, SuggestedFile suggestedFile,
FileFormatOption fileFormatOption, boolean checkMetadata) throws IOException { FileFormatOption fileFormatOption, boolean checkMetadata) throws IOException {
// ::comment when WASM // ::comment when CORE
final SFile existingFile = suggestedFile.getFile(0); final SFile existingFile = suggestedFile.getFile(0);
if (checkMetadata && fileFormatOption.getFileFormat().doesSupportMetadata() && existingFile.exists()) { if (checkMetadata && fileFormatOption.getFileFormat().doesSupportMetadata() && existingFile.exists()) {
// && system.getNbImages() == 1) { // && system.getNbImages() == 1) {
@ -85,7 +85,7 @@ public class PSystemUtils {
if (system instanceof SequenceDiagram) if (system instanceof SequenceDiagram)
return exportDiagramsSequence((SequenceDiagram) system, suggestedFile, fileFormatOption); return exportDiagramsSequence((SequenceDiagram) system, suggestedFile, fileFormatOption);
// ::comment when WASM // ::comment when CORE
if (system instanceof CucaDiagram && fileFormatOption.getFileFormat() == FileFormat.HTML) if (system instanceof CucaDiagram && fileFormatOption.getFileFormat() == FileFormat.HTML)
return createFilesHtml((CucaDiagram) system, suggestedFile); return createFilesHtml((CucaDiagram) system, suggestedFile);
// ::done // ::done

View File

@ -75,7 +75,7 @@ import net.sourceforge.plantuml.utils.Log;
import net.sourceforge.plantuml.version.Version; import net.sourceforge.plantuml.version.Version;
public class Run { public class Run {
// ::remove file when WASM // ::remove file when CORE
private static Cypher cypher; private static Cypher cypher;

View File

@ -48,7 +48,7 @@ import net.sourceforge.plantuml.utils.Log;
public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader { public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader {
// ::remove file when WASM // ::remove file when CORE
private File outputDirectory; private File outputDirectory;

View File

@ -65,7 +65,7 @@ import net.sourceforge.plantuml.security.SecurityUtils;
import net.sourceforge.plantuml.utils.Log; import net.sourceforge.plantuml.utils.Log;
public abstract class SourceFileReaderAbstract implements ISourceFileReader { public abstract class SourceFileReaderAbstract implements ISourceFileReader {
// ::remove file when WASM // ::remove file when CORE
final private File file; final private File file;

View File

@ -42,7 +42,7 @@ import java.util.List;
import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.Defines;
public class SourceFileReaderCopyCat extends SourceFileReaderAbstract implements ISourceFileReader { public class SourceFileReaderCopyCat extends SourceFileReaderAbstract implements ISourceFileReader {
// ::remove file when WASM // ::remove file when CORE
private final File outputDirectory; private final File outputDirectory;

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SFile;
public class SourceFileReaderHardFile extends SourceFileReaderAbstract implements ISourceFileReader { public class SourceFileReaderHardFile extends SourceFileReaderAbstract implements ISourceFileReader {
// ::remove file when WASM // ::remove file when CORE
private final File outputFile; private final File outputFile;

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.error.PSystemError;
import net.sourceforge.plantuml.utils.Log; import net.sourceforge.plantuml.utils.Log;
public class StdrptV1 implements Stdrpt { public class StdrptV1 implements Stdrpt {
// ::remove file when WASM // ::remove file when CORE
public void printInfo(final PrintStream output, Diagram sys) { public void printInfo(final PrintStream output, Diagram sys) {
if (sys instanceof PSystemWelcome) { if (sys instanceof PSystemWelcome) {

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.eggs.PSystemWelcome;
import net.sourceforge.plantuml.error.PSystemError; import net.sourceforge.plantuml.error.PSystemError;
public class StdrptV2 implements Stdrpt { public class StdrptV2 implements Stdrpt {
// ::remove file when WASM // ::remove file when CORE
public void finalMessage() { public void finalMessage() {
} }

View File

@ -353,7 +353,7 @@ public class StringUtils {
return result; return result;
} }
// ::comment when WASM // ::comment when CORE
public static int getWcWidth(Display stringsToDisplay) { public static int getWcWidth(Display stringsToDisplay) {
int result = 1; int result = 1;
for (CharSequence s : stringsToDisplay) { for (CharSequence s : stringsToDisplay) {

View File

@ -38,7 +38,7 @@ package net.sourceforge.plantuml;
import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SFile;
public class SuggestedFile { public class SuggestedFile {
// ::remove file when WASM // ::remove file when CORE
private final FileFormat fileFormat; private final FileFormat fileFormat;
private final int initialCpt; private final int initialCpt;

View File

@ -81,7 +81,7 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
private final SkinParam skinParam; private final SkinParam skinParam;
// ::comment when WASM // ::comment when CORE
private Animation animation; private Animation animation;
// ::done // ::done
@ -254,7 +254,7 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
return ClockwiseTopRightBottomLeft.same(10); return ClockwiseTopRightBottomLeft.same(10);
} }
// ::comment when WASM // ::comment when CORE
final public void setAnimation(Iterable<CharSequence> animationData) { final public void setAnimation(Iterable<CharSequence> animationData) {
// try { // try {
final AnimationDecoder animationDecoder = new AnimationDecoder(animationData); final AnimationDecoder animationDecoder = new AnimationDecoder(animationData);

View File

@ -130,7 +130,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion()); fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion());
// ::comment when WASM // ::comment when CORE
if (fileFormatOption.getFileFormat() == FileFormat.PDF) if (fileFormatOption.getFileFormat() == FileFormat.PDF)
return exportDiagramInternalPdf(os, index); return exportDiagramInternalPdf(os, index);
// ::done // ::done
@ -161,7 +161,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
public static void exportDiagramError(OutputStream os, Throwable exception, FileFormatOption fileFormat, long seed, public static void exportDiagramError(OutputStream os, Throwable exception, FileFormatOption fileFormat, long seed,
String metadata, String flash, List<String> strings) throws IOException { String metadata, String flash, List<String> strings) throws IOException {
// ::comment when WASM // ::comment when CORE
if (fileFormat.getFileFormat() == FileFormat.ATXT || fileFormat.getFileFormat() == FileFormat.UTXT) { if (fileFormat.getFileFormat() == FileFormat.ATXT || fileFormat.getFileFormat() == FileFormat.UTXT) {
exportDiagramErrorText(os, exception, strings); exportDiagramErrorText(os, exception, strings);
return; return;
@ -171,7 +171,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
strings.addAll(CommandExecutionResult.getStackTrace(exception)); strings.addAll(CommandExecutionResult.getStackTrace(exception));
BufferedImage im2 = null; BufferedImage im2 = null;
// ::comment when WASM // ::comment when CORE
if (flash != null) { if (flash != null) {
final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils(); final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
try { try {
@ -201,7 +201,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
plainImageBuilder(drawable, fileFormat).metadata(metadata).seed(seed).write(os); plainImageBuilder(drawable, fileFormat).metadata(metadata).seed(seed).write(os);
} }
// ::comment when WASM // ::comment when CORE
private static void exportDiagramErrorText(OutputStream os, Throwable exception, List<String> strings) { private static void exportDiagramErrorText(OutputStream os, Throwable exception, List<String> strings) {
final PrintWriter pw = SecurityUtils.createPrintWriter(os); final PrintWriter pw = SecurityUtils.createPrintWriter(os);
exception.printStackTrace(pw); exception.printStackTrace(pw);
@ -254,7 +254,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
return strings; return strings;
} }
// ::comment when WASM // ::comment when CORE
private void exportDiagramInternalMjpeg(OutputStream os) throws IOException { private void exportDiagramInternalMjpeg(OutputStream os) throws IOException {
final SFile f = new SFile("c:/test.avi"); final SFile f = new SFile("c:/test.avi");
final int nb = 150; final int nb = 150;

View File

@ -58,7 +58,7 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.core.UmlSource;
public class PSystemXearth extends AbstractPSystem { public class PSystemXearth extends AbstractPSystem {
// :: remove folder when WASM // :: remove folder when CORE
final private int width; final private int width;
final private int height; final private int height;

View File

@ -42,19 +42,19 @@ import java.util.Objects;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.baraye.CucaDiagram; import net.sourceforge.plantuml.baraye.CucaDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType; import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.utils.Direction; import net.sourceforge.plantuml.utils.Direction;
public class ActivityDiagram extends CucaDiagram { public class ActivityDiagram extends CucaDiagram {
private EntityImp lastEntityConsulted; private Entity lastEntityConsulted;
private EntityImp lastEntityBrancheConsulted; private Entity lastEntityBrancheConsulted;
private ConditionalContext currentContext; private ConditionalContext currentContext;
public ActivityDiagram(UmlSource source, Map<String, String> skinParam) { public ActivityDiagram(UmlSource source, Map<String, String> skinParam) {
@ -66,29 +66,10 @@ public class ActivityDiagram extends CucaDiagram {
return "#" + this.getUniqueSequence(); return "#" + this.getUniqueSequence();
} }
// public final IEntity getOrCreateInActivity(Quark idNewLong, String codeString, Display display, LeafType type) {
// final Quark code = buildFromFullPath(codeString);
// final IEntity result;
// if (code.getData() == null) {
// final Quark quark = getPlasma().getIfExistsFromName(code.getName());
// if (quark != null && quark.getData() != null)
// result = getFromName(code.getName());
// else
// result = reallyCreateLeaf(idNewLong, display, type, null);
// } else {
// result = (ILeaf) code.getData();
// if (result.getLeafType() != type)
// return null;
// }
// updateLasts(result);
// return result;
// }
public void startIf(String optionalCodeString) { public void startIf(String optionalCodeString) {
final String idShort = optionalCodeString == null ? getAutoBranch() : optionalCodeString; final String idShort = optionalCodeString == null ? getAutoBranch() : optionalCodeString;
final Quark quark = quarkInContext(cleanIdForQuark(idShort), false); final Quark quark = quarkInContext(cleanIdForQuark(idShort), false);
// final Quark code = buildCode(idShort); final Entity br = reallyCreateLeaf(quark, Display.create(""), LeafType.BRANCH, null);
final EntityImp br = reallyCreateLeaf(quark, Display.create(""), LeafType.BRANCH, null);
currentContext = new ConditionalContext(currentContext, br, Direction.DOWN); currentContext = new ConditionalContext(currentContext, br, Direction.DOWN);
} }
@ -96,25 +77,25 @@ public class ActivityDiagram extends CucaDiagram {
currentContext = currentContext.getParent(); currentContext = currentContext.getParent();
} }
public EntityImp getStart() { public Entity getStart() {
final Quark quark = quarkInContext("start", false); final Quark quark = quarkInContext("start", false);
if (quark.getData() == null) { if (quark.getData() == null)
quark.setData(reallyCreateLeaf(quark, Display.getWithNewlines("start"), LeafType.CIRCLE_START, null)); quark.setData(reallyCreateLeaf(quark, Display.getWithNewlines("start"), LeafType.CIRCLE_START, null));
}
return (EntityImp) quark.getData(); return (Entity) quark.getData();
} }
public EntityImp getEnd(String suppId) { public Entity getEnd(String suppId) {
final String tmp = suppId == null ? "end" : "end$" + suppId; final String tmp = suppId == null ? "end" : "end$" + suppId;
final Quark quark = quarkInContext(tmp, false); final Quark quark = quarkInContext(tmp, false);
if (quark.getData() == null) { if (quark.getData() == null)
quark.setData(reallyCreateLeaf(quark, Display.getWithNewlines("end"), LeafType.CIRCLE_END, null)); quark.setData(reallyCreateLeaf(quark, Display.getWithNewlines("end"), LeafType.CIRCLE_END, null));
}
return (EntityImp) quark.getData(); return (Entity) quark.getData();
} }
@Override @Override
protected void updateLasts(EntityImp result) { protected void updateLasts(Entity result) {
if (result == null || result.getLeafType() == LeafType.NOTE) if (result == null || result.getLeafType() == LeafType.NOTE)
return; return;
@ -125,7 +106,7 @@ public class ActivityDiagram extends CucaDiagram {
} }
public EntityImp createNote(Quark idNewLong, String code__, Display display) { public Entity createNote(Quark idNewLong, String code__, Display display) {
return reallyCreateLeaf(Objects.requireNonNull(idNewLong), display, LeafType.NOTE, null); return reallyCreateLeaf(Objects.requireNonNull(idNewLong), display, LeafType.NOTE, null);
} }
@ -135,15 +116,15 @@ public class ActivityDiagram extends CucaDiagram {
} }
public DiagramDescription getDescription() { public DiagramDescription getDescription() {
return new DiagramDescription("(" + getLeafssize() + " activities)"); return new DiagramDescription("(" + getEntityFactory().leafs().size() + " activities)");
} }
public EntityImp getLastEntityConsulted() { public Entity getLastEntityConsulted() {
return lastEntityConsulted; return lastEntityConsulted;
} }
@Deprecated @Deprecated
public EntityImp getLastEntityBrancheConsulted() { public Entity getLastEntityBrancheConsulted() {
return lastEntityBrancheConsulted; return lastEntityBrancheConsulted;
} }
@ -151,18 +132,18 @@ public class ActivityDiagram extends CucaDiagram {
return currentContext; return currentContext;
} }
public final void setLastEntityConsulted(EntityImp lastEntityConsulted) { public final void setLastEntityConsulted(Entity lastEntityConsulted) {
// System.err.println("setLastEntityConsulted " + lastEntityConsulted); // System.err.println("setLastEntityConsulted " + lastEntityConsulted);
this.lastEntityConsulted = lastEntityConsulted; this.lastEntityConsulted = lastEntityConsulted;
} }
public EntityImp createInnerActivity() { public Entity createInnerActivity() {
final String idShort = "##" + this.getUniqueSequence(); final String idShort = "##" + this.getUniqueSequence();
final Quark quark = quarkInContext(idShort, false); final Quark quark = quarkInContext(idShort, false);
gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.INNER_ACTIVITY); gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.INNER_ACTIVITY);
final EntityImp g = getCurrentGroup(); final Entity g = getCurrentGroup();
lastEntityConsulted = null; lastEntityConsulted = null;
lastEntityBrancheConsulted = null; lastEntityBrancheConsulted = null;

View File

@ -37,17 +37,17 @@ package net.sourceforge.plantuml.activitydiagram;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.utils.Direction; import net.sourceforge.plantuml.utils.Direction;
public class ConditionalContext { public class ConditionalContext {
private final EntityImp branch; private final Entity branch;
private final Direction direction; private final Direction direction;
private final ConditionalContext parent; private final ConditionalContext parent;
public ConditionalContext(ConditionalContext parent, EntityImp branch, Direction direction) { public ConditionalContext(ConditionalContext parent, Entity branch, Direction direction) {
this.branch = Objects.requireNonNull(branch); this.branch = Objects.requireNonNull(branch);
if (branch.getLeafType() != LeafType.BRANCH) { if (branch.getLeafType() != LeafType.BRANCH) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
@ -64,7 +64,7 @@ public class ConditionalContext {
return parent; return parent;
} }
public final EntityImp getBranch() { public final Entity getBranch() {
return branch; return branch;
} }

View File

@ -36,7 +36,7 @@
package net.sourceforge.plantuml.activitydiagram.command; package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram; import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
@ -66,7 +66,7 @@ public class CommandElse extends SingleLineCommand2<ActivityDiagram> {
if (system.getCurrentContext() == null) { if (system.getCurrentContext() == null) {
return CommandExecutionResult.error("No if for this else"); return CommandExecutionResult.error("No if for this else");
} }
final EntityImp branch = system.getCurrentContext().getBranch(); final Entity branch = system.getCurrentContext().getBranch();
system.setLastEntityConsulted(branch); system.setLastEntityConsulted(branch);

View File

@ -37,7 +37,7 @@ package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram; import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass; import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -94,7 +94,7 @@ public class CommandIf extends SingleLineCommand2<ActivityDiagram> {
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) {
final EntityImp entity1 = CommandLinkActivity.getEntity(diagram, arg, true); final Entity entity1 = CommandLinkActivity.getEntity(diagram, arg, true);
if (entity1 == null) if (entity1 == null)
return CommandExecutionResult.error("No if possible at this point"); return CommandExecutionResult.error("No if possible at this point");
@ -122,7 +122,7 @@ public class CommandIf extends SingleLineCommand2<ActivityDiagram> {
lenght = arrow.length() - 1; lenght = arrow.length() - 1;
} }
final EntityImp branch = diagram.getCurrentContext().getBranch(); final Entity branch = diagram.getCurrentContext().getBranch();
final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(arg.get("BRACKET", 0)), lenght); final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(arg.get("BRACKET", 0)), lenght);
Link link = new Link(diagram.getEntityFactory(), diagram.getSkinParam().getCurrentStyleBuilder(), entity1, Link link = new Link(diagram.getEntityFactory(), diagram.getSkinParam().getCurrentStyleBuilder(), entity1,

View File

@ -61,7 +61,7 @@ public class CommandInnerConcurrent extends SingleLineCommand2<ActivityDiagram>
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) {
if (diagram.getCurrentGroup().getQuark().isRoot()) { if (diagram.getCurrentGroup().isRoot()) {
return CommandExecutionResult.error("No inner activity"); return CommandExecutionResult.error("No inner activity");
} }
diagram.concurrentActivity(arg.get("NAME", 0)); diagram.concurrentActivity(arg.get("NAME", 0));

View File

@ -37,8 +37,7 @@ package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram; import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass; import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -54,6 +53,7 @@ import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.klimt.color.ColorParser; import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -122,7 +122,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
@Override @Override
protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg) protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException { throws NoSuchColorException {
final EntityImp entity1 = getEntity(diagram, arg, true); final Entity entity1 = getEntity(diagram, arg, true);
if (entity1 == null) if (entity1 == null)
return CommandExecutionResult.error("No such activity"); return CommandExecutionResult.error("No such activity");
@ -135,7 +135,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColor(s)); entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColor(s));
} }
final EntityImp entity2 = getEntity(diagram, arg, false); final Entity entity2 = getEntity(diagram, arg, false);
if (entity2 == null) if (entity2 == null)
return CommandExecutionResult.error("No such activity"); return CommandExecutionResult.error("No such activity");
@ -186,7 +186,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
} }
static EntityImp getEntity(ActivityDiagram diagram, RegexResult arg, final boolean start) { static Entity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean start) {
final String suf = start ? "" : "2"; final String suf = start ? "" : "2";
final String openBracket2 = arg.get("OPENBRACKET" + suf, 0); final String openBracket2 = arg.get("OPENBRACKET" + suf, 0);
@ -215,7 +215,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
final Quark ident = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false); final Quark ident = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false);
final LeafType type = getTypeIfExisting(diagram, ident); final LeafType type = getTypeIfExisting(diagram, ident);
EntityImp result = (EntityImp) ident.getData(); Entity result = (Entity) ident.getData();
if (result == null) if (result == null)
result = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(idShort), type, null); result = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(idShort), type, null);
@ -227,7 +227,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
final String bar = arg.get("BAR" + suf, 0); final String bar = arg.get("BAR" + suf, 0);
if (bar != null) { if (bar != null) {
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(bar), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(bar), false);
EntityImp result = (EntityImp) quark.getData(); Entity result = (Entity) quark.getData();
if (result == null) if (result == null)
result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(bar), LeafType.SYNCHRO_BAR, null); result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(bar), LeafType.SYNCHRO_BAR, null);
return result; return result;
@ -243,7 +243,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(quotedString), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(quotedString), false);
final LeafType type = getTypeIfExisting(diagram, quark); final LeafType type = getTypeIfExisting(diagram, quark);
EntityImp result = (EntityImp) quark.getData(); Entity result = (Entity) quark.getData();
if (result == null) if (result == null)
result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quoted.get(0)), type, null); result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quoted.get(0)), type, null);
if (partition != null) if (partition != null)
@ -258,7 +258,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
diagram.gotoGroup(quark, Display.getWithNewlines(quark), GroupType.PACKAGE); diagram.gotoGroup(quark, Display.getWithNewlines(quark), GroupType.PACKAGE);
} }
final Quark identInvisible = diagram.quarkInContext(diagram.cleanIdForQuark(quoteInvisibleString), false); final Quark identInvisible = diagram.quarkInContext(diagram.cleanIdForQuark(quoteInvisibleString), false);
EntityImp result = (EntityImp) identInvisible.getData(); Entity result = (Entity) identInvisible.getData();
if (result == null) if (result == null)
result = diagram.reallyCreateLeaf(identInvisible, Display.getWithNewlines(identInvisible.getName()), result = diagram.reallyCreateLeaf(identInvisible, Display.getWithNewlines(identInvisible.getName()),
LeafType.ACTIVITY, null); LeafType.ACTIVITY, null);

View File

@ -39,8 +39,7 @@ import java.util.List;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram; import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass; import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2; import net.sourceforge.plantuml.command.CommandMultilines2;
@ -57,6 +56,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement; import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.MyPattern; import net.sourceforge.plantuml.regex.MyPattern;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
@ -120,7 +120,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
lines = lines.trim(); lines = lines.trim();
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());
final EntityImp entity1 = CommandLinkActivity.getEntity(diagram, line0, true); final Entity entity1 = CommandLinkActivity.getEntity(diagram, line0, true);
if (entity1 == null) if (entity1 == null)
return CommandExecutionResult.error("No such entity"); return CommandExecutionResult.error("No such entity");
@ -181,7 +181,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
} }
final Quark ident = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false); final Quark ident = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false);
EntityImp entity2 = (EntityImp) ident.getData(); Entity entity2 = (Entity) ident.getData();
if (entity2 == null) if (entity2 == null)
entity2 = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(display), LeafType.ACTIVITY, null); entity2 = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(display), LeafType.ACTIVITY, null);

View File

@ -36,8 +36,7 @@
package net.sourceforge.plantuml.activitydiagram.command; package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram; import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
@ -47,6 +46,7 @@ import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.klimt.color.ColorParser; import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -89,7 +89,7 @@ public class CommandPartition extends SingleLineCommand2<ActivityDiagram> {
// final Quark code = diagram.buildFromFullPath(idShort); // final Quark code = diagram.buildFromFullPath(idShort);
diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.PACKAGE); diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.PACKAGE);
final EntityImp p = diagram.getCurrentGroup(); final Entity p = diagram.getCurrentGroup();
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
if (colors.isEmpty() == false) { if (colors.isEmpty() == false) {

View File

@ -41,7 +41,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
abstract class AbstractInstruction { abstract class AbstractInstruction {
// ::comment when WASM // ::comment when CORE
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
throw new UnsupportedOperationException("" + getClass()); throw new UnsupportedOperationException("" + getClass());
} }

View File

@ -78,7 +78,7 @@ public class Branch {
private final HColor color; private final HColor color;
private Ftile ftile; private Ftile ftile;
// ::comment when WASM // ::comment when CORE
private Gtile gtile; private Gtile gtile;
// ::done // ::done
@ -132,7 +132,7 @@ public class Branch {
this.ftile = factory.decorateOut(list.createFtile(factory), inlinkRendering); this.ftile = factory.decorateOut(list.createFtile(factory), inlinkRendering);
} }
// ::comment when WASM // ::comment when CORE
public void updateGtile(ISkinParam skinParam, StringBounder stringBounder) { public void updateGtile(ISkinParam skinParam, StringBounder stringBounder) {
this.gtile = list.createGtile(skinParam, stringBounder); this.gtile = list.createGtile(skinParam, stringBounder);
} }
@ -190,14 +190,14 @@ public class Branch {
return ftile; return ftile;
} }
// ::comment when WASM // ::comment when CORE
public Gtile getGtile() { public Gtile getGtile() {
return gtile; return gtile;
} }
// ::done // ::done
public ISkinParam skinParam() { public ISkinParam skinParam() {
// ::comment when WASM // ::comment when CORE
if (gtile != null) if (gtile != null)
return gtile.skinParam(); return gtile.skinParam();
// ::done // ::done

View File

@ -52,7 +52,7 @@ public interface Instruction extends Swimable {
public Ftile createFtile(FtileFactory factory); public Ftile createFtile(FtileFactory factory);
// ::comment when WASM // ::comment when CORE
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder); public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder);
// ::done // ::done

View File

@ -61,7 +61,7 @@ public class InstructionBreak extends MonoSwimable implements Instruction {
return new FtileBreak(factory.skinParam(), getSwimlaneIn()); return new FtileBreak(factory.skinParam(), getSwimlaneIn());
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileBreak(stringBounder, skinParam, getSwimlaneIn()); return new GtileBreak(stringBounder, skinParam, getSwimlaneIn());

View File

@ -57,7 +57,7 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
this.inlinkRendering = Objects.requireNonNull(inlinkRendering); this.inlinkRendering = Objects.requireNonNull(inlinkRendering);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn()); return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn());

View File

@ -98,7 +98,7 @@ public class InstructionFork extends WithNote implements Instruction {
return getLastList().add(ins); return getLastList().add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
final List<Gtile> all = new ArrayList<>(); final List<Gtile> all = new ArrayList<>();

View File

@ -59,7 +59,7 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
return new FtileGoto(factory.skinParam(), getSwimlaneIn(), name); return new FtileGoto(factory.skinParam(), getSwimlaneIn(), name);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileEmpty(stringBounder, skinParam); return new GtileEmpty(stringBounder, skinParam);

View File

@ -90,7 +90,7 @@ public class InstructionGroup extends AbstractInstruction implements Instruction
return list.add(ins); return list.add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
Gtile tmp = list.createGtile(skinParam, stringBounder); Gtile tmp = list.createGtile(skinParam, stringBounder);

View File

@ -108,7 +108,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
return current.add(ins); return current.add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
for (Branch branch : thens) for (Branch branch : thens)

View File

@ -59,7 +59,7 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
return new FtileLabel(factory.skinParam(), getSwimlaneIn(), name); return new FtileLabel(factory.skinParam(), getSwimlaneIn(), name);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileEmpty(stringBounder, skinParam); return new GtileEmpty(stringBounder, skinParam);

View File

@ -101,7 +101,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
if (all.size() == 0) if (all.size() == 0)

View File

@ -127,7 +127,7 @@ public class InstructionRepeat extends AbstractInstruction implements Instructio
return repeatList.add(ins); return repeatList.add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {

View File

@ -82,7 +82,7 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
this.colors = Objects.requireNonNull(colors); this.colors = Objects.requireNonNull(colors);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
GtileBox result = GtileBox.create(stringBounder, colors.mute(skinParam), label, getSwimlaneIn(), style, GtileBox result = GtileBox.create(stringBounder, colors.mute(skinParam), label, getSwimlaneIn(), style,

View File

@ -89,7 +89,7 @@ public class InstructionSplit extends AbstractInstruction implements Instruction
return getLast().add(ins); return getLast().add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
final List<Gtile> all = new ArrayList<>(); final List<Gtile> all = new ArrayList<>();

View File

@ -80,7 +80,7 @@ public class InstructionSpot extends MonoSwimable implements Instruction {
return result; return result;
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY); final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);

View File

@ -62,7 +62,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
return false; return false;
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn()); return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn());

View File

@ -62,7 +62,7 @@ public class InstructionStop extends MonoSwimable implements Instruction {
return false; return false;
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn()); return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn());

View File

@ -97,7 +97,7 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
return current.add(ins); return current.add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
for (Branch branch : switches) for (Branch branch : switches)

View File

@ -103,7 +103,7 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
return repeatList.add(ins); return repeatList.add(ins);
} }
// ::comment when WASM // ::comment when CORE
@Override @Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) { public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
final Gtile back = null; final Gtile back = null;

View File

@ -192,7 +192,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
final ConnectionCross connectionCross = new ConnectionCross(connection); final ConnectionCross connectionCross = new ConnectionCross(connection);
connectionCross.drawU(getUg()); connectionCross.drawU(getUg());
} }
// ::comment when WASM // ::comment when CORE
} else if (shape instanceof Gtile) { } else if (shape instanceof Gtile) {
final Gtile tile = (Gtile) shape; final Gtile tile = (Gtile) shape;
tile.drawU(this); tile.drawU(this);
@ -222,7 +222,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
} }
public final void drawU(UGraphic ug) { public final void drawU(UGraphic ug) {
// ::comment when WASM // ::comment when CORE
if (Gtile.USE_GTILE) { if (Gtile.USE_GTILE) {
drawGtile(ug); drawGtile(ug);
return; return;
@ -242,7 +242,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
} }
} }
// ::comment when WASM // ::comment when CORE
private void drawGtile(UGraphic ug) { private void drawGtile(UGraphic ug) {
TextBlock full = root.createGtile(skinParam, ug.getStringBounder()); TextBlock full = root.createGtile(skinParam, ug.getStringBounder());

View File

@ -61,7 +61,7 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
} }
public void draw(UShape shape) { public void draw(UShape shape) {
// :: comment when WASM // :: comment when CORE
if (shape instanceof Gtile) { if (shape instanceof Gtile) {
final Gtile gtile = (Gtile) shape; final Gtile gtile = (Gtile) shape;
// System.err.println("gtile=" + gtile); // System.err.println("gtile=" + gtile);

View File

@ -73,7 +73,7 @@ public class UGraphicInterceptorOneSwimlane extends UGraphicDelegator {
tile.drawU(this); tile.drawU(this);
// drawGoto(); // drawGoto();
} }
// ::comment when WASM // ::comment when CORE
} else if (shape instanceof Gtile) { } else if (shape instanceof Gtile) {
final Gtile tile = (Gtile) shape; final Gtile tile = (Gtile) shape;
final Set<Swimlane> swinlanes = tile.getSwimlanes(); final Set<Swimlane> swinlanes = tile.getSwimlanes();

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.klimt.font.StringBounder; import net.sourceforge.plantuml.klimt.font.StringBounder;
public interface Gtile extends Swimable2, TextBlock { public interface Gtile extends Swimable2, TextBlock {
// ::remove folder when WASM // ::remove folder when CORE
public static final boolean USE_GTILE = false; public static final boolean USE_GTILE = false;

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.awt.geom.XPoint2D;
import net.sourceforge.plantuml.klimt.geom.MinMax; import net.sourceforge.plantuml.klimt.geom.MinMax;
public class AffineTransformation { public class AffineTransformation {
// ::remove folder when WASM // ::remove folder when CORE
static private final Pattern rotate = Pattern.compile("rotate\\s+(-?\\d+\\.?\\d*)"); static private final Pattern rotate = Pattern.compile("rotate\\s+(-?\\d+\\.?\\d*)");
static private final Pattern shear = Pattern.compile("shear\\s+(-?\\d+\\.?\\d*)\\s+(-?\\d+\\.?\\d*)"); static private final Pattern shear = Pattern.compile("shear\\s+(-?\\d+\\.?\\d*)\\s+(-?\\d+\\.?\\d*)");

View File

@ -54,7 +54,7 @@ import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.security.SecurityUtils;
public class CheckZipTask extends Task { public class CheckZipTask extends Task {
// ::remove folder when WASM // ::remove folder when CORE
private String zipfile = null; private String zipfile = null;
private List<FileSet> filesets = new ArrayList<>(); private List<FileSet> filesets = new ArrayList<>();

View File

@ -38,6 +38,6 @@ package net.sourceforge.plantuml.api.mda.option2;
import java.util.Collection; import java.util.Collection;
public interface MDADiagram { public interface MDADiagram {
// ::remove folder when WASM // ::remove folder when CORE
public Collection<MDAPackage> getPackages(); public Collection<MDAPackage> getPackages();
} }

View File

@ -36,5 +36,5 @@
package net.sourceforge.plantuml.api.mda.option3; package net.sourceforge.plantuml.api.mda.option3;
public interface MDAVisitor { public interface MDAVisitor {
// ::remove folder when WASM // ::remove folder when CORE
} }

View File

@ -25,7 +25,7 @@ import net.sourceforge.plantuml.argon2.model.Argon2Type;
import net.sourceforge.plantuml.argon2.model.Instance; import net.sourceforge.plantuml.argon2.model.Instance;
public class Argon2 { public class Argon2 {
// ::remove folder when WASM // ::remove folder when CORE
private byte[] output; private byte[] output;
private int outputLength; // -l N private int outputLength; // -l N

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
public abstract class AbstractComponentText implements Component { public abstract class AbstractComponentText implements Component {
// ::remove folder when WASM // ::remove folder when CORE
public final XDimension2D getPreferredDimension(StringBounder stringBounder) { public final XDimension2D getPreferredDimension(StringBounder stringBounder) {
final double w = getPreferredWidth(stringBounder); final double w = getPreferredWidth(stringBounder);

View File

@ -75,6 +75,8 @@ import net.sourceforge.plantuml.cucadiagram.dot.CucaDiagramTxtMaker;
import net.sourceforge.plantuml.elk.CucaDiagramFileMakerElk; import net.sourceforge.plantuml.elk.CucaDiagramFileMakerElk;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphml.CucaDiagramGraphmlMaker; import net.sourceforge.plantuml.graphml.CucaDiagramGraphmlMaker;
import net.sourceforge.plantuml.plasma.Plasma;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.sdot.CucaDiagramFileMakerSmetana; import net.sourceforge.plantuml.sdot.CucaDiagramFileMakerSmetana;
import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.security.SecurityUtils;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
@ -104,7 +106,6 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
private boolean visibilityModifierPresent; private boolean visibilityModifierPresent;
// private NamespaceStrategy lastNamespaceStrategy;
private Together currentTogether; private Together currentTogether;
public CucaDiagram(UmlSource source, UmlDiagramType type, Map<String, String> orig) { public CucaDiagram(UmlSource source, UmlDiagramType type, Map<String, String> orig) {
@ -147,7 +148,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
@Override @Override
public boolean hasUrl() { public boolean hasUrl() {
for (Quark quark : getPlasma().quarks()) { for (Quark quark : getPlasma().quarks()) {
final EntityImp ent = (EntityImp) quark.getData(); final Entity ent = (Entity) quark.getData();
if (ent != null && ent.hasUrl()) if (ent != null && ent.hasUrl())
return true; return true;
} }
@ -155,21 +156,21 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return false; return false;
} }
final public void setLastEntity(EntityImp foo) { final public void setLastEntity(Entity foo) {
this.lastEntity = (EntityImp) foo; this.lastEntity = (Entity) foo;
} }
protected void updateLasts(EntityImp result) { protected void updateLasts(Entity result) {
} }
final public EntityImp reallyCreateLeaf(Quark ident, Display display, LeafType type, USymbol symbol) { final public Entity reallyCreateLeaf(Quark ident, Display display, LeafType type, USymbol symbol) {
Objects.requireNonNull(type); Objects.requireNonNull(type);
if (ident.getData() != null) if (ident.getData() != null)
throw new IllegalStateException(); throw new IllegalStateException();
if (Display.isNull(display)) if (Display.isNull(display))
throw new IllegalArgumentException(); throw new IllegalArgumentException();
final EntityImp result = entityFactory.createLeaf(ident, display, type, getHides()); final Entity result = entityFactory.createLeaf(ident, type, getHides());
result.setUSymbol(symbol); result.setUSymbol(symbol);
ident.setData(result); ident.setData(result);
this.lastEntity = result; this.lastEntity = result;
@ -177,6 +178,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
updateLasts(result); updateLasts(result);
// if (type == LeafType.OBJECT) // if (type == LeafType.OBJECT)
// ((EntityImp) parent.getData()).muteToType2(type); // ((EntityImp) parent.getData()).muteToType2(type);
result.setDisplay(display);
return result; return result;
} }
@ -184,7 +186,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
final public Quark quarkInContext(String full, boolean specialForCreateClass) { final public Quark quarkInContext(String full, boolean specialForCreateClass) {
final String sep = getNamespaceSeparator(); final String sep = getNamespaceSeparator();
if (sep == null) { if (sep == null) {
final Quark result = getPlasma().getIfExistsFromName(full); final Quark result = getPlasma().firstWithName(full);
if (result != null) if (result != null)
return result; return result;
return currentQuark().child(full); return currentQuark().child(full);
@ -196,7 +198,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
final int x = full.indexOf(sep); final int x = full.indexOf(sep);
if (x == -1) { if (x == -1) {
if (specialForCreateClass == false && getPlasma().countByName(full) == 1) { if (specialForCreateClass == false && getPlasma().countByName(full) == 1) {
final Quark byName = getPlasma().getIfExistsFromName(full); final Quark byName = getPlasma().firstWithName(full);
assert byName != null; assert byName != null;
if (byName != currentQuark) if (byName != currentQuark)
return byName; return byName;
@ -233,24 +235,13 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return id.substring(x + 2); return id.substring(x + 2);
} }
// protected Plasma getPlasma() {
public /* protected */ Plasma getPlasma() { public /* protected */ Plasma getPlasma() {
return entityFactory.getPlasma(); return entityFactory.getPlasma();
} }
final public Collection<EntityImp> getChildrenGroups(EntityImp parent) { final public Collection<Entity> getChildrenGroups(Entity entity) {
final Collection<EntityImp> result = new ArrayList<>(); return entity.groups();
final Quark parent__;
if (parent.instanceofGroupRoot())
parent__ = getPlasma().root();
else
parent__ = ((EntityImp) parent).getQuark();
for (EntityImp gg : getGroups(false))
if (gg.getQuark().getParent() == parent__)
result.add(gg);
return Collections.unmodifiableCollection(result);
} }
private void eventuallyBuildPhantomGroups() { private void eventuallyBuildPhantomGroups() {
@ -259,12 +250,13 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
continue; continue;
int countChildren = quark.countChildren(); int countChildren = quark.countChildren();
if (countChildren > 0) { if (countChildren > 0) {
final Display display = Display.getWithNewlines(quark.getQualifiedName()); // final Display display = Display.getWithNewlines(quark.getQualifiedName());
final EntityImp result = entityFactory.createGroup(quark, display, GroupType.PACKAGE, getHides()); final Display display = Display.getWithNewlines(quark.getName());
final Entity result = entityFactory.createGroup(quark, GroupType.PACKAGE, getHides());
result.setDisplay(display);
quark.setData(result); quark.setData(result);
} }
} }
} }
final public CommandExecutionResult gotoTogether() { final public CommandExecutionResult gotoTogether() {
@ -275,19 +267,19 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
final public CommandExecutionResult gotoGroup(Quark ident, Display display, GroupType type) { final public CommandExecutionResult gotoGroup(Quark quark, Display display, GroupType type) {
if (currentTogether != null) if (currentTogether != null)
return CommandExecutionResult.error("Cannot be done inside 'together'"); return CommandExecutionResult.error("Cannot be done inside 'together'");
if (ident.getData() == null) { if (quark.getData() == null) {
final EntityImp result = entityFactory.createGroup(ident, display, type, getHides()); final Entity result = entityFactory.createGroup(quark, type, getHides());
ident.setData(result); result.setDisplay(display);
quark.setData(result);
} }
final EntityImp ent = (EntityImp) ident.getData(); final Entity ent = (Entity) quark.getData();
ent.setDisplay(display); ent.muteToGroupType(type);
ent.muteToType2(type);
this.stacks.add(ident); this.stacks.add(quark);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
@ -309,64 +301,33 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
} }
public final EntityImp getCurrentGroup() { public final Entity getCurrentGroup() {
return (EntityImp) currentQuark().getData(); return (Entity) currentQuark().getData();
} }
public final EntityImp getGroup(String code) { public final Entity getGroup(String code) {
final Quark quark = getPlasma().getIfExistsFromName(code); final Quark quark = getPlasma().firstWithName(code);
if (quark == null) if (quark == null)
return null; return null;
return (EntityImp) quark.getData(); return (Entity) quark.getData();
} }
public final boolean isGroup(String code) { public final boolean isGroup(String code) {
final Quark quark = getPlasma().getIfExistsFromName(code); final Quark quark = getPlasma().firstWithName(code);
if (quark == null) if (quark == null)
return false; return false;
return isGroup(quark); return isGroup(quark);
} }
public final boolean isGroup(final Quark quark) { public final boolean isGroup(Quark quark) {
final EntityImp ent = (EntityImp) quark.getData(); final Entity ent = (Entity) quark.getData();
if (ent == null) if (ent == null)
return false; return false;
return ent.isGroup(); return ent.isGroup();
} }
public final Collection<EntityImp> getGroups(boolean withRootGroup) { public Entity getRootGroup() {
final List<EntityImp> result = new ArrayList<>(); return (Entity) getPlasma().root().getData();
for (Quark quark : getPlasma().quarks()) {
if (quark.isRoot()) {
if (withRootGroup)
result.add((EntityImp) quark.getData());
} else {
final EntityImp data = (EntityImp) quark.getData();
if (data != null && data.isGroup())
result.add(data);
}
}
return Collections.unmodifiableCollection(result);
}
public EntityImp getRootGroup() {
return (EntityImp) getPlasma().root().getData();
}
public final Collection<EntityImp> getLeafsvalues() {
final List<EntityImp> result = new ArrayList<>();
for (Quark quark : getPlasma().quarks()) {
if (quark.isRoot())
continue;
final EntityImp data = (EntityImp) quark.getData();
if (data != null && data.isGroup() == false)
result.add(data);
}
return Collections.unmodifiableCollection(result);
}
public final int getLeafssize() {
return getLeafsvalues().size();
} }
final public void addLink(Link link) { final public void addLink(Link link) {
@ -401,7 +362,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return result.toArray(new String[result.size()]); return result.toArray(new String[result.size()]);
} }
// ::comment when WASM // ::comment when CORE
private void createFilesGraphml(OutputStream suggestedFile) throws IOException { private void createFilesGraphml(OutputStream suggestedFile) throws IOException {
final CucaDiagramGraphmlMaker maker = new CucaDiagramGraphmlMaker(this); final CucaDiagramGraphmlMaker maker = new CucaDiagramGraphmlMaker(this);
maker.createFiles(suggestedFile); maker.createFiles(suggestedFile);
@ -435,7 +396,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
throws IOException { throws IOException {
final FileFormat fileFormat = fileFormatOption.getFileFormat(); final FileFormat fileFormat = fileFormatOption.getFileFormat();
// ::comment when WASM // ::comment when CORE
if (fileFormat == FileFormat.ATXT || fileFormat == FileFormat.UTXT) { if (fileFormat == FileFormat.ATXT || fileFormat == FileFormat.UTXT) {
try { try {
createFilesTxt(os, index, fileFormat); createFilesTxt(os, index, fileFormat);
@ -467,13 +428,13 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
this.eventuallyBuildPhantomGroups(); this.eventuallyBuildPhantomGroups();
final CucaDiagramFileMaker maker; final CucaDiagramFileMaker maker;
// ::comment when WASM // ::comment when CORE
if (this.isUseElk()) if (this.isUseElk())
maker = new CucaDiagramFileMakerElk(this, fileFormatOption.getDefaultStringBounder(getSkinParam())); maker = new CucaDiagramFileMakerElk(this, fileFormatOption.getDefaultStringBounder(getSkinParam()));
else if (this.isUseSmetana()) else if (this.isUseSmetana())
// ::done // ::done
maker = new CucaDiagramFileMakerSmetana(this, fileFormatOption.getDefaultStringBounder(getSkinParam())); maker = new CucaDiagramFileMakerSmetana(this, fileFormatOption.getDefaultStringBounder(getSkinParam()));
// ::comment when WASM // ::comment when CORE
else else
maker = new CucaDiagramFileMakerSvek(this); maker = new CucaDiagramFileMakerSvek(this);
// ::done // ::done
@ -501,7 +462,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return generalWarningOrError + BackSlash.NEWLINE + warningOrError; return generalWarningOrError + BackSlash.NEWLINE + warningOrError;
} }
public boolean isAutarkic(EntityImp g) { public boolean isAutarkic(Entity g) {
if (g.getGroupType() == GroupType.PACKAGE) if (g.getGroupType() == GroupType.PACKAGE)
return false; return false;
@ -521,7 +482,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
if (EntityUtils.isPureInnerLink3(g, link) == false) if (EntityUtils.isPureInnerLink3(g, link) == false)
return false; return false;
for (EntityImp leaf : g.getLeafsDirect()) for (Entity leaf : g.leafs())
if (leaf.getEntityPosition() != EntityPosition.NORMAL) if (leaf.getEntityPosition() != EntityPosition.NORMAL)
return false; return false;
@ -571,16 +532,8 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return "25"; return "25";
} }
final public boolean isEmpty(EntityImp gToTest) { final public boolean isEmpty(Entity entity) {
for (EntityImp gg : getGroups(false)) { return entity.isEmpty();
if (gg == gToTest)
continue;
if (gg.getParentContainer() == gToTest)
return false;
}
return gToTest.size() == 0;
} }
public final boolean isVisibilityModifierPresent() { public final boolean isVisibilityModifierPresent() {
@ -591,7 +544,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
this.visibilityModifierPresent = visibilityModifierPresent; this.visibilityModifierPresent = visibilityModifierPresent;
} }
public final boolean showPortion(EntityPortion portion, EntityImp entity) { public final boolean showPortion(EntityPortion portion, Entity entity) {
if (getSkinParam().strictUmlStyle() && portion == EntityPortion.CIRCLED_CHARACTER) if (getSkinParam().strictUmlStyle() && portion == EntityPortion.CIRCLED_CHARACTER)
return false; return false;
@ -643,7 +596,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return Collections.unmodifiableSet(hides); return Collections.unmodifiableSet(hides);
} }
final public boolean isStandalone(EntityImp ent) { final public boolean isStandalone(Entity ent) {
for (final Link link : getLinks()) for (final Link link : getLinks())
if (link.getEntity1() == ent || link.getEntity2() == ent) if (link.getEntity1() == ent || link.getEntity2() == ent)
return false; return false;
@ -651,7 +604,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return true; return true;
} }
final public boolean isStandaloneForArgo(EntityImp ent) { final public boolean isStandaloneForArgo(Entity ent) {
for (final Link link : getLinks()) { for (final Link link : getLinks()) {
if (link.isHidden() || link.isInvis()) if (link.isHidden() || link.isInvis())
continue; continue;
@ -688,24 +641,24 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return null; return null;
} }
protected EntityImp lastEntity = null; protected Entity lastEntity = null;
final public EntityImp getLastEntity() { final public Entity getLastEntity() {
return lastEntity; return lastEntity;
} }
final public EntityFactory getEntityFactory() { final public EntityFactory getEntityFactory() {
// throw new UnsupportedOperationException();
return entityFactory; return entityFactory;
} }
public void applySingleStrategy() { public void applySingleStrategy() {
final MagmaList magmaList = new MagmaList(); final MagmaList magmaList = new MagmaList();
for (EntityImp g : getGroups(true)) { final Collection<Entity> groups = getEntityFactory().groupsAndRoot();
final List<EntityImp> standalones = new ArrayList<>(); for (Entity g : groups) {
final List<Entity> standalones = new ArrayList<>();
for (EntityImp ent : g.getLeafsDirect()) for (Entity ent : g.leafs())
if (isStandalone(ent)) if (isStandalone(ent))
standalones.add(ent); standalones.add(ent);
@ -717,7 +670,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
magmaList.add(magma); magmaList.add(magma);
} }
for (EntityImp g : getGroups(true)) { for (Entity g : groups) {
final MagmaList magmas = magmaList.getMagmas(g); final MagmaList magmas = magmaList.getMagmas(g);
if (magmas.size() < 3) if (magmas.size() < 3)
continue; continue;

View File

@ -42,7 +42,6 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.Bodier; import net.sourceforge.plantuml.cucadiagram.Bodier;
import net.sourceforge.plantuml.cucadiagram.BodierJSon; import net.sourceforge.plantuml.cucadiagram.BodierJSon;
import net.sourceforge.plantuml.cucadiagram.BodierMap; import net.sourceforge.plantuml.cucadiagram.BodierMap;
@ -55,6 +54,8 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.entity.IEntityFactory; import net.sourceforge.plantuml.cucadiagram.entity.IEntityFactory;
import net.sourceforge.plantuml.plasma.Plasma;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
public final class EntityFactory implements IEntityFactory { public final class EntityFactory implements IEntityFactory {
@ -65,38 +66,24 @@ public final class EntityFactory implements IEntityFactory {
private final Plasma plasma; private final Plasma plasma;
private final EntityImp rootGroup; private final Entity rootGroup;
private final List<HideOrShow2> hides2; private final List<HideOrShow2> hides2;
private final List<HideOrShow2> removed; private final List<HideOrShow2> removed;
/* private */ final public ICucaDiagram namespaceSeparator; final private ICucaDiagram namespaceSeparator;
public EntityImp getLeafForEmptyGroup(EntityImp g) {
throw new UnsupportedOperationException();
}
public EntityImp createLeafForEmptyGroup(EntityImp g, ISkinParam skinPdaram) {
final EntityImp ent = (EntityImp) g;
ent.muteToType2(LeafType.EMPTY_PACKAGE);
return ent;
}
//
public EntityImp isIntricated(EntityImp parent) {
throw new UnsupportedOperationException();
}
//
public EntityFactory(List<HideOrShow2> hides2, List<HideOrShow2> removed, ICucaDiagram namespaceSeparator) { public EntityFactory(List<HideOrShow2> hides2, List<HideOrShow2> removed, ICucaDiagram namespaceSeparator) {
this.hides2 = hides2; this.hides2 = hides2;
this.removed = removed; this.removed = removed;
this.namespaceSeparator = namespaceSeparator; this.namespaceSeparator = namespaceSeparator;
this.plasma = new Plasma("."); this.plasma = new Plasma(".");
this.rootGroup = new EntityImp(this.plasma.root(), this, null, GroupType.ROOT, 0); this.rootGroup = new Entity(this.plasma.root(), this, null, GroupType.ROOT, 0);
this.plasma.root().setData(rootGroup); this.plasma.root().setData(rootGroup);
} }
public boolean isHidden(EntityImp leaf) { public boolean isHidden(Entity leaf) {
final EntityImp other = isNoteWithSingleLinkAttachedTo(leaf); final Entity other = isNoteWithSingleLinkAttachedTo(leaf);
if (other != null && other != leaf) if (other != null && other != leaf)
return isHidden(other); return isHidden(other);
@ -115,10 +102,10 @@ public final class EntityFactory implements IEntityFactory {
return result; return result;
} }
public boolean isRemoved(EntityImp leaf) { public boolean isRemoved(Entity leaf) {
final EntityImp other = isNoteWithSingleLinkAttachedTo(leaf); final Entity other = isNoteWithSingleLinkAttachedTo(leaf);
if (other instanceof EntityImp) if (other instanceof Entity)
return isRemoved((EntityImp) other); return isRemoved((Entity) other);
boolean result = false; boolean result = false;
for (HideOrShow2 hide : removed) for (HideOrShow2 hide : removed)
@ -127,11 +114,11 @@ public final class EntityFactory implements IEntityFactory {
return result; return result;
} }
private EntityImp isNoteWithSingleLinkAttachedTo(EntityImp note) { private Entity isNoteWithSingleLinkAttachedTo(Entity note) {
if (note.getLeafType() != LeafType.NOTE) if (note.getLeafType() != LeafType.NOTE)
return null; return null;
assert note.getLeafType() == LeafType.NOTE; assert note.getLeafType() == LeafType.NOTE;
EntityImp other = null; Entity other = null;
for (Link link : this.getLinks()) { for (Link link : this.getLinks()) {
if (link.getType().isInvisible()) if (link.getType().isInvisible())
continue; continue;
@ -148,7 +135,7 @@ public final class EntityFactory implements IEntityFactory {
} }
public boolean isRemovedIgnoreUnlinked(EntityImp leaf) { public boolean isRemovedIgnoreUnlinked(Entity leaf) {
boolean result = false; boolean result = false;
for (HideOrShow2 hide : removed) for (HideOrShow2 hide : removed)
if (hide.isAboutUnlinked() == false) if (hide.isAboutUnlinked() == false)
@ -157,8 +144,7 @@ public final class EntityFactory implements IEntityFactory {
return result; return result;
} }
final public EntityImp createLeaf(Quark quark, Display display, LeafType entityType, final public Entity createLeaf(Quark quark, LeafType entityType, Set<VisibilityModifier> hides) {
Set<VisibilityModifier> hides) {
final Bodier bodier; final Bodier bodier;
if (Objects.requireNonNull(entityType) == LeafType.MAP) if (Objects.requireNonNull(entityType) == LeafType.MAP)
bodier = new BodierMap(); bodier = new BodierMap();
@ -167,49 +153,33 @@ public final class EntityFactory implements IEntityFactory {
else else
bodier = BodyFactory.createLeaf(entityType, hides); bodier = BodyFactory.createLeaf(entityType, hides);
final EntityImp result = new EntityImp(quark, this, bodier, entityType, rawLayout); final Entity result = new Entity(quark, this, bodier, entityType, rawLayout);
bodier.setLeaf(result); bodier.setLeaf(result);
result.setDisplay(display);
return result; return result;
} }
public EntityImp createGroup(Quark quark, Display display, GroupType groupType, Set<VisibilityModifier> hides) { public Entity createGroup(Quark quark, GroupType groupType, Set<VisibilityModifier> hides) {
Objects.requireNonNull(groupType); Objects.requireNonNull(groupType);
if (quark.getData() != null) if (quark.getData() != null)
return (EntityImp) quark.getData(); return (Entity) quark.getData();
// for (Entry<Ident, IGroup> ent : groups2.entrySet())
// if (ent.getKey().equals(ident))
// return ent.getValue();
final Bodier bodier = BodyFactory.createGroup(hides); final Bodier bodier = BodyFactory.createGroup(hides);
final EntityImp result = new EntityImp(quark, this, bodier, groupType, rawLayout); final Entity result = new Entity(quark, this, bodier, groupType, rawLayout);
if (Display.isNull(display) == false)
result.setDisplay(display);
return result; return result;
} }
public EntityImp getRootGroup() { public Entity getRootGroup() {
return rootGroup; return rootGroup;
} }
public final EntityImp getLeafStrict(Quark ident) { public final Collection<Entity> leafs() {
if (ident instanceof Quark == false)
throw new UnsupportedOperationException();
final Quark quark = (Quark) ident;
final EntityImp result = (EntityImp) quark.getData();
if (result == null)
throw new UnsupportedOperationException();
return result;
}
public final Collection<EntityImp> leafs() { final List<Entity> result = new ArrayList<>();
final List<EntityImp> result = new ArrayList<>();
for (Quark quark : getPlasma().quarks()) { for (Quark quark : getPlasma().quarks()) {
if (quark.isRoot()) if (quark.isRoot())
continue; continue;
final EntityImp data = (EntityImp) quark.getData(); final Entity data = (Entity) quark.getData();
if (data != null && data.isGroup() == false) if (data != null && data.isGroup() == false)
result.add(data); result.add(data);
} }
@ -217,18 +187,27 @@ public final class EntityFactory implements IEntityFactory {
} }
public final Collection<EntityImp> groups() { public final Collection<Entity> groups() {
final List<EntityImp> result = new ArrayList<>(); final List<Entity> result = new ArrayList<>();
for (Quark quark : getPlasma().quarks()) { for (Quark quark : getPlasma().quarks()) {
if (quark.isRoot()) if (quark.isRoot())
continue; continue;
final EntityImp data = (EntityImp) quark.getData();
final Entity data = (Entity) quark.getData();
if (data != null && data.isGroup()) if (data != null && data.isGroup())
result.add(data); result.add(data);
} }
// System.err.println("GROUPS=" + result.size());
return Collections.unmodifiableCollection(result); return Collections.unmodifiableCollection(result);
}
public final Collection<Entity> groupsAndRoot() {
final List<Entity> result = new ArrayList<>();
for (Quark quark : getPlasma().quarks()) {
final Entity data = (Entity) quark.getData();
if (data != null && data.isGroup())
result.add(data);
}
return Collections.unmodifiableCollection(result);
} }
public void incRawLayout() { public void incRawLayout() {

View File

@ -1,732 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
* Contribution: Hisashi Miyashita
* Contribution: Miguel Esteves
*
*/
package net.sourceforge.plantuml.baraye;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import net.sourceforge.plantuml.Hideable;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineConfigurable;
import net.sourceforge.plantuml.Removeable;
import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.Position;
import net.sourceforge.plantuml.cucadiagram.Bodier;
import net.sourceforge.plantuml.cucadiagram.CucaNote;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplayPositioned;
import net.sourceforge.plantuml.cucadiagram.EntityPosition;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.ICucaDiagram;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.Stereostyles;
import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.Together;
import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.USymbols;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
import net.sourceforge.plantuml.klimt.font.FontParam;
import net.sourceforge.plantuml.klimt.font.UFont;
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.Kal;
import net.sourceforge.plantuml.svek.Margins;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.svek.SingleStrategy;
import net.sourceforge.plantuml.svek.image.EntityImageStateCommon;
import net.sourceforge.plantuml.text.Guillemet;
import net.sourceforge.plantuml.url.Url;
import net.sourceforge.plantuml.utils.Direction;
import net.sourceforge.plantuml.utils.LineLocation;
final public class EntityImp implements SpecificBackcolorable, Hideable, Removeable, LineConfigurable {
private final EntityFactory entityFactory;
private Quark quark;
private Url url;
private final Bodier bodier;
private final String uid;
private Display display = Display.empty();
private DisplayPositioned legend = null;
private LeafType leafType;
private Stereotype stereotype;
private Stereostyles stereostyles = Stereostyles.NONE;
private String generic;
private GroupType groupType;
// Other
private Margins margins = Margins.NONE;
private final Collection<String> portShortNames = new HashSet<>();
private int xposition;
private IEntityImage svekImage;
private USymbol symbol;
private final int rawLayout;
private char concurrentSeparator;
private LineLocation codeLine;
private Set<Stereotag> tags = new LinkedHashSet<>();
private final List<CucaNote> notesTop = new ArrayList<>();
private final List<CucaNote> notesBottom = new ArrayList<>();
private Together together;
//
public void addNote(Display note, Position position, Colors colors) {
if (position == Position.TOP)
notesTop.add(CucaNote.build(note, position, colors));
else if (position == Position.BOTTOM)
notesBottom.add(CucaNote.build(note, position, colors));
}
//
public List<CucaNote> getNotes(Position position) {
if (position == Position.TOP)
return Collections.unmodifiableList(notesTop);
if (position == Position.BOTTOM)
return Collections.unmodifiableList(notesBottom);
throw new IllegalArgumentException();
}
public void addStereotag(Stereotag tag) {
this.tags.add(tag);
}
public Set<Stereotag> stereotags() {
return Collections.unmodifiableSet(tags);
}
// Back to Entity
private EntityImp(Quark quark, EntityFactory entityFactory, Bodier bodier, int rawLayout) {
this.quark = Objects.requireNonNull(quark);
if (quark.isRoot())
this.uid = "clroot";
else
this.uid = StringUtils.getUid("cl", entityFactory.getDiagram().getUniqueSequence());
this.entityFactory = entityFactory;
this.bodier = bodier;
this.rawLayout = rawLayout;
}
EntityImp(Quark quark, EntityFactory entityFactory, Bodier bodier, LeafType leafType, int rawLayout) {
this(Objects.requireNonNull(quark), entityFactory, bodier, rawLayout);
this.leafType = leafType;
}
EntityImp(Quark quark, EntityFactory entityFactory, Bodier bodier, GroupType groupType, int rawLayout) {
this(Objects.requireNonNull(quark), entityFactory, bodier, rawLayout);
this.groupType = groupType;
}
public LeafType getLeafType() {
return leafType;
}
public void muteToType2(LeafType newType) {
if (leafType == LeafType.CLASS && newType == LeafType.OBJECT)
bodier.muteClassToObject();
this.groupType = null;
this.leafType = newType;
}
public void muteToType2(GroupType newType) {
this.groupType = newType;
this.leafType = null;
}
public boolean muteToType(LeafType newType, USymbol newSymbol) {
// checkNotGroup();
Objects.requireNonNull(newType);
if (leafType != LeafType.STILL_UNKNOWN) {
if (newType == this.leafType)
return true;
if (leafType != LeafType.ANNOTATION && leafType != LeafType.ABSTRACT_CLASS && leafType != LeafType.CLASS
&& leafType != LeafType.ENUM && leafType != LeafType.INTERFACE) {
return false;
// throw new IllegalArgumentException("type=" + leafType);
}
if (newType != LeafType.ANNOTATION && newType != LeafType.ABSTRACT_CLASS && newType != LeafType.CLASS
&& newType != LeafType.ENUM && newType != LeafType.INTERFACE && newType != LeafType.OBJECT) {
return false;
// throw new IllegalArgumentException("newtype=" + newType);
}
}
if (leafType == LeafType.CLASS && newType == LeafType.OBJECT)
bodier.muteClassToObject();
this.leafType = newType;
this.symbol = newSymbol;
return true;
}
public Quark getQuark() {
return quark;
}
public String getCode() {
return getQuark().getName();
}
public String getCodeGetName() {
return getQuark().getName();
}
public Display getDisplay() {
return display;
}
public void setDisplay(Display display) {
this.display = display;
}
public String getUid() {
return uid;
}
public Stereotype getStereotype() {
return stereotype;
}
public final void setStereotype(Stereotype stereotype) {
this.stereotype = stereotype;
}
public String toString() {
return quark.toString() + " " + display + "(" + leafType + ")[" + groupType + "] " + getUid();
}
public final Url getUrl99() {
return url;
}
public boolean hasUrl() {
if (Display.isNull(display) == false && display.hasUrl())
return true;
if (bodier == null)
return false;
if (bodier.hasUrl())
return true;
return url != null;
}
public final void addUrl(Url url) {
this.url = url;
}
public final Margins getMargins() {
checkNotGroup();
return margins;
}
public final void ensureMargins(Margins newMargins) {
// checkNotGroup();
this.margins = this.margins.merge(newMargins);
}
public int getXposition() {
checkNotGroup();
return xposition;
}
public void setXposition(int pos) {
checkNotGroup();
xposition = pos;
}
public final IEntityImage getSvekImage() {
checkNotGroup();
return svekImage;
}
public final void setSvekImage(IEntityImage svekImage) {
checkNotGroup();
this.svekImage = svekImage;
}
public final void setGeneric(String generic) {
checkNotGroup();
this.generic = generic;
}
public final String getGeneric() {
checkNotGroup();
return generic;
}
public Bodier getBodier() {
return bodier;
}
public EntityPosition getEntityPosition() {
// if (leafType == LeafType.PORT)
// return EntityPosition.PORT;
if (leafType == LeafType.PORTIN)
return EntityPosition.PORTIN;
if (leafType == LeafType.PORTOUT)
return EntityPosition.PORTOUT;
if (leafType != LeafType.STATE)
return EntityPosition.NORMAL;
if (quark.isRoot())
return EntityPosition.NORMAL;
final Stereotype stereotype = getStereotype();
if (stereotype == null)
return EntityPosition.NORMAL;
return EntityPosition.fromStereotype(stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
}
// ----------
private void checkGroup() {
if (isGroup() == false)
throw new UnsupportedOperationException();
}
private void checkNotGroup() {
if (isGroup())
throw new UnsupportedOperationException();
}
public GroupType getGroupType() {
checkGroup();
return groupType;
}
public PackageStyle getPackageStyle() {
checkGroup();
if (stereotype == null)
return null;
return stereotype.getPackageStyle();
}
public boolean isGroup() {
if (groupType != null && leafType != null)
throw new IllegalStateException();
assert groupType == null || leafType == null;
if (groupType != null)
return true;
if (leafType != null)
return false;
throw new IllegalStateException();
}
// ---- other
public void overrideImage(IEntityImage img, LeafType leafType) {
checkGroup();
this.svekImage = img;
this.url = null;
for (final Link link : new ArrayList<>(entityFactory.getLinks()))
if (EntityUtils.isPureInnerLink12(this, link))
entityFactory.removeLink(link);
// if (entityFactory.namespaceSeparator.V1972()) {
// entityFactory.removeGroup(getIdent());
// for (ILeaf ent : new ArrayList<>(entityFactory.leafs()))
// if (this != ent && getIdent().equals(ent.getIdent().parent()))
// entityFactory.removeLeaf(ent.getIdent());
//
// } else {
// entityFactory.removeGroup(getCodeGetName());
// for (ILeaf ent : new ArrayList<>(entityFactory.leafs()))
// if (this != ent && this == ent.getParentContainer())
// entityFactory.removeLeaf(ent.getCodeGetName());
// }
//
// entityFactory.addLeaf(this);
this.groupType = null;
this.leafType = leafType;
}
// void muteToGroup(Code namespaceNew, GroupType groupType, IGroup parentContainer) {
// checkNotGroup();
// if (parentContainer.isGroup() == false)
// throw new IllegalArgumentException();
//
// this.namespace = namespaceNew;
// this.groupType = groupType;
// this.leafType = null;
// this.parentContainer = parentContainer;
// }
public USymbol getUSymbol() {
if (getLeafType() == LeafType.CIRCLE)
return USymbols.INTERFACE;
// if (symbol != null && stereotype != null && stereotype.getSprite() != null) {
// return symbol.withStereoAlignment(HorizontalAlignment.RIGHT);
// }
return symbol;
}
public void setUSymbol(USymbol symbol) {
this.symbol = symbol;
}
public SingleStrategy getSingleStrategy() {
return SingleStrategy.SQUARE;
}
public boolean isHidden() {
if (getParentContainer() != null && getParentContainer().isHidden())
return true;
return isHiddenInternal();
}
private boolean isHiddenInternal() {
if (quark.isRoot())
return false;
if (isGroup()) {
if (entityFactory.isHidden(this))
return true;
if (getLeafsDirect().size() == 0)
return false;
for (EntityImp leaf : getLeafsDirect())
if (leaf.isHiddenInternal() == false)
return false;
for (EntityImp g : getChildren())
if (g.isHiddenInternal() == false)
return false;
return true;
}
return entityFactory.isHidden(this);
}
public boolean isRemoved() {
if (getParentContainer() != null && getParentContainer().isRemoved())
return true;
return isRemovedInternal();
}
private boolean isRemovedInternal() {
if (isGroup()) {
if (entityFactory.isRemoved(this))
return true;
if (getLeafsDirect().size() == 0 && getChildren().size() == 0)
return false;
for (EntityImp leaf : getLeafsDirect())
if (((EntityImp) leaf).isRemovedInternal() == false)
return false;
for (EntityImp g : getChildren())
if (((EntityImp) g).isRemovedInternal() == false)
return false;
return true;
}
return entityFactory.isRemoved(this);
}
public boolean isAloneAndUnlinked() {
if (isGroup())
return false;
for (Link link : entityFactory.getLinks())
if (link.contains(this)) {
final EntityImp other = (EntityImp) link.getOther(this);
final boolean removed = entityFactory.isRemovedIgnoreUnlinked(other);
if (removed == false && link.getType().isInvisible() == false)
return false;
}
return true;
}
private FontParam getTitleFontParam() {
return getGroupType() == GroupType.STATE ? FontParam.STATE : FontParam.PACKAGE;
}
public FontConfiguration getFontConfigurationForTitle(final ISkinParam skinParam) {
final FontParam fontParam = getTitleFontParam();
final HColor fontHtmlColor = skinParam.getFontHtmlColor(getStereotype(), fontParam, FontParam.PACKAGE);
final UFont font = skinParam.getFont(getStereotype(), true, fontParam, FontParam.PACKAGE);
final FontConfiguration fontConfiguration = FontConfiguration.create(font, fontHtmlColor,
skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
return fontConfiguration;
}
public final int getRawLayout() {
return rawLayout;
}
public char getConcurrentSeparator() {
return concurrentSeparator;
}
public void setConcurrentSeparator(char separator) {
this.concurrentSeparator = separator;
}
private Neighborhood neighborhood;
public void setNeighborhood(Neighborhood neighborhood) {
this.neighborhood = neighborhood;
}
public Neighborhood getNeighborhood() {
return neighborhood;
}
private final Map<String, Display> tips = new LinkedHashMap<String, Display>();
public void putTip(String member, Display display) {
tips.put(member, display);
}
public Map<String, Display> getTips() {
return Collections.unmodifiableMap(tips);
}
private Colors colors = Colors.empty();
public Colors getColors() {
return colors;
}
public void setColors(Colors colors) {
this.colors = colors;
}
public void setSpecificColorTOBEREMOVED(ColorType type, HColor color) {
if (color != null)
this.colors = colors.add(type, color);
}
public Collection<String> getPortShortNames() {
checkNotGroup();
return Collections.unmodifiableCollection(portShortNames);
}
public void addPortShortName(String portShortName) {
portShortNames.add(portShortName);
}
private VisibilityModifier visibility;
public void setVisibilityModifier(VisibilityModifier visibility) {
this.visibility = visibility;
}
public VisibilityModifier getVisibilityModifier() {
return visibility;
}
public void setLegend(DisplayPositioned legend) {
checkGroup();
this.legend = legend;
}
public DisplayPositioned getLegend() {
return legend;
}
public String getCodeLine() {
if (this.codeLine == null)
return null;
return "" + this.codeLine.getPosition();
}
public void setCodeLine(LineLocation codeLine) {
this.codeLine = codeLine;
}
//
public void setStereostyle(String stereo) {
this.stereostyles = Stereostyles.build(stereo);
}
//
public Stereostyles getStereostyles() {
return stereostyles;
}
private final Map<Direction, List<Kal>> kals = new EnumMap<>(Direction.class);
public void addKal(Kal kal) {
final Direction position = kal.getPosition();
List<Kal> list = kals.get(position);
if (list == null) {
list = new ArrayList<>();
kals.put(position, list);
}
list.add(kal);
}
public List<Kal> getKals(Direction position) {
final List<Kal> result = kals.get(position);
if (result == null)
return Collections.emptyList();
return Collections.unmodifiableList(result);
}
public ICucaDiagram getDiagram() {
return entityFactory.getDiagram();
}
private boolean isStatic;
//
public void setStatic(boolean isStatic) {
this.isStatic = isStatic;
}
//
public boolean isStatic() {
return isStatic;
}
// For group
public TextBlock getStateHeader(ISkinParam skinParam) {
checkGroup();
final Style style = EntityImageStateCommon.getStyleStateHeader(this, skinParam);
final List<CharSequence> details = getBodier().getRawBody();
if (details.size() == 0)
return new TextBlockEmpty();
if (style == null)
throw new IllegalArgumentException();
final FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, style);
Display display = null;
for (CharSequence s : details)
if (display == null)
display = Display.getWithNewlines(s.toString());
else
display = display.addAll(Display.getWithNewlines(s.toString()));
return display.create(fontConfiguration, HorizontalAlignment.LEFT, skinParam);
}
public Together getTogether() {
return together;
}
public void setTogether(Together together) {
this.together = together;
}
public EntityImp getParentContainer() {
if (quark.isRoot())
return null;
return (EntityImp) quark.getParent().getData();
}
public Collection<EntityImp> getLeafsDirect() {
final List<EntityImp> result = new ArrayList<>();
for (Quark quark : quark.getChildren()) {
final EntityImp data = (EntityImp) quark.getData();
if (data != null && data.isGroup() == false)
result.add(data);
}
return Collections.unmodifiableCollection(result);
}
public Collection<EntityImp> getChildren() {
final List<EntityImp> result = new ArrayList<>();
for (Quark quark : quark.getChildren()) {
final EntityImp data = (EntityImp) quark.getData();
if (data != null && data.isGroup())
result.add(data);
}
return Collections.unmodifiableCollection(result);
}
public int size() {
return getQuark().countChildren();
}
public boolean instanceofGroupRoot() {
return getQuark().isRoot();
}
}

View File

@ -39,7 +39,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
public abstract class EntityUtils { public abstract class EntityUtils {
private static boolean isParent(EntityImp groupToBeTested, EntityImp parentGroup) { private static boolean isParent(Entity groupToBeTested, Entity parentGroup) {
if (groupToBeTested.isGroup() == false) if (groupToBeTested.isGroup() == false)
// Very strange! // Very strange!
return false; return false;
@ -47,7 +47,7 @@ public abstract class EntityUtils {
if (groupToBeTested.isGroup() == false) if (groupToBeTested.isGroup() == false)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
while (groupToBeTested.getQuark().isRoot() == false) { while (groupToBeTested.isRoot() == false) {
if (groupToBeTested == parentGroup) if (groupToBeTested == parentGroup)
return true; return true;
@ -60,14 +60,14 @@ public abstract class EntityUtils {
return false; return false;
} }
public static boolean isPureInnerLink12(EntityImp group, Link link) { public static boolean isPureInnerLink12(Entity group, Link link) {
if (group.isGroup() == false) if (group.isGroup() == false)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
final EntityImp e1 = link.getEntity1(); final Entity e1 = link.getEntity1();
final EntityImp e2 = link.getEntity2(); final Entity e2 = link.getEntity2();
final EntityImp group1 = e1.getParentContainer(); final Entity group1 = e1.getParentContainer();
final EntityImp group2 = e2.getParentContainer(); final Entity group2 = e2.getParentContainer();
if (isParent(group1, group) && isParent(group2, group)) if (isParent(group1, group) && isParent(group2, group))
return true; return true;
@ -75,44 +75,14 @@ public abstract class EntityUtils {
return false; return false;
} }
// public static boolean isPureInnerLink12(EntityImp group, Link link) { public static boolean isPureInnerLink3(Entity group, Link link) {
// if (group.isGroup() == false)
// throw new IllegalArgumentException();
//
// final EntityImp e1 = (EntityImp) link.getZEntity1();
// final EntityImp e2 = (EntityImp) link.getZEntity2();
// final Quark group1 = e1.getQuark().getParent();
// final Quark group2 = e2.getQuark().getParent();
// if (group.getQuark().containsLarge(group1) && group.getQuark().containsLarge(group2))
// return true;
//// if (isParent(group1, group) && isParent(group2, group))
//// return true;
//
// return false;
// }
//
// public static boolean isPureInnerLink12(EntityImp group, Link link) {
// if (group.isGroup() == false)
// throw new IllegalArgumentException();
//
// final EntityImp e1 = link.getEntity1();
// final EntityImp e2 = link.getEntity2();
// final EntityImp group1 = e1.getParentContainer();
// final EntityImp group2 = e2.getParentContainer();
// if (isParent(group1, group) && isParent(group2, group))
// return true;
//
// return false;
// }
public static boolean isPureInnerLink3(EntityImp group, Link link) {
if (group.isGroup() == false) if (group.isGroup() == false)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
final EntityImp e1 = link.getEntity1(); final Entity e1 = link.getEntity1();
final EntityImp e2 = link.getEntity2(); final Entity e2 = link.getEntity2();
final EntityImp group1 = e1.getParentContainer(); final Entity group1 = e1.getParentContainer();
final EntityImp group2 = e2.getParentContainer(); final Entity group2 = e2.getParentContainer();
if (isParent(group2, group) == isParent(group1, group)) if (isParent(group2, group) == isParent(group1, group))
return true; return true;

View File

@ -1,173 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.baraye;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class Plasma {
private String separator;
private final Quark root;
private final List<Quark> quarks = new ArrayList<>();
public Plasma(String separator) {
this.root = new Quark(this, null, "");
this.separator = separator;
this.quarks.add(root);
}
public Quark root() {
return root;
}
public final String getSeparator() {
return separator;
}
public final void setSeparator(String separator) {
if (separator == null)
separator = "\u0000";
this.separator = separator;
}
public final boolean hasSeparator() {
return this.separator != null && this.separator != "\u0000";
}
public Quark parse(Quark root, String full) {
final List<String> result = root.getSignature();
while (true) {
int idx = full.indexOf(separator);
if (idx == -1) {
result.add(full);
return ensurePresent(result);
}
if (idx > 0) {
result.add(full.substring(0, idx));
ensurePresent(new ArrayList<>(result));
}
full = full.substring(idx + separator.length());
}
}
Quark ensurePresent(List<String> result) {
Quark quark = getIfExists(result);
if (quark == null) {
if (result.size() == 0) {
// quark = new Quark(this, null, result);
throw new UnsupportedOperationException();
} else {
final Quark parent = ensurePresent(result.subList(0, result.size() - 1));
quark = new Quark(this, parent, result.get(result.size() - 1));
}
// System.err.println("PUTTING " + quark);
quarks.add(quark);
}
return quark;
}
public Collection<Quark> quarks() {
return Collections.unmodifiableCollection(quarks);
}
public Quark getIfExistsFromName(String name) {
Quark result = null;
for (Quark quark : quarks)
if (quark.getName().equals(name)) {
// if (result != null)
// throw new IllegalArgumentException("Duplicate name: " + name);
result = quark;
return result;
}
return result;
}
public int countByName(String name) {
int count = 0;
for (Quark quark : quarks)
if (quark.getName().equals(name))
count++;
return count;
}
public Quark getIfExistsFromFullPath(String full) {
for (Quark quark : quarks)
if (quark.toString(separator).equals(full))
return quark;
return null;
}
public Quark getIfExists(List<String> signature) {
for (Quark quark : quarks)
if (quark.getSignature().equals(signature))
return quark;
return null;
}
public int countChildren(Quark parent) {
int count = 0;
for (Quark quark : quarks)
if (quark.getParent() == parent)
count++;
return count;
}
public List<Quark> getChildren(Quark parent) {
final List<Quark> result = new ArrayList<>();
for (Quark quark : quarks)
if (quark.getParent() == parent)
result.add(quark);
return Collections.unmodifiableList(result);
}
public void moveAllChildOfToAnewFather(Quark oldFather, Quark newFather) {
for (Quark quark : quarks) {
if (quark == newFather)
continue;
if (quark.getParent() == oldFather)
quark.setParent(newFather);
}
}
}

View File

@ -1,180 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.baraye;
import java.util.ArrayList;
import java.util.List;
public class Quark {
private final Plasma plasma;
private /* final */ Quark parent;
private final String name;
private Object data;
Quark(Plasma plasma, Quark parent, String name) {
this.name = name;
this.plasma = plasma;
this.parent = parent;
}
public Quark getParent() {
return parent;
}
@Override
public String toString() {
// return parts.toString() + "(parent=" + parent + ")";
return getSignature().toString();
}
public List<String> getSignature() {
final List<String> result = new ArrayList<>();
if (parent != null)
result.addAll(parent.getSignature());
result.add(name);
return result;
}
public List<String> parts() {
return getSignature();
}
public boolean containsLarge(Quark other) {
final List<String> signature = this.parts();
final List<String> otherSignature = other.parts();
return otherSignature.size() > signature.size()
&& otherSignature.subList(0, signature.size()).equals(signature);
}
// @Override
// public boolean equals(Object obj) {
// final Quark other = (Quark) obj;
// if (this.plasma != other.plasma)
// throw new IllegalArgumentException();
// return this.parts.equals(other.parts);
// }
//
// @Override
// public int hashCode() {
// return parts.hashCode();
// }
public String toString(String sep) {
if (sep == null)
sep = ".";
final StringBuilder sb = new StringBuilder();
for (String s : parts()) {
if (sb.length() > 0)
sb.append(sep);
sb.append(s);
}
return sb.toString();
}
public String getName() {
return name;
}
public String getQualifiedName() {
if (plasma.hasSeparator())
return toString(plasma.getSeparator());
return name;
}
public boolean isRoot() {
return parent == null;
// throw new UnsupportedOperationException();
// return parts.size() == 0;
}
public final Plasma getPlasma() {
return plasma;
}
public final Object getData() {
return data;
}
public final void setData(Object data) {
this.data = data;
}
public Quark childIfExists(String name) {
final List<String> sig = new ArrayList<>(getSignature());
sig.add(name);
return plasma.getIfExists(sig);
}
public Quark child(String full) {
return plasma.parse(this, full);
}
public int countChildren() {
return plasma.countChildren(this);
}
public List<Quark> getChildren() {
return plasma.getChildren(this);
}
public String forXmi() {
final StringBuilder sb = new StringBuilder();
for (String s : parts()) {
if (sb.length() > 0)
sb.append(".");
sb.append(s);
}
return sb.toString();
}
public String getPortMember() {
final String last = getName();
final int x = last.lastIndexOf("::");
if (x == -1) {
return null;
}
return last.substring(x + 2);
}
void setParent(Quark newFather) {
this.parent = newFather;
}
}

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.core.UmlSource;
public class BoardDiagramFactory extends PSystemCommandFactory { public class BoardDiagramFactory extends PSystemCommandFactory {
// ::remove folder when WASM // ::remove folder when CORE
public BoardDiagramFactory() { public BoardDiagramFactory() {
super(DiagramType.BOARD); super(DiagramType.BOARD);

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageBuilder;
public class BpmDiagram extends UmlDiagram { public class BpmDiagram extends UmlDiagram {
// ::remove folder when WASM // ::remove folder when CORE
private void cleanGrid(Grid grid) { private void cleanGrid(Grid grid) {
while (true) { while (true) {

View File

@ -36,7 +36,7 @@
package net.sourceforge.plantuml.braille; package net.sourceforge.plantuml.braille;
public class BrailleChar { public class BrailleChar {
// ::remove folder when WASM // ::remove folder when CORE
private final int id; private final int id;

View File

@ -12,7 +12,7 @@ package net.sourceforge.plantuml.brotli;
* Bit reading helpers. * Bit reading helpers.
*/ */
final class BitReader { final class BitReader {
// ::remove folder when WASM // ::remove folder when CORE
// Added by Arnaud... not very beautifull // Added by Arnaud... not very beautifull
private static final boolean CHECK_UNUSED_BYTES_AFTER_END = false; private static final boolean CHECK_UNUSED_BYTES_AFTER_END = false;

View File

@ -65,7 +65,7 @@ public abstract class AbstractEntityDiagram extends CucaDiagram {
} }
final public DiagramDescription getDescription() { final public DiagramDescription getDescription() {
final StringBuilder result = new StringBuilder("(" + getLeafssize() + " entities"); final StringBuilder result = new StringBuilder("(" + getEntityFactory().leafs().size() + " entities");
if (getSource() != null) { if (getSource() != null) {
final String id = getSource().getId(); final String id = getSource().getId();
if (id != null) { if (id != null) {

View File

@ -41,7 +41,7 @@ import java.util.Map;
import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.Link;
@ -139,14 +139,14 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
private RowLayout getRawLayout(int raw) { private RowLayout getRawLayout(int raw) {
final RowLayout rawLayout = new RowLayout(); final RowLayout rawLayout = new RowLayout();
for (EntityImp leaf : entityFactory.leafs()) for (Entity leaf : entityFactory.leafs())
if (leaf.getRawLayout() == raw) if (leaf.getRawLayout() == raw)
rawLayout.addLeaf(getEntityImageClass(leaf)); rawLayout.addLeaf(getEntityImageClass(leaf));
return rawLayout; return rawLayout;
} }
private TextBlock getEntityImageClass(EntityImp entity) { private TextBlock getEntityImageClass(Entity entity) {
return new EntityImageClass(entity, getSkinParam(), this); return new EntityImageClass(entity, getSkinParam(), this);
} }

View File

@ -35,14 +35,14 @@
*/ */
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -71,7 +71,7 @@ public class CommandAddMethod extends SingleLineCommand2<ClassDiagram> {
throws NoSuchColorException { throws NoSuchColorException {
final String idShort = arg.get("NAME", 0); final String idShort = arg.get("NAME", 0);
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false);
EntityImp entity = (EntityImp) quark.getData(); Entity entity = (Entity) quark.getData();
if (entity == null) if (entity == null)
entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark), LeafType.CLASS, null); entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark), LeafType.CLASS, null);
// final Quark ident = diagram.buildFromName(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(idShort)); // final Quark ident = diagram.buildFromName(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(idShort));

View File

@ -36,8 +36,7 @@
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -52,6 +51,7 @@ import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.HColor; import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.klimt.font.FontParam; import net.sourceforge.plantuml.klimt.font.FontParam;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -141,55 +141,18 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
final Quark quark = diagram.quarkInContext(idShort, true); final Quark quark = diagram.quarkInContext(idShort, true);
Display display = Display.getWithNewlines(displayString); Entity entity = (Entity) quark.getData();
if (Display.isNull(display))
display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE);
EntityImp entity = (EntityImp) quark.getData();
if (entity == null) { if (entity == null) {
Display display = Display.getWithNewlines(displayString);
if (Display.isNull(display))
display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE);
entity = diagram.reallyCreateLeaf(quark, display, type, null); entity = diagram.reallyCreateLeaf(quark, display, type, null);
} else { } else {
if (entity.muteToType(type, null) == false) if (entity.muteToType(type, null) == false)
return CommandExecutionResult.error("Bad name"); return CommandExecutionResult.error("Bad name");
entity.setDisplay(display);
} }
// final Quark quark = diagram.getPlasma().getIfExistsFromName(idShort);
// if (quark != null && quark.getData() != null)
// entity = diagram.getFromName(idShort);
// else
// } else
// entity = (ILeaf) quark.getData();
// if (entity == null || entity.isGroup()) {
// for (Quark tmp : diagram.getPlasma().quarks())
// if (tmp.getData() instanceof EntityImp) {
// final EntityImp tmp2 = (EntityImp) tmp.getData();
// if (tmp2 != null && tmp.getName().equals(idShort) && tmp2.isGroup() == false) {
// entity = (ILeaf) tmp.getData();
// break;
// }
// }
// }
// if (entity == null) {
// entity = diagram.reallyCreateLeaf(quark, display, type, null);
// } else {
// if (entity.muteToType(type, null) == false)
// return CommandExecutionResult.error("Bad name");
// }
// } else {
// final Quark idNewLong = diagram.buildLeafIdent(idShort);
// final Quark code = diagram.buildCode(idShort);
// if (diagram.leafExist(code)) {
// entity = diagram.getOrCreateLeaf(idNewLong, code, type, null);
// if (entity.muteToType(type, null) == false)
// return CommandExecutionResult.error("Bad name");
//
// } else {
// entity = diagram.createLeaf(idNewLong, code, Display.getWithNewlines(display), type, null);
// }
// }
diagram.setLastEntity(entity); diagram.setLastEntity(entity);
if (stereo != null) { if (stereo != null) {
entity.setStereotype(Stereotype.build(stereo, diagram.getSkinParam().getCircledCharacterRadius(), entity.setStereotype(Stereotype.build(stereo, diagram.getSkinParam().getCircledCharacterRadius(),

View File

@ -36,8 +36,7 @@
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2; import net.sourceforge.plantuml.command.CommandMultilines2;
@ -58,6 +57,7 @@ import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.HColor; import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.klimt.font.FontParam; import net.sourceforge.plantuml.klimt.font.FontParam;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -169,7 +169,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
final Quark quark = diagram.quarkInContext(idShort, true); final Quark quark = diagram.quarkInContext(idShort, true);
EntityImp entity = (EntityImp) quark.getData(); Entity entity = (Entity) quark.getData();
Display display = Display.getWithNewlines(displayString); Display display = Display.getWithNewlines(displayString);
if (entity == null) { if (entity == null) {
@ -250,7 +250,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
public static void addTags(EntityImp entity, String tags) { public static void addTags(Entity entity, String tags) {
if (tags == null) if (tags == null)
return; return;
@ -261,7 +261,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
} }
} }
public static void manageExtends(String keyword, ClassDiagram diagram, RegexResult arg, final EntityImp entity) { public static void manageExtends(String keyword, ClassDiagram diagram, RegexResult arg, final Entity entity) {
if (arg.get(keyword, 0) != null) { if (arg.get(keyword, 0) != null) {
final Mode mode = arg.get(keyword, 0).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS; final Mode mode = arg.get(keyword, 0).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS;
LeafType type2 = LeafType.CLASS; LeafType type2 = LeafType.CLASS;
@ -280,7 +280,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
// final IEntity cl2 = diagram.getOrCreateLeaf(ident, other, type2, null); // final IEntity cl2 = diagram.getOrCreateLeaf(ident, other, type2, null);
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), true); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), true);
EntityImp cl2 = (EntityImp) quark.getData(); Entity cl2 = (Entity) quark.getData();
if (cl2 == null) if (cl2 == null)
cl2 = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), type2, null); cl2 = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), type2, null);
@ -297,7 +297,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
} }
} }
private EntityImp executeArg0(ClassDiagram diagram, RegexResult line0) throws NoSuchColorException { private Entity executeArg0(ClassDiagram diagram, RegexResult line0) throws NoSuchColorException {
final String typeString = StringUtils.goUpperCase(line0.get("TYPE", 0)); final String typeString = StringUtils.goUpperCase(line0.get("TYPE", 0));
final LeafType type = LeafType.getLeafType(typeString); final LeafType type = LeafType.getLeafType(typeString);
@ -320,7 +320,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
if (Display.isNull(display)) if (Display.isNull(display))
display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE);
EntityImp entity = (EntityImp) quark.getData(); Entity entity = (Entity) quark.getData();
if (entity == null) { if (entity == null) {
entity = diagram.reallyCreateLeaf(quark, display, type, null); entity = diagram.reallyCreateLeaf(quark, display, type, null);

View File

@ -37,8 +37,7 @@
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -53,6 +52,7 @@ import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.klimt.font.FontParam; import net.sourceforge.plantuml.klimt.font.FontParam;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
import net.sourceforge.plantuml.regex.RegexOptional; import net.sourceforge.plantuml.regex.RegexOptional;
@ -207,7 +207,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw);
final Display display = Display.getWithNewlines(displayRaw == null ? idShort : displayRaw); final Display display = Display.getWithNewlines(displayRaw == null ? idShort : displayRaw);
final Quark quark = diagram.quarkInContext(idShort, false); final Quark quark = diagram.quarkInContext(idShort, false);
EntityImp entity = (EntityImp) quark.getData(); Entity entity = (Entity) quark.getData();
if (entity == null) if (entity == null)
entity = diagram.reallyCreateLeaf(quark, display, type, usymbol); entity = diagram.reallyCreateLeaf(quark, display, type, usymbol);

View File

@ -35,12 +35,12 @@
*/ */
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;

View File

@ -37,9 +37,8 @@ package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.EntityUtils; import net.sourceforge.plantuml.baraye.EntityUtils;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.EntityGender; import net.sourceforge.plantuml.cucadiagram.EntityGender;
@ -48,6 +47,7 @@ import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram; import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -150,7 +150,7 @@ public class CommandHideShowByGender extends SingleLineCommand2<UmlDiagram> {
return CommandExecutionResult.error("No such element " + quark.getName()); return CommandExecutionResult.error("No such element " + quark.getName());
// final IEntity entity = diagram.getOrCreateLeaf(quark, // final IEntity entity = diagram.getOrCreateLeaf(quark,
// diagram.buildFromFullPath(arg1), null, null); // diagram.buildFromFullPath(arg1), null, null);
final EntityImp entity = (EntityImp) quark.getData(); final Entity entity = (Entity) quark.getData();
gender = EntityGenderUtils.byEntityAlone(entity); gender = EntityGenderUtils.byEntityAlone(entity);
} }
@ -193,7 +193,7 @@ public class CommandHideShowByGender extends SingleLineCommand2<UmlDiagram> {
} else { } else {
arg1 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg1); arg1 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg1);
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(arg1), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(arg1), false);
EntityImp entity = (EntityImp) quark.getData(); Entity entity = (Entity) quark.getData();
if (entity == null) if (entity == null)
return CommandExecutionResult.error("No such element " + quark.getName()); return CommandExecutionResult.error("No such element " + quark.getName());
// entity = diagram.reallyCreateLeaf(quark, // entity = diagram.reallyCreateLeaf(quark,
@ -209,7 +209,7 @@ public class CommandHideShowByGender extends SingleLineCommand2<UmlDiagram> {
if (empty == true && emptyMembers == false) { if (empty == true && emptyMembers == false) {
gender = EntityGenderUtils.and(gender, emptyByGender(portion)); gender = EntityGenderUtils.and(gender, emptyByGender(portion));
} }
if (diagram.getCurrentGroup().getQuark().isRoot() == false) { if (diagram.getCurrentGroup().isRoot() == false) {
gender = EntityGenderUtils.and(gender, EntityGenderUtils.byPackage(diagram.getCurrentGroup())); gender = EntityGenderUtils.and(gender, EntityGenderUtils.byPackage(diagram.getCurrentGroup()));
} }

View File

@ -38,8 +38,7 @@ package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
@ -54,6 +53,7 @@ import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
import net.sourceforge.plantuml.regex.RegexOptional; import net.sourceforge.plantuml.regex.RegexOptional;
@ -175,12 +175,12 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
String port1 = null; String port1 = null;
String port2 = null; String port2 = null;
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
if (ent1String.contains("::") && diagram.getPlasma().getIfExistsFromName(ent1String) == null) { if (ent1String.contains("::") && diagram.getPlasma().firstWithName(ent1String) == null) {
port1 = diagram.getPortId(ent1String); port1 = diagram.getPortId(ent1String);
ent1String = diagram.removePortId(ent1String); ent1String = diagram.removePortId(ent1String);
} }
if (ent2String.contains("::") && diagram.getPlasma().getIfExistsFromName(ent2String) == null) { if (ent2String.contains("::") && diagram.getPlasma().firstWithName(ent2String) == null) {
port2 = diagram.getPortId(ent2String); port2 = diagram.getPortId(ent2String);
ent2String = diagram.removePortId(ent2String); ent2String = diagram.removePortId(ent2String);
} }
@ -188,10 +188,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Quark quark1 = diagram.quarkInContext(ent1String, false); final Quark quark1 = diagram.quarkInContext(ent1String, false);
final Quark quark2 = diagram.quarkInContext(ent2String, false); final Quark quark2 = diagram.quarkInContext(ent2String, false);
EntityImp cl1 = (EntityImp) quark1.getData(); Entity cl1 = (Entity) quark1.getData();
if (cl1 == null) if (cl1 == null)
cl1 = diagram.reallyCreateLeaf(quark1, Display.getWithNewlines(quark1.getName()), LeafType.CLASS, null); cl1 = diagram.reallyCreateLeaf(quark1, Display.getWithNewlines(quark1.getName()), LeafType.CLASS, null);
EntityImp cl2 = (EntityImp) quark2.getData(); Entity cl2 = (Entity) quark2.getData();
if (cl2 == null) if (cl2 == null)
cl2 = diagram.reallyCreateLeaf(quark2, Display.getWithNewlines(quark2.getName()), LeafType.CLASS, null); cl2 = diagram.reallyCreateLeaf(quark2, Display.getWithNewlines(quark2.getName()), LeafType.CLASS, null);
@ -268,8 +268,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
throws NoSuchColorException { throws NoSuchColorException {
final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""); final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""); final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
final EntityImp cl1 = diagram.getGroup(ent1String); final Entity cl1 = diagram.getGroup(ent1String);
final EntityImp cl2 = diagram.getGroup(ent2String); final Entity cl2 = diagram.getGroup(ent2String);
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg); final Direction dir = getDirection(arg);
@ -309,13 +309,13 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
if (quark1B.getData() != null == false) if (quark1B.getData() != null == false)
return CommandExecutionResult.error("No class " + name1B); return CommandExecutionResult.error("No class " + name1B);
EntityImp cl1A = (EntityImp) quark1A.getData(); Entity cl1A = (Entity) quark1A.getData();
EntityImp cl1B = (EntityImp) quark1B.getData(); Entity cl1B = (Entity) quark1B.getData();
final String id2 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""); final String id2 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
final Quark ent2 = diagram.quarkInContext(id2, false); final Quark ent2 = diagram.quarkInContext(id2, false);
EntityImp cl2 = (EntityImp) ent2.getData(); Entity cl2 = (Entity) ent2.getData();
if (cl2 == null) if (cl2 == null)
cl2 = diagram.reallyCreateLeaf(ent2, Display.getWithNewlines(ent2.getName()), LeafType.CLASS, null); cl2 = diagram.reallyCreateLeaf(ent2, Display.getWithNewlines(ent2.getName()), LeafType.CLASS, null);
@ -342,13 +342,13 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
if (quark2B.getData() != null == false) if (quark2B.getData() != null == false)
return CommandExecutionResult.error("No class " + name2B); return CommandExecutionResult.error("No class " + name2B);
final EntityImp cl2A = (EntityImp) quark2A.getData(); final Entity cl2A = (Entity) quark2A.getData();
final EntityImp cl2B = (EntityImp) quark2B.getData(); final Entity cl2B = (Entity) quark2B.getData();
final String id1 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""); final String id1 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final Quark ent1 = diagram.quarkInContext(id1, false); final Quark ent1 = diagram.quarkInContext(id1, false);
EntityImp cl1 = (EntityImp) ent1.getData(); Entity cl1 = (Entity) ent1.getData();
if (cl1 == null) if (cl1 == null)
cl1 = diagram.reallyCreateLeaf(ent1, Display.getWithNewlines(ent1.getName()), LeafType.CLASS, null); cl1 = diagram.reallyCreateLeaf(ent1, Display.getWithNewlines(ent1.getName()), LeafType.CLASS, null);
@ -383,10 +383,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
if (quark2B.getData() != null == false) if (quark2B.getData() != null == false)
return CommandExecutionResult.error("No class " + name2B); return CommandExecutionResult.error("No class " + name2B);
final EntityImp cl1A = (EntityImp) quark1A.getData(); final Entity cl1A = (Entity) quark1A.getData();
final EntityImp cl1B = (EntityImp) quark1B.getData(); final Entity cl1B = (Entity) quark1B.getData();
final EntityImp cl2A = (EntityImp) quark2A.getData(); final Entity cl2A = (Entity) quark2A.getData();
final EntityImp cl2B = (EntityImp) quark2B.getData(); final Entity cl2B = (Entity) quark2B.getData();
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));

View File

@ -37,8 +37,7 @@ package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
@ -48,6 +47,7 @@ import net.sourceforge.plantuml.cucadiagram.LinkArg;
import net.sourceforge.plantuml.cucadiagram.LinkDecor; import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType; import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.Matcher2; import net.sourceforge.plantuml.regex.Matcher2;
import net.sourceforge.plantuml.regex.MyPattern; import net.sourceforge.plantuml.regex.MyPattern;
import net.sourceforge.plantuml.regex.Pattern2; import net.sourceforge.plantuml.regex.Pattern2;
@ -118,15 +118,15 @@ final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassO
final String ent1 = arg.get("ENT1", 1); final String ent1 = arg.get("ENT1", 1);
final String ent2 = arg.get("ENT2", 1); final String ent2 = arg.get("ENT2", 1);
final EntityImp cl1; final Entity cl1;
final EntityImp cl2; final Entity cl2;
final EntityImp normalEntity; final Entity normalEntity;
final String suffix = "lol" + diagram.getUniqueSequence(); final String suffix = "lol" + diagram.getUniqueSequence();
if (arg.get("LOL_THEN_ENT", 1) == null) { if (arg.get("LOL_THEN_ENT", 1) == null) {
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(ent1), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(ent1), false);
cl1 = (EntityImp) quark.getData(); cl1 = (Entity) quark.getData();
if (cl1 == null) if (cl1 == null)
return CommandExecutionResult.error("No class " + quark.getName()); return CommandExecutionResult.error("No class " + quark.getName());
@ -145,7 +145,7 @@ final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassO
// normalEntity = cl1; // normalEntity = cl1;
} else { } else {
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(ent2), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(ent2), false);
cl2 = (EntityImp) quark.getData(); cl2 = (Entity) quark.getData();
if (cl2 == null) if (cl2 == null)
return CommandExecutionResult.error("No class " + quark.getName()); return CommandExecutionResult.error("No class " + quark.getName());

View File

@ -35,14 +35,14 @@
*/ */
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.klimt.font.FontParam; import net.sourceforge.plantuml.klimt.font.FontParam;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -73,7 +73,7 @@ public class CommandStereotype extends SingleLineCommand2<ClassDiagram> {
// final Quark code = diagram.buildFromFullPath(name); // final Quark code = diagram.buildFromFullPath(name);
// final IEntity entity = diagram.getOrCreateLeaf(ident, code, null, null); // final IEntity entity = diagram.getOrCreateLeaf(ident, code, null, null);
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(name), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(name), false);
final EntityImp entity = (EntityImp) quark.getData(); final Entity entity = (Entity) quark.getData();
if (entity == null) if (entity == null)
return CommandExecutionResult.error("No such class " + quark.getName()); return CommandExecutionResult.error("No such class " + quark.getName());

View File

@ -35,11 +35,11 @@
*/ */
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram; import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -78,7 +78,7 @@ public class CommandUrl extends SingleLineCommand2<AbstractEntityDiagram> {
// final Quark code = diagram.buildFromFullPath(idShort); // final Quark code = diagram.buildFromFullPath(idShort);
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), false);
final EntityImp entity = (EntityImp) quark.getData(); final Entity entity = (Entity) quark.getData();
if (entity == null) if (entity == null)
return CommandExecutionResult.error(quark.getName() + " does not exist"); return CommandExecutionResult.error(quark.getName() + " does not exist");

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.brotli.BrotliInputStream;
import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.log.Logme;
public class CompressionBrotli implements Compression { public class CompressionBrotli implements Compression {
// ::remove file when WASM // ::remove file when CORE
public byte[] compress(byte[] in) { public byte[] compress(byte[] in) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View File

@ -43,13 +43,13 @@ import net.sourceforge.plantuml.code.deflate.Decompressor;
public class CompressionZlib implements Compression { public class CompressionZlib implements Compression {
// ::comment when WASM // ::comment when CORE
private static boolean USE_ZOPFLI = false; private static boolean USE_ZOPFLI = false;
// ::done // ::done
private static final int COMPRESSION_LEVEL = 9; private static final int COMPRESSION_LEVEL = 9;
public byte[] compress(byte[] in) { public byte[] compress(byte[] in) {
// ::comment when WASM // ::comment when CORE
if (USE_ZOPFLI) if (USE_ZOPFLI)
return new CompressionZopfliZlib().compress(in); return new CompressionZopfliZlib().compress(in);
// ::done // ::done

View File

@ -42,7 +42,7 @@ import java.util.zip.Inflater;
@Deprecated @Deprecated
public class CompressionZlibAttic implements Compression { public class CompressionZlibAttic implements Compression {
// ::remove file when WASM // ::remove file when CORE
private static boolean USE_ZOPFLI = false; private static boolean USE_ZOPFLI = false;
private static final int COMPRESSION_LEVEL = 9; private static final int COMPRESSION_LEVEL = 9;

View File

@ -41,7 +41,7 @@ import net.sourceforge.plantuml.zopfli.Options.OutputFormat;
import net.sourceforge.plantuml.zopfli.Zopfli; import net.sourceforge.plantuml.zopfli.Zopfli;
public class CompressionZopfliZlib implements Compression { public class CompressionZopfliZlib implements Compression {
// ::remove file when WASM // ::remove file when CORE
public byte[] compress(byte[] in) { public byte[] compress(byte[] in) {
if (in.length == 0) if (in.length == 0)

View File

@ -62,7 +62,7 @@ public class CommandAffineTransform extends SingleLineCommand2<UmlDiagram> {
@Override @Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, LineLocation location, RegexResult arg) { protected CommandExecutionResult executeArg(UmlDiagram diagram, LineLocation location, RegexResult arg) {
final CharSequence value = arg.get("ANIMATION", 0); final CharSequence value = arg.get("ANIMATION", 0);
// ::comment when WASM // ::comment when CORE
diagram.setAnimation(Collections.singletonList(value)); diagram.setAnimation(Collections.singletonList(value));
// ::done // ::done
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -35,8 +35,7 @@
*/ */
package net.sourceforge.plantuml.command; package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType; import net.sourceforge.plantuml.cucadiagram.GroupType;
@ -46,6 +45,7 @@ import net.sourceforge.plantuml.graphic.USymbols;
import net.sourceforge.plantuml.klimt.color.ColorParser; import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -82,14 +82,12 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg) protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException { throws NoSuchColorException {
final String idShort = arg.get("NAME", 0); final String idShort = arg.get("NAME", 0);
// final Quark current = diagram.currentQuark();
// final Quark idNewLong = current.child(idShort);
final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), true); final Quark quark = diagram.quarkInContext(diagram.cleanIdForQuark(idShort), true);
final CommandExecutionResult status = diagram.gotoGroup(quark, final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()),
Display.getWithNewlines(quark.getQualifiedName()), GroupType.PACKAGE); GroupType.PACKAGE);
if (status.isOk() == false) if (status.isOk() == false)
return status; return status;
final EntityImp p = diagram.getCurrentGroup(); final Entity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0); final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null) { if (stereotype != null) {
final USymbol usymbol = USymbols.fromString(stereotype, diagram.getSkinParam().actorStyle(), final USymbol usymbol = USymbols.fromString(stereotype, diagram.getSkinParam().actorStyle(),

View File

@ -35,8 +35,7 @@
*/ */
package net.sourceforge.plantuml.command; package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType; import net.sourceforge.plantuml.cucadiagram.GroupType;
@ -44,6 +43,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.klimt.color.ColorParser; import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -94,7 +94,7 @@ public class CommandNamespace2 extends SingleLineCommand2<ClassDiagram> {
final CommandExecutionResult status = diagram.gotoGroup(quark, display, GroupType.PACKAGE); final CommandExecutionResult status = diagram.gotoGroup(quark, display, GroupType.PACKAGE);
if (status.isOk() == false) if (status.isOk() == false)
return status; return status;
final EntityImp p = diagram.getCurrentGroup(); final Entity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0); final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null) if (stereotype != null)
p.setStereotype(Stereotype.build(stereotype)); p.setStereotype(Stereotype.build(stereotype));

View File

@ -35,8 +35,7 @@
*/ */
package net.sourceforge.plantuml.command; package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType; import net.sourceforge.plantuml.cucadiagram.GroupType;
@ -44,6 +43,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.klimt.color.ColorParser; import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -94,7 +94,7 @@ public class CommandNamespaceEmpty extends SingleLineCommand2<ClassDiagram> {
final CommandExecutionResult status = diagram.gotoGroup(quark, display, GroupType.PACKAGE); final CommandExecutionResult status = diagram.gotoGroup(quark, display, GroupType.PACKAGE);
if (status.isOk() == false) if (status.isOk() == false)
return status; return status;
final EntityImp p = diagram.getCurrentGroup(); final Entity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0); final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null) if (stereotype != null)
p.setStereotype(Stereotype.build(stereotype)); p.setStereotype(Stereotype.build(stereotype));

View File

@ -36,8 +36,7 @@
package net.sourceforge.plantuml.command; package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram; import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines; import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
@ -50,6 +49,7 @@ import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.klimt.color.ColorParser; import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -117,16 +117,14 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
display = idShort; display = idShort;
} }
} else { } else {
display = name; display = name;
idShort = arg.get("AS", 0); idShort = arg.get("AS", 0);
} }
// final Quark current = diagram.currentQuark();
// final Quark ident = current.child(idShort);
final Quark quark; final Quark quark;
if (arg.get("AS", 0) == null) { if (arg.get("AS", 0) == null) {
quark = diagram.quarkInContext(diagram.cleanIdForQuark(name), true); quark = diagram.quarkInContext(diagram.cleanIdForQuark(name), true);
display = quark.getQualifiedName(); display = quark.getName();
} else { } else {
quark = diagram.quarkInContext(diagram.cleanIdForQuark(arg.get("AS", 0)), true); quark = diagram.quarkInContext(diagram.cleanIdForQuark(arg.get("AS", 0)), true);
display = name; display = name;
@ -137,7 +135,7 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
if (status.isOk() == false) if (status.isOk() == false)
return status; return status;
final EntityImp p = diagram.getCurrentGroup(); final Entity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0); final String stereotype = arg.get("STEREOTYPE", 0);

View File

@ -36,13 +36,13 @@
package net.sourceforge.plantuml.command; package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.baraye.EntityImp; import net.sourceforge.plantuml.baraye.Entity;
import net.sourceforge.plantuml.baraye.Quark;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram; import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType; import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.klimt.color.ColorType; import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException; import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.plasma.Quark;
import net.sourceforge.plantuml.regex.IRegex; import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat; import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexLeaf;
@ -99,7 +99,7 @@ public class CommandPackageEmpty extends SingleLineCommand2<AbstractEntityDiagra
GroupType.PACKAGE); GroupType.PACKAGE);
if (status.isOk() == false) if (status.isOk() == false)
return status; return status;
final EntityImp p = diagram.getCurrentGroup(); final Entity p = diagram.getCurrentGroup();
final String color = arg.get("COLOR", 0); final String color = arg.get("COLOR", 0);
if (color != null) if (color != null)
p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColor(color)); p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColor(color));

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