From dbc5104528d98b5bf9dfb1d7bbcbc836ebeb7d51 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Tue, 1 Mar 2022 19:11:51 +0100 Subject: [PATCH] wip --- .../sourceforge/plantuml/AnnotatedWorker.java | 12 +- src/net/sourceforge/plantuml/FontParam.java | 16 +- .../sourceforge/plantuml/TitledDiagram.java | 4 +- .../plantuml/activitydiagram3/Branch.java | 10 +- .../command/CommandPartition3.java | 10 +- .../ftile/EntityImageLegend.java | 4 +- .../ftile/FtileFactoryDelegator.java | 14 +- .../activitydiagram3/ftile/LaneDivider.java | 6 +- .../activitydiagram3/ftile/Snake.java | 8 +- .../activitydiagram3/ftile/Swimlanes.java | 6 +- .../plantuml/activitydiagram3/ftile/Worm.java | 2 +- .../AbstractParallelFtilesBuilder.java | 10 +- .../ftile/vcompact/FloatingNote.java | 4 +- .../ftile/vcompact/FtileGroup.java | 6 +- .../ftile/vcompact/FtileIfAndStop.java | 4 +- .../ftile/vcompact/FtileNoteAlone.java | 6 +- .../ftile/vcompact/FtileWithNoteOpale.java | 6 +- .../ftile/vcompact/FtileWithNotes.java | 6 +- .../ftile/vcompact/ParallelBuilderSplit.java | 6 +- .../ftile/vcompact/VCompactFactory.java | 18 +- .../vcompact/cond/ConditionalBuilder.java | 10 +- .../cond/FtileSwitchWithDiamonds.java | 2 +- .../ftile/vertical/FtileBlackBlock.java | 6 +- .../ftile/vertical/FtileBox.java | 12 +- .../ftile/vertical/FtileBox2.java | 12 +- .../ftile/vertical/FtileBoxOld.java | 16 +- .../ftile/vertical/FtileDiamondWIP.java | 6 +- .../gtile/GAbstractConnection.java | 6 +- .../activitydiagram3/gtile/GtileAssembly.java | 6 +- .../activitydiagram3/gtile/GtileBox.java | 12 +- .../gtile/GtileCircleSpot.java | 6 +- .../gtile/GtileCircleStart.java | 6 +- .../activitydiagram3/gtile/GtileGroup.java | 6 +- .../gtile/GtileHexagonInside.java | 6 +- .../activitydiagram3/gtile/GtileIfAlone.java | 14 +- .../gtile/GtileIfHexagon.java | 14 +- .../activitydiagram3/gtile/GtileRepeat.java | 14 +- .../activitydiagram3/gtile/GtileSplit.java | 14 +- .../activitydiagram3/gtile/GtileWhile.java | 6 +- .../gtile/GtileWithNoteOpale.java | 6 +- .../gtile/GtileWithNotes.java | 6 +- .../activitydiagram3/gtile/Gtiles.java | 6 +- .../asciiart/AbstractComponentText.java | 4 +- .../sourceforge/plantuml/bpm/BpmElement.java | 6 +- .../classdiagram/ClassDiagramFactory.java | 2 + .../plantuml/cucadiagram/BodierJSon.java | 103 +++++++ .../plantuml/cucadiagram/LeafType.java | 2 +- .../cucadiagram/TextBlockCucaJSon.java | 237 ++++++++++++++++ .../dot/GraphvizVersionFinder.java | 7 +- .../cucadiagram/entity/EntityFactory.java | 6 +- src/net/sourceforge/plantuml/elk/ElkPath.java | 4 +- .../sourceforge/plantuml/gitlog/MagicBox.java | 4 +- .../plantuml/gitlog/SmetanaForGit.java | 4 +- .../plantuml/graphic/HtmlColorAndStyle.java | 6 +- src/net/sourceforge/plantuml/json/Json.java | 4 +- .../plantuml/jsondiagram/SmetanaForJson.java | 12 +- .../plantuml/mindmap/FingerImpl.java | 18 +- .../plantuml/nwdiag/NwDiagram.java | 6 +- .../plantuml/nwdiag/core/NServer.java | 6 +- .../plantuml/nwdiag/core/NwGroup.java | 6 +- .../nwdiag/next/GridTextBlockDecorated.java | 6 +- .../command/CommandCreateJson.java | 159 +++++++++++ .../command/CommandCreateMap.java | 16 +- .../sourceforge/plantuml/posimo/Frame.java | 4 +- .../plantuml/project/GanttArrow.java | 6 +- .../plantuml/project/GanttConstraint.java | 6 +- .../plantuml/project/GanttDiagram.java | 12 +- .../project/draw/AbstractTaskDraw.java | 8 +- .../project/draw/TaskDrawDiamond.java | 6 +- .../project/draw/TaskDrawRegular.java | 10 +- .../project/draw/TaskDrawSeparator.java | 6 +- .../plantuml/sdot/SmetanaPath.java | 4 +- .../sequencediagram/AbstractMessage.java | 6 +- .../plantuml/sequencediagram/Delay.java | 4 +- .../plantuml/sequencediagram/Divider.java | 4 +- .../plantuml/sequencediagram/Doll.java | 6 +- .../plantuml/sequencediagram/Grouping.java | 10 +- .../plantuml/sequencediagram/LinkAnchor.java | 4 +- .../plantuml/sequencediagram/Note.java | 4 +- .../plantuml/sequencediagram/NoteStyle.java | 6 +- .../plantuml/sequencediagram/Participant.java | 7 +- .../sequencediagram/ParticipantType.java | 20 +- .../plantuml/sequencediagram/Reference.java | 10 +- .../graphic/DrawableSetInitializer.java | 2 +- .../SequenceDiagramFileMakerPuma2.java | 8 +- ...ommunicationTileNoteBottomTopAbstract.java | 4 +- .../sequencediagram/teoz/LifeEventTile.java | 4 +- .../teoz/SequenceDiagramFileMakerTeoz.java | 8 +- .../plantuml/skin/AbstractComponent.java | 4 +- .../plantuml/skin/ComponentType.java | 24 +- .../plantuml/skin/VisibilityModifier.java | 14 +- .../skin/rose/ComponentRoseGroupingSpace.java | 4 +- .../sourceforge/plantuml/skin/rose/Rose.java | 4 +- .../style/ClockwiseTopRightBottomLeft.java | 2 +- .../sourceforge/plantuml/style/Context.java | 12 +- .../plantuml/style/DarkString.java | 16 +- .../plantuml/style/FromSkinparamToStyle.java | 64 +++-- src/net/sourceforge/plantuml/style/Style.java | 6 +- .../plantuml/style/StyleBuilder.java | 30 +- .../plantuml/style/StyleLoader.java | 11 +- .../plantuml/style/StyleSignature.java | 201 +------------ .../plantuml/style/StyleSignatureBasic.java | 254 +++++++++++++++++ .../plantuml/style/StyleSignatures.java | 87 ++++++ .../sourceforge/plantuml/style/Styleable.java | 2 +- .../sourceforge/plantuml/svek/Cluster.java | 23 +- ...ucaDiagramFileMakerSvek2InternalImage.java | 6 +- .../plantuml/svek/GeneralImageBuilder.java | 23 +- .../plantuml/svek/GroupPngMakerActivity.java | 6 +- .../plantuml/svek/GroupPngMakerState.java | 8 +- .../sourceforge/plantuml/svek/SvekResult.java | 11 +- .../svek/image/EntityImageActivity.java | 8 +- .../svek/image/EntityImageAssociation.java | 6 +- .../svek/image/EntityImageBranch.java | 6 +- .../svek/image/EntityImageCircleEnd.java | 6 +- .../svek/image/EntityImageCircleStart.java | 6 +- .../plantuml/svek/image/EntityImageClass.java | 6 +- .../svek/image/EntityImageClassHeader.java | 20 +- .../svek/image/EntityImageDescription.java | 6 +- .../svek/image/EntityImageEmptyPackage.java | 8 +- .../plantuml/svek/image/EntityImageJson.java | 263 ++++++++++++++++++ .../image/EntityImageLollipopInterface.java | 6 +- .../plantuml/svek/image/EntityImageMap.java | 10 +- .../plantuml/svek/image/EntityImageNote.java | 6 +- .../svek/image/EntityImageObject.java | 10 +- .../plantuml/svek/image/EntityImagePort.java | 6 +- .../svek/image/EntityImagePseudoState.java | 6 +- .../svek/image/EntityImageState2.java | 6 +- .../svek/image/EntityImageStateBorder.java | 6 +- .../svek/image/EntityImageStateCommon.java | 10 +- .../svek/image/EntityImageSynchroBar.java | 8 +- .../plantuml/svek/image/EntityImageTips.java | 6 +- .../svek/image/EntityImageUseCase.java | 7 +- .../plantuml/timingdiagram/Highlight.java | 6 +- .../plantuml/timingdiagram/Player.java | 6 +- .../plantuml/timingdiagram/PlayerAnalog.java | 6 +- .../plantuml/timingdiagram/PlayerBinary.java | 6 +- .../plantuml/timingdiagram/PlayerClock.java | 6 +- .../timingdiagram/PlayerRobustConcise.java | 12 +- .../timingdiagram/TimeConstraint.java | 6 +- .../plantuml/timingdiagram/TimeMessage.java | 6 +- .../plantuml/timingdiagram/TimingDiagram.java | 6 +- .../plantuml/timingdiagram/TimingRuler.java | 6 +- .../timingdiagram/graphic/Histogram.java | 2 +- .../timingdiagram/graphic/PlayerFrame.java | 6 +- .../plantuml/ugraphic/ImageBuilder.java | 4 +- .../sourceforge/plantuml/version/Version.java | 2 +- .../plantuml/wbs/WBSTextBlock.java | 6 +- .../sourceforge/plantuml/wbs/WElement.java | 16 +- 148 files changed, 1712 insertions(+), 761 deletions(-) create mode 100644 src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java create mode 100644 src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java create mode 100644 src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java create mode 100644 src/net/sourceforge/plantuml/style/StyleSignatureBasic.java create mode 100644 src/net/sourceforge/plantuml/style/StyleSignatures.java create mode 100644 src/net/sourceforge/plantuml/svek/image/EntityImageJson.java diff --git a/src/net/sourceforge/plantuml/AnnotatedWorker.java b/src/net/sourceforge/plantuml/AnnotatedWorker.java index d9fda2dd3..f7be6886d 100644 --- a/src/net/sourceforge/plantuml/AnnotatedWorker.java +++ b/src/net/sourceforge/plantuml/AnnotatedWorker.java @@ -53,7 +53,7 @@ import net.sourceforge.plantuml.graphic.USymbols; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.DecorateEntityImage; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.MinMax; @@ -103,7 +103,7 @@ public class AnnotatedWorker { final UStroke stroke; final HColor borderColor; if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, SName.frame) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame) .getMergedStyle(skinParam.getCurrentStyleBuilder()); deltaShadow = style.value(PName.Shadowing).asDouble(); fontConfiguration = new FontConfiguration(getSkinParam(), style); @@ -189,7 +189,7 @@ public class AnnotatedWorker { return TextBlockUtils.empty(0, 0); if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, SName.caption) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.caption) .getMergedStyle(skinParam.getCurrentStyleBuilder()); return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); } @@ -204,7 +204,7 @@ public class AnnotatedWorker { final TextBlock block; if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, SName.title) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title) .getMergedStyle(skinParam.getCurrentStyleBuilder()); block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(), skinParam); } else { @@ -226,7 +226,7 @@ public class AnnotatedWorker { if (footer.isNull() == false) { Style style = null; if (UseStyle.useBetaStyle()) { - style = StyleSignature.of(SName.root, SName.document, SName.footer) + style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null), @@ -236,7 +236,7 @@ public class AnnotatedWorker { if (header.isNull() == false) { Style style = null; if (UseStyle.useBetaStyle()) { - style = StyleSignature.of(SName.root, SName.document, SName.header) + style = StyleSignatureBasic.of(SName.root, SName.document, SName.header) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null), diff --git a/src/net/sourceforge/plantuml/FontParam.java b/src/net/sourceforge/plantuml/FontParam.java index 2d7ec2569..7f84e97c7 100644 --- a/src/net/sourceforge/plantuml/FontParam.java +++ b/src/net/sourceforge/plantuml/FontParam.java @@ -39,7 +39,7 @@ import java.awt.Font; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; interface FontParamConstant { String FAMILY = "SansSerif"; @@ -187,23 +187,23 @@ public enum FontParam { return new FontConfiguration(skinParam, this, null); } - public StyleSignature getStyleDefinition(SName diagramType) { + public StyleSignatureBasic getStyleDefinition(SName diagramType) { if (this == FOOTER) { - return StyleSignature.of(SName.root, SName.document, SName.footer); + return StyleSignatureBasic.of(SName.root, SName.document, SName.footer); } if (this == HEADER) { - return StyleSignature.of(SName.root, SName.document, SName.header); + return StyleSignatureBasic.of(SName.root, SName.document, SName.header); } if (this == TITLE) { - return StyleSignature.of(SName.root, SName.document, SName.title); + return StyleSignatureBasic.of(SName.root, SName.document, SName.title); } if (this == CLASS_ATTRIBUTE) { - return StyleSignature.of(SName.root, SName.element, SName.classDiagram, SName.class_); + return StyleSignatureBasic.of(SName.root, SName.element, SName.classDiagram, SName.class_); } if (this == RECTANGLE || this == NODE) { - return StyleSignature.of(SName.root, SName.element, SName.componentDiagram, SName.component); + return StyleSignatureBasic.of(SName.root, SName.element, SName.componentDiagram, SName.component); } - return StyleSignature.of(SName.root, SName.element, diagramType, SName.component); + return StyleSignatureBasic.of(SName.root, SName.element, diagramType, SName.component); // System.err.println("Warning " + this); // throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/TitledDiagram.java b/src/net/sourceforge/plantuml/TitledDiagram.java index fe732a31e..86697296c 100644 --- a/src/net/sourceforge/plantuml/TitledDiagram.java +++ b/src/net/sourceforge/plantuml/TitledDiagram.java @@ -58,7 +58,7 @@ import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; import net.sourceforge.plantuml.style.StyleLoader; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; @@ -274,7 +274,7 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram, public HColor calculateBackColor() { if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName()) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName()) .getMergedStyle(this.getSkinParam().getCurrentStyleBuilder()); HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(), diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java index 33858f663..f0bc096d9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java @@ -63,7 +63,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; public class Branch { @@ -82,12 +82,12 @@ public class Branch { private Ftile ftile; private Gtile gtile; - public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } - public StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + public StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } public boolean containsBreak() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java index a075ca7e1..a575a8033 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java @@ -57,7 +57,7 @@ import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException; @@ -119,10 +119,10 @@ public class CommandPartition3 extends SingleLineCommand2 { return ColorParser.simpleColor(ColorType.BACK, id); } - private StyleSignature getDefaultStyleDefinitionPartition(USymbol symbol) { + private StyleSignatureBasic getDefaultStyleDefinitionPartition(USymbol symbol) { if (symbol == USymbols.RECTANGLE) - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.rectangle); - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition); + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.rectangle); + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.partition); } @Override @@ -145,7 +145,7 @@ public class CommandPartition3 extends SingleLineCommand2 { double roundCorner; if (UseStyle.useBetaStyle()) { - final Style stylePartition = getDefaultStyleDefinitionPartition(symbol).with(stereotype) + final Style stylePartition = getDefaultStyleDefinitionPartition(symbol).withTOBECHANGED(stereotype) .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); borderColor = stylePartition.value(PName.LineColor).asColor(diagram.getSkinParam().getThemeStyle(), diagram.getSkinParam().getIHtmlColorSet()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java index 520cd3523..dbd4491e0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -57,7 +57,7 @@ public class EntityImageLegend { public static TextBlock create(Display note, ISkinParam skinParam) { if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.root, SName.document, + final Style style = StyleSignatureBasic.of(SName.root, SName.root, SName.document, skinParam.getUmlDiagramType().getStyleName(), SName.legend) .getMergedStyle(skinParam.getCurrentStyleBuilder()); return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java index 19f0fe0bd..5b3d4c492 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java @@ -61,7 +61,7 @@ import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; public class FtileFactoryDelegator implements FtileFactory { @@ -70,16 +70,16 @@ public class FtileFactoryDelegator implements FtileFactory { private final Rose rose = new Rose(); - final public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + final public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final public StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final public StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } protected final Rainbow getInLinkRenderingColor(Ftile tile) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java index 13695dabe..3a73a9e91 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/LaneDivider.java @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; @@ -73,8 +73,8 @@ public class LaneDivider extends AbstractTextBlock { this.height = height; } - public StyleSignature getDefaultStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.swimlane); + public StyleSignatureBasic getDefaultStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.swimlane); } private Style getStyle() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java index 90f4eca0f..bf8ba96bc 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java @@ -53,7 +53,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; @@ -148,19 +148,19 @@ public class Snake implements UShape { } public static Snake create(ISkinParam skinParam, Rainbow color) { - final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style style = StyleSignatureBasic.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); return new Snake(skinParam, null, color, null, new Worm(style), MergeStrategy.FULL, null, new ArrayList()); } public static Snake create(ISkinParam skinParam, Rainbow color, UPolygon endDecoration) { - final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style style = StyleSignatureBasic.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); return new Snake(skinParam, null, color, endDecoration, new Worm(style), MergeStrategy.FULL, null, new ArrayList()); } public static Snake create(ISkinParam skinParam, UPolygon startDecoration, Rainbow color, UPolygon endDecoration) { - final Style style = StyleSignature.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style style = StyleSignatureBasic.activityArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); return new Snake(skinParam, startDecoration, color, endDecoration, new Worm(style), MergeStrategy.FULL, null, new ArrayList()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java index b0c093b55..b45b63861 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java @@ -75,7 +75,7 @@ import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; import net.sourceforge.plantuml.svek.UGraphicForSnake; import net.sourceforge.plantuml.ugraphic.LimitFinder; @@ -120,8 +120,8 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable return Collections.unmodifiableList(swimlanesSpecial); } - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.swimlane); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.swimlane); } public Swimlanes(ISkinParam skinParam, Pragma pragma) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java index d0eed686e..97b7ace01 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java @@ -50,7 +50,7 @@ import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.graphic.HtmlColorAndStyle; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java index e68981db2..a5051c191 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java @@ -55,7 +55,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; public abstract class AbstractParallelFtilesBuilder { @@ -67,12 +67,12 @@ public abstract class AbstractParallelFtilesBuilder { private final StringBounder stringBounder; protected final List list99 = new ArrayList<>(); - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final public StyleSignature getStyleSignatureArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getStyleSignatureArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } public AbstractParallelFtilesBuilder(ISkinParam skinParam, StringBounder stringBounder, List all) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java index c4664c62b..e95a01514 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java @@ -58,7 +58,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -79,7 +79,7 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc final LineBreakStrategy wrapWidth; final double shadowing; if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note) + final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note) .getMergedStyle(skinParam.getCurrentStyleBuilder()); wrapWidth = style.wrapWidth(); fc = new FontConfiguration(skinParam, style); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java index 8cec0b6bc..da3a371e2 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java @@ -62,7 +62,7 @@ import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.UGraphicForSnake; import net.sourceforge.plantuml.ugraphic.LimitFinder; import net.sourceforge.plantuml.ugraphic.MinMax; @@ -87,8 +87,8 @@ public class FtileGroup extends AbstractFtile { private final USymbol type; private final double roundCorner; - final public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition); + final public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.partition); } public FtileGroup(Ftile inner, Display title, Display displayNote, HColor arrowColor, HColor backColor, diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java index 621f3c850..8f521cbb1 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java @@ -73,7 +73,7 @@ import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -126,7 +126,7 @@ class FtileIfAndStop extends AbstractFtile { final UStroke thickness; final FontConfiguration fcTest; if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); + final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder()); thickness = tileNonStop.getThickness(style); fcTest = new FontConfiguration(skinParam, style); } else { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java index 7d2e81d9a..4ee9c64df 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java @@ -64,7 +64,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -77,8 +77,8 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable private final boolean withOutPoint; private final Swimlane swimlane; - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java index 436c6bd9d..69ccea6a6 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java @@ -71,7 +71,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -88,8 +88,8 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea private final double suppSpace = 20; private final Swimlane swimlaneNote; - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note); } public Set getSwimlanes() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java index 0e7567ade..ed3fde54a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java @@ -66,7 +66,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -83,8 +83,8 @@ public class FtileWithNotes extends AbstractFtile { private final double suppSpace = 20; - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note); } public Set getSwimlanes() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java index b5a013391..d1e6e104a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java @@ -58,7 +58,7 @@ import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -70,8 +70,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder { } @Override - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java index aa936f32f..b4087f205 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java @@ -71,7 +71,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -94,20 +94,20 @@ public class VCompactFactory implements FtileFactory { this.stringBounder = stringBounder; } - private StyleSignature getSignatureCircleEnd() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.end); + private StyleSignatureBasic getSignatureCircleEnd() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.end); } - private StyleSignature getSignatureCircleStop() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.stop); + private StyleSignatureBasic getSignatureCircleStop() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.stop); } - private StyleSignature getSignatureCircleSpot() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.spot); + private StyleSignatureBasic getSignatureCircleSpot() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.spot); } - private StyleSignature getSignatureCircleStart() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.start); + private StyleSignatureBasic getSignatureCircleStart() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle, SName.start); } public Ftile start(Swimlane swimlane) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java index 59707fbbc..a18a83c8e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java @@ -68,7 +68,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.ConditionEndStyle; import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -96,12 +96,12 @@ public class ConditionalBuilder { private final Ftile tile2; private final Url url; - private StyleSignature getStyleSignatureDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + private StyleSignatureBasic getStyleSignatureDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - private StyleSignature getStyleSignatureArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + private StyleSignatureBasic getStyleSignatureArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } public ConditionalBuilder(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor, diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java index 23acf8ba3..1b8b43180 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java @@ -55,7 +55,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java index 58231201a..78ea4c649 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java @@ -53,7 +53,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -93,8 +93,8 @@ public class FtileBlackBlock extends AbstractFtile { return new FtileGeometry(width + supp, height, width / 2, 0, height); } - private StyleSignature getSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activityBar); + private StyleSignatureBasic getSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activityBar); } public void drawU(UGraphic ug) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java index 68d51178f..a4a610d64 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java @@ -73,7 +73,7 @@ import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -99,12 +99,12 @@ public class FtileBox extends AbstractFtile { private final HColor backColor; private final Style style; - static public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + static public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - static public StyleSignature getStyleSignatureArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + static public StyleSignatureBasic getStyleSignatureArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } final public LinkRendering getInLinkRendering() { @@ -144,7 +144,7 @@ public class FtileBox extends AbstractFtile { Style style = null; Style styleArrow = null; if (UseStyle.useBetaStyle()) { - style = getStyleSignature().with(stereotype) + style = getStyleSignature().withTOBECHANGED(stereotype) .getMergedStyle(skinParam.getCurrentStyleBuilder()); styleArrow = getStyleSignatureArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java index 1b108de58..3f854537b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java @@ -73,7 +73,7 @@ import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -100,12 +100,12 @@ public class FtileBox2 extends AbstractFtile { private final HColor backColor; private final Style style; - static public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + static public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - static public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + static public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } final public LinkRendering getInLinkRendering() { @@ -145,7 +145,7 @@ public class FtileBox2 extends AbstractFtile { Style style = null; Style styleArrow = null; if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().with(stereotype) + style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) .getMergedStyle(skinParam.getCurrentStyleBuilder()); styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java index c6d90c516..fbad56228 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java @@ -74,7 +74,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -99,12 +99,12 @@ public class FtileBoxOld extends AbstractFtile { private final HColor backColor; private final Style style; - static public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + static public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - static public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + static public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } final public LinkRendering getInLinkRendering() { @@ -144,7 +144,7 @@ public class FtileBoxOld extends AbstractFtile { Style style = null; Style styleArrow = null; if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().with(stereotype) + style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) .getMergedStyle(skinParam.getCurrentStyleBuilder()); styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); } @@ -152,7 +152,7 @@ public class FtileBoxOld extends AbstractFtile { } public static TextBlock createWbs(StyleBuilder styleBuilder, ISkinParam skinParam, Display label, - StyleSignature styleDefinition) { + StyleSignatureBasic styleDefinition) { Style style = null; Style styleArrow = null; if (UseStyle.useBetaStyle()) { @@ -171,7 +171,7 @@ public class FtileBoxOld extends AbstractFtile { } public static TextBlock createMindMap(StyleBuilder styleBuilder, ISkinParam skinParam, Display label, - StyleSignature styleDefinition) { + StyleSignatureBasic styleDefinition) { final Style style = styleDefinition.getMergedStyle(styleBuilder); final Style styleArrow = style; return new FtileBoxOld(skinParam, label, null, BoxStyle.PLAIN, style, styleArrow); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java index e7dcecd7e..9e17348c3 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondWIP.java @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -67,8 +67,8 @@ abstract class FtileDiamondWIP extends AbstractFtile implements Styleable { protected final double shadowing; - final public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } final public Style getStyle() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java index bbc98fa7f..05b24bf32 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GAbstractConnection.java @@ -44,7 +44,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -87,8 +87,8 @@ public abstract class GAbstractConnection implements GConnection { throw new UnsupportedOperationException(); } - private final StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + private final StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } protected ISkinParam skinParam() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java index 2b8c290a4..977041cdb 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java @@ -52,7 +52,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UTranslate; public class GtileAssembly extends GtileTopDown { @@ -71,8 +71,8 @@ public class GtileAssembly extends GtileTopDown { return new UTranslate(0, height); } - final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java index 3ca5bc6bb..bae0310d9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileBox.java @@ -68,7 +68,7 @@ import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -94,12 +94,12 @@ public class GtileBox extends AbstractGtile { private final HColor backColor; private final Style style; - static public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + static public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - static public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + static public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } final public LinkRendering getInLinkRendering() { @@ -124,7 +124,7 @@ public class GtileBox extends AbstractGtile { Style style = null; Style styleArrow = null; if (UseStyle.useBetaStyle()) { - style = getDefaultStyleDefinitionActivity().with(stereotype) + style = getDefaultStyleDefinitionActivity().withTOBECHANGED(stereotype) .getMergedStyle(skinParam.getCurrentStyleBuilder()); styleArrow = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java index 8cd113373..2b2522b46 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleSpot.java @@ -49,7 +49,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UFont; @@ -66,8 +66,8 @@ public class GtileCircleSpot extends AbstractGtile { private final HColor backColor; private double shadowing; - private StyleSignature getDefaultStyleDefinitionCircle() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle); + private StyleSignatureBasic getDefaultStyleDefinitionCircle() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle); } public GtileCircleSpot(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane, diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java index dbf603fab..a4ff06fcc 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileCircleStart.java @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -58,8 +58,8 @@ public class GtileCircleStart extends AbstractGtile { private final HColor backColor; private double shadowing; - private StyleSignature getDefaultStyleDefinitionCircle() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle); + private StyleSignatureBasic getDefaultStyleDefinitionCircle() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle); } public GtileCircleStart(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java index 11d9b7e1c..4a3ece457 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileGroup.java @@ -60,7 +60,7 @@ import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -82,8 +82,8 @@ public class GtileGroup extends AbstractGtileRoot { private final USymbol type; private final double roundCorner; - final public StyleSignature getDefaultStyleDefinitionPartition() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition); + final public StyleSignatureBasic getDefaultStyleDefinitionPartition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.partition); } private double suppWidth(StringBounder stringBounder) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java index 2a9fa6dc9..5b08ae8a1 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInside.java @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -63,8 +63,8 @@ public class GtileHexagonInside extends AbstractGtile { protected final double shadowing; - final public StyleSignature getDefaultStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final public StyleSignatureBasic getDefaultStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } // FtileDiamondInside diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java index 712feddd5..a581d3ee8 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; public class GtileIfAlone extends GtileTopDown3 { @@ -74,16 +74,16 @@ public class GtileIfAlone extends GtileTopDown3 { return Gtiles.withNorthMargin(tmp, 20); } - final public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + final public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final static public StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final static public StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java index 8b67b1481..fdf2f6325 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -177,16 +177,16 @@ public class GtileIfHexagon extends GtileColumns { return Dimension2DDouble.delta(nude, 0, height2 + 30); } - final public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + final public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final public StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final public StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java index 56ff98859..3329013b1 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java @@ -49,7 +49,7 @@ import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -83,16 +83,16 @@ public class GtileRepeat extends GtileTopDown3 { return Gtiles.withNorthMargin(tmp, 20); } - final public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + final public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final static public StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final static public StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java index 66ae3b13f..ff4e2a5ff 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java @@ -42,7 +42,7 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -59,16 +59,16 @@ public class GtileSplit extends GtileColumns { } - final public StyleSignature getDefaultStyleDefinitionActivity() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity); + final public StyleSignatureBasic getDefaultStyleDefinitionActivity() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity); } - final static public StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + final static public StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } - final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWhile.java index 0c86bdea2..6629fc55d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWhile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWhile.java @@ -43,7 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class GtileWhile extends GtileTopDown3 { @@ -52,8 +52,8 @@ public class GtileWhile extends GtileTopDown3 { super(tile1, tile2, tile3); } - private static StyleSignature getDefaultStyleDefinitionDiamond() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); + private static StyleSignatureBasic getDefaultStyleDefinitionDiamond() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond); } private static Gtile getShape1(Gtile toto, Swimlane swimlane, Display test, Display yes) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java index 2d44699f3..1129d032d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java @@ -63,7 +63,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -86,8 +86,8 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea private final Dimension2D dimNote; private final Dimension2D dimTile; - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java index 3031366ac..caf51ed47 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNotes.java @@ -63,7 +63,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -80,8 +80,8 @@ public class GtileWithNotes extends AbstractGtile { private final double suppSpace = 20; - public StyleSignature getDefaultStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note); + public StyleSignatureBasic getDefaultStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note); } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java index f71352644..54b5b655d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java @@ -56,7 +56,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.ConditionStyle; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -66,7 +66,7 @@ public class Gtiles { private static final Rose rose = new Rose(); static public GtileHexagonInside hexagonInside(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam, - StyleSignature styleSignature, HColor color, Display label) { + StyleSignatureBasic styleSignature, HColor color, Display label) { final ConditionStyle conditionStyle = skinParam.getConditionStyle(); final HColor borderColor; @@ -99,7 +99,7 @@ public class Gtiles { } static public AbstractGtileRoot diamondEmpty(Swimlane swimlane, StringBounder stringBounder, ISkinParam skinParam, - StyleSignature styleSignature, HColor color) { + StyleSignatureBasic styleSignature, HColor color) { final HColor borderColor; final HColor backColor; diff --git a/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java b/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java index 1ae8b7e5c..9a2917cf1 100644 --- a/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java +++ b/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java @@ -41,7 +41,7 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; public abstract class AbstractComponentText implements Component { @@ -55,7 +55,7 @@ public abstract class AbstractComponentText implements Component { throw new UnsupportedOperationException(); } - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/bpm/BpmElement.java b/src/net/sourceforge/plantuml/bpm/BpmElement.java index 21228114f..972a81821 100644 --- a/src/net/sourceforge/plantuml/bpm/BpmElement.java +++ b/src/net/sourceforge/plantuml/bpm/BpmElement.java @@ -56,7 +56,7 @@ import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -142,8 +142,8 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz } } - private StyleSignature getSignatureCircle() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle); + private StyleSignatureBasic getSignatureCircle() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.circle); } private Style getStyle(ISkinParam skinParam) { diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java index cd5944323..18c83ea47 100644 --- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java +++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java @@ -80,6 +80,7 @@ import net.sourceforge.plantuml.descdiagram.command.CommandNewpage; import net.sourceforge.plantuml.descdiagram.command.CommandPackageWithUSymbol; import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObject; import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObjectMultilines; +import net.sourceforge.plantuml.objectdiagram.command.CommandCreateJson; import net.sourceforge.plantuml.objectdiagram.command.CommandCreateMap; public class ClassDiagramFactory extends PSystemCommandFactory { @@ -106,6 +107,7 @@ public class ClassDiagramFactory extends PSystemCommandFactory { cmds.add(new CommandCreateClassMultilines()); cmds.add(new CommandCreateEntityObjectMultilines()); cmds.add(new CommandCreateMap()); + cmds.add(new CommandCreateJson()); cmds.add(new CommandCreateClass()); cmds.add(new CommandCreateEntityObject()); diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java b/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java new file mode 100644 index 000000000..c9e349c4d --- /dev/null +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierJSon.java @@ -0,0 +1,103 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (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 + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * + * Original Author: Arnaud Roques + * + * + */ +package net.sourceforge.plantuml.cucadiagram; + +import java.util.List; +import java.util.Objects; + +import net.sourceforge.plantuml.FontParam; +import net.sourceforge.plantuml.ISkinParam; +import net.sourceforge.plantuml.graphic.FontConfiguration; +import net.sourceforge.plantuml.graphic.TextBlock; +import net.sourceforge.plantuml.json.JsonValue; +import net.sourceforge.plantuml.style.Style; +import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException; + +public class BodierJSon implements Bodier { + + private ILeaf leaf; + private JsonValue json; + + @Override + public void muteClassToObject() { + throw new UnsupportedOperationException(); + } + + public BodierJSon() { + } + + @Override + public void setLeaf(ILeaf leaf) { + this.leaf = Objects.requireNonNull(leaf); + + } + + @Override + public Display getMethodsToDisplay() { + throw new UnsupportedOperationException(); + } + + @Override + public Display getFieldsToDisplay() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean hasUrl() { + return false; + } + + @Override + public TextBlock getBody(FontParam fontParam, ISkinParam skinParam, final boolean showMethods, + final boolean showFields, Stereotype stereotype, Style style, FontConfiguration fontConfiguration) { + return new TextBlockCucaJSon(fontConfiguration, fontParam, skinParam, json); + } + + @Override + public List getRawBody() { + throw new UnsupportedOperationException(); + } + + @Override + public void addFieldOrMethod(String s) throws NoSuchColorException { + throw new UnsupportedOperationException(); + } + + public void setJson(JsonValue json) { + this.json = json; + } + +} diff --git a/src/net/sourceforge/plantuml/cucadiagram/LeafType.java b/src/net/sourceforge/plantuml/cucadiagram/LeafType.java index ef3488304..5c63151f4 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/LeafType.java +++ b/src/net/sourceforge/plantuml/cucadiagram/LeafType.java @@ -42,7 +42,7 @@ public enum LeafType { EMPTY_PACKAGE, - ABSTRACT_CLASS, CLASS, INTERFACE, ANNOTATION, LOLLIPOP_FULL, LOLLIPOP_HALF, NOTE, TIPS, OBJECT, MAP, ASSOCIATION, + ABSTRACT_CLASS, CLASS, INTERFACE, ANNOTATION, LOLLIPOP_FULL, LOLLIPOP_HALF, NOTE, TIPS, OBJECT, MAP, JSON, ASSOCIATION, ENUM, CIRCLE, USECASE, USECASE_BUSINESS, diff --git a/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java b/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java new file mode 100644 index 000000000..f01dda4d5 --- /dev/null +++ b/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java @@ -0,0 +1,237 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (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 + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * + * Original Author: Arnaud Roques + * + * + */ +package net.sourceforge.plantuml.cucadiagram; + +import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.FontParam; +import net.sourceforge.plantuml.ISkinParam; +import net.sourceforge.plantuml.awt.geom.Dimension2D; +import net.sourceforge.plantuml.graphic.AbstractTextBlock; +import net.sourceforge.plantuml.graphic.FontConfiguration; +import net.sourceforge.plantuml.graphic.HorizontalAlignment; +import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.TextBlock; +import net.sourceforge.plantuml.graphic.TextBlockUtils; +import net.sourceforge.plantuml.json.JsonArray; +import net.sourceforge.plantuml.json.JsonObject; +import net.sourceforge.plantuml.json.JsonValue; +import net.sourceforge.plantuml.svek.Ports; +import net.sourceforge.plantuml.svek.WithPorts; +import net.sourceforge.plantuml.ugraphic.UGraphic; +import net.sourceforge.plantuml.ugraphic.ULine; +import net.sourceforge.plantuml.ugraphic.UTranslate; + +public class TextBlockCucaJSon extends AbstractTextBlock implements WithPorts { + + private final FontParam fontParam; + private final ISkinParam skinParam; + private final FontConfiguration fontConfiguration; + private final JsonValue json; + private TextBlockJson jsonTextBlock; + private double totalWidth; + + public TextBlockCucaJSon(FontConfiguration fontConfiguration, FontParam fontParam, ISkinParam skinParam, + JsonValue json) { + this.fontParam = fontParam; + this.skinParam = skinParam; + this.json = json; + this.fontConfiguration = fontConfiguration; + } + + private TextBlockJson getJsonTextBlock() { + if (jsonTextBlock == null) + this.jsonTextBlock = new TextBlockJson(json, 0); + + jsonTextBlock.totalWidth = totalWidth; + return jsonTextBlock; + } + + @Override + public Ports getPorts(StringBounder stringBounder) { + return new Ports(); + } + + public Dimension2D calculateDimension(StringBounder stringBounder) { + return getJsonTextBlock().calculateDimension(stringBounder); + } + + public void drawU(UGraphic ug) { + getJsonTextBlock().drawU(ug); + } + + class TextBlockJson extends AbstractTextBlock { + + private final JsonObject obj; + private double totalWidth; + + public TextBlockJson(JsonValue json, double totalWidth) { + this.obj = json.asObject(); + this.totalWidth = totalWidth; + } + + @Override + public Dimension2D calculateDimension(StringBounder stringBounder) { + return new Dimension2DDouble(getWidth1(stringBounder) + getWidth2(stringBounder), getHeight(stringBounder)); + } + + private double getWidth1(StringBounder stringBounder) { + double result = 0; + for (JsonObject.Member s : obj) { + final TextBlock tb1 = getTextBlockKey(s.getName()); + result = Math.max(result, tb1.calculateDimension(stringBounder).getWidth()); + } + return result; + } + + private double getWidth2(StringBounder stringBounder) { + double result = 0; + for (JsonObject.Member s : obj) { + final TextBlock tb2 = getTextBlockValue(s.getValue(), totalWidth); + result = Math.max(result, tb2.calculateDimension(stringBounder).getWidth()); + } + return result; + } + + private double getHeight(StringBounder stringBounder) { + double result = 0; + for (JsonObject.Member s : obj) { + final TextBlock tb1 = getTextBlockKey(s.getName()); + final TextBlock tb2 = getTextBlockValue(s.getValue(), totalWidth); + final Dimension2D dim1 = tb1.calculateDimension(stringBounder); + final Dimension2D dim2 = tb2.calculateDimension(stringBounder); + result += Math.max(dim1.getHeight(), dim2.getHeight()); + } + return result; + } + + @Override + public void drawU(UGraphic ug) { + final StringBounder stringBounder = ug.getStringBounder(); + final double width1 = getWidth1(stringBounder); + final double width2 = getWidth2(stringBounder); + final double height = getHeight(stringBounder); + ug.apply(UTranslate.dx(width1)).draw(ULine.vline(height)); + final ULine hline = ULine.hline(this.totalWidth); + for (JsonObject.Member s : obj) { + final TextBlock tb1 = getTextBlockKey(s.getName()); + final TextBlock tb2 = getTextBlockValue(s.getValue(), width2); + final Dimension2D dim1 = tb1.calculateDimension(stringBounder); + final Dimension2D dim2 = tb2.calculateDimension(stringBounder); + ug.draw(hline); + tb1.drawU(ug); + tb2.drawU(ug.apply(UTranslate.dx(width1))); + ug = ug.apply(UTranslate.dy(Math.max(dim1.getHeight(), dim2.getHeight()))); + } + + } + + } + + private TextBlock getTextBlockValue(JsonValue value, double width2) { + if (value.isString() || value.isNull() || value.isTrue() || value.isFalse() || value.isNumber()) { + final String tmp = value.isString() ? value.asString() : value.toString(); + final Display display = Display.getWithNewlines(tmp); + TextBlock result = display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam); + result = TextBlockUtils.withMargin(result, 5, 2); + return result; + } + if (value.isArray()) + return new TextBlockArray(value.asArray(), width2); + if (value.isObject()) + return new TextBlockJson(value, width2); + + final String tmp = value.getClass().getSimpleName(); + final Display display = Display.getWithNewlines(tmp); + TextBlock result = display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam); + result = TextBlockUtils.withMargin(result, 5, 2); + return result; + } + + class TextBlockArray extends AbstractTextBlock { + + private final JsonArray array; + private final double totalWidth; + + public TextBlockArray(JsonArray array, double totalWidth) { + this.array = array; + this.totalWidth = totalWidth; + } + + @Override + public Dimension2D calculateDimension(StringBounder stringBounder) { + Dimension2D result = new Dimension2DDouble(0, 0); + for (JsonValue element : array) { + final TextBlock tb = getTextBlockValue(element, totalWidth); + final Dimension2D dim = tb.calculateDimension(stringBounder); + result = Dimension2DDouble.mergeTB(result, dim); + } + return result; + } + + @Override + public void drawU(UGraphic ug) { + final ULine hline = ULine.hline(this.totalWidth); + int nb = 0; + for (JsonValue element : array) { + final TextBlock tb = getTextBlockValue(element, totalWidth); + if (nb > 0) + ug.draw(hline); + nb++; + tb.drawU(ug); + ug = ug.apply(UTranslate.dy(tb.calculateDimension(ug.getStringBounder()).getHeight())); + } + } + + } + + private TextBlock getTextBlockKey(String key) { + final Display display = Display.getWithNewlines(key); + TextBlock result = display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam); + result = TextBlockUtils.withMargin(result, 5, 2); + return result; + } + + private FontConfiguration getFontConfiguration() { + if (fontConfiguration == null) + return new FontConfiguration(skinParam, fontParam, null); + return fontConfiguration; + } + + public void setTotalWidth(double totalWidth) { + this.totalWidth = totalWidth; + } + +} diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java index 699481d9c..80189cd25 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java @@ -72,14 +72,15 @@ public class GraphvizVersionFinder { public GraphvizVersion getVersion() { final String dotVersion = dotVersion(); - final Pattern p = Pattern.compile("\\d\\.\\d\\d"); + final Pattern p = Pattern.compile("([23])\\.(\\d\\d?)"); final Matcher m = p.matcher(dotVersion); final boolean find = m.find(); if (find == false) { return DEFAULT; } - final String vv = m.group(0); - final int v = Integer.parseInt(vv.replaceAll("\\.", "")); + final int major = Integer.parseInt(m.group(1)); + final int minor = Integer.parseInt(m.group(2)); + final int v = 100 * major + minor; return new GraphvizVersion() { public boolean useShield() { return v <= 228; diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java index 6783016d8..16cf68c5a 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java @@ -52,6 +52,7 @@ import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Bodier; +import net.sourceforge.plantuml.cucadiagram.BodierJSon; import net.sourceforge.plantuml.cucadiagram.BodierMap; import net.sourceforge.plantuml.cucadiagram.BodyFactory; import net.sourceforge.plantuml.cucadiagram.Code; @@ -134,8 +135,7 @@ public final class EntityFactory { if (g.getColors().getColor(ColorType.BACK) == null) { final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack(); final HColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false); - folder.setSpecificColorTOBEREMOVED(ColorType.BACK, - c1 == null ? skinParam.getBackgroundColor() : c1); + folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? skinParam.getBackgroundColor() : c1); } else { folder.setSpecificColorTOBEREMOVED(ColorType.BACK, g.getColors().getColor(ColorType.BACK)); } @@ -226,6 +226,8 @@ public final class EntityFactory { final Bodier bodier; if (Objects.requireNonNull(entityType) == LeafType.MAP) bodier = new BodierMap(); + else if (Objects.requireNonNull(entityType) == LeafType.JSON) + bodier = new BodierJSon(); else bodier = BodyFactory.createLeaf(entityType, hides); diff --git a/src/net/sourceforge/plantuml/elk/ElkPath.java b/src/net/sourceforge/plantuml/elk/ElkPath.java index eabb4d17d..bf7d338db 100644 --- a/src/net/sourceforge/plantuml/elk/ElkPath.java +++ b/src/net/sourceforge/plantuml/elk/ElkPath.java @@ -78,7 +78,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.extremity.ExtremityFactory; import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryExtends; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -129,7 +129,7 @@ public class ElkPath implements UDrawable { } private Style getStyle() { - final StyleSignature signature = StyleSignature.of(SName.root, SName.element, styleName, SName.arrow); + final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, styleName, SName.arrow); return signature.getMergedStyle(diagram.getCurrentStyleBuilder()); } diff --git a/src/net/sourceforge/plantuml/gitlog/MagicBox.java b/src/net/sourceforge/plantuml/gitlog/MagicBox.java index 71ae5cdfc..327c0ad62 100644 --- a/src/net/sourceforge/plantuml/gitlog/MagicBox.java +++ b/src/net/sourceforge/plantuml/gitlog/MagicBox.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.URectangle; @@ -64,7 +64,7 @@ public class MagicBox { public MagicBox(ISkinParam skinParam, GNode node) { this.skinParam = skinParam; this.node = node; - final Style style = StyleSignature.of(SName.root, SName.element, SName.gitDiagram) + final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.gitDiagram) .getMergedStyle(skinParam.getCurrentStyleBuilder()); this.fontColor = style.value(PName.FontColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); } diff --git a/src/net/sourceforge/plantuml/gitlog/SmetanaForGit.java b/src/net/sourceforge/plantuml/gitlog/SmetanaForGit.java index 72d80b8d3..af578ef37 100644 --- a/src/net/sourceforge/plantuml/gitlog/SmetanaForGit.java +++ b/src/net/sourceforge/plantuml/gitlog/SmetanaForGit.java @@ -62,7 +62,7 @@ import net.sourceforge.plantuml.jsondiagram.Mirror; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -89,7 +89,7 @@ public class SmetanaForGit { } private Style getStyle() { - return StyleSignature.of(SName.root, SName.element, SName.gitDiagram) + return StyleSignatureBasic.of(SName.root, SName.element, SName.gitDiagram) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java index ddd01059a..47cf5dfe4 100644 --- a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java +++ b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java @@ -43,7 +43,7 @@ import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException; @@ -81,8 +81,8 @@ public class HtmlColorAndStyle { return style; } - static final public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); + static final public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.arrow); } public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) throws NoSuchColorException { diff --git a/src/net/sourceforge/plantuml/json/Json.java b/src/net/sourceforge/plantuml/json/Json.java index ed171d44c..def05c92c 100644 --- a/src/net/sourceforge/plantuml/json/Json.java +++ b/src/net/sourceforge/plantuml/json/Json.java @@ -331,7 +331,7 @@ public final class Json { return string; } - static class DefaultHandler extends JsonHandler { + public static class DefaultHandler extends JsonHandler { protected JsonValue value; @@ -385,7 +385,7 @@ public final class Json { object.add(name, value); } - JsonValue getValue() { + public JsonValue getValue() { return value; } diff --git a/src/net/sourceforge/plantuml/jsondiagram/SmetanaForJson.java b/src/net/sourceforge/plantuml/jsondiagram/SmetanaForJson.java index 61ddde588..c4f0b0a2c 100644 --- a/src/net/sourceforge/plantuml/jsondiagram/SmetanaForJson.java +++ b/src/net/sourceforge/plantuml/jsondiagram/SmetanaForJson.java @@ -59,7 +59,7 @@ import net.sourceforge.plantuml.json.JsonValue; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -116,27 +116,27 @@ public class SmetanaForJson { } private Style getStyleArrow() { - return StyleSignature.of(SName.root, SName.element, getDiagramType(), SName.arrow) + return StyleSignatureBasic.of(SName.root, SName.element, getDiagramType(), SName.arrow) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } private Style getStyleNode() { - return StyleSignature.of(SName.root, SName.element, getDiagramType(), SName.node) + return StyleSignatureBasic.of(SName.root, SName.element, getDiagramType(), SName.node) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } private Style getStyleNodeHeader() { - return StyleSignature.of(SName.root, SName.element, getDiagramType(), SName.header, SName.node) + return StyleSignatureBasic.of(SName.root, SName.element, getDiagramType(), SName.header, SName.node) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } private Style getStyleNodeHighlight() { - return StyleSignature.of(SName.root, SName.element, getDiagramType(), SName.node, SName.highlight) + return StyleSignatureBasic.of(SName.root, SName.element, getDiagramType(), SName.node, SName.highlight) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } private Style getStyleNodeHeaderHighlight() { - return StyleSignature.of(SName.root, SName.element, getDiagramType(), SName.header, SName.node, SName.highlight) + return StyleSignatureBasic.of(SName.root, SName.element, getDiagramType(), SName.header, SName.node, SName.highlight) .getMergedStyle(skinParam.getCurrentStyleBuilder()); } diff --git a/src/net/sourceforge/plantuml/mindmap/FingerImpl.java b/src/net/sourceforge/plantuml/mindmap/FingerImpl.java index 33df5f1c2..1e51713ec 100644 --- a/src/net/sourceforge/plantuml/mindmap/FingerImpl.java +++ b/src/net/sourceforge/plantuml/mindmap/FingerImpl.java @@ -56,7 +56,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPath; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -82,32 +82,32 @@ public class FingerImpl implements Finger, UDrawable { private final List nail = new ArrayList<>(); private Tetris tetris = null; - private StyleSignature getDefaultStyleDefinitionNode() { + private StyleSignatureBasic getDefaultStyleDefinitionNode() { final String depth = SName.depth(level); if (level == 0) { - return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.rootNode) + return StyleSignatureBasic.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.rootNode) .add(stereotype).add(depth); } if (shape == IdeaShape.NONE && nail.size() == 0) { - return StyleSignature + return StyleSignatureBasic .of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.leafNode, SName.boxless) .add(stereotype).add(depth); } if (shape == IdeaShape.NONE) { - return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.boxless) + return StyleSignatureBasic.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.boxless) .add(stereotype).add(depth); } if (nail.size() == 0) { - return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.leafNode) + return StyleSignatureBasic.of(SName.root, SName.element, SName.mindmapDiagram, SName.node, SName.leafNode) .add(stereotype).add(depth); } - return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.node).add(stereotype) + return StyleSignatureBasic.of(SName.root, SName.element, SName.mindmapDiagram, SName.node).add(stereotype) .add(depth); } - public StyleSignature getDefaultStyleDefinitionArrow() { + public StyleSignatureBasic getDefaultStyleDefinitionArrow() { final String depth = SName.depth(level); - return StyleSignature.of(SName.root, SName.element, SName.mindmapDiagram, SName.arrow).add(stereotype) + return StyleSignatureBasic.of(SName.root, SName.element, SName.mindmapDiagram, SName.arrow).add(stereotype) .add(depth); } diff --git a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java index 2c5fdf928..ce2c8239b 100644 --- a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java +++ b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java @@ -75,7 +75,7 @@ import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UEmpty; @@ -278,8 +278,8 @@ public class NwDiagram extends UmlDiagram { }; } - private StyleSignature getStyleDefinitionNetwork(SName sname) { - return StyleSignature.of(SName.root, SName.element, SName.nwdiagDiagram, sname); + private StyleSignatureBasic getStyleDefinitionNetwork(SName sname) { + return StyleSignatureBasic.of(SName.root, SName.element, SName.nwdiagDiagram, sname); } private TextBlock toTextBlockForNetworkName(String name, String s) { diff --git a/src/net/sourceforge/plantuml/nwdiag/core/NServer.java b/src/net/sourceforge/plantuml/nwdiag/core/NServer.java index 0e1e92ba9..7e3db50df 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/NServer.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/NServer.java @@ -55,7 +55,7 @@ import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.PackageStyle; public class NServer { @@ -97,8 +97,8 @@ public class NServer { skinParam); } - private StyleSignature getStyleDefinition(SName sname) { - return StyleSignature.of(SName.root, SName.element, SName.nwdiagDiagram, sname); + private StyleSignatureBasic getStyleDefinition(SName sname) { + return StyleSignatureBasic.of(SName.root, SName.element, SName.nwdiagDiagram, sname); } private FontConfiguration getFontConfiguration(ISkinParam skinParam, SName sname) { diff --git a/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java b/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java index 8fb6c0fb3..fb8fdcdd7 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java @@ -51,7 +51,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -137,8 +137,8 @@ public class NwGroup implements NStackable { return blockDim.getHeight(); } - private StyleSignature getStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.nwdiagDiagram, SName.group); + private StyleSignatureBasic getStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.nwdiagDiagram, SName.group); } public void drawGroup(UGraphic ug, MinMax size, ISkinParam skinParam) { diff --git a/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java b/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java index 7a613c380..ef3468da2 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java @@ -44,7 +44,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.URectangle; @@ -133,8 +133,8 @@ public class GridTextBlockDecorated extends GridTextBlockSimple { return false; } - private StyleSignature getStyleDefinitionNetwork(SName sname) { - return StyleSignature.of(SName.root, SName.element, SName.nwdiagDiagram, sname); + private StyleSignatureBasic getStyleDefinitionNetwork(SName sname) { + return StyleSignatureBasic.of(SName.root, SName.element, SName.nwdiagDiagram, sname); } private void drawNetworkTube(UGraphic ug) { diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java new file mode 100644 index 000000000..99e926a19 --- /dev/null +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java @@ -0,0 +1,159 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (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 + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * + * Original Author: Arnaud Roques + * + * + */ +package net.sourceforge.plantuml.objectdiagram.command; + +import net.sourceforge.plantuml.FontParam; +import net.sourceforge.plantuml.StringLocated; +import net.sourceforge.plantuml.UrlBuilder; +import net.sourceforge.plantuml.command.BlocLines; +import net.sourceforge.plantuml.command.CommandExecutionResult; +import net.sourceforge.plantuml.command.CommandMultilines2; +import net.sourceforge.plantuml.command.MultilinesStrategy; +import net.sourceforge.plantuml.command.regex.IRegex; +import net.sourceforge.plantuml.command.regex.RegexConcat; +import net.sourceforge.plantuml.command.regex.RegexLeaf; +import net.sourceforge.plantuml.command.regex.RegexResult; +import net.sourceforge.plantuml.cucadiagram.BodierJSon; +import net.sourceforge.plantuml.cucadiagram.Code; +import net.sourceforge.plantuml.cucadiagram.Display; +import net.sourceforge.plantuml.cucadiagram.IEntity; +import net.sourceforge.plantuml.cucadiagram.Ident; +import net.sourceforge.plantuml.cucadiagram.LeafType; +import net.sourceforge.plantuml.cucadiagram.Stereotype; +import net.sourceforge.plantuml.graphic.color.ColorParser; +import net.sourceforge.plantuml.graphic.color.ColorType; +import net.sourceforge.plantuml.json.Json.DefaultHandler; +import net.sourceforge.plantuml.json.JsonParser; +import net.sourceforge.plantuml.json.JsonValue; +import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; +import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException; + +public class CommandCreateJson extends CommandMultilines2 { + + public CommandCreateJson() { + super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE); + } + + private static IRegex getRegexConcat() { + return RegexConcat.build(CommandCreateJson.class.getName(), RegexLeaf.start(), // + new RegexLeaf("TYPE", "json"), // + RegexLeaf.spaceOneOrMore(), // + new RegexLeaf("NAME", "(?:[%g]([^%g]+)[%g][%s]+as[%s]+)?([%pLN_.]+)"), // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), // + RegexLeaf.spaceZeroOrMore(), // + ColorParser.exp1(), // + RegexLeaf.spaceZeroOrMore(), // + new RegexLeaf("\\{"), // + RegexLeaf.end()); + } + + @Override + public String getPatternEnd() { + return "^[%s]*\\}[%s]*$"; + } + + @Override + protected CommandExecutionResult executeNow(AbstractClassOrObjectDiagram diagram, BlocLines lines) + throws NoSuchColorException { + lines = lines.trim().removeEmptyLines(); + final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString()); + final IEntity entity1 = executeArg0(diagram, line0); + if (entity1 == null) + return CommandExecutionResult.error("No such entity"); + + lines = lines.subExtract(1, 1); + final StringBuilder sb = new StringBuilder("{"); + for (StringLocated sl : lines) { + final String line = sl.getString(); + assert line.length() > 0; + System.err.println("l=" + line); + sb.append(line); +// entity1.getBodier().addFieldOrMethod(line); +// if (BodierMap.getLinkedEntry(line) != null) { +// final String linkStr = BodierMap.getLinkedEntry(line); +// final int x = line.indexOf(linkStr); +// final String key = line.substring(0, x).trim(); +// final String dest = line.substring(x + linkStr.length()).trim(); +// final Ident ident2 = diagram.buildLeafIdentSpecial(dest); +// final ILeaf entity2 = diagram.getEntityFactory().getLeafStrict(ident2); +// if (entity2 == null) +// return CommandExecutionResult.error("No such entity " + ident2.getName()); +// +// final LinkType linkType = new LinkType(LinkDecor.ARROW, LinkDecor.NONE); +// final int length = linkStr.length() - 2; +// final Link link = new Link(entity1, entity2, linkType, Display.NULL, length, +// diagram.getSkinParam().getCurrentStyleBuilder()); +// link.setPortMembers(key, null); +// diagram.addLink(link); +// } + } + sb.append("}"); + + final DefaultHandler handler = new DefaultHandler(); + new JsonParser(handler).parse(sb.toString()); + final JsonValue json = handler.getValue(); + System.err.println("foo=" + json); + ((BodierJSon) entity1.getBodier()).setJson(json); + + return CommandExecutionResult.ok(); + } + + private IEntity executeArg0(AbstractClassOrObjectDiagram diagram, RegexResult line0) throws NoSuchColorException { + final String name = line0.get("NAME", 1); + final Ident ident = diagram.buildLeafIdent(name); + final Code code = diagram.V1972() ? ident : diagram.buildCode(name); + final String display = line0.get("NAME", 0); + final String stereotype = line0.get("STEREO", 0); + final boolean leafExist = diagram.V1972() ? diagram.leafExistSmart(ident) : diagram.leafExist(code); + if (leafExist) + return diagram.getOrCreateLeaf(diagram.buildLeafIdent(name), code, LeafType.JSON, null); + + final IEntity entity = diagram.createLeaf(ident, code, Display.getWithNewlines(display), LeafType.JSON, null); + if (stereotype != null) + entity.setStereotype(Stereotype.build(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), + diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), + diagram.getSkinParam().getIHtmlColorSet())); + + final String s = line0.get("COLOR", 0); + entity.setSpecificColorTOBEREMOVED(ColorType.BACK, s == null ? null + : diagram.getSkinParam().getIHtmlColorSet().getColor(diagram.getSkinParam().getThemeStyle(), s)); + return entity; + } + +} diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java index ef9eb4758..3725d2501 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java @@ -95,9 +95,9 @@ public class CommandCreateMap extends CommandMultilines2 " + dest.toString(); } - final public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.arrow); + final public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.arrow); } public UDrawable getUDrawable(TimeScale timeScale, ToTaskDraw toTaskDraw) { diff --git a/src/net/sourceforge/plantuml/project/GanttDiagram.java b/src/net/sourceforge/plantuml/project/GanttDiagram.java index 4032953f1..a485d7616 100644 --- a/src/net/sourceforge/plantuml/project/GanttDiagram.java +++ b/src/net/sourceforge/plantuml/project/GanttDiagram.java @@ -101,7 +101,7 @@ import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.GraphvizCrash; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.MinMax; @@ -216,7 +216,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit if (labelStrategy.titleInFirstColumn()) ug = ug.apply(UTranslate.dx(getTitlesColumnWidth(ug.getStringBounder()))); - final Style timelineStyle = StyleSignature + final Style timelineStyle = StyleSignatureBasic .of(SName.root, SName.element, SName.ganttDiagram, SName.timeline) .getMergedStyle(getCurrentStyleBuilder()); @@ -328,12 +328,12 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit } private Style getClosedStyle() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.closed) + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.closed) .getMergedStyle(getCurrentStyleBuilder()); } private Style getTimelineStyle() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.timeline) + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.timeline) .getMergedStyle(getCurrentStyleBuilder()); } @@ -365,8 +365,8 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit } - public StyleSignature getDefaultStyleDefinitionArrow() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.arrow); + public StyleSignatureBasic getDefaultStyleDefinitionArrow() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.arrow); } private void drawTasksTitle(UGraphic ug, double colTitles, double colBars) { diff --git a/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java b/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java index ca48fc97c..9196b86c2 100644 --- a/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java +++ b/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java @@ -53,7 +53,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; @@ -98,10 +98,10 @@ public abstract class AbstractTaskDraw implements TaskDraw { this.task = task; } - abstract StyleSignature getStyleSignature(); + abstract StyleSignatureBasic getStyleSignature(); - private StyleSignature getStyleSignatureUnstarted() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.task, SName.unstarted); + private StyleSignatureBasic getStyleSignatureUnstarted() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.task, SName.unstarted); } final protected HColor getLineColor() { diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java index b8ec619e1..de36b2b01 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java @@ -55,7 +55,7 @@ import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UShape; @@ -70,8 +70,8 @@ public class TaskDrawDiamond extends AbstractTaskDraw { } @Override - StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.milestone); + StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.milestone); } @Override diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java index ba826ca5c..c3618acc7 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java @@ -68,7 +68,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Value; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -174,8 +174,8 @@ public class TaskDrawRegular extends AbstractTaskDraw { } @Override - StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.task); + StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.task); } public void drawU(UGraphic ug) { @@ -208,7 +208,7 @@ public class TaskDrawRegular extends AbstractTaskDraw { } private Opale getOpaleNote() { - final Style style = StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.note) + final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.note) .getMergedStyle(getStyleBuilder()); final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(), getColorSet()); @@ -292,7 +292,7 @@ public class TaskDrawRegular extends AbstractTaskDraw { off.add(new Segment(x1, x2)); } - final HColor backUndone = StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.undone) + final HColor backUndone = StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.undone) .getMergedStyle(getStyleBuilder()).value(PName.BackGroundColor) .asColor(skinParam.getThemeStyle(), getColorSet()); diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java index b1a1679fa..dab8a0a2d 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java @@ -56,7 +56,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.URectangle; @@ -107,8 +107,8 @@ public class TaskDrawSeparator implements TaskDraw { return 0; } - private StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.ganttDiagram, SName.separator); + private StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.ganttDiagram, SName.separator); } private Style getStyle() { diff --git a/src/net/sourceforge/plantuml/sdot/SmetanaPath.java b/src/net/sourceforge/plantuml/sdot/SmetanaPath.java index 82f2e47db..009810b6c 100644 --- a/src/net/sourceforge/plantuml/sdot/SmetanaPath.java +++ b/src/net/sourceforge/plantuml/sdot/SmetanaPath.java @@ -57,7 +57,7 @@ import net.sourceforge.plantuml.posimo.DotPath; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.extremity.ExtremityFactory; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -115,7 +115,7 @@ public class SmetanaPath implements UDrawable { HColor color; if (UseStyle.useBetaStyle()) { - color = StyleSignature.of(SName.root, SName.element, diagram.getUmlDiagramType().getStyleName(), SName.arrow) + color = StyleSignatureBasic.of(SName.root, SName.element, diagram.getUmlDiagramType().getStyleName(), SName.arrow) .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()) .value(PName.LineColor) .asColor(diagram.getSkinParam().getThemeStyle(), diagram.getSkinParam().getIHtmlColorSet()); diff --git a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java index a71778778..150950952 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java +++ b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; public abstract class AbstractMessage implements EventWithDeactivate, WithStyle { @@ -61,8 +61,8 @@ public abstract class AbstractMessage implements EventWithDeactivate, WithStyle return new Style[] { style }; } - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow); } private final Display label; diff --git a/src/net/sourceforge/plantuml/sequencediagram/Delay.java b/src/net/sourceforge/plantuml/sequencediagram/Delay.java index c020a1beb..73bd8235e 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Delay.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Delay.java @@ -39,7 +39,7 @@ import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; public class Delay extends AbstractEvent implements Event, WithStyle { @@ -48,7 +48,7 @@ public class Delay extends AbstractEvent implements Event, WithStyle { final private Style style; - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { return ComponentType.DELAY_TEXT.getStyleSignature(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/Divider.java b/src/net/sourceforge/plantuml/sequencediagram/Divider.java index 26c79566f..db7c83b59 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Divider.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Divider.java @@ -39,7 +39,7 @@ import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; public class Divider extends AbstractEvent implements Event, WithStyle { @@ -48,7 +48,7 @@ public class Divider extends AbstractEvent implements Event, WithStyle { final private Style style; - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { return ComponentType.DIVIDER.getStyleSignature(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/Doll.java b/src/net/sourceforge/plantuml/sequencediagram/Doll.java index 110531771..3857f33a1 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Doll.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Doll.java @@ -55,7 +55,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -94,12 +94,12 @@ public class Doll implements WithStyle { } - final public StyleSignature getStyleSignature() { + final public StyleSignatureBasic getStyleSignature() { return ComponentType.ENGLOBER.getStyleSignature(); } final public Style[] getUsedStyles() { - Style tmp = getStyleSignature().with(englober.getStereotype()).getMergedStyle(styleBuilder); + Style tmp = getStyleSignature().withTOBECHANGED(englober.getStereotype()).getMergedStyle(styleBuilder); final HColor backColor = englober.getBoxColor(); if (tmp != null) tmp = tmp.eventuallyOverride(PName.BackGroundColor, backColor); diff --git a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java index 7c0cad09d..a0b06f90e 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java @@ -39,7 +39,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -55,12 +55,12 @@ public abstract class Grouping implements Event, WithStyle { final private Style style; final private Style styleHeader; - public StyleSignature getStyleSignature() { - return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.group); + public StyleSignatureBasic getStyleSignature() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.group); } - private StyleSignature getHeaderStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.groupHeader); + private StyleSignatureBasic getHeaderStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.groupHeader); } public Style[] getUsedStyles() { diff --git a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java index 5bf9490b6..67b50d018 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java +++ b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java @@ -51,7 +51,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -97,7 +97,7 @@ public class LinkAnchor { final HColor color; final FontConfiguration fontConfiguration; if (UseStyle.useBetaStyle()) { - final StyleSignature signature = StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, + final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow); final Style style = signature.getMergedStyle(skinParam.getCurrentStyleBuilder()); diff --git a/src/net/sourceforge/plantuml/sequencediagram/Note.java b/src/net/sourceforge/plantuml/sequencediagram/Note.java index c5fa1acbf..bc313e95c 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Note.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Note.java @@ -46,7 +46,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; final public class Note extends AbstractEvent implements Event, SpecificBackcolorable, WithStyle { @@ -72,7 +72,7 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo private Style style; - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { return noteStyle.getDefaultStyleDefinition(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java b/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java index 632ff512a..91ffcf5bd 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java +++ b/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java @@ -37,7 +37,7 @@ package net.sourceforge.plantuml.sequencediagram; import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; public enum NoteStyle { @@ -62,8 +62,8 @@ public enum NoteStyle { return ComponentType.NOTE; } - public StyleSignature getDefaultStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, + public StyleSignatureBasic getDefaultStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.note); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/Participant.java b/src/net/sourceforge/plantuml/sequencediagram/Participant.java index 256ffdb0e..364c36750 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Participant.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Participant.java @@ -50,9 +50,10 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.SymbolContext; import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.Colors; +import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.WithStyle; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -72,7 +73,7 @@ public class Participant implements SpecificBackcolorable, WithStyle { // private Style style; - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { return type.getStyleSignature().addClickable(getUrl()); } @@ -80,7 +81,7 @@ public class Participant implements SpecificBackcolorable, WithStyle { if (UseStyle.useBetaStyle() == false) { return null; } - final StyleSignature signature = getStyleSignature().with(stereotype); + final StyleSignature signature = getStyleSignature().withTOBECHANGED(stereotype); Style tmp = signature.getMergedStyle(styleBuilder); tmp = tmp.eventuallyOverride(getColors()); Style stereo = getStyleSignature().forStereotypeItself(stereotype).getMergedStyle(styleBuilder); diff --git a/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java b/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java index 78876702a..e415b07b8 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java +++ b/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java @@ -37,7 +37,7 @@ package net.sourceforge.plantuml.sequencediagram; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; public enum ParticipantType implements Styleable { @@ -60,37 +60,37 @@ public enum ParticipantType implements Styleable { return background; } - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { if (this == PARTICIPANT) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.participant); } if (this == ACTOR) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.actor); } if (this == BOUNDARY) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.boundary); } if (this == CONTROL) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.control); } if (this == ENTITY) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.entity); } if (this == QUEUE) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.queue); } if (this == DATABASE) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.database); } if (this == COLLECTIONS) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.collections); } return null; diff --git a/src/net/sourceforge/plantuml/sequencediagram/Reference.java b/src/net/sourceforge/plantuml/sequencediagram/Reference.java index 028303652..c50ec29de 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Reference.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Reference.java @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.color.HColor; public class Reference extends AbstractEvent implements Event { @@ -60,12 +60,12 @@ public class Reference extends AbstractEvent implements Event { final private Style style; final private Style styleHeader; - public StyleSignature getDefaultStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.reference); + public StyleSignatureBasic getDefaultStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.reference); } - private StyleSignature getHeaderStyleDefinition() { - return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.referenceHeader); + private StyleSignatureBasic getHeaderStyleDefinition() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.referenceHeader); } public Style[] getUsedStyles() { diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java index c72a0e49c..06ef7e542 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java @@ -623,7 +623,7 @@ class DrawableSetInitializer { participantDisplay); final Component tail = drawableSet.getSkin().createComponent(p.getUsedStyles(), tailType, null, skinParam, participantDisplay); - final Style style = this.defaultLineType.getStyleSignature().with(p.getStereotype()) + final Style style = this.defaultLineType.getStyleSignature().withTOBECHANGED(p.getStereotype()) .getMergedStyle(skinParam.getCurrentStyleBuilder()); final Component line = drawableSet.getSkin().createComponent(new Style[] { style }, this.defaultLineType, null, drawableSet.getSkinParam(), participantDisplay); diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java index d6c97aa29..b56ffff73 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java @@ -66,7 +66,7 @@ import net.sourceforge.plantuml.sequencediagram.SequenceDiagram; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -152,7 +152,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { compTitle = null; } else { if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, SName.title) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title) .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); compTitle = style.createTextBlockBordered(page.getTitle(), diagram.getSkinParam().getIHtmlColorSet(), diagram.getSkinParam()); @@ -173,7 +173,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { legendBlock = TextBlockUtils.empty(0, 0); } else { if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, SName.legend) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.legend) .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); legendBlock = style.createTextBlockBordered(diagram.getLegend().getDisplay(), diagram.getSkinParam().getIHtmlColorSet(), diagram.getSkinParam()); @@ -251,7 +251,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { final DisplaySection display = diagram.getFooterOrHeaderTeoz(fontParam).withPage(page + 1, pages.size()); Style style = null; if (UseStyle.useBetaStyle()) { - final StyleSignature def = fontParam.getStyleDefinition(null); + final StyleSignatureBasic def = fontParam.getStyleDefinition(null); style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); } return new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor, diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottomTopAbstract.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottomTopAbstract.java index e02766172..7b1432d70 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottomTopAbstract.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottomTopAbstract.java @@ -54,7 +54,7 @@ import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -129,7 +129,7 @@ public abstract class CommunicationTileNoteBottomTopAbstract extends AbstractTil final HColor color; if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram) + final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram) .getMergedStyle(skinParam.getCurrentStyleBuilder()); color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); } else diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java index b6ef40aa9..1ec7d5ba8 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -86,7 +86,7 @@ public class LifeEventTile extends AbstractTile { this.skinParam = skinParam; } - private StyleSignature getStyleSignature() { + private StyleSignatureBasic getStyleSignature() { return ComponentType.DESTROY.getStyleSignature(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java index 4ebf99a0e..46d8308a4 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java @@ -67,7 +67,7 @@ import net.sourceforge.plantuml.skin.SimpleContext2D; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -213,7 +213,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { } final TextBlock compTitle; if (UseStyle.useBetaStyle()) { - final Style style = StyleSignature.of(SName.root, SName.document, SName.title) + final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.title) .getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); compTitle = style.createTextBlockBordered(diagram.getTitle().getDisplay(), diagram.getSkinParam().getIHtmlColorSet(), diagram.getSkinParam()); @@ -245,7 +245,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { Style style = null; final ISkinParam skinParam = diagram.getSkinParam(); if (UseStyle.useBetaStyle()) { - final StyleSignature def = param.getStyleDefinition(null); + final StyleSignatureBasic def = param.getStyleDefinition(null); style = def.getMergedStyle(skinParam.getCurrentStyleBuilder()); } final PngTitler pngTitler = new PngTitler(titleColor, display, fontSize, fontFamily, hyperlinkColor, @@ -271,7 +271,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { HorizontalAlignment titleAlignment = HorizontalAlignment.CENTER; if (UseStyle.useBetaStyle()) { - final StyleSignature def = FontParam.TITLE.getStyleDefinition(null); + final StyleSignatureBasic def = FontParam.TITLE.getStyleDefinition(null); titleAlignment = def.getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()) .getHorizontalAlignment(); } diff --git a/src/net/sourceforge/plantuml/skin/AbstractComponent.java b/src/net/sourceforge/plantuml/skin/AbstractComponent.java index d13765910..6fcdeb65e 100644 --- a/src/net/sourceforge/plantuml/skin/AbstractComponent.java +++ b/src/net/sourceforge/plantuml/skin/AbstractComponent.java @@ -40,7 +40,7 @@ import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; @@ -50,7 +50,7 @@ public abstract class AbstractComponent implements Component { throw new UnsupportedOperationException(); } - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/skin/ComponentType.java b/src/net/sourceforge/plantuml/skin/ComponentType.java index ef6926e1b..fddb68c44 100644 --- a/src/net/sourceforge/plantuml/skin/ComponentType.java +++ b/src/net/sourceforge/plantuml/skin/ComponentType.java @@ -37,7 +37,7 @@ package net.sourceforge.plantuml.skin; import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.Styleable; public enum ComponentType implements Styleable { @@ -70,42 +70,42 @@ public enum ComponentType implements Styleable { return this == ARROW; } - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { if (this == PARTICIPANT_HEAD || this == PARTICIPANT_TAIL) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.participant); } if (this == PARTICIPANT_LINE || this == CONTINUE_LINE) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.lifeLine); } if (this == ALIVE_BOX_CLOSE_CLOSE || this == ALIVE_BOX_CLOSE_OPEN || this == ALIVE_BOX_OPEN_CLOSE || this == ALIVE_BOX_OPEN_OPEN) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.lifeLine); } if (this == DESTROY) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.lifeLine); } if (this == DIVIDER) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.separator); } if (this == ENGLOBER) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.box); } if (this == NOTE) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.note); } if (this == DELAY_TEXT) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.delay); } if (this == DELAY_LINE) { - return StyleSignature.of(SName.root, SName.element, + return StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.delay); } // if (this == REFERENCE) { @@ -116,6 +116,6 @@ public enum ComponentType implements Styleable { throw new UnsupportedOperationException(toString()); } - return StyleSignature.of(SName.root); + return StyleSignatureBasic.of(SName.root); } } diff --git a/src/net/sourceforge/plantuml/skin/VisibilityModifier.java b/src/net/sourceforge/plantuml/skin/VisibilityModifier.java index ac9c99628..968beab5f 100644 --- a/src/net/sourceforge/plantuml/skin/VisibilityModifier.java +++ b/src/net/sourceforge/plantuml/skin/VisibilityModifier.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; @@ -324,21 +324,21 @@ public enum VisibilityModifier { return false; } - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { if (this == IE_MANDATORY) - return StyleSignature.of(SName.root, SName.element, SName.visibilityIcon, SName.IEMandatory); + return StyleSignatureBasic.of(SName.root, SName.element, SName.visibilityIcon, SName.IEMandatory); if (this == PUBLIC_FIELD || this == PUBLIC_METHOD) - return StyleSignature.of(SName.root, SName.element, SName.visibilityIcon, SName.public_); + return StyleSignatureBasic.of(SName.root, SName.element, SName.visibilityIcon, SName.public_); if (this == PRIVATE_FIELD || this == PRIVATE_METHOD) - return StyleSignature.of(SName.root, SName.element, SName.visibilityIcon, SName.private_); + return StyleSignatureBasic.of(SName.root, SName.element, SName.visibilityIcon, SName.private_); if (this == PROTECTED_FIELD || this == PROTECTED_METHOD) - return StyleSignature.of(SName.root, SName.element, SName.visibilityIcon, SName.protected_); + return StyleSignatureBasic.of(SName.root, SName.element, SName.visibilityIcon, SName.protected_); if (this == PACKAGE_PRIVATE_FIELD || this == VisibilityModifier.PACKAGE_PRIVATE_METHOD) - return StyleSignature.of(SName.root, SName.element, SName.visibilityIcon, SName.package_); + return StyleSignatureBasic.of(SName.root, SName.element, SName.visibilityIcon, SName.package_); throw new IllegalStateException(); } diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java index f487221d6..e5a292eaa 100644 --- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java +++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java @@ -43,7 +43,7 @@ import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UGraphic; public class ComponentRoseGroupingSpace implements Component { @@ -52,7 +52,7 @@ public class ComponentRoseGroupingSpace implements Component { throw new UnsupportedOperationException(); } - public StyleSignature getStyleSignature() { + public StyleSignatureBasic getStyleSignature() { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java index 221ebb1b5..50f0148e6 100644 --- a/src/net/sourceforge/plantuml/skin/rose/Rose.java +++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java @@ -59,7 +59,7 @@ import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -375,7 +375,7 @@ public class Rose { final HorizontalAlignment textHorizontalAlignment; final ArrowDirection arrowDirection = config.getArrowDirection(); if (UseStyle.useBetaStyle()) { - final StyleSignature signature = StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, + final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow); final Style textStyle = signature.getMergedStyle(param.getCurrentStyleBuilder()); final String value = textStyle.value(PName.HorizontalAlignment).asString(); diff --git a/src/net/sourceforge/plantuml/style/ClockwiseTopRightBottomLeft.java b/src/net/sourceforge/plantuml/style/ClockwiseTopRightBottomLeft.java index 83bdb5a96..924d22ad2 100644 --- a/src/net/sourceforge/plantuml/style/ClockwiseTopRightBottomLeft.java +++ b/src/net/sourceforge/plantuml/style/ClockwiseTopRightBottomLeft.java @@ -116,7 +116,7 @@ public class ClockwiseTopRightBottomLeft { } public static ClockwiseTopRightBottomLeft marginForDocument(StyleBuilder styleBuilder) { - final Style style = StyleSignature.of(SName.root, SName.document).getMergedStyle(styleBuilder); + final Style style = StyleSignatureBasic.of(SName.root, SName.document).getMergedStyle(styleBuilder); return style.getMargin(); } diff --git a/src/net/sourceforge/plantuml/style/Context.java b/src/net/sourceforge/plantuml/style/Context.java index 39bef6fb5..0e93c17f8 100644 --- a/src/net/sourceforge/plantuml/style/Context.java +++ b/src/net/sourceforge/plantuml/style/Context.java @@ -70,8 +70,8 @@ class Context { return data.size(); } - public Collection toSignatures() { - List results = new ArrayList<>(Collections.singletonList(StyleSignature.empty())); + public Collection toSignatures() { + List results = new ArrayList<>(Collections.singletonList(StyleSignatureBasic.empty())); boolean star = false; for (Iterator it = data.iterator(); it.hasNext();) { String s = it.next(); @@ -80,16 +80,16 @@ class Context { s = s.substring(0, s.length() - 1); } final String[] names = s.split(","); - final List tmp = new ArrayList<>(); - for (StyleSignature ss : results) + final List tmp = new ArrayList<>(); + for (StyleSignatureBasic ss : results) for (String name : names) tmp.add(ss.add(name)); results = tmp; } if (star) - for (ListIterator it = results.listIterator(); it.hasNext();) { - final StyleSignature tmp = it.next().addStar(); + for (ListIterator it = results.listIterator(); it.hasNext();) { + final StyleSignatureBasic tmp = it.next().addStar(); it.set(tmp); } diff --git a/src/net/sourceforge/plantuml/style/DarkString.java b/src/net/sourceforge/plantuml/style/DarkString.java index 56c5b3d87..dc1a1d993 100644 --- a/src/net/sourceforge/plantuml/style/DarkString.java +++ b/src/net/sourceforge/plantuml/style/DarkString.java @@ -52,7 +52,7 @@ public class DarkString { return this; if ((this.value2 == null && other.value2 == null) || this.value1 == null && other.value1 == null) { - if (this.priority > other.priority) + if (isBigger(this.priority, other.priority)) return this; return other; } @@ -60,16 +60,24 @@ public class DarkString { return new DarkString(this.value1, other.value2, this.priority); if (other.value2 == null && this.value1 == null) return new DarkString(other.value1, this.value2, other.priority); - - if (this.priority > other.priority) + + if (isBigger(this.priority, other.priority)) return this; return other; - + // System.err.println("this =" + this); // System.err.println("other=" + other); // throw new UnsupportedOperationException(); } + private static boolean isBigger(int a, int b) { + if (a > StyleLoader.DELTA_PRIORITY_FOR_STEREOTYPE) + a = StyleLoader.DELTA_PRIORITY_FOR_STEREOTYPE; + if (b > StyleLoader.DELTA_PRIORITY_FOR_STEREOTYPE) + b = StyleLoader.DELTA_PRIORITY_FOR_STEREOTYPE; + return a > b; + } + public DarkString addPriority(int delta) { return new DarkString(value1, value2, delta + priority); } diff --git a/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java b/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java index 7bc20351c..9f5cd893a 100644 --- a/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java +++ b/src/net/sourceforge/plantuml/style/FromSkinparamToStyle.java @@ -252,27 +252,20 @@ public class FromSkinparamToStyle { return; } - final boolean complex = value.contains(";"); + final boolean complex = isComplexValue(value); 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()) { - final String read = st.nextToken(); - // System.err.println("read:" + read); - if (read.startsWith("text:")) { - final String value2 = read.split(":")[1]; - for (Data data : datas) - addStyle(PName.FontColor, ValueImpl.regular(value2, counter), data.styleNames); - } else if (read.startsWith("line.dotted")) { - for (Data data : datas) - addStyle(PName.LineStyle, ValueImpl.regular("1;3", counter), data.styleNames); - } else if (read.startsWith("line.dashed")) { - for (Data data : datas) - addStyle(PName.LineStyle, ValueImpl.regular("7;7", counter), data.styleNames); + if (value.contains(";")) { + if (value.startsWith(";")) + value = " " + value; + final StringTokenizer st = new StringTokenizer(value, ";"); + value = st.nextToken(); + while (st.hasMoreTokens()) { + final String read = st.nextToken(); + readValue(read, datas, counter); } + } else { + readValue(value, datas, counter); + return; } } @@ -282,6 +275,28 @@ public class FromSkinparamToStyle { } + private void readValue(final String read, final List datas, final AutomaticCounter counter) { + if (read.startsWith("text:")) { + final String value2 = read.split(":")[1]; + for (Data data : datas) + addStyle(PName.FontColor, ValueImpl.regular(value2, counter), data.styleNames); + } else if (read.startsWith("line.dotted")) { + for (Data data : datas) + addStyle(PName.LineStyle, ValueImpl.regular("1;3", counter), data.styleNames); + } else if (read.startsWith("line.dashed")) { + for (Data data : datas) + addStyle(PName.LineStyle, ValueImpl.regular("7;7", counter), data.styleNames); + } + } + + private boolean isComplexValue(String value) { + if (value.contains(";")) + return true; + if (value.startsWith("text:")) + return true; + return false; + } + private ValueImpl getShadowingValue(final String value, final AutomaticCounter counter) { if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no")) return ValueImpl.regular("0", counter); @@ -293,14 +308,17 @@ public class FromSkinparamToStyle { } private void addStyle(PName propertyName, Value value, SName... styleNames) { - final Map map = new EnumMap(PName.class); + Map map = new EnumMap(PName.class); map.put(propertyName, value); - StyleSignature sig = StyleSignature.of(styleNames); - if (stereo != null) + StyleSignatureBasic sig = StyleSignatureBasic.of(styleNames); + if (stereo != null) { + map = StyleLoader.addPriorityForStereotype(map); for (String s : stereo.split("\\&")) sig = sig.add(s); + } - styles.add(new Style(sig, map)); + final Style style = new Style(sig, map); + styles.add(style); } public List