From 1fd8715ec9ee721c01768d57b76294947ad4d926 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Wed, 16 Feb 2022 19:59:44 +0100 Subject: [PATCH] wip --- .../plantuml/graphic/ExposantChange.java | 2 +- .../plantuml/graphic/GraphicPosition.java | 1 - src/net/sourceforge/plantuml/graphic/Line.java | 1 - .../plantuml/graphic/SkinParameter.java | 6 +++--- .../plantuml/graphic/TextBlockGeneric.java | 2 +- .../plantuml/graphic/TextBlockRecentred.java | 3 ++- .../plantuml/graphic/TextBlockSprited.java | 4 ++-- .../plantuml/graphic/TextBlockVertical2.java | 4 ++-- .../plantuml/graphic/TextBlockWithUrl.java | 2 +- .../sourceforge/plantuml/graphic/TileImage.java | 3 +-- .../plantuml/graphic/UGraphicDelegator.java | 8 ++++---- .../plantuml/graphic/USymbolActor.java | 5 +++-- .../plantuml/graphic/USymbolArtifact.java | 3 +-- .../plantuml/graphic/USymbolBoundary.java | 3 +-- .../plantuml/graphic/USymbolCard.java | 3 +-- .../plantuml/graphic/USymbolCloud.java | 3 +-- .../plantuml/graphic/USymbolCollections.java | 3 +-- .../plantuml/graphic/USymbolComponent1.java | 3 +-- .../plantuml/graphic/USymbolComponent2.java | 3 +-- .../plantuml/graphic/USymbolControl.java | 3 +-- .../plantuml/graphic/USymbolDatabase.java | 3 +-- .../plantuml/graphic/USymbolEntityDomain.java | 3 +-- .../plantuml/graphic/USymbolFile.java | 3 +-- .../plantuml/graphic/USymbolFolder.java | 3 +-- .../plantuml/graphic/USymbolHexagon.java | 3 +-- .../plantuml/graphic/USymbolInterface.java | 3 +-- .../plantuml/graphic/USymbolLabel.java | 3 +-- .../plantuml/graphic/USymbolNode.java | 3 +-- .../plantuml/graphic/USymbolPerson.java | 3 +-- .../plantuml/graphic/USymbolQueue.java | 3 +-- .../plantuml/graphic/USymbolStack.java | 3 +-- .../plantuml/graphic/USymbolTogether.java | 6 +++--- .../plantuml/style/FromSkinparamToStyle.java | 7 +++++-- src/net/sourceforge/plantuml/svek/SvekLine.java | 15 +++++++++++---- .../sourceforge/plantuml/svek/image/Circle.java | 9 ++++----- .../plantuml/svek/image/EntityImageBranch.java | 2 +- .../plantuml/svek/image/EntityImageClass.java | 4 +--- .../svek/image/EntityImageDescription.java | 9 +++++++-- .../plantuml/svek/image/EntityImageGroup.java | 6 ++++-- .../image/EntityImageLollipopInterface.java | 4 +--- .../image/EntityImageLollipopInterfaceEye1.java | 3 +-- .../image/EntityImageLollipopInterfaceEye2.java | 4 ++-- .../plantuml/svek/image/EntityImageMap.java | 4 +--- .../plantuml/svek/image/EntityImageNote.java | 6 ++++-- .../svek/image/EntityImageNoteLink.java | 4 ++-- .../plantuml/svek/image/EntityImageObject.java | 5 +---- .../plantuml/svek/image/EntityImageState2.java | 1 - .../plantuml/svek/image/EntityImageUseCase.java | 4 +--- .../plantuml/svek/image/Footprint.java | 7 +------ .../sourceforge/plantuml/svg/SvgGraphics.java | 17 ++++++++--------- 50 files changed, 97 insertions(+), 118 deletions(-) diff --git a/src/net/sourceforge/plantuml/graphic/ExposantChange.java b/src/net/sourceforge/plantuml/graphic/ExposantChange.java index e43ac7bc0..410fea04e 100644 --- a/src/net/sourceforge/plantuml/graphic/ExposantChange.java +++ b/src/net/sourceforge/plantuml/graphic/ExposantChange.java @@ -36,7 +36,7 @@ package net.sourceforge.plantuml.graphic; class ExposantChange implements FontChange { - + private final FontPosition fontPosition; ExposantChange(FontPosition fontPosition) { diff --git a/src/net/sourceforge/plantuml/graphic/GraphicPosition.java b/src/net/sourceforge/plantuml/graphic/GraphicPosition.java index 17a38032d..85ad453ef 100644 --- a/src/net/sourceforge/plantuml/graphic/GraphicPosition.java +++ b/src/net/sourceforge/plantuml/graphic/GraphicPosition.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.graphic; - public enum GraphicPosition { BOTTOM, BACKGROUND_CORNER_BOTTOM_RIGHT, BACKGROUND_CORNER_TOP_RIGHT diff --git a/src/net/sourceforge/plantuml/graphic/Line.java b/src/net/sourceforge/plantuml/graphic/Line.java index 4093d0d29..0dafe0c6c 100644 --- a/src/net/sourceforge/plantuml/graphic/Line.java +++ b/src/net/sourceforge/plantuml/graphic/Line.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.graphic; - public interface Line extends TextBlock { HorizontalAlignment getHorizontalAlignment(); diff --git a/src/net/sourceforge/plantuml/graphic/SkinParameter.java b/src/net/sourceforge/plantuml/graphic/SkinParameter.java index a86c7bd73..341ef7429 100644 --- a/src/net/sourceforge/plantuml/graphic/SkinParameter.java +++ b/src/net/sourceforge/plantuml/graphic/SkinParameter.java @@ -108,9 +108,9 @@ public class SkinParameter { ColorParam.hexagonBackground, ColorParam.hexagonBorder, FontParam.HEXAGON, FontParam.HEXAGON_STEREOTYPE, CornerParam.hexagon, LineParam.hexagonBorder); - public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON", - ColorParam.personBackground, ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE, - CornerParam.person, LineParam.personBorder); + public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON", ColorParam.personBackground, + ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE, CornerParam.person, + LineParam.personBorder); public static final SkinParameter ARCHIMATE = new SkinParameter(SName.archimate, "ARCHIMATE", ColorParam.archimateBackground, ColorParam.archimateBorder, FontParam.ARCHIMATE, diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java index 1805d6a97..a6951bd60 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java @@ -64,7 +64,7 @@ public class TextBlockGeneric extends AbstractTextBlock implements TextBlock { ug = ug.apply(border); final Dimension2D dim = calculateDimension(ug.getStringBounder()); ug.apply(new UStroke(2, 2, 1)).draw(new URectangle(dim.getWidth(), dim.getHeight())); - + textBlock.drawU(ug); } diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java index 4619e659b..939254a1d 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java @@ -64,7 +64,8 @@ public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBa // if (cachedMinMax == null) { // cachedMinMax = getMinMaxSlow(stringBounder); // } - // // assert cachedMinMax.toString().equals(getMinMaxSlow(stringBounder).toString()); + // // assert + // cachedMinMax.toString().equals(getMinMaxSlow(stringBounder).toString()); // return cachedMinMax; } diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java b/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java index d215cead1..0bad6d411 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java @@ -56,8 +56,8 @@ public class TextBlockSprited extends AbstractTextBlock { final double heightCircledCharacter = sprite.calculateDimension(stringBounder).getHeight(); final Dimension2D dim = parent.calculateDimension(stringBounder); - return new Dimension2DDouble(dim.getWidth() + widthCircledCharacter, Math.max(heightCircledCharacter, - dim.getHeight())); + return new Dimension2DDouble(dim.getWidth() + widthCircledCharacter, + Math.max(heightCircledCharacter, dim.getHeight())); } private double getCircledCharacterWithAndMargin(StringBounder stringBounder) { diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java index 0514b2240..9ec529fe7 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java @@ -102,10 +102,10 @@ public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, final Dimension2D dimb = block.calculateDimension(ug.getStringBounder()); if (block instanceof TextBlockBackcolored) { final HColor back = ((TextBlockBackcolored) block).getBackcolor(); - if (back != null) + if (back != null) ug.apply(UTranslate.dy(y)).apply(back).apply(back.bg()) .draw(new URectangle(dimtotal.getWidth(), dimb.getHeight())); - + } if (horizontalAlignment == HorizontalAlignment.LEFT) { block.drawU(ug.apply(UTranslate.dy(y))); diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java b/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java index a0203e762..6a9635354 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java @@ -69,7 +69,7 @@ public class TextBlockWithUrl implements TextBlock { public Dimension2D calculateDimension(StringBounder stringBounder) { return block.calculateDimension(stringBounder); } - + public MinMax getMinMax(StringBounder stringBounder) { return block.getMinMax(stringBounder); } diff --git a/src/net/sourceforge/plantuml/graphic/TileImage.java b/src/net/sourceforge/plantuml/graphic/TileImage.java index 476df10a0..c7dad83e0 100644 --- a/src/net/sourceforge/plantuml/graphic/TileImage.java +++ b/src/net/sourceforge/plantuml/graphic/TileImage.java @@ -61,8 +61,7 @@ public class TileImage extends AbstractTextBlock implements TextBlock { } public void drawU(UGraphic ug) { - ug.apply(UTranslate.dy(vspace)) - .draw(new UImage(new PixelImage(image, AffineTransformType.TYPE_BILINEAR))); + ug.apply(UTranslate.dy(vspace)).draw(new UImage(new PixelImage(image, AffineTransformType.TYPE_BILINEAR))); } } diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java index 479fecf78..783e6e595 100644 --- a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java +++ b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java @@ -35,6 +35,10 @@ */ 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.ugraphic.UGraphic; 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.HColor; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Map; - public abstract class UGraphicDelegator implements UGraphic { final private UGraphic ug; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolActor.java b/src/net/sourceforge/plantuml/graphic/USymbolActor.java index 69ef2ea3a..c15764675 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolActor.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolActor.java @@ -51,7 +51,7 @@ class USymbolActor extends USymbolSimpleAbstract { public SkinParameter getSkinParameter() { return SkinParameter.ACTOR; } - + @Override public SName getSName() { return SName.actor; @@ -60,7 +60,8 @@ class USymbolActor extends USymbolSimpleAbstract { @Override protected TextBlock getDrawing(SymbolContext symbolContext) { // 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); } diff --git a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java index 4b386e0c4..d5e3aabf0 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java @@ -52,13 +52,12 @@ class USymbolArtifact extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.ARTIFACT; } - + @Override public SName getSName() { return SName.artifact; } - private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, double shadowing, double roundCorner) { diff --git a/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java b/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java index 9fd7531ca..35142b6b1 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java @@ -44,13 +44,12 @@ class USymbolBoundary extends USymbolSimpleAbstract { public SkinParameter getSkinParameter() { return SkinParameter.BOUNDARY; } - + @Override public SName getSName() { return SName.boundary; } - @Override protected TextBlock getDrawing(SymbolContext symbolContext) { return new Boundary(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0)); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCard.java b/src/net/sourceforge/plantuml/graphic/USymbolCard.java index 14adf11b6..811154456 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolCard.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolCard.java @@ -52,13 +52,12 @@ class USymbolCard extends USymbol { public USymbolCard(SkinParameter skinParameter) { this.skinParameter = skinParameter; } - + @Override public SName getSName() { return SName.card; } - @Override public SkinParameter getSkinParameter() { return skinParameter; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java index 3a879d830..68bf90467 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java @@ -61,13 +61,12 @@ class USymbolCloud extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.CLOUD; } - + @Override public SName getSName() { return SName.cloud; } - private void drawCloud(UGraphic ug, double width, double height, double shadowing) { final UPath shape = getSpecificFrontierForCloud(width, height); shape.setDeltaShadow(shadowing); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java index d7bd3ecc9..a038788c2 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java @@ -63,13 +63,12 @@ class USymbolCollections extends USymbol { public SkinParameter getSkinParameter() { return skinParameter; } - + @Override public SName getSName() { return SName.collections; } - private void drawCollections(UGraphic ug, double width, double height, double shadowing, double roundCorner) { final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection()) .rounded(roundCorner); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java index c47528520..3f020870a 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java @@ -51,13 +51,12 @@ class USymbolComponent1 extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.COMPONENT1; } - + @Override public SName getSName() { return SName.component; } - private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, double shadowing, double roundCorner) { diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java index 1540a0b1b..83e7d9ca3 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java @@ -51,13 +51,12 @@ class USymbolComponent2 extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.COMPONENT2; } - + @Override public SName getSName() { return SName.component; } - private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, double shadowing, double roundCorner) { diff --git a/src/net/sourceforge/plantuml/graphic/USymbolControl.java b/src/net/sourceforge/plantuml/graphic/USymbolControl.java index 69c9a5b92..2ae62fe17 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolControl.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolControl.java @@ -44,13 +44,12 @@ class USymbolControl extends USymbolSimpleAbstract { public SkinParameter getSkinParameter() { return SkinParameter.CONTROL; } - + @Override public SName getSName() { return SName.control; } - @Override protected TextBlock getDrawing(final SymbolContext symbolContext) { return new Control(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0)); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java index 648e2fc21..103016c11 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java @@ -54,13 +54,12 @@ class USymbolDatabase extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.DATABASE; } - + @Override public SName getSName() { return SName.database; } - private void drawDatabase(UGraphic ug, double width, double height, double shadowing) { final UPath shape = new UPath(); shape.setDeltaShadow(shadowing); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java index 3d641f0e2..61f935b53 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java @@ -44,13 +44,12 @@ class USymbolEntityDomain extends USymbolSimpleAbstract { public SkinParameter getSkinParameter() { return SkinParameter.ENTITY; } - + @Override public SName getSName() { return SName.entity; } - @Override protected TextBlock getDrawing(final SymbolContext symbolContext) { return new EntityDomain(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0)); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFile.java b/src/net/sourceforge/plantuml/graphic/USymbolFile.java index cda6c024d..29f19e964 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolFile.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolFile.java @@ -55,13 +55,12 @@ class USymbolFile extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.FILE; } - + @Override public SName getSName() { return SName.file; } - private void drawFile(UGraphic ug, double width, double height, double shadowing, double roundCorner) { final int cornersize = 10; final Shadowable out; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java index b36d3e441..4f98f1723 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java @@ -77,13 +77,12 @@ public class USymbolFolder extends USymbol { public SkinParameter getSkinParameter() { return skinParameter; } - + @Override public SName getSName() { return sname; } - private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, double shadowing, double roundCorner) { diff --git a/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java b/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java index 7ef121c26..65e363f24 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java @@ -49,13 +49,12 @@ public class USymbolHexagon extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.HEXAGON; } - + @Override public SName getSName() { return SName.hexagon; } - private final double marginY = 5; @Override diff --git a/src/net/sourceforge/plantuml/graphic/USymbolInterface.java b/src/net/sourceforge/plantuml/graphic/USymbolInterface.java index 12396465a..48988f3d0 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolInterface.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolInterface.java @@ -44,13 +44,12 @@ public class USymbolInterface extends USymbolSimpleAbstract { public SkinParameter getSkinParameter() { return SkinParameter.INTERFACE; } - + @Override public SName getSName() { return SName.interface_; } - @Override protected TextBlock getDrawing(SymbolContext symbolContext) { return new CircleInterface2(symbolContext.getBackColor(), symbolContext.getForeColor(), diff --git a/src/net/sourceforge/plantuml/graphic/USymbolLabel.java b/src/net/sourceforge/plantuml/graphic/USymbolLabel.java index 00ecd67e6..f9c46d955 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolLabel.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolLabel.java @@ -50,13 +50,12 @@ class USymbolLabel extends USymbol { public USymbolLabel(SkinParameter skinParameter) { this.skinParameter = skinParameter; } - + @Override public SName getSName() { return SName.label; } - @Override public SkinParameter getSkinParameter() { return skinParameter; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolNode.java b/src/net/sourceforge/plantuml/graphic/USymbolNode.java index 905aacfe4..c7139947c 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolNode.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolNode.java @@ -57,13 +57,12 @@ class USymbolNode extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.NODE; } - + @Override public SName getSName() { return SName.node; } - // public USymbolNode(HorizontalAlignment stereotypeAlignement) { // this.stereotypeAlignement = stereotypeAlignement; // } diff --git a/src/net/sourceforge/plantuml/graphic/USymbolPerson.java b/src/net/sourceforge/plantuml/graphic/USymbolPerson.java index 4a2821163..649763a95 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolPerson.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolPerson.java @@ -51,13 +51,12 @@ class USymbolPerson extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.PERSON; } - + @Override public SName getSName() { return SName.person; } - private void drawHeadAndBody(UGraphic ug, double shadowing, Dimension2D dimBody, double headSize) { final UEllipse head = new UEllipse(headSize, headSize); final URectangle body = new URectangle(dimBody).rounded(headSize); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java index dc7a4c961..b33178f41 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java @@ -53,13 +53,12 @@ class USymbolQueue extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.QUEUE; } - + @Override public SName getSName() { return SName.queue; } - private final double dx = 5; private void drawQueue(UGraphic ug, double width, double height, double shadowing) { diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStack.java b/src/net/sourceforge/plantuml/graphic/USymbolStack.java index 5874db1a8..9c65cb461 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolStack.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolStack.java @@ -53,13 +53,12 @@ class USymbolStack extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.STACK; } - + @Override public SName getSName() { return SName.stack; } - private void drawQueue(UGraphic ug, double width, double height, double shadowing, double roundCorner) { final double border = 15; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolTogether.java b/src/net/sourceforge/plantuml/graphic/USymbolTogether.java index 76bfed439..c54df0756 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolTogether.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolTogether.java @@ -47,13 +47,12 @@ class USymbolTogether extends USymbol { public SkinParameter getSkinParameter() { return SkinParameter.STORAGE; } - + @Override public SName getSName() { return SName.storage; } - @Override public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) { @@ -62,7 +61,8 @@ class USymbolTogether extends USymbol { @Override 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() { public void drawU(UGraphic ug) { diff --git a/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java b/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java index c6dd854f6..414cd679e 100644 --- a/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java +++ b/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java @@ -253,6 +253,8 @@ public class FromSkinparamToStyle { final boolean complex = value.contains(";"); if (complex) { // System.err.println("key=" + key + " value=" + value); + if (value.startsWith(";")) + value = " " + value; final StringTokenizer st = new StringTokenizer(value, ";"); value = st.nextToken(); while (st.hasMoreTokens()) { @@ -272,8 +274,9 @@ public class FromSkinparamToStyle { } } - for (Data data : datas) - addStyle(data.propertyName, ValueImpl.regular(value, counter), data.styleNames); + if (" ".equals(value) == false) + for (Data data : datas) + addStyle(data.propertyName, ValueImpl.regular(value, counter), data.styleNames); } diff --git a/src/net/sourceforge/plantuml/svek/SvekLine.java b/src/net/sourceforge/plantuml/svek/SvekLine.java index d8d6402fd..b1a833759 100644 --- a/src/net/sourceforge/plantuml/svek/SvekLine.java +++ b/src/net/sourceforge/plantuml/svek/SvekLine.java @@ -37,7 +37,13 @@ package net.sourceforge.plantuml.svek; import java.awt.geom.Dimension2D; 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.ColorParam; @@ -619,9 +625,10 @@ public class SvekLine implements Moveable, Hideable, GuideLine { return; ug.draw(link.commentForSvg()); - Map typeIDent = new EnumMap<>(UGroupType.class);; - typeIDent.put(UGroupType.CLASS, "link " + link.getEntity1().getCode() + " " + link.getEntity2().getCode() + " selected"); - typeIDent.put(UGroupType.ID, "link_" + link.getEntity1().getCode() + "_" + link.getEntity2().getCode()); + final Map typeIDent = new EnumMap<>(UGroupType.class); + 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; diff --git a/src/net/sourceforge/plantuml/svek/image/Circle.java b/src/net/sourceforge/plantuml/svek/image/Circle.java index 386a600f2..755379942 100644 --- a/src/net/sourceforge/plantuml/svek/image/Circle.java +++ b/src/net/sourceforge/plantuml/svek/image/Circle.java @@ -64,17 +64,16 @@ public class Circle { return new Circle(p2, p1, p3); } - private Circle(Point2D p1, Point2D p2, Point2D p3) { 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()) + 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() - * (-p1.getY() + p3.getY())); + final double den1 = 2 * (p3.getX() * (p1.getY() - p2.getY()) + p1.getX() * (p2.getY() - p3.getY()) + + p2.getX() * (-p1.getY() + p3.getY())); final double x = num1 / den1; final double den2 = p3.getY() - p2.getY(); - final double y = (p2.getY() + p3.getY()) / 2 - (p3.getX() - p2.getX()) / den2 - * (x - (p2.getX() + p3.getX()) / 2); + final double y = (p2.getY() + p3.getY()) / 2 + - (p3.getX() - p2.getX()) / den2 * (x - (p2.getX() + p3.getX()) / 2); center = new Point2D.Double(x, y); radius = center.distance(p1); } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java index 1a0720f39..3f8a5c5b7 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java @@ -103,7 +103,7 @@ public class EntityImageBranch extends AbstractEntityImage { } diams.setDeltaShadow(shadowing); - Map typeIDent = new EnumMap<>(UGroupType.class); + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java index bbb8dc0d7..7620cb55d 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java @@ -37,9 +37,7 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; -import java.util.Collections; import java.util.EnumMap; -import java.util.HashMap; import java.util.Map; import net.sourceforge.plantuml.ColorParam; @@ -139,7 +137,7 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi if (url != null) ug.startUrl(url); - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java index 4ac9d5d1b..da1e5f1d7 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java @@ -37,7 +37,12 @@ package net.sourceforge.plantuml.svek.image; 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.Guillemet; @@ -283,7 +288,7 @@ public class EntityImageDescription extends AbstractEntityImage { final public void drawU(UGraphic ug) { ug.draw(new UComment("entity " + getEntity().getCodeGetName())); - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java b/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java index 451b10a57..ca3a83b4e 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java @@ -52,8 +52,10 @@ public class EntityImageGroup extends AbstractEntityImage { public EntityImageGroup(ILeaf entity, ISkinParam skinParam) { super(entity, skinParam); - // this.desc = Display.create(StringUtils.getWithNewlines(entity.getDisplay()), new FontConfiguration( - // getFont(FontParam.ACTIVITY), HtmlColorUtils.BLACK), HorizontalAlignment.CENTER); + // this.desc = Display.create(StringUtils.getWithNewlines(entity.getDisplay()), + // new FontConfiguration( + // getFont(FontParam.ACTIVITY), HtmlColorUtils.BLACK), + // HorizontalAlignment.CENTER); } public Dimension2D calculateDimension(StringBounder stringBounder) { diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java index 2ceae293e..948b97814 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java @@ -36,9 +36,7 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; -import java.util.Collections; import java.util.EnumMap; -import java.util.HashMap; import java.util.Map; import net.sourceforge.plantuml.ColorParam; @@ -135,7 +133,7 @@ public class EntityImageLollipopInterface extends AbstractEntityImage { if (url != null) ug.startUrl(url); - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java index 875bad9c3..aa050a478 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java @@ -84,8 +84,7 @@ public class EntityImageLollipopInterfaceEye1 extends AbstractEntityImage { final public void drawU(UGraphic ug) { ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.classBorder)); - ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), - ColorParam.classBackground).bg()); + ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.classBackground).bg()); if (url != null) { ug.startUrl(url); } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java index a24064bb4..70ef0ce8a 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java @@ -80,8 +80,8 @@ public class EntityImageLollipopInterfaceEye2 extends AbstractEntityImage { super(entity, skinParam); final Stereotype stereotype = entity.getStereotype(); - final USymbol symbol = Objects.requireNonNull(entity.getUSymbol() == null ? skinParam.componentStyle().toUSymbol() - : entity.getUSymbol()); + final USymbol symbol = Objects.requireNonNull( + entity.getUSymbol() == null ? skinParam.componentStyle().toUSymbol() : entity.getUSymbol()); this.desc = BodyFactory.create2(skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), entity.getDisplay(), symbol.getFontParam(), skinParam, stereotype, entity, diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java index 0ee2c1d8f..75794c885 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageMap.java @@ -36,9 +36,7 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; -import java.util.Collections; import java.util.EnumMap; -import java.util.HashMap; import java.util.Map; import net.sourceforge.plantuml.ColorParam; @@ -197,7 +195,7 @@ public class EntityImageMap extends AbstractEntityImage implements Stencil, With if (url != null) ug.startUrl(url); - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java index 302064ecb..6dfd38cbb 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java @@ -38,7 +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.*; +import java.util.EnumMap; +import java.util.Map; +import java.util.Objects; import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.ColorParam; @@ -217,7 +219,7 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil { final public void drawU(UGraphic ug) { final Url url = getEntity().getUrl99(); - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java b/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java index 666145fdd..7f2a8a483 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java @@ -63,8 +63,8 @@ public class EntityImageNoteLink extends AbstractTextBlock implements IEntityIma public EntityImageNoteLink(Display note, Colors colors, ISkinParam skinParam, StyleBuilder styleBuilder) { final Rose skin = new Rose(); comp = skin.createComponentNote( - new Style[] { ComponentType.NOTE.getStyleSignature().getMergedStyle(styleBuilder) }, - ComponentType.NOTE, colors.mute(skinParam), note); + new Style[] { ComponentType.NOTE.getStyleSignature().getMergedStyle(styleBuilder) }, ComponentType.NOTE, + colors.mute(skinParam), note); } public Dimension2D calculateDimension(StringBounder stringBounder) { diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java index 49823d1dc..a9ab9f899 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java @@ -36,9 +36,7 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; -import java.util.Collections; import java.util.EnumMap; -import java.util.HashMap; import java.util.Map; import net.sourceforge.plantuml.ColorParam; @@ -199,8 +197,7 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil, W if (url != null) ug.startUrl(url); - - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java index eac32201a..e5c82d028 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java @@ -37,7 +37,6 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java index fb1ab6fcc..0000c0825 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java @@ -37,9 +37,7 @@ package net.sourceforge.plantuml.svek.image; import java.awt.geom.Dimension2D; import java.awt.geom.Point2D; -import java.util.Collections; import java.util.EnumMap; -import java.util.HashMap; import java.util.Map; import net.sourceforge.plantuml.ColorParam; @@ -163,7 +161,7 @@ public class EntityImageUseCase extends AbstractEntityImage { ug = ug.apply(backcolor.bg()); final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse()); - Map typeIDent = new EnumMap<>(UGroupType.class);; + final Map typeIDent = new EnumMap<>(UGroupType.class); typeIDent.put(UGroupType.CLASS, "elem " + getEntity().getCode() + " selected"); typeIDent.put(UGroupType.ID, "elem_" + getEntity().getCode()); ug.startGroup(typeIDent); diff --git a/src/net/sourceforge/plantuml/svek/image/Footprint.java b/src/net/sourceforge/plantuml/svek/image/Footprint.java index a17e4228e..697909d94 100644 --- a/src/net/sourceforge/plantuml/svek/image/Footprint.java +++ b/src/net/sourceforge/plantuml/svek/image/Footprint.java @@ -82,12 +82,7 @@ public class Footprint { private MyUGraphic(MyUGraphic other, UChange change) { super(other, change); - if (!instanceOfAny(change, - UBackground.class, - HColor.class, - UStroke.class, - UTranslate.class - )) { + if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class)) { throw new UnsupportedOperationException(change.getClass().toString()); } this.all = other.all; diff --git a/src/net/sourceforge/plantuml/svg/SvgGraphics.java b/src/net/sourceforge/plantuml/svg/SvgGraphics.java index c1b7d6d87..f70ab113e 100644 --- a/src/net/sourceforge/plantuml/svg/SvgGraphics.java +++ b/src/net/sourceforge/plantuml/svg/SvgGraphics.java @@ -993,7 +993,6 @@ public class SvgGraphics { if (SecurityUtils.ignoreThisLink(url)) return; - // if (pendingAction.size() > 0) // closeLink(); @@ -1041,16 +1040,16 @@ public class SvgGraphics { } public void startGroup(Map typeIdents) { - if (!typeIdents.isEmpty()) - pendingAction.add(0, (Element) document.createElement("g")); - for (Map.Entry typeIdent : typeIdents.entrySet()) { - if (typeIdent.getKey() == UGroupType.ID) { - pendingAction.get(0).setAttribute("id", typeIdent.getValue()); - } + if (typeIdents.isEmpty()) + throw new IllegalArgumentException(); + + pendingAction.add(0, (Element) document.createElement("g")); - if (INTERACTIVE && typeIdent.getKey() == UGroupType.CLASS) { + 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()); - } } }