From 9c62daa35dbaef9c6c6c326243ec66b9c2192d95 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sun, 12 Mar 2023 12:41:34 +0100 Subject: [PATCH] Fix UGraphic hierarchy --- .../sourceforge/plantuml/PSystemBuilder.java | 9 +- .../plantuml/braille/UGraphicBraille.java | 4 +- .../plantuml/help/CommandHelp.java | 78 ------------- .../plantuml/help/CommandHelpColor.java | 75 ------------- .../plantuml/help/CommandHelpFont.java | 77 ------------- .../plantuml/help/CommandHelpKeyword.java | 75 ------------- .../plantuml/help/CommandHelpSkinparam.java | 75 ------------- .../plantuml/help/CommandHelpTheme.java | 88 --------------- .../plantuml/help/CommandHelpType.java | 75 ------------- src/net/sourceforge/plantuml/help/Help.java | 103 ------------------ .../plantuml/help/HelpFactory.java | 63 ----------- .../klimt/drawing/AbstractCommonUGraphic.java | 15 +-- .../klimt/drawing/AbstractUGraphic.java | 17 +-- .../plantuml/klimt/drawing/UGraphicNull.java | 4 +- .../klimt/drawing/debug/UGraphicDebug.java | 8 +- .../klimt/drawing/eps/UGraphicEps.java | 4 +- .../klimt/drawing/g2d/UGraphicG2d.java | 4 +- .../klimt/drawing/html5/UGraphicHtml5.java | 3 +- .../klimt/drawing/svg/DriverTextSvg.java | 4 +- .../klimt/drawing/svg/UGraphicSvg.java | 16 +-- .../klimt/drawing/tikz/UGraphicTikz.java | 4 +- .../klimt/drawing/txt/UGraphicTxt.java | 8 +- .../klimt/drawing/visio/UGraphicVdx.java | 4 +- .../sourceforge/plantuml/help/HelpTest.java | 23 ---- 24 files changed, 63 insertions(+), 773 deletions(-) delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelp.java delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelpColor.java delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelpFont.java delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelpKeyword.java delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelpSkinparam.java delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelpTheme.java delete mode 100644 src/net/sourceforge/plantuml/help/CommandHelpType.java delete mode 100644 src/net/sourceforge/plantuml/help/Help.java delete mode 100644 src/net/sourceforge/plantuml/help/HelpFactory.java delete mode 100644 test/net/sourceforge/plantuml/help/HelpTest.java diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index a6d7ab07a..1b2168aeb 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -74,7 +74,6 @@ import net.sourceforge.plantuml.flowdiagram.FlowDiagramFactory; import net.sourceforge.plantuml.font.PSystemListFontsFactory; import net.sourceforge.plantuml.gitlog.GitDiagramFactory; import net.sourceforge.plantuml.hcl.HclDiagramFactory; -import net.sourceforge.plantuml.help.HelpFactory; import net.sourceforge.plantuml.jcckit.PSystemJcckitFactory; import net.sourceforge.plantuml.jsondiagram.JsonDiagramFactory; import net.sourceforge.plantuml.klimt.creole.legacy.PSystemCreoleFactory; @@ -237,18 +236,20 @@ public class PSystemBuilder { factories.add(new PSystemXearthFactory()); } // ::done + factories.add(new GanttDiagramFactory()); factories.add(new FlowDiagramFactory()); - // factories.add(new PSystemTreeFactory(DiagramType.JUNGLE)); - // factories.add(new PSystemCuteFactory(DiagramType.CUTE)); + // ::comment when __CORE__ factories.add(new PSystemDedicationFactory()); // ::done + factories.add(new TimingDiagramFactory()); + // ::comment when __CORE__ - factories.add(new HelpFactory()); factories.add(new WireDiagramFactory()); // ::done + factories.add(new JsonDiagramFactory()); factories.add(new GitDiagramFactory()); // ::comment when __CORE__ diff --git a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java index 67f0a0723..d02e913e0 100644 --- a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java +++ b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java @@ -66,11 +66,13 @@ public class UGraphicBraille extends AbstractUGraphic implements Cl } public UGraphicBraille(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) { - copy(defaultBackground, colorMapper, stringBounder, new BrailleGrid(QUANTA)); + super(stringBounder); + copy(defaultBackground, colorMapper, new BrailleGrid(QUANTA)); register(); } private UGraphicBraille(UGraphicBraille other) { + super(other.getStringBounder()); copy(other); register(); } diff --git a/src/net/sourceforge/plantuml/help/CommandHelp.java b/src/net/sourceforge/plantuml/help/CommandHelp.java deleted file mode 100644 index 86718a5ac..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelp.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * 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.help; - -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 CommandHelp extends SingleLineCommand2 { - // ::remove folder when __CORE__ - - public CommandHelp() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelp.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("General help"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" There are some other help command:"); - diagram.add("* help types"); - diagram.add("* help keywords"); - diagram.add("* help preprocessors"); - diagram.add("* help colors"); - diagram.add("* help font"); - diagram.add("* help skinparams"); - diagram.add("* help themes"); - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/CommandHelpColor.java b/src/net/sourceforge/plantuml/help/CommandHelpColor.java deleted file mode 100644 index 985bee4f4..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelpColor.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ======================================================================== - * 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.help; - -import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.SingleLineCommand2; -import net.sourceforge.plantuml.klimt.color.HColorSet; -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 CommandHelpColor extends SingleLineCommand2 { - - public CommandHelpColor() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelpColor.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("colors?"), RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("Help on colors"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" The possible colors are :"); - for (String type : HColorSet.instance().names()) { - diagram.add("* " + type); - } - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/CommandHelpFont.java b/src/net/sourceforge/plantuml/help/CommandHelpFont.java deleted file mode 100644 index d6ea00875..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelpFont.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ======================================================================== - * 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.help; - -import java.awt.GraphicsEnvironment; - -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 CommandHelpFont extends SingleLineCommand2 { - - public CommandHelpFont() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelpFont.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("fonts?"), RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("Help on font"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" The possible font on your system are :"); - final String name[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); - for (String n : name) { - diagram.add("* " + n); - } - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/CommandHelpKeyword.java b/src/net/sourceforge/plantuml/help/CommandHelpKeyword.java deleted file mode 100644 index 7165d501b..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelpKeyword.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ======================================================================== - * 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.help; - -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.syntax.LanguageDescriptor; -import net.sourceforge.plantuml.utils.LineLocation; - -public class CommandHelpKeyword extends SingleLineCommand2 { - - public CommandHelpKeyword() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelpKeyword.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("keywords?"), RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("Help on keywords"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" The possible keywords are :"); - for (String type : new LanguageDescriptor().getKeyword()) { - diagram.add("* " + type); - } - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/CommandHelpSkinparam.java b/src/net/sourceforge/plantuml/help/CommandHelpSkinparam.java deleted file mode 100644 index 3c2e922d7..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelpSkinparam.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ======================================================================== - * 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.help; - -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.skin.SkinParam; -import net.sourceforge.plantuml.utils.LineLocation; - -public class CommandHelpSkinparam extends SingleLineCommand2 { - - public CommandHelpSkinparam() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelpSkinparam.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("skinparams?"), RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("Help on skinparam"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" The possible skinparam are :"); - for (String type : SkinParam.getPossibleValues()) { - diagram.add("* " + type); - } - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/CommandHelpTheme.java b/src/net/sourceforge/plantuml/help/CommandHelpTheme.java deleted file mode 100644 index 82596faab..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelpTheme.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2021, 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: Matthew Leather - * - * - */ -package net.sourceforge.plantuml.help; - -import java.io.IOException; - -import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.SingleLineCommand2; -import net.sourceforge.plantuml.log.Logme; -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.theme.ThemeUtils; -import net.sourceforge.plantuml.utils.LineLocation; -import net.sourceforge.plantuml.utils.Log; - -public class CommandHelpTheme extends SingleLineCommand2 { - // ::remove folder when __HAXE__ - - public CommandHelpTheme() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelpTheme.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("themes?"), RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("Help on themes"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" The possible themes are :"); - - try { - for (String theme : ThemeUtils.getAllThemeNames()) { - diagram.add("* " + theme); - } - } catch (IOException e) { - final String message = "Unexpected error listing themes: " + e.getMessage(); - Log.error(message); - Logme.error(e); - return CommandExecutionResult.error(message); - } - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/CommandHelpType.java b/src/net/sourceforge/plantuml/help/CommandHelpType.java deleted file mode 100644 index dfaab64fb..000000000 --- a/src/net/sourceforge/plantuml/help/CommandHelpType.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ======================================================================== - * 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.help; - -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.syntax.LanguageDescriptor; -import net.sourceforge.plantuml.utils.LineLocation; - -public class CommandHelpType extends SingleLineCommand2 { - - public CommandHelpType() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandHelpType.class.getName(), RegexLeaf.start(), // - new RegexLeaf("help"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("types?"), RegexLeaf.end()); - } - - @Override - protected CommandExecutionResult executeArg(Help diagram, LineLocation location, RegexResult arg) { - diagram.add("Help on types"); - diagram.add(" "); - diagram.add("The code of this command is located in net.sourceforge.plantuml.help package."); - diagram.add( - "You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help"); - diagram.add(" "); - diagram.add(" The possible types are :"); - for (String type : new LanguageDescriptor().getType()) { - diagram.add("* " + type); - } - - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/help/Help.java b/src/net/sourceforge/plantuml/help/Help.java deleted file mode 100644 index 36962e0a5..000000000 --- a/src/net/sourceforge/plantuml/help/Help.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ======================================================================== - * 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.help; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import net.atmp.ImageBuilder; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.UmlDiagram; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.klimt.LineBreakStrategy; -import net.sourceforge.plantuml.klimt.creole.CreoleMode; -import net.sourceforge.plantuml.klimt.creole.Display; -import net.sourceforge.plantuml.klimt.creole.Sheet; -import net.sourceforge.plantuml.klimt.creole.SheetBlock1; -import net.sourceforge.plantuml.klimt.font.FontConfiguration; -import net.sourceforge.plantuml.klimt.font.UFont; -import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment; -import net.sourceforge.plantuml.klimt.shape.TextBlock; -import net.sourceforge.plantuml.skin.UmlDiagramType; -import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; - -public class Help extends UmlDiagram { - - private final List lines = new ArrayList<>(); - - public DiagramDescription getDescription() { - return new DiagramDescription("(Help)"); - } - - public Help(UmlSource source) { - super(source, UmlDiagramType.HELP, null); - } - - @Override - public ImageBuilder createImageBuilder(FileFormatOption fileFormatOption) throws IOException { - return super.createImageBuilder(fileFormatOption).annotations(false); - } - - @Override - protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormat) - throws IOException { - final Display display = Display.create(lines); - final UFont font = UFont.serif(16); - final FontConfiguration fontConfiguration = FontConfiguration.blackBlueTrue(font); - final Sheet sheet = getSkinParam().sheet(fontConfiguration, HorizontalAlignment.LEFT, CreoleMode.FULL) - .createSheet(display); - final SheetBlock1 sheetBlock = new SheetBlock1(sheet, LineBreakStrategy.NONE, 0); - return createImageBuilder(fileFormat).drawable(sheetBlock).write(os); - } - - public void add(CharSequence line) { - this.lines.add(line); - } - - @Override - public ClockwiseTopRightBottomLeft getDefaultMargins() { - return ClockwiseTopRightBottomLeft.same(0); - } - - @Override - protected TextBlock getTextBlock() { - throw new UnsupportedOperationException(); - } - -} diff --git a/src/net/sourceforge/plantuml/help/HelpFactory.java b/src/net/sourceforge/plantuml/help/HelpFactory.java deleted file mode 100644 index cdf306704..000000000 --- a/src/net/sourceforge/plantuml/help/HelpFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ======================================================================== - * 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.help; - -import java.util.List; -import java.util.Map; - -import net.sourceforge.plantuml.command.Command; -import net.sourceforge.plantuml.command.PSystemCommandFactory; -import net.sourceforge.plantuml.core.UmlSource; - -public class HelpFactory extends PSystemCommandFactory { - - @Override - public Help createEmptyDiagram(UmlSource source, Map skinParam) { - return new Help(source); - } - - @Override - protected void initCommandsList(List cmds) { - cmds.add(new CommandHelp()); - cmds.add(new CommandHelpColor()); - cmds.add(new CommandHelpFont()); - cmds.add(new CommandHelpKeyword()); - cmds.add(new CommandHelpSkinparam()); - cmds.add(new CommandHelpType()); - cmds.add(new CommandHelpTheme()); - } - -} diff --git a/src/net/sourceforge/plantuml/klimt/drawing/AbstractCommonUGraphic.java b/src/net/sourceforge/plantuml/klimt/drawing/AbstractCommonUGraphic.java index cdcfdbe2e..aad503df0 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/AbstractCommonUGraphic.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/AbstractCommonUGraphic.java @@ -63,25 +63,27 @@ public abstract class AbstractCommonUGraphic implements UGraphic { private HColor color = HColors.none(); private boolean enlargeClip = false; - private /*final*/ StringBounder stringBounder; + private final StringBounder stringBounder; private UTranslate translate = UTranslate.none(); - private /*final*/ ColorMapper colorMapper; + private /* final */ ColorMapper colorMapper; private UClip clip; - private /*final*/ HColor defaultBackground; + private /* final */ HColor defaultBackground; - public void basicCopy(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) { + protected AbstractCommonUGraphic(StringBounder stringBounder) { + this.stringBounder = stringBounder; + } + + public void basicCopy(HColor defaultBackground, ColorMapper colorMapper) { this.colorMapper = colorMapper; this.defaultBackground = Objects.requireNonNull(defaultBackground); - this.stringBounder = stringBounder; } protected void basicCopy(AbstractCommonUGraphic other) { this.defaultBackground = Objects.requireNonNull(other.defaultBackground); this.enlargeClip = other.enlargeClip; this.colorMapper = other.colorMapper; - this.stringBounder = other.stringBounder; this.translate = other.translate; this.clip = other.clip; @@ -94,7 +96,6 @@ public abstract class AbstractCommonUGraphic implements UGraphic { protected abstract AbstractCommonUGraphic copyUGraphic(); - @Override public HColor getDefaultBackground() { return defaultBackground; diff --git a/src/net/sourceforge/plantuml/klimt/drawing/AbstractUGraphic.java b/src/net/sourceforge/plantuml/klimt/drawing/AbstractUGraphic.java index a45d773dd..3389f693c 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/AbstractUGraphic.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/AbstractUGraphic.java @@ -37,7 +37,6 @@ package net.sourceforge.plantuml.klimt.drawing; import java.util.HashMap; import java.util.Map; -import java.util.Objects; import net.atmp.SpecialText; import net.sourceforge.plantuml.activitydiagram3.ftile.CenteredText; @@ -67,10 +66,10 @@ import net.sourceforge.plantuml.klimt.shape.URectangle; import net.sourceforge.plantuml.klimt.shape.UText; public abstract class AbstractUGraphic extends AbstractCommonUGraphic { - // ::remove file when __HAXE__ + // ::remove file when __HAXE__ - private /*final*/ O graphic; - private /*final*/ MinMaxMutable minmax; + private /* final */ O graphic; + private /* final */ MinMaxMutable minmax; // It would be nice to do something like this but not sure how: // Map, UDriver> @@ -78,9 +77,12 @@ public abstract class AbstractUGraphic extends AbstractCommonUGraphic { // https://stackoverflow.com/questions/416540/java-map-with-values-limited-by-keys-type-parameter private final Map, UDriver> drivers = new HashMap<>(); - public void copy(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, O graphic) { - basicCopy(defaultBackground, colorMapper, stringBounder); - // super(Objects.requireNonNull(defaultBackground), colorMapper, stringBounder); + protected AbstractUGraphic(StringBounder stringBounder) { + super(stringBounder); + } + + public void copy(HColor defaultBackground, ColorMapper colorMapper, O graphic) { + basicCopy(defaultBackground, colorMapper); this.graphic = graphic; this.minmax = MinMaxMutable.getEmpty(true); } @@ -91,7 +93,6 @@ public abstract class AbstractUGraphic extends AbstractCommonUGraphic { this.minmax = other.minmax; } - protected final O getGraphicObject() { return graphic; } diff --git a/src/net/sourceforge/plantuml/klimt/drawing/UGraphicNull.java b/src/net/sourceforge/plantuml/klimt/drawing/UGraphicNull.java index 83450f236..fe1942c81 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/UGraphicNull.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/UGraphicNull.java @@ -53,11 +53,13 @@ public class UGraphicNull extends AbstractUGraphic implements EnsureVisi } private UGraphicNull(UGraphicNull other) { + super(FileFormat.PNG.getDefaultStringBounder()); copy(other); } public UGraphicNull() { - copy(HColors.BLACK, ColorMapper.IDENTITY, FileFormat.PNG.getDefaultStringBounder(), "foo"); + super(FileFormat.PNG.getDefaultStringBounder()); + copy(HColors.BLACK, ColorMapper.IDENTITY, "foo"); } @Override diff --git a/src/net/sourceforge/plantuml/klimt/drawing/debug/UGraphicDebug.java b/src/net/sourceforge/plantuml/klimt/drawing/debug/UGraphicDebug.java index b1d4bcc24..d55eb118e 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/debug/UGraphicDebug.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/debug/UGraphicDebug.java @@ -80,13 +80,14 @@ public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContain @Override protected AbstractCommonUGraphic copyUGraphic() { - final UGraphicDebug result = new UGraphicDebug(this, output, scaleFactor, dim, svgLinkTarget, hoverPathColorRGB, seed, - preserveAspectRatio); + final UGraphicDebug result = new UGraphicDebug(this, output, scaleFactor, dim, svgLinkTarget, hoverPathColorRGB, + seed, preserveAspectRatio); return result; } private UGraphicDebug(UGraphicDebug other, List output, double scaleFactor, XDimension2D dim, String svgLinkTarget, String hoverPathColorRGB, long seed, String preserveAspectRatio) { + super(other.getStringBounder()); basicCopy(other); this.output = output; this.scaleFactor = scaleFactor; @@ -99,7 +100,8 @@ public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContain public UGraphicDebug(double scaleFactor, XDimension2D dim, String svgLinkTarget, String hoverPathColorRGB, long seed, String preserveAspectRatio) { - basicCopy(HColors.WHITE, ColorMapper.IDENTITY, new StringBounderDebug()); + super(new StringBounderDebug()); + basicCopy(HColors.WHITE, ColorMapper.IDENTITY); this.output = new ArrayList<>(); this.scaleFactor = scaleFactor; this.dim = dim; diff --git a/src/net/sourceforge/plantuml/klimt/drawing/eps/UGraphicEps.java b/src/net/sourceforge/plantuml/klimt/drawing/eps/UGraphicEps.java index 9f94e321c..b1337902c 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/eps/UGraphicEps.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/eps/UGraphicEps.java @@ -67,6 +67,7 @@ public class UGraphicEps extends AbstractUGraphic implements ClipCo } protected UGraphicEps(UGraphicEps other) { + super(other.getStringBounder()); copy(other); this.strategyTOBEREMOVED = other.strategyTOBEREMOVED; register(); @@ -74,7 +75,8 @@ public class UGraphicEps extends AbstractUGraphic implements ClipCo public UGraphicEps(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, EpsStrategy strategy) { - copy(defaultBackground, colorMapper, stringBounder, strategy.creatEpsGraphics()); + super(stringBounder); + copy(defaultBackground, colorMapper, strategy.creatEpsGraphics()); this.strategyTOBEREMOVED = strategy; register(); } diff --git a/src/net/sourceforge/plantuml/klimt/drawing/g2d/UGraphicG2d.java b/src/net/sourceforge/plantuml/klimt/drawing/g2d/UGraphicG2d.java index 706cb0efe..c9923239f 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/g2d/UGraphicG2d.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/g2d/UGraphicG2d.java @@ -112,6 +112,7 @@ public class UGraphicG2d extends AbstractUGraphic implements EnsureV } private UGraphicG2d(UGraphicG2d other) { + super(other.getStringBounder()); copy(other); // ::comment when __CORE__ this.hasAffineTransform = other.hasAffineTransform; @@ -141,7 +142,8 @@ public class UGraphicG2d extends AbstractUGraphic implements EnsureV // StringBounder stringBounder, Graphics2D g2d, // double dpiFactor, double dx, double dy, FileFormat format) { // ::done - copy(defaultBackground, colorMapper, stringBounder, g2d); + super(stringBounder); + copy(defaultBackground, colorMapper, g2d); this.format = format; this.dpiFactor = dpiFactor; if (dpiFactor != 1.0) diff --git a/src/net/sourceforge/plantuml/klimt/drawing/html5/UGraphicHtml5.java b/src/net/sourceforge/plantuml/klimt/drawing/html5/UGraphicHtml5.java index c6dfcb867..85d33e909 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/html5/UGraphicHtml5.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/html5/UGraphicHtml5.java @@ -56,7 +56,8 @@ public class UGraphicHtml5 extends AbstractUGraphic implements Clip } public UGraphicHtml5(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) { - copy(defaultBackground, colorMapper, stringBounder, new Html5Drawer()); + super(stringBounder); + copy(defaultBackground, colorMapper, new Html5Drawer()); registerDriver(URectangle.class, new DriverRectangleHtml5(this)); // registerDriver(UText.class, new DriverTextEps(imDummy, this, strategy)); ignoreShape(UText.class); diff --git a/src/net/sourceforge/plantuml/klimt/drawing/svg/DriverTextSvg.java b/src/net/sourceforge/plantuml/klimt/drawing/svg/DriverTextSvg.java index 43475c041..0c5a12cf7 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/svg/DriverTextSvg.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/svg/DriverTextSvg.java @@ -51,12 +51,14 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.shape.UText; public class DriverTextSvg implements UDriver { - // ::remove file when __HAXE__ + // ::remove file when __HAXE__ private final StringBounder stringBounder; private final ClipContainer clipContainer; public DriverTextSvg(StringBounder stringBounder, ClipContainer clipContainer) { + if (stringBounder == null) + System.err.println("stringBounder=" + stringBounder); this.stringBounder = stringBounder; this.clipContainer = clipContainer; } diff --git a/src/net/sourceforge/plantuml/klimt/drawing/svg/UGraphicSvg.java b/src/net/sourceforge/plantuml/klimt/drawing/svg/UGraphicSvg.java index 98b99277a..f66fa13ac 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/svg/UGraphicSvg.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/svg/UGraphicSvg.java @@ -60,9 +60,9 @@ import net.sourceforge.plantuml.klimt.shape.UText; import net.sourceforge.plantuml.url.Url; public class UGraphicSvg extends AbstractUGraphic implements ClipContainer { - // ::remove file when __HAXE__ + // ::remove file when __HAXE__ - private /* final */ boolean textAsPath; + private final boolean textAsPath; private /* final */ SvgOption option; public double dpiFactor() { @@ -71,21 +71,21 @@ public class UGraphicSvg extends AbstractUGraphic implements ClipCo @Override protected AbstractCommonUGraphic copyUGraphic() { - final UGraphicSvg result = new UGraphicSvg(); + final UGraphicSvg result = new UGraphicSvg(getStringBounder(), textAsPath); result.copy(this); - result.textAsPath = this.textAsPath; result.option = this.option; return result; } - private UGraphicSvg() { + private UGraphicSvg(StringBounder stringBounder, boolean textAsPath) { + super(stringBounder); + this.textAsPath = textAsPath; register(); } public static UGraphicSvg build(SvgOption option, boolean textAsPath, long seed, StringBounder stringBounder) { - final UGraphicSvg result = new UGraphicSvg(); - result.copy(option.getBackcolor(), option.getColorMapper(), stringBounder, new SvgGraphics(seed, option)); - result.textAsPath = textAsPath; + final UGraphicSvg result = new UGraphicSvg(stringBounder, textAsPath); + result.copy(option.getBackcolor(), option.getColorMapper(), new SvgGraphics(seed, option)); result.option = option; return result; } diff --git a/src/net/sourceforge/plantuml/klimt/drawing/tikz/UGraphicTikz.java b/src/net/sourceforge/plantuml/klimt/drawing/tikz/UGraphicTikz.java index 9a2be5593..89c345744 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/tikz/UGraphicTikz.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/tikz/UGraphicTikz.java @@ -61,7 +61,8 @@ public class UGraphicTikz extends AbstractUGraphic implements Clip public UGraphicTikz(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, double scale, boolean withPreamble) { - copy(defaultBackground, colorMapper, stringBounder, new TikzGraphics(scale, withPreamble, colorMapper)); + super(stringBounder); + copy(defaultBackground, colorMapper, new TikzGraphics(scale, withPreamble, colorMapper)); register(); } @@ -72,6 +73,7 @@ public class UGraphicTikz extends AbstractUGraphic implements Clip } private UGraphicTikz(UGraphicTikz other) { + super(other.getStringBounder()); copy(other); register(); } diff --git a/src/net/sourceforge/plantuml/klimt/drawing/txt/UGraphicTxt.java b/src/net/sourceforge/plantuml/klimt/drawing/txt/UGraphicTxt.java index 8dacf15d3..9121c378e 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/txt/UGraphicTxt.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/txt/UGraphicTxt.java @@ -40,7 +40,6 @@ import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; -import net.sourceforge.plantuml.asciiart.TextStringBounder; import net.sourceforge.plantuml.asciiart.TranslatedCharArea; import net.sourceforge.plantuml.asciiart.UmlCharArea; import net.sourceforge.plantuml.asciiart.UmlCharAreaImpl; @@ -49,6 +48,7 @@ import net.sourceforge.plantuml.klimt.UShape; import net.sourceforge.plantuml.klimt.color.ColorMapper; import net.sourceforge.plantuml.klimt.color.HColors; import net.sourceforge.plantuml.klimt.drawing.AbstractCommonUGraphic; +import net.sourceforge.plantuml.klimt.drawing.debug.StringBounderDebug; import net.sourceforge.plantuml.klimt.font.FontStyle; import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.shape.UImage; @@ -56,7 +56,7 @@ import net.sourceforge.plantuml.klimt.shape.UText; import net.sourceforge.plantuml.security.SecurityUtils; public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer { - // ::remove folder when __HAXE__ + // ::remove folder when __HAXE__ // ::remove folder when __CORE__ private final UmlCharArea charArea; @@ -68,12 +68,14 @@ public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer } private UGraphicTxt(UGraphicTxt other) { + super(other.getStringBounder()); basicCopy(other); this.charArea = other.charArea; } public UGraphicTxt() { - basicCopy(HColors.BLACK, ColorMapper.IDENTITY, new TextStringBounder()); + super(new StringBounderDebug()); + basicCopy(HColors.BLACK, ColorMapper.IDENTITY); this.charArea = new UmlCharAreaImpl(); } diff --git a/src/net/sourceforge/plantuml/klimt/drawing/visio/UGraphicVdx.java b/src/net/sourceforge/plantuml/klimt/drawing/visio/UGraphicVdx.java index e973627df..32e012f05 100644 --- a/src/net/sourceforge/plantuml/klimt/drawing/visio/UGraphicVdx.java +++ b/src/net/sourceforge/plantuml/klimt/drawing/visio/UGraphicVdx.java @@ -62,7 +62,8 @@ public class UGraphicVdx extends AbstractUGraphic implements Clip } public UGraphicVdx(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) { - copy(defaultBackground, colorMapper, stringBounder, new VisioGraphics()); + super(stringBounder); + copy(defaultBackground, colorMapper, new VisioGraphics()); register(); } @@ -73,6 +74,7 @@ public class UGraphicVdx extends AbstractUGraphic implements Clip } private UGraphicVdx(UGraphicVdx other) { + super(other.getStringBounder()); copy(other); register(); } diff --git a/test/net/sourceforge/plantuml/help/HelpTest.java b/test/net/sourceforge/plantuml/help/HelpTest.java deleted file mode 100644 index 5183ba99f..000000000 --- a/test/net/sourceforge/plantuml/help/HelpTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.sourceforge.plantuml.help; - -import static net.sourceforge.plantuml.test.PlantUmlTestUtils.exportDiagram; -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; - -class HelpTest { - - @Test - public void test_help_themes() throws Exception { - - final String output = exportDiagram( - "@startuml", - "help themes", - "@enduml" - ).asString(); - - assertThat(output) - .startsWith("Help on themes") - .contains("bluegray", "hacker"); - } -}