From 2b337ac940996904fa2f41d3135728b63986fcf0 Mon Sep 17 00:00:00 2001 From: Bob Jacobsen Date: Thu, 2 Jun 2022 14:50:03 -0400 Subject: [PATCH] add support for Protocol and Struct in class diagram --- .../classdiagram/command/CommandCreateClass.java | 8 ++++---- .../command/CommandCreateClassMultilines.java | 8 ++++---- .../command/CommandHideShowByGender.java | 10 +++++++--- .../command/CommandLinkLollipop.java | 8 ++++---- .../plantuml/cucadiagram/LeafType.java | 13 ++++++++----- src/net/sourceforge/plantuml/style/SName.java | 14 ++++++++------ .../svek/image/EntityImageClassHeader.java | 16 ++++++++++++---- 7 files changed, 47 insertions(+), 30 deletions(-) diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java index 9c9c34528..980d3166f 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java @@ -5,12 +5,12 @@ * (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 @@ -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|abstract|class|entity|circle|diamond)"), // + "(interface|enum|annotation|abstract[%s]+class|abstract|class|entity|circle|diamond|protocol|struct)"), // 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 4cca42eb4..f011d49d7 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java @@ -5,12 +5,12 @@ * (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 @@ -92,7 +92,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2 { gender = EntityGenderUtils.byEntityType(LeafType.ABSTRACT_CLASS); } else if (arg1.equalsIgnoreCase("annotation")) { gender = EntityGenderUtils.byEntityType(LeafType.ANNOTATION); + } else if (arg1.equalsIgnoreCase("protocol")) { + gender = EntityGenderUtils.byEntityType(LeafType.PROTOCOL); + } else if (arg1.equalsIgnoreCase("struct")) { + gender = EntityGenderUtils.byEntityType(LeafType.STRUCT); } 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 30eb510f5..d9b1bd146 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java @@ -5,12 +5,12 @@ * (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 @@ -95,7 +95,7 @@ final public class CommandLinkLollipop extends SingleLineCommand2