From 4e3d8c94f6b81dd7d65821f1957721477f8f86cb Mon Sep 17 00:00:00 2001 From: Benjamin Davies Date: Sat, 26 Aug 2023 18:54:16 +1200 Subject: [PATCH] Parse Chen EER diagrams --- .../sourceforge/plantuml/PSystemBuilder.java | 3 + .../plantuml/cheneer/ChenEerDiagram.java | 93 ++++++++++++++++++ .../cheneer/ChenEerDiagramFactory.java | 76 +++++++++++++++ .../command/CommandAssociateRelationship.java | 76 +++++++++++++++ .../command/CommandCreateAttribute.java | 96 +++++++++++++++++++ .../cheneer/command/CommandCreateEntity.java | 74 ++++++++++++++ .../command/CommandCreateRelationship.java | 74 ++++++++++++++ .../cheneer/command/CommandEndGroup.java | 65 +++++++++++++ .../plantuml/core/DiagramType.java | 5 +- .../plantuml/skin/UmlDiagramType.java | 2 +- 10 files changed, 562 insertions(+), 2 deletions(-) create mode 100644 src/net/sourceforge/plantuml/cheneer/ChenEerDiagram.java create mode 100644 src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java create mode 100644 src/net/sourceforge/plantuml/cheneer/command/CommandAssociateRelationship.java create mode 100644 src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java create mode 100644 src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java create mode 100644 src/net/sourceforge/plantuml/cheneer/command/CommandCreateRelationship.java create mode 100644 src/net/sourceforge/plantuml/cheneer/command/CommandEndGroup.java diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index 0a58f6492..8faf8df5d 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -48,6 +48,7 @@ import net.sourceforge.plantuml.activitydiagram3.ActivityDiagramFactory3; import net.sourceforge.plantuml.api.PSystemFactory; import net.sourceforge.plantuml.board.BoardDiagramFactory; import net.sourceforge.plantuml.bpm.BpmDiagramFactory; +import net.sourceforge.plantuml.cheneer.ChenEerDiagramFactory; import net.sourceforge.plantuml.classdiagram.ClassDiagramFactory; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.DiagramType; @@ -258,6 +259,8 @@ public class PSystemBuilder { factories.add(new HclDiagramFactory()); factories.add(new PSystemEbnfFactory()); factories.add(new PSystemRegexFactory()); + + factories.add(new ChenEerDiagramFactory()); } private boolean isOk(Diagram ps) { diff --git a/src/net/sourceforge/plantuml/cheneer/ChenEerDiagram.java b/src/net/sourceforge/plantuml/cheneer/ChenEerDiagram.java new file mode 100644 index 000000000..f307b952d --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/ChenEerDiagram.java @@ -0,0 +1,93 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import net.sourceforge.plantuml.FileFormatOption; +import net.sourceforge.plantuml.TitledDiagram; +import net.sourceforge.plantuml.abel.Entity; +import net.sourceforge.plantuml.core.DiagramDescription; +import net.sourceforge.plantuml.core.ImageData; +import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.klimt.drawing.UGraphic; +import net.sourceforge.plantuml.klimt.font.StringBounder; +import net.sourceforge.plantuml.klimt.geom.XDimension2D; +import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock; +import net.sourceforge.plantuml.klimt.shape.TextBlock; +import net.sourceforge.plantuml.klimt.shape.TextBlockUtils; +import net.sourceforge.plantuml.skin.UmlDiagramType; + +public class ChenEerDiagram extends TitledDiagram { + + public ChenEerDiagram(UmlSource source, Map skinParam) { + super(source, UmlDiagramType.CHEN_EER, skinParam); + // TODO + } + + @Override + public DiagramDescription getDescription() { + return new DiagramDescription("(Chen EER)"); + } + + @Override + protected ImageData exportDiagramNow(OutputStream os, int index, FileFormatOption fileFormatOption) + throws IOException { + return createImageBuilder(fileFormatOption).drawable(getTextBlock()).write(os); + } + + private void drawInternal(UGraphic ug) { + // TODO + } + + @Override + protected TextBlock getTextBlock() { + return new AbstractTextBlock() { + public void drawU(UGraphic ug) { + drawInternal(ug); + } + + public XDimension2D calculateDimension(StringBounder stringBounder) { + return TextBlockUtils.getMinMax(getTextBlock(), stringBounder, true).getDimension(); + } + }; + } + +} diff --git a/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java b/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java new file mode 100644 index 000000000..5c23db469 --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java @@ -0,0 +1,76 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer; + +import java.util.List; +import java.util.Map; + +import net.sourceforge.plantuml.AbstractPSystem; +import net.sourceforge.plantuml.cheneer.command.CommandAssociateRelationship; +import net.sourceforge.plantuml.cheneer.command.CommandCreateAttribute; +import net.sourceforge.plantuml.cheneer.command.CommandCreateEntity; +import net.sourceforge.plantuml.cheneer.command.CommandCreateRelationship; +import net.sourceforge.plantuml.cheneer.command.CommandEndGroup; +import net.sourceforge.plantuml.command.Command; +import net.sourceforge.plantuml.command.CommonCommands; +import net.sourceforge.plantuml.command.PSystemCommandFactory; +import net.sourceforge.plantuml.core.DiagramType; +import net.sourceforge.plantuml.core.UmlSource; + +public class ChenEerDiagramFactory extends PSystemCommandFactory { + + public ChenEerDiagramFactory() { + super(DiagramType.CHEN_EER); + } + + @Override + protected void initCommandsList(List cmds) { + cmds.add(new CommandCreateEntity()); + cmds.add(new CommandCreateAttribute()); + cmds.add(new CommandCreateRelationship()); + cmds.add(new CommandAssociateRelationship()); + cmds.add(new CommandEndGroup()); + + CommonCommands.addTitleCommands(cmds); + CommonCommands.addCommonCommands2(cmds); + } + + @Override + public AbstractPSystem createEmptyDiagram(UmlSource source, Map skinParam) { + return new ChenEerDiagram(source, skinParam); + } + +} diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandAssociateRelationship.java b/src/net/sourceforge/plantuml/cheneer/command/CommandAssociateRelationship.java new file mode 100644 index 000000000..01d2b1e24 --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandAssociateRelationship.java @@ -0,0 +1,76 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer.command; + +import net.sourceforge.plantuml.cheneer.ChenEerDiagram; +import net.sourceforge.plantuml.command.CommandExecutionResult; +import net.sourceforge.plantuml.command.SingleLineCommand2; +import net.sourceforge.plantuml.klimt.color.NoSuchColorException; +import net.sourceforge.plantuml.regex.IRegex; +import net.sourceforge.plantuml.regex.RegexConcat; +import net.sourceforge.plantuml.regex.RegexLeaf; +import net.sourceforge.plantuml.regex.RegexOptional; +import net.sourceforge.plantuml.regex.RegexResult; +import net.sourceforge.plantuml.utils.LineLocation; + +public class CommandAssociateRelationship extends SingleLineCommand2 { + + public CommandAssociateRelationship() { + super(getRegexConcat()); + } + + private static IRegex getRegexConcat() { + return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("PARTICIPATION", "([-=])"), // + new RegexOptional( // + new RegexLeaf("CARDINALITY", "(\\w+|\\(\\w+,[%s]*\\w+\\))")), // + RegexLeaf.spaceOneOrMore(), // + new RegexLeaf("NAME", "([\\w-]+)"), // + RegexLeaf.end()); + } + + @Override + protected CommandExecutionResult executeArg(ChenEerDiagram system, LineLocation location, RegexResult arg) + throws NoSuchColorException { + final String name = arg.get("NAME", 0); + + System.out.println("- " + name); + + return CommandExecutionResult.ok(); + } + +} diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java new file mode 100644 index 000000000..68b6dff5e --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java @@ -0,0 +1,96 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer.command; + +import net.sourceforge.plantuml.cheneer.ChenEerDiagram; +import net.sourceforge.plantuml.command.CommandExecutionResult; +import net.sourceforge.plantuml.command.SingleLineCommand2; +import net.sourceforge.plantuml.klimt.color.NoSuchColorException; +import net.sourceforge.plantuml.regex.IRegex; +import net.sourceforge.plantuml.regex.RegexConcat; +import net.sourceforge.plantuml.regex.RegexLeaf; +import net.sourceforge.plantuml.regex.RegexOptional; +import net.sourceforge.plantuml.regex.RegexResult; +import net.sourceforge.plantuml.utils.LineLocation; + +public class CommandCreateAttribute extends SingleLineCommand2 { + + public CommandCreateAttribute() { + super(getRegexConcat()); + } + + private static IRegex getRegexConcat() { + return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), // + RegexLeaf.spaceZeroOrMore(), + new RegexOptional( // + new RegexConcat( // + new RegexLeaf("MULTI", "multi"), // + RegexLeaf.spaceOneOrMore())), // + new RegexOptional( // + new RegexConcat( // + new RegexLeaf("DERIVED", "derived"), // + RegexLeaf.spaceOneOrMore())), // + new RegexOptional( // + new RegexConcat( // + new RegexOptional( // + new RegexConcat( // + new RegexLeaf("PARTIAL", "partial"), // + RegexLeaf.spaceOneOrMore())), + new RegexLeaf("KEY", "key"), // + RegexLeaf.spaceOneOrMore())), // + new RegexOptional( // + new RegexConcat( // + new RegexLeaf("attr(:?ibute)?"), // + RegexLeaf.spaceOneOrMore())), // + new RegexLeaf("NAME", "(\\w+)"), // + new RegexOptional(// + new RegexConcat( // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("COMPOSITE", "\\{"))), // + RegexLeaf.end()); + } + + @Override + protected CommandExecutionResult executeArg(ChenEerDiagram system, LineLocation location, RegexResult arg) + throws NoSuchColorException { + final String name = arg.get("NAME", 0); + + System.out.println("attribute " + name); + + return CommandExecutionResult.ok(); + } + +} diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java new file mode 100644 index 000000000..52ca57e76 --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java @@ -0,0 +1,74 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer.command; + +import net.sourceforge.plantuml.cheneer.ChenEerDiagram; +import net.sourceforge.plantuml.command.CommandExecutionResult; +import net.sourceforge.plantuml.command.SingleLineCommand2; +import net.sourceforge.plantuml.klimt.color.NoSuchColorException; +import net.sourceforge.plantuml.regex.IRegex; +import net.sourceforge.plantuml.regex.RegexConcat; +import net.sourceforge.plantuml.regex.RegexLeaf; +import net.sourceforge.plantuml.regex.RegexResult; +import net.sourceforge.plantuml.utils.LineLocation; + +public class CommandCreateEntity extends SingleLineCommand2 { + + public CommandCreateEntity() { + super(getRegexConcat()); + } + + private static IRegex getRegexConcat() { + return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), // + new RegexLeaf("entity"), // + RegexLeaf.spaceOneOrMore(), // + new RegexLeaf("NAME", "(\\w+)"), // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("\\{"), // + RegexLeaf.end()); + } + + @Override + protected CommandExecutionResult executeArg(ChenEerDiagram system, LineLocation location, RegexResult arg) + throws NoSuchColorException { + final String name = arg.get("NAME", 0); + + System.out.println("entity " + name); + + return CommandExecutionResult.ok(); + } + +} diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateRelationship.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateRelationship.java new file mode 100644 index 000000000..bd1c219ec --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateRelationship.java @@ -0,0 +1,74 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer.command; + +import net.sourceforge.plantuml.cheneer.ChenEerDiagram; +import net.sourceforge.plantuml.command.CommandExecutionResult; +import net.sourceforge.plantuml.command.SingleLineCommand2; +import net.sourceforge.plantuml.klimt.color.NoSuchColorException; +import net.sourceforge.plantuml.regex.IRegex; +import net.sourceforge.plantuml.regex.RegexConcat; +import net.sourceforge.plantuml.regex.RegexLeaf; +import net.sourceforge.plantuml.regex.RegexResult; +import net.sourceforge.plantuml.utils.LineLocation; + +public class CommandCreateRelationship extends SingleLineCommand2 { + + public CommandCreateRelationship() { + super(getRegexConcat()); + } + + private static IRegex getRegexConcat() { + return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), // + new RegexLeaf("relationship"), // + RegexLeaf.spaceOneOrMore(), // + new RegexLeaf("NAME", "(\\w+)"), // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("\\{"), // + RegexLeaf.end()); + } + + @Override + protected CommandExecutionResult executeArg(ChenEerDiagram system, LineLocation location, RegexResult arg) + throws NoSuchColorException { + final String name = arg.get("NAME", 0); + + System.out.println("relationship " + name); + + return CommandExecutionResult.ok(); + } + +} diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandEndGroup.java b/src/net/sourceforge/plantuml/cheneer/command/CommandEndGroup.java new file mode 100644 index 000000000..7eaada17c --- /dev/null +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandEndGroup.java @@ -0,0 +1,65 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.cheneer.command; + +import net.sourceforge.plantuml.cheneer.ChenEerDiagram; +import net.sourceforge.plantuml.command.CommandExecutionResult; +import net.sourceforge.plantuml.command.SingleLineCommand2; +import net.sourceforge.plantuml.regex.IRegex; +import net.sourceforge.plantuml.regex.RegexConcat; +import net.sourceforge.plantuml.regex.RegexLeaf; +import net.sourceforge.plantuml.regex.RegexResult; +import net.sourceforge.plantuml.utils.LineLocation; + +public class CommandEndGroup extends SingleLineCommand2 { + + public CommandEndGroup() { + super(getRegexConcat()); + } + + static IRegex getRegexConcat() { + return RegexConcat.build(CommandEndGroup.class.getName(), RegexLeaf.start(), // + new RegexLeaf("\\}"), // + RegexLeaf.end()); // + } + + @Override + protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation location, RegexResult arg) { + // TODO + return CommandExecutionResult.ok(); + } + +} diff --git a/src/net/sourceforge/plantuml/core/DiagramType.java b/src/net/sourceforge/plantuml/core/DiagramType.java index 2b0e4a4e7..463f70b28 100644 --- a/src/net/sourceforge/plantuml/core/DiagramType.java +++ b/src/net/sourceforge/plantuml/core/DiagramType.java @@ -40,7 +40,7 @@ import net.sourceforge.plantuml.utils.StartUtils; public enum DiagramType { // ::remove folder when __HAXE__ UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, NW, - MINDMAP, WBS, WIRE, JSON, GIT, BOARD, YAML, HCL, EBNF, REGEX, FILES, UNKNOWN; + MINDMAP, WBS, WIRE, JSON, GIT, BOARD, YAML, HCL, EBNF, REGEX, FILES, CHEN_EER, UNKNOWN; static public DiagramType getTypeFromArobaseStart(String s) { s = s.toLowerCase(); @@ -128,6 +128,9 @@ public enum DiagramType { if (StartUtils.startsWithSymbolAnd("startfiles", s)) return FILES; + if (StartUtils.startsWithSymbolAnd("startchen", s)) + return CHEN_EER; + return UNKNOWN; } } diff --git a/src/net/sourceforge/plantuml/skin/UmlDiagramType.java b/src/net/sourceforge/plantuml/skin/UmlDiagramType.java index 3beaf0691..f30c09913 100644 --- a/src/net/sourceforge/plantuml/skin/UmlDiagramType.java +++ b/src/net/sourceforge/plantuml/skin/UmlDiagramType.java @@ -39,7 +39,7 @@ import net.sourceforge.plantuml.style.SName; public enum UmlDiagramType { SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM, NWDIAG, MINDMAP, WBS, WIRE, - HELP, GANTT, SALT, JSON, GIT, BOARD, YAML, HCL, EBNF, REGEX, FILES; + HELP, GANTT, SALT, JSON, GIT, BOARD, YAML, HCL, EBNF, REGEX, FILES, CHEN_EER; public SName getStyleName() { if (this == SEQUENCE)