1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 21:15:09 +00:00
This commit is contained in:
Arnaud Roques 2022-02-16 19:59:44 +01:00
parent a250727e18
commit 1fd8715ec9
50 changed files with 97 additions and 118 deletions

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
public enum GraphicPosition { public enum GraphicPosition {
BOTTOM, BACKGROUND_CORNER_BOTTOM_RIGHT, BACKGROUND_CORNER_TOP_RIGHT BOTTOM, BACKGROUND_CORNER_BOTTOM_RIGHT, BACKGROUND_CORNER_TOP_RIGHT

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
public interface Line extends TextBlock { public interface Line extends TextBlock {
HorizontalAlignment getHorizontalAlignment(); HorizontalAlignment getHorizontalAlignment();

View File

@ -108,9 +108,9 @@ public class SkinParameter {
ColorParam.hexagonBackground, ColorParam.hexagonBorder, FontParam.HEXAGON, FontParam.HEXAGON_STEREOTYPE, ColorParam.hexagonBackground, ColorParam.hexagonBorder, FontParam.HEXAGON, FontParam.HEXAGON_STEREOTYPE,
CornerParam.hexagon, LineParam.hexagonBorder); CornerParam.hexagon, LineParam.hexagonBorder);
public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON", public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON", ColorParam.personBackground,
ColorParam.personBackground, ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE, ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE, CornerParam.person,
CornerParam.person, LineParam.personBorder); LineParam.personBorder);
public static final SkinParameter ARCHIMATE = new SkinParameter(SName.archimate, "ARCHIMATE", public static final SkinParameter ARCHIMATE = new SkinParameter(SName.archimate, "ARCHIMATE",
ColorParam.archimateBackground, ColorParam.archimateBorder, FontParam.ARCHIMATE, ColorParam.archimateBackground, ColorParam.archimateBorder, FontParam.ARCHIMATE,

View File

@ -64,7 +64,8 @@ public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBa
// if (cachedMinMax == null) { // if (cachedMinMax == null) {
// cachedMinMax = getMinMaxSlow(stringBounder); // cachedMinMax = getMinMaxSlow(stringBounder);
// } // }
// // assert cachedMinMax.toString().equals(getMinMaxSlow(stringBounder).toString()); // // assert
// cachedMinMax.toString().equals(getMinMaxSlow(stringBounder).toString());
// return cachedMinMax; // return cachedMinMax;
} }

View File

@ -56,8 +56,8 @@ public class TextBlockSprited extends AbstractTextBlock {
final double heightCircledCharacter = sprite.calculateDimension(stringBounder).getHeight(); final double heightCircledCharacter = sprite.calculateDimension(stringBounder).getHeight();
final Dimension2D dim = parent.calculateDimension(stringBounder); final Dimension2D dim = parent.calculateDimension(stringBounder);
return new Dimension2DDouble(dim.getWidth() + widthCircledCharacter, Math.max(heightCircledCharacter, return new Dimension2DDouble(dim.getWidth() + widthCircledCharacter,
dim.getHeight())); Math.max(heightCircledCharacter, dim.getHeight()));
} }
private double getCircledCharacterWithAndMargin(StringBounder stringBounder) { private double getCircledCharacterWithAndMargin(StringBounder stringBounder) {

View File

@ -61,8 +61,7 @@ public class TileImage extends AbstractTextBlock implements TextBlock {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug.apply(UTranslate.dy(vspace)) ug.apply(UTranslate.dy(vspace)).draw(new UImage(new PixelImage(image, AffineTransformType.TYPE_BILINEAR)));
.draw(new UImage(new PixelImage(image, AffineTransformType.TYPE_BILINEAR)));
} }
} }

View File

@ -35,6 +35,10 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGroupType; import net.sourceforge.plantuml.ugraphic.UGroupType;
@ -43,10 +47,6 @@ import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.ugraphic.color.HColor; 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 { public abstract class UGraphicDelegator implements UGraphic {
final private UGraphic ug; final private UGraphic ug;

View File

@ -60,7 +60,8 @@ class USymbolActor extends USymbolSimpleAbstract {
@Override @Override
protected TextBlock getDrawing(SymbolContext symbolContext) { protected TextBlock getDrawing(SymbolContext symbolContext) {
// final double deltaShadow = symbolContext.isShadowing() ? 4.0 : 0.0; // final double deltaShadow = symbolContext.isShadowing() ? 4.0 : 0.0;
// final SymbolContext tmp = symbolContext.withDeltaShadow(deltaShadow).withStroke(new UStroke(2)); // final SymbolContext tmp =
// symbolContext.withDeltaShadow(deltaShadow).withStroke(new UStroke(2));
return actorStyle.getTextBlock(symbolContext); return actorStyle.getTextBlock(symbolContext);
} }

View File

@ -58,7 +58,6 @@ class USymbolArtifact extends USymbol {
return SName.artifact; return SName.artifact;
} }
private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, double shadowing, private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, double shadowing,
double roundCorner) { double roundCorner) {

View File

@ -50,7 +50,6 @@ class USymbolBoundary extends USymbolSimpleAbstract {
return SName.boundary; return SName.boundary;
} }
@Override @Override
protected TextBlock getDrawing(SymbolContext symbolContext) { protected TextBlock getDrawing(SymbolContext symbolContext) {
return new Boundary(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0)); return new Boundary(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0));

View File

@ -58,7 +58,6 @@ class USymbolCard extends USymbol {
return SName.card; return SName.card;
} }
@Override @Override
public SkinParameter getSkinParameter() { public SkinParameter getSkinParameter() {
return skinParameter; return skinParameter;

View File

@ -67,7 +67,6 @@ class USymbolCloud extends USymbol {
return SName.cloud; return SName.cloud;
} }
private void drawCloud(UGraphic ug, double width, double height, double shadowing) { private void drawCloud(UGraphic ug, double width, double height, double shadowing) {
final UPath shape = getSpecificFrontierForCloud(width, height); final UPath shape = getSpecificFrontierForCloud(width, height);
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);

View File

@ -69,7 +69,6 @@ class USymbolCollections extends USymbol {
return SName.collections; return SName.collections;
} }
private void drawCollections(UGraphic ug, double width, double height, double shadowing, double roundCorner) { private void drawCollections(UGraphic ug, double width, double height, double shadowing, double roundCorner) {
final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection()) final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection())
.rounded(roundCorner); .rounded(roundCorner);

View File

@ -57,7 +57,6 @@ class USymbolComponent1 extends USymbol {
return SName.component; return SName.component;
} }
private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, double shadowing, private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, double shadowing,
double roundCorner) { double roundCorner) {

View File

@ -57,7 +57,6 @@ class USymbolComponent2 extends USymbol {
return SName.component; return SName.component;
} }
private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, double shadowing, private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, double shadowing,
double roundCorner) { double roundCorner) {

View File

@ -50,7 +50,6 @@ class USymbolControl extends USymbolSimpleAbstract {
return SName.control; return SName.control;
} }
@Override @Override
protected TextBlock getDrawing(final SymbolContext symbolContext) { protected TextBlock getDrawing(final SymbolContext symbolContext) {
return new Control(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0)); return new Control(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0));

View File

@ -60,7 +60,6 @@ class USymbolDatabase extends USymbol {
return SName.database; return SName.database;
} }
private void drawDatabase(UGraphic ug, double width, double height, double shadowing) { private void drawDatabase(UGraphic ug, double width, double height, double shadowing) {
final UPath shape = new UPath(); final UPath shape = new UPath();
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);

View File

@ -50,7 +50,6 @@ class USymbolEntityDomain extends USymbolSimpleAbstract {
return SName.entity; return SName.entity;
} }
@Override @Override
protected TextBlock getDrawing(final SymbolContext symbolContext) { protected TextBlock getDrawing(final SymbolContext symbolContext) {
return new EntityDomain(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0)); return new EntityDomain(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0));

View File

@ -61,7 +61,6 @@ class USymbolFile extends USymbol {
return SName.file; return SName.file;
} }
private void drawFile(UGraphic ug, double width, double height, double shadowing, double roundCorner) { private void drawFile(UGraphic ug, double width, double height, double shadowing, double roundCorner) {
final int cornersize = 10; final int cornersize = 10;
final Shadowable out; final Shadowable out;

View File

@ -83,7 +83,6 @@ public class USymbolFolder extends USymbol {
return sname; return sname;
} }
private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, double shadowing, private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, double shadowing,
double roundCorner) { double roundCorner) {

View File

@ -55,7 +55,6 @@ public class USymbolHexagon extends USymbol {
return SName.hexagon; return SName.hexagon;
} }
private final double marginY = 5; private final double marginY = 5;
@Override @Override

View File

@ -50,7 +50,6 @@ public class USymbolInterface extends USymbolSimpleAbstract {
return SName.interface_; return SName.interface_;
} }
@Override @Override
protected TextBlock getDrawing(SymbolContext symbolContext) { protected TextBlock getDrawing(SymbolContext symbolContext) {
return new CircleInterface2(symbolContext.getBackColor(), symbolContext.getForeColor(), return new CircleInterface2(symbolContext.getBackColor(), symbolContext.getForeColor(),

View File

@ -56,7 +56,6 @@ class USymbolLabel extends USymbol {
return SName.label; return SName.label;
} }
@Override @Override
public SkinParameter getSkinParameter() { public SkinParameter getSkinParameter() {
return skinParameter; return skinParameter;

View File

@ -63,7 +63,6 @@ class USymbolNode extends USymbol {
return SName.node; return SName.node;
} }
// public USymbolNode(HorizontalAlignment stereotypeAlignement) { // public USymbolNode(HorizontalAlignment stereotypeAlignement) {
// this.stereotypeAlignement = stereotypeAlignement; // this.stereotypeAlignement = stereotypeAlignement;
// } // }

View File

@ -57,7 +57,6 @@ class USymbolPerson extends USymbol {
return SName.person; return SName.person;
} }
private void drawHeadAndBody(UGraphic ug, double shadowing, Dimension2D dimBody, double headSize) { private void drawHeadAndBody(UGraphic ug, double shadowing, Dimension2D dimBody, double headSize) {
final UEllipse head = new UEllipse(headSize, headSize); final UEllipse head = new UEllipse(headSize, headSize);
final URectangle body = new URectangle(dimBody).rounded(headSize); final URectangle body = new URectangle(dimBody).rounded(headSize);

View File

@ -59,7 +59,6 @@ class USymbolQueue extends USymbol {
return SName.queue; return SName.queue;
} }
private final double dx = 5; private final double dx = 5;
private void drawQueue(UGraphic ug, double width, double height, double shadowing) { private void drawQueue(UGraphic ug, double width, double height, double shadowing) {

View File

@ -59,7 +59,6 @@ class USymbolStack extends USymbol {
return SName.stack; return SName.stack;
} }
private void drawQueue(UGraphic ug, double width, double height, double shadowing, double roundCorner) { private void drawQueue(UGraphic ug, double width, double height, double shadowing, double roundCorner) {
final double border = 15; final double border = 15;

View File

@ -53,7 +53,6 @@ class USymbolTogether extends USymbol {
return SName.storage; return SName.storage;
} }
@Override @Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) { final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
@ -62,7 +61,8 @@ class USymbolTogether extends USymbol {
@Override @Override
public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype, public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
final double width, final double height, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) { final double width, final double height, final SymbolContext symbolContext,
final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() { return new AbstractTextBlock() {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {

View File

@ -253,6 +253,8 @@ public class FromSkinparamToStyle {
final boolean complex = value.contains(";"); final boolean complex = value.contains(";");
if (complex) { if (complex) {
// System.err.println("key=" + key + " value=" + value); // System.err.println("key=" + key + " value=" + value);
if (value.startsWith(";"))
value = " " + value;
final StringTokenizer st = new StringTokenizer(value, ";"); final StringTokenizer st = new StringTokenizer(value, ";");
value = st.nextToken(); value = st.nextToken();
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
@ -272,6 +274,7 @@ public class FromSkinparamToStyle {
} }
} }
if (" ".equals(value) == false)
for (Data data : datas) for (Data data : datas)
addStyle(data.propertyName, ValueImpl.regular(value, counter), data.styleNames); addStyle(data.propertyName, ValueImpl.regular(value, counter), data.styleNames);

View File

@ -37,7 +37,13 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.*; import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -619,8 +625,9 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
return; return;
ug.draw(link.commentForSvg()); ug.draw(link.commentForSvg());
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "link " + link.getEntity1().getCode() + " " + link.getEntity2().getCode() + " selected"); typeIDent.put(UGroupType.CLASS,
"link " + link.getEntity1().getCode() + " " + link.getEntity2().getCode() + " selected");
typeIDent.put(UGroupType.ID, "link_" + link.getEntity1().getCode() + "_" + link.getEntity2().getCode()); typeIDent.put(UGroupType.ID, "link_" + link.getEntity1().getCode() + "_" + link.getEntity2().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);
double x = 0; double x = 0;

View File

@ -64,17 +64,16 @@ public class Circle {
return new Circle(p2, p1, p3); return new Circle(p2, p1, p3);
} }
private Circle(Point2D p1, Point2D p2, Point2D p3) { private Circle(Point2D p1, Point2D p2, Point2D p3) {
final double num1 = p3.getX() * p3.getX() * (p1.getY() - p2.getY()) final double num1 = p3.getX() * p3.getX() * (p1.getY() - p2.getY())
+ (p1.getX() * p1.getX() + (p1.getY() - p2.getY()) * (p1.getY() - p3.getY())) * (p2.getY() - p3.getY()) + (p1.getX() * p1.getX() + (p1.getY() - p2.getY()) * (p1.getY() - p3.getY())) * (p2.getY() - p3.getY())
+ p2.getX() * p2.getX() * (-p1.getY() + p3.getY()); + p2.getX() * p2.getX() * (-p1.getY() + p3.getY());
final double den1 = 2 * (p3.getX() * (p1.getY() - p2.getY()) + p1.getX() * (p2.getY() - p3.getY()) + p2.getX() final double den1 = 2 * (p3.getX() * (p1.getY() - p2.getY()) + p1.getX() * (p2.getY() - p3.getY())
* (-p1.getY() + p3.getY())); + p2.getX() * (-p1.getY() + p3.getY()));
final double x = num1 / den1; final double x = num1 / den1;
final double den2 = p3.getY() - p2.getY(); final double den2 = p3.getY() - p2.getY();
final double y = (p2.getY() + p3.getY()) / 2 - (p3.getX() - p2.getX()) / den2 final double y = (p2.getY() + p3.getY()) / 2
* (x - (p2.getX() + p3.getX()) / 2); - (p3.getX() - p2.getX()) / den2 * (x - (p2.getX() + p3.getX()) / 2);
center = new Point2D.Double(x, y); center = new Point2D.Double(x, y);
radius = center.distance(p1); radius = center.distance(p1);
} }

View File

@ -103,7 +103,7 @@ public class EntityImageBranch extends AbstractEntityImage {
} }
diams.setDeltaShadow(shadowing); diams.setDeltaShadow(shadowing);
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class); final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -37,9 +37,7 @@ package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -139,7 +137,7 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi
if (url != null) if (url != null)
ug.startUrl(url); ug.startUrl(url);
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -37,7 +37,12 @@
package net.sourceforge.plantuml.svek.image; package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.util.*; import java.util.Collection;
import java.util.EnumMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.Guillemet;
@ -283,7 +288,7 @@ public class EntityImageDescription extends AbstractEntityImage {
final public void drawU(UGraphic ug) { final public void drawU(UGraphic ug) {
ug.draw(new UComment("entity " + getEntity().getCodeGetName())); ug.draw(new UComment("entity " + getEntity().getCodeGetName()));
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -52,8 +52,10 @@ public class EntityImageGroup extends AbstractEntityImage {
public EntityImageGroup(ILeaf entity, ISkinParam skinParam) { public EntityImageGroup(ILeaf entity, ISkinParam skinParam) {
super(entity, skinParam); super(entity, skinParam);
// this.desc = Display.create(StringUtils.getWithNewlines(entity.getDisplay()), new FontConfiguration( // this.desc = Display.create(StringUtils.getWithNewlines(entity.getDisplay()),
// getFont(FontParam.ACTIVITY), HtmlColorUtils.BLACK), HorizontalAlignment.CENTER); // new FontConfiguration(
// getFont(FontParam.ACTIVITY), HtmlColorUtils.BLACK),
// HorizontalAlignment.CENTER);
} }
public Dimension2D calculateDimension(StringBounder stringBounder) { public Dimension2D calculateDimension(StringBounder stringBounder) {

View File

@ -36,9 +36,7 @@
package net.sourceforge.plantuml.svek.image; package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -135,7 +133,7 @@ public class EntityImageLollipopInterface extends AbstractEntityImage {
if (url != null) if (url != null)
ug.startUrl(url); ug.startUrl(url);
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -84,8 +84,7 @@ public class EntityImageLollipopInterfaceEye1 extends AbstractEntityImage {
final public void drawU(UGraphic ug) { final public void drawU(UGraphic ug) {
ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.classBorder)); ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.classBorder));
ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.classBackground).bg());
ColorParam.classBackground).bg());
if (url != null) { if (url != null) {
ug.startUrl(url); ug.startUrl(url);
} }

View File

@ -80,8 +80,8 @@ public class EntityImageLollipopInterfaceEye2 extends AbstractEntityImage {
super(entity, skinParam); super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
final USymbol symbol = Objects.requireNonNull(entity.getUSymbol() == null ? skinParam.componentStyle().toUSymbol() final USymbol symbol = Objects.requireNonNull(
: entity.getUSymbol()); entity.getUSymbol() == null ? skinParam.componentStyle().toUSymbol() : entity.getUSymbol());
this.desc = BodyFactory.create2(skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), this.desc = BodyFactory.create2(skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER),
entity.getDisplay(), symbol.getFontParam(), skinParam, stereotype, entity, entity.getDisplay(), symbol.getFontParam(), skinParam, stereotype, entity,

View File

@ -36,9 +36,7 @@
package net.sourceforge.plantuml.svek.image; package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -197,7 +195,7 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With
if (url != null) if (url != null)
ug.startUrl(url); ug.startUrl(url);
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -38,7 +38,9 @@ package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.awt.geom.Line2D; import java.awt.geom.Line2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.*; import java.util.EnumMap;
import java.util.Map;
import java.util.Objects;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -217,7 +219,7 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
final public void drawU(UGraphic ug) { final public void drawU(UGraphic ug) {
final Url url = getEntity().getUrl99(); final Url url = getEntity().getUrl99();
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -63,8 +63,8 @@ public class EntityImageNoteLink extends AbstractTextBlock implements IEntityIma
public EntityImageNoteLink(Display note, Colors colors, ISkinParam skinParam, StyleBuilder styleBuilder) { public EntityImageNoteLink(Display note, Colors colors, ISkinParam skinParam, StyleBuilder styleBuilder) {
final Rose skin = new Rose(); final Rose skin = new Rose();
comp = skin.createComponentNote( comp = skin.createComponentNote(
new Style[] { ComponentType.NOTE.getStyleSignature().getMergedStyle(styleBuilder) }, new Style[] { ComponentType.NOTE.getStyleSignature().getMergedStyle(styleBuilder) }, ComponentType.NOTE,
ComponentType.NOTE, colors.mute(skinParam), note); colors.mute(skinParam), note);
} }
public Dimension2D calculateDimension(StringBounder stringBounder) { public Dimension2D calculateDimension(StringBounder stringBounder) {

View File

@ -36,9 +36,7 @@
package net.sourceforge.plantuml.svek.image; package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -199,8 +197,7 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W
if (url != null) if (url != null)
ug.startUrl(url); ug.startUrl(url);
final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);;
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -37,7 +37,6 @@ package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;

View File

@ -37,9 +37,7 @@ package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.Collections;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
@ -163,7 +161,7 @@ public class EntityImageUseCase extends AbstractEntityImage {
ug = ug.apply(backcolor.bg()); ug = ug.apply(backcolor.bg());
final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse()); final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse());
Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);; final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected");
typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode());
ug.startGroup(typeIDent); ug.startGroup(typeIDent);

View File

@ -82,12 +82,7 @@ public class Footprint {
private MyUGraphic(MyUGraphic other, UChange change) { private MyUGraphic(MyUGraphic other, UChange change) {
super(other, change); super(other, change);
if (!instanceOfAny(change, if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class)) {
UBackground.class,
HColor.class,
UStroke.class,
UTranslate.class
)) {
throw new UnsupportedOperationException(change.getClass().toString()); throw new UnsupportedOperationException(change.getClass().toString());
} }
this.all = other.all; this.all = other.all;

View File

@ -993,7 +993,6 @@ public class SvgGraphics {
if (SecurityUtils.ignoreThisLink(url)) if (SecurityUtils.ignoreThisLink(url))
return; return;
// if (pendingAction.size() > 0) // if (pendingAction.size() > 0)
// closeLink(); // closeLink();
@ -1041,18 +1040,18 @@ public class SvgGraphics {
} }
public void startGroup(Map<UGroupType, String> typeIdents) { public void startGroup(Map<UGroupType, String> typeIdents) {
if (!typeIdents.isEmpty()) if (typeIdents.isEmpty())
pendingAction.add(0, (Element) document.createElement("g")); throw new IllegalArgumentException();
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.add(0, (Element) document.createElement("g"));
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()); pendingAction.get(0).setAttribute("class", typeIdent.getValue());
} }
} }
}
public void closeGroup() { public void closeGroup() {
closeLink(); closeLink();