1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-26 23:06:30 +00:00

Make interactive SVG for Class diagrams

This commit is contained in:
Kir Ax 2021-03-14 18:56:57 +07:00
parent 28f253d992
commit e27667b683
3 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,7 @@ import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.AbstractEntityImage; import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGroupType;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -99,7 +100,9 @@ public class EntityImageBranch extends AbstractEntityImage {
} }
diams.setDeltaShadow(shadowing); diams.setDeltaShadow(shadowing);
ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
ug.apply(border).apply(back.bg()).apply(stroke).draw(diams); ug.apply(border).apply(back.bg()).apply(stroke).draw(diams);
ug.closeGroup();
} }
public ShapeType getShapeType() { public ShapeType getShapeType() {

View File

@ -74,6 +74,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; 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.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone; import net.sourceforge.plantuml.ugraphic.color.HColorNone;
@ -131,7 +132,10 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi
if (url != null) { if (url != null) {
ug.startUrl(url); ug.startUrl(url);
} }
ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
drawInternal(ug); drawInternal(ug);
ug.closeGroup();
if (url != null) { if (url != null) {
ug.closeUrl(); ug.closeUrl();

View File

@ -56,6 +56,7 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.UGroupType;
public class EntityImageLollipopInterface extends AbstractEntityImage { public class EntityImageLollipopInterface extends AbstractEntityImage {
@ -93,7 +94,9 @@ public class EntityImageLollipopInterface extends AbstractEntityImage {
if (url != null) { if (url != null) {
ug.startUrl(url); ug.startUrl(url);
} }
ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
ug.apply(new UStroke(1.5)).draw(circle); ug.apply(new UStroke(1.5)).draw(circle);
ug.closeGroup();
final Dimension2D dimDesc = desc.calculateDimension(ug.getStringBounder()); final Dimension2D dimDesc = desc.calculateDimension(ug.getStringBounder());
final double widthDesc = dimDesc.getWidth(); final double widthDesc = dimDesc.getWidth();