summaryrefslogtreecommitdiff
path: root/src/net/sourceforge/plantuml/classdiagram/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/sourceforge/plantuml/classdiagram/command')
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java67
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java6
2 files changed, 71 insertions, 2 deletions
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java
new file mode 100644
index 0000000..8f02c8c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificStereotype.java
@@ -0,0 +1,67 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.classdiagram.command;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+
+public class CommandHideShowSpecificStereotype extends SingleLineCommand2<CucaDiagram> {
+
+ public CommandHideShowSpecificStereotype() {
+ super(getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("COMMAND", "(hide|show)"), //
+ new RegexLeaf("[%s]+"), //
+ new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)"), //
+ new RegexLeaf("$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
+
+ final String stereotype = arg.get("STEREOTYPE", 0);
+ diagram.hideOrShow(new Stereotype(stereotype), arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+
+ return CommandExecutionResult.ok();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
index 6fe820f..48ccea2 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
@@ -86,11 +86,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
new RegexLeaf("ARROW_HEAD1", "([%s]+o|[#\\[<*+^]|[<\\[]\\|)?"), //
new RegexLeaf("ARROW_BODY1", "([-=.]+)"), //
new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,bold|,hidden|,norank)*)\\])?"),
+ "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("ARROW_DIRECTION", "(left|right|up|down|le?|ri?|up?|do?)?"), //
new RegexLeaf("INSIDE", "(?:(0|\\(0\\)|\\(0|0\\))(?=[-=.~]))?"), //
new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,bold|,hidden|,norank)*)\\])?"),
+ "(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("ARROW_BODY2", "([-=.]*)"), //
new RegexLeaf("ARROW_HEAD2", "(o[%s]+|[#\\]>*+^]|\\|[>\\]])?")), //
@@ -525,6 +525,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
link.goDotted();
} else if (s.equalsIgnoreCase("hidden")) {
link.goHidden();
+ } else if (s.equalsIgnoreCase("plain")) {
+ // Do nothing
} else if (s.equalsIgnoreCase("norank")) {
link.goNorank();
} else {