From 416325e6c82acba6254258f9f6120abec8e3bc7d Mon Sep 17 00:00:00 2001 From: Martin Ross Date: Tue, 15 Feb 2022 13:11:51 -0500 Subject: [PATCH] Preserve element group structure in svg output to allow more intelligent post-processing --- .../plantuml/graphic/UGraphicDelegator.java | 15 ++++----- .../sourceforge/plantuml/svek/Cluster.java | 14 ++++++--- .../sourceforge/plantuml/svek/SvekLine.java | 20 ++++++------ .../svek/image/EntityImageBranch.java | 17 ++++++---- .../plantuml/svek/image/EntityImageClass.java | 16 +++++++--- .../svek/image/EntityImageDescription.java | 18 +++++------ .../image/EntityImageLollipopInterface.java | 16 +++++++--- .../plantuml/svek/image/EntityImageMap.java | 16 +++++++--- .../plantuml/svek/image/EntityImageNote.java | 16 +++++++--- .../svek/image/EntityImageObject.java | 17 +++++++--- .../plantuml/svek/image/EntityImageState.java | 11 ++++--- .../svek/image/EntityImageUseCase.java | 16 +++++++--- .../sourceforge/plantuml/svg/SvgGraphics.java | 31 ++++++++++++------- .../ugraphic/AbstractCommonUGraphic.java | 11 ++++--- .../plantuml/ugraphic/UGraphic.java | 11 ++++--- .../plantuml/ugraphic/UGraphicNo.java | 15 ++++----- .../plantuml/ugraphic/UGroupType.java | 9 +++--- .../plantuml/ugraphic/svg/UGraphicSvg.java | 11 ++++--- 18 files changed, 168 insertions(+), 112 deletions(-) diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java index 1f70ba533..479fecf78 100644 --- a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java +++ b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.graphic; @@ -45,6 +45,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColor; import java.io.IOException; import java.io.OutputStream; +import java.util.Map; public abstract class UGraphicDelegator implements UGraphic { @@ -78,7 +79,7 @@ public abstract class UGraphicDelegator implements UGraphic { public ColorMapper getColorMapper() { return ug.getColorMapper(); } - + @Override public void startUrl(Url url) { ug.startUrl(url); @@ -89,8 +90,8 @@ public abstract class UGraphicDelegator implements UGraphic { ug.closeUrl(); } - public void startGroup(UGroupType type, String ident) { - ug.startGroup(type, ident); + public void startGroup(Map typeIdents) { + ug.startGroup(typeIdents); } public void closeGroup() { diff --git a/src/net/sourceforge/plantuml/svek/Cluster.java b/src/net/sourceforge/plantuml/svek/Cluster.java index 8d27ef2d3..d2580d9c1 100644 --- a/src/net/sourceforge/plantuml/svek/Cluster.java +++ b/src/net/sourceforge/plantuml/svek/Cluster.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -32,7 +32,7 @@ * Original Author: Arnaud Roques * Contribution : Hisashi Miyashita * - * + * */ package net.sourceforge.plantuml.svek; @@ -80,6 +80,7 @@ import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.image.EntityImageState; import net.sourceforge.plantuml.ugraphic.UComment; import net.sourceforge.plantuml.ugraphic.UGraphic; +import net.sourceforge.plantuml.ugraphic.UGroupType; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -347,6 +348,9 @@ public class Cluster implements Moveable { } + + ug.startGroup(Collections.singletonMap(UGroupType.ID, "cluster_" + fullName)); + final Url url = group.getUrl99(); if (url != null) ug.startUrl(url); @@ -411,8 +415,8 @@ public class Cluster implements Moveable { } finally { if (url != null) ug.closeUrl(); + ug.closeGroup(); } - } static public UStroke getStrokeInternal(IGroup group, ISkinParam skinParam, Style style) { diff --git a/src/net/sourceforge/plantuml/svek/SvekLine.java b/src/net/sourceforge/plantuml/svek/SvekLine.java index 55fa764c0..da6adf38b 100644 --- a/src/net/sourceforge/plantuml/svek/SvekLine.java +++ b/src/net/sourceforge/plantuml/svek/SvekLine.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -31,17 +31,13 @@ * * Original Author: Arnaud Roques * - * + * */ package net.sourceforge.plantuml.svek; import java.awt.geom.Dimension2D; import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import java.util.Set; +import java.util.*; import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.ColorParam; @@ -623,8 +619,10 @@ public class SvekLine implements Moveable, Hideable, GuideLine { return; ug.draw(link.commentForSvg()); - ug.startGroup(UGroupType.CLASS, - "link " + link.getEntity1().getCode() + " " + link.getEntity2().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "link " + link.getEntity1().getCode() + " " + link.getEntity2().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "link_" + link.getEntity1().getCode() + "_" + link.getEntity2().getCode()); + ug.startGroup(typeIDent); double x = 0; double y = 0; final Url url = link.getUrl(); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java index 309c8987b..8eb03cd6d 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,12 +30,15 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; @@ -101,8 +104,10 @@ public class EntityImageBranch extends AbstractEntityImage { } diams.setDeltaShadow(shadowing); - - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); ug.apply(border).apply(back.bg()).apply(stroke).draw(diams); ug.closeGroup(); } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java index fe36ba3b8..d298d98a6 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,13 +30,16 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.CornerParam; @@ -135,7 +138,10 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi if (url != null) ug.startUrl(url); - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); drawInternal(ug); ug.closeGroup(); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java index 2da5f0f9a..12c97e68c 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -31,16 +31,13 @@ * * Original Author: Arnaud Roques * Modified by : Arno Peterson - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; -import java.util.Collection; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; +import java.util.*; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Guillemet; @@ -286,7 +283,10 @@ public class EntityImageDescription extends AbstractEntityImage { final public void drawU(UGraphic ug) { ug.draw(new UComment("entity " + getEntity().getCodeGetName())); - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); if (url != null) ug.startUrl(url); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java index bacbffa00..be6d597eb 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,12 +30,15 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; @@ -131,7 +134,10 @@ public class EntityImageLollipopInterface extends AbstractEntityImage { if (url != null) ug.startUrl(url); - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); ug.apply(getUStroke()).draw(circle); ug.closeGroup(); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java index 786326444..34c40ccd1 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,12 +30,15 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.CornerParam; @@ -193,7 +196,10 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With if (url != null) ug.startUrl(url); - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); ug.apply(stroke).draw(rect); final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder())); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java index 0e1ae46aa..11fe8f86b 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; @@ -38,6 +38,9 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; import java.awt.geom.Line2D; import java.awt.geom.Point2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import net.sourceforge.plantuml.AlignmentParam; @@ -217,7 +220,10 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil { final public void drawU(UGraphic ug) { final Url url = getEntity().getUrl99(); - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); if (url != null) ug.startUrl(url); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java index 3bfc80662..580099a2e 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,12 +30,15 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.CornerParam; @@ -195,7 +198,11 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W if (url != null) ug.startUrl(url); - ug.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); ug.apply(stroke).draw(rect); final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder())); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageState.java b/src/net/sourceforge/plantuml/svek/image/EntityImageState.java index 93e4e8fab..8c6e4cd41 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageState.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageState.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,12 +30,13 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; +import java.util.Collections; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FontParam; @@ -102,7 +103,7 @@ public class EntityImageState extends EntityImageStateCommon { } final public void drawU(UGraphic ug) { - ug.startGroup(UGroupType.ID, getEntity().getIdent().toString(".")); + ug.startGroup(Collections.singletonMap(UGroupType.ID, getEntity().getIdent().toString("."))); if (url != null) ug.startUrl(url); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java index cf34ae432..dcbfaef5c 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,13 +30,16 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; import java.awt.geom.Point2D; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; @@ -159,7 +162,10 @@ public class EntityImageUseCase extends AbstractEntityImage { ug = ug.apply(backcolor.bg()); final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse()); - ug2.startGroup(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + Map typeIDent = new HashMap<>(); + typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); + typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); + ug.startGroup(typeIDent); ellipse.drawU(ug2); ug2.closeGroup(); diff --git a/src/net/sourceforge/plantuml/svg/SvgGraphics.java b/src/net/sourceforge/plantuml/svg/SvgGraphics.java index 7676f84a4..19e5594b3 100644 --- a/src/net/sourceforge/plantuml/svg/SvgGraphics.java +++ b/src/net/sourceforge/plantuml/svg/SvgGraphics.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svg; @@ -992,9 +992,11 @@ public class SvgGraphics { // javascript: security issue if (SecurityUtils.ignoreThisLink(url)) return; + Log.info("openLink=" + title); - if (pendingAction.size() > 0) - closeLink(); + +// if (pendingAction.size() > 0) +// closeLink(); pendingAction.add(0, (Element) document.createElement("a")); pendingAction.get(0).setAttribute("target", target); @@ -1039,13 +1041,18 @@ public class SvgGraphics { } } - public void startGroup(UGroupType type, String ident) { - if (type == UGroupType.ID) { + public void startGroup(Map typeIdents) { + Log.debug("startGroup=" + typeIdents) ; + if (!typeIdents.isEmpty()) pendingAction.add(0, (Element) document.createElement("g")); - pendingAction.get(0).setAttribute("id", ident); - } else if (INTERACTIVE && type == UGroupType.CLASS) { - pendingAction.add(0, (Element) document.createElement("g")); - pendingAction.get(0).setAttribute("class", ident); + for (Map.Entry typeIdent : typeIdents.entrySet()) { + if (typeIdent.getKey() == UGroupType.ID) { + pendingAction.get(0).setAttribute("id", typeIdent.getValue()); + } + + if (INTERACTIVE && typeIdent.getKey() == UGroupType.CLASS) { + pendingAction.get(0).setAttribute("class", typeIdent.getValue()); + } } } diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java b/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java index c52cf9626..ef748737c 100644 --- a/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java +++ b/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,11 +30,12 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.ugraphic; +import java.util.Map; import java.util.Objects; import net.sourceforge.plantuml.Url; @@ -181,7 +182,7 @@ public abstract class AbstractCommonUGraphic implements UGraphic { public void closeUrl() { } - public void startGroup(UGroupType type, String ident) { + public void startGroup(Map typeIdents) { } public void closeGroup() { diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java index 4c1254941..c89006d5b 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java +++ b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.ugraphic; @@ -42,6 +42,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColor; import java.io.IOException; import java.io.OutputStream; +import java.util.Map; public interface UGraphic { @@ -59,7 +60,7 @@ public interface UGraphic { public void closeUrl(); - public void startGroup(UGroupType type, String ident); + public void startGroup(Map typeIdents); public void closeGroup(); diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java index 32da15c41..d6b09e736 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java +++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.ugraphic; @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import java.io.IOException; import java.io.OutputStream; +import java.util.Map; public abstract class UGraphicNo implements UGraphic { @@ -62,13 +63,13 @@ public abstract class UGraphicNo implements UGraphic { // // Implement UGraphic // - + @Override final public void startUrl(Url url) { } @Override - public void startGroup(UGroupType type, String ident) { + public void startGroup(Map typeIdents) { } @Override @@ -88,7 +89,7 @@ public abstract class UGraphicNo implements UGraphic { public HColor getDefaultBackground() { return HColorUtils.BLACK; } - + @Override public UParam getParam() { return new UParamNull(); diff --git a/src/net/sourceforge/plantuml/ugraphic/UGroupType.java b/src/net/sourceforge/plantuml/ugraphic/UGroupType.java index fad708b5e..6621f3542 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UGroupType.java +++ b/src/net/sourceforge/plantuml/ugraphic/UGroupType.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -30,12 +30,11 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.ugraphic; public enum UGroupType { ID, CLASS - } diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java index e19d1a4ac..a594404d5 100644 --- a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java +++ b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -37,6 +37,7 @@ package net.sourceforge.plantuml.ugraphic.svg; import java.awt.geom.Dimension2D; import java.io.IOException; import java.io.OutputStream; +import java.util.Map; import javax.xml.transform.TransformerException; @@ -157,8 +158,8 @@ public class UGraphicSvg extends AbstractUGraphic implements ClipCo } @Override - public void startGroup(UGroupType type, String ident) { - getGraphicObject().startGroup(type, ident); + public void startGroup(Map typeIdents) { + getGraphicObject().startGroup(typeIdents); } @Override