1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-16 18:25:11 +00:00

Merge pull request #489 from ioplker/master

Interactive SVG for Class and Object diagrams
This commit is contained in:
arnaudroques 2021-03-14 17:59:51 +01:00 committed by GitHub
commit 9152e7348d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 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.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() {

View File

@ -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();

View File

@ -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,10 @@ 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();

View File

@ -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() {

View File

@ -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() {