From e27667b6832fe0c04a65d3249dc22dedf79878e6 Mon Sep 17 00:00:00 2001 From: Kir Ax Date: Sun, 14 Mar 2021 18:56:57 +0700 Subject: [PATCH 1/3] Make interactive SVG for Class diagrams --- .../sourceforge/plantuml/svek/image/EntityImageBranch.java | 3 +++ src/net/sourceforge/plantuml/svek/image/EntityImageClass.java | 4 ++++ .../plantuml/svek/image/EntityImageLollipopInterface.java | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java index 4fd6a1f67..c15bdfae4 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.AbstractEntityImage; import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.ugraphic.UGraphic; +import net.sourceforge.plantuml.ugraphic.UGroupType; import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -99,7 +100,9 @@ public class EntityImageBranch extends AbstractEntityImage { } diams.setDeltaShadow(shadowing); + ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); ug.apply(border).apply(back.bg()).apply(stroke).draw(diams); + ug.closeGroup(); } public ShapeType getShapeType() { diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java index 694b62e70..37609bf49 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java @@ -74,6 +74,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphicStencil; import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; +import net.sourceforge.plantuml.ugraphic.UGroupType; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorNone; @@ -131,7 +132,10 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi if (url != null) { ug.startUrl(url); } + + ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); drawInternal(ug); + ug.closeGroup(); if (url != null) { ug.closeUrl(); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java index 6397d0f35..6937a5e80 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java @@ -56,6 +56,7 @@ import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; +import net.sourceforge.plantuml.ugraphic.UGroupType; public class EntityImageLollipopInterface extends AbstractEntityImage { @@ -93,7 +94,9 @@ public class EntityImageLollipopInterface extends AbstractEntityImage { if (url != null) { ug.startUrl(url); } + ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); ug.apply(new UStroke(1.5)).draw(circle); + ug.closeGroup(); final Dimension2D dimDesc = desc.calculateDimension(ug.getStringBounder()); final double widthDesc = dimDesc.getWidth(); From 869143866ff42b9993dfc0385cee3de622dae174 Mon Sep 17 00:00:00 2001 From: Kir Ax Date: Sun, 14 Mar 2021 23:37:50 +0700 Subject: [PATCH 2/3] Make interactive SVG for Object diagrams --- src/net/sourceforge/plantuml/svek/image/EntityImageMap.java | 5 +++++ .../sourceforge/plantuml/svek/image/EntityImageObject.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java index d13bcd1cc..a6b45e88f 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java @@ -73,6 +73,7 @@ import net.sourceforge.plantuml.ugraphic.ULayoutGroup; import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; +import net.sourceforge.plantuml.ugraphic.UGroupType; import net.sourceforge.plantuml.ugraphic.color.HColor; public class EntityImageMap extends AbstractEntityImage implements Stencil, WithPorts { @@ -151,6 +152,8 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With } final UStroke stroke = getStroke(); + + ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); ug.apply(stroke).draw(rect); final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder())); @@ -167,6 +170,8 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With if (url != null) { ug.closeUrl(); } + + ug.closeGroup(); } private UStroke getStroke() { diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java index a1c1c4d64..e0bd2da3c 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java @@ -72,6 +72,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; +import net.sourceforge.plantuml.ugraphic.UGroupType; public class EntityImageObject extends AbstractEntityImage implements Stencil { @@ -156,6 +157,8 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil { } final UStroke stroke = getStroke(); + + ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); ug.apply(stroke).draw(rect); final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder())); @@ -171,6 +174,8 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil { if (url != null) { ug.closeUrl(); } + + ug.closeGroup(); } private UStroke getStroke() { From 8b99027a833ae3888dbadd331c9afa274e78922b Mon Sep 17 00:00:00 2001 From: Kir Ax Date: Sun, 14 Mar 2021 23:40:04 +0700 Subject: [PATCH 3/3] Add empty line between code blocks --- .../plantuml/svek/image/EntityImageLollipopInterface.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java index 6937a5e80..1a4b6ed1f 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java @@ -94,6 +94,7 @@ public class EntityImageLollipopInterface extends AbstractEntityImage { if (url != null) { ug.startUrl(url); } + ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); ug.apply(new UStroke(1.5)).draw(circle); ug.closeGroup();