mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-25 14:27:33 +00:00
Merge pull request #925 from blipper/master
Preserve element group structure in svg output to allow more intelligent post-processing
This commit is contained in:
commit
7fca076240
@ -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<UGroupType, String> typeIdents) {
|
||||
ug.startGroup(typeIdents);
|
||||
}
|
||||
|
||||
public void closeGroup() {
|
||||
|
@ -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) {
|
||||
|
@ -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<UGroupType, String> 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();
|
||||
|
@ -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<UGroupType, String> 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();
|
||||
}
|
||||
|
@ -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<UGroupType, String> 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();
|
||||
|
||||
|
@ -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<UGroupType, String> 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);
|
||||
|
@ -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<UGroupType, String> 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();
|
||||
|
||||
|
@ -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<UGroupType, String> 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()));
|
||||
|
@ -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<UGroupType, String> 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);
|
||||
|
@ -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<UGroupType, String> 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()));
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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<UGroupType, String> 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();
|
||||
|
||||
|
@ -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<UGroupType, String> 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<UGroupType, String> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<UGroupType, String> typeIdents) {
|
||||
}
|
||||
|
||||
public void closeGroup() {
|
||||
|
@ -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<UGroupType, String> typeIdents);
|
||||
|
||||
public void closeGroup();
|
||||
|
||||
|
@ -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<UGroupType, String> 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();
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
|
@ -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<SvgGraphics> implements ClipCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startGroup(UGroupType type, String ident) {
|
||||
getGraphicObject().startGroup(type, ident);
|
||||
public void startGroup(Map<UGroupType, String> typeIdents) {
|
||||
getGraphicObject().startGroup(typeIdents);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user