From b2e2a2bbcd7ac5ea647cd24970dddbe8a8cf75f2 Mon Sep 17 00:00:00 2001 From: The-Lum <86879521+The-Lum@users.noreply.github.com> Date: Tue, 18 Oct 2022 20:00:25 +0000 Subject: [PATCH] add support for `MetaClass`, `Stereotype` in class --- skin/plantuml.skin | 12 ++++++++++++ .../classdiagram/command/CommandCreateClass.java | 2 +- .../command/CommandCreateClassMultilines.java | 2 +- .../command/CommandHideShowByGender.java | 8 ++++++++ .../classdiagram/command/CommandLinkLollipop.java | 2 +- .../sourceforge/plantuml/cucadiagram/LeafType.java | 6 ++++-- src/net/sourceforge/plantuml/style/SName.java | 2 ++ .../plantuml/svek/image/EntityImageClassHeader.java | 8 ++++++++ 8 files changed, 37 insertions(+), 5 deletions(-) diff --git a/skin/plantuml.skin b/skin/plantuml.skin index a99142a1a..e4ba76e7c 100644 --- a/skin/plantuml.skin +++ b/skin/plantuml.skin @@ -213,6 +213,12 @@ spot { spotException { BackgroundColor #D94321 } + spotMetaClass { + BackgroundColor #CCCCCC + } + spotStereotype { + BackgroundColor #FF77FF + } } @@ -573,6 +579,12 @@ spot { spotException { BackgroundColor #7D0000 } + spotMetaClass { + BackgroundColor #7C7C7C + } + spotStereotype { + BackgroundColor #890089 + } } diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java index 13010c4e0..cb6908833 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java @@ -80,7 +80,7 @@ public class CommandCreateClass extends SingleLineCommand2 { private static IRegex getRegexConcat() { return RegexConcat.build(CommandCreateClass.class.getName(), RegexLeaf.start(), // new RegexLeaf("TYPE", // - "(interface|enum|annotation|abstract[%s]+class|static[%s]+class|abstract|class|entity|circle|diamond|protocol|struct|exception)"), // + "(interface|enum|annotation|abstract[%s]+class|static[%s]+class|abstract|class|entity|circle|diamond|protocol|struct|exception|metaclass|stereotype)"), // RegexLeaf.spaceOneOrMore(), // new RegexOr(// new RegexConcat(// diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java index 547d408fc..0bd8c2407 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java @@ -95,7 +95,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2 { gender = EntityGenderUtils.byEntityType(LeafType.STRUCT); } else if (arg1.equalsIgnoreCase("exception")) { gender = EntityGenderUtils.byEntityType(LeafType.EXCEPTION); + } else if (arg1.equalsIgnoreCase("metaclass")) { + gender = EntityGenderUtils.byEntityType(LeafType.METACLASS); + } else if (arg1.equalsIgnoreCase("stereotype")) { + gender = EntityGenderUtils.byEntityType(LeafType.STEREOTYPE); } else if (arg1.startsWith("<<")) { gender = EntityGenderUtils.byStereotype(arg1); } else { @@ -175,6 +179,10 @@ public class CommandHideShowByGender extends SingleLineCommand2 { gender = EntityGenderUtils.byEntityType(LeafType.STRUCT); } else if (arg1.equalsIgnoreCase("exception")) { gender = EntityGenderUtils.byEntityType(LeafType.EXCEPTION); + } else if (arg1.equalsIgnoreCase("metaclass")) { + gender = EntityGenderUtils.byEntityType(LeafType.METACLASS); + } else if (arg1.equalsIgnoreCase("stereotype")) { + gender = EntityGenderUtils.byEntityType(LeafType.STEREOTYPE); } else if (arg1.startsWith("<<")) { gender = EntityGenderUtils.byStereotype(arg1); } else { diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java index 082725f3c..f0f88ea31 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java @@ -97,7 +97,7 @@ final public class CommandLinkLollipop extends SingleLineCommand2