From 7ac50bf403ec8e4b46efd9a9bfefb134b287ed5d Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sat, 21 May 2022 11:41:00 +0200 Subject: [PATCH] wip --- src/net/sourceforge/plantuml/ColorParam.java | 134 +---- src/net/sourceforge/plantuml/FileFormat.java | 1 + src/net/sourceforge/plantuml/ISkinParam.java | 3 - src/net/sourceforge/plantuml/SkinParam.java | 27 - .../plantuml/SkinParamDelegator.java | 6 - .../activitydiagram3/InstructionEnd.java | 3 +- .../activitydiagram3/InstructionFork.java | 3 +- .../activitydiagram3/InstructionGroup.java | 7 +- .../activitydiagram3/InstructionIf.java | 3 +- .../activitydiagram3/InstructionList.java | 3 +- .../activitydiagram3/InstructionRepeat.java | 3 +- .../activitydiagram3/InstructionSimple.java | 3 +- .../activitydiagram3/InstructionSpot.java | 3 +- .../activitydiagram3/InstructionStart.java | 3 +- .../activitydiagram3/InstructionStop.java | 3 +- .../activitydiagram3/InstructionSwitch.java | 30 +- .../activitydiagram3/InstructionWhile.java | 16 +- .../plantuml/activitydiagram3/WithNote.java | 10 +- .../command/CommandPartition3.java | 28 +- .../CommandRepeatWhile3Multilines.java | 1 - .../activitydiagram3/ftile/FtileFactory.java | 4 +- .../ftile/FtileFactoryDelegator.java | 6 +- .../AbstractParallelFtilesBuilder.java | 2 - .../FtileFactoryDelegatorAddNote.java | 18 +- .../FtileFactoryDelegatorCreateGroup.java | 12 +- .../ftile/vcompact/FtileForkInner.java | 2 +- .../vcompact/FtileForkInnerOverlapped.java | 2 +- .../ftile/vcompact/FtileGroup.java | 12 +- .../ftile/vcompact/FtileIfDown.java | 2 +- .../ftile/vcompact/FtileIfLongHorizontal.java | 2 +- .../ftile/vcompact/FtileIfLongVertical.java | 2 +- .../ftile/vcompact/FtileRepeat.java | 2 +- .../ftile/vcompact/FtileSplit1.java | 2 +- .../ftile/vcompact/FtileSwitch.java | 2 +- .../ftile/vcompact/FtileWhile.java | 2 +- .../ftile/vcompact/FtileWithNoteOpale.java | 50 +- .../ftile/vcompact/FtileWithNotes.java | 25 +- .../ftile/vcompact/ParallelBuilderFork.java | 10 +- .../ftile/vcompact/ParallelBuilderMerge.java | 3 +- .../ftile/vcompact/ParallelBuilderSplit.java | 1 - .../ftile/vcompact/VCompactFactory.java | 4 +- .../ftile/vertical/FtileBlackBlock.java | 11 +- .../ftile/vertical/FtileBox2.java | 1 - .../ftile/vertical/FtileBoxOld.java | 6 +- .../ftile/vertical/FtileCircleSpot.java | 1 - .../ftile/vertical/FtileCircleStart.java | 1 - .../ftile/vertical/FtileCircleStop.java | 1 - .../ftile/vertical/FtileDecorateInLabel.java | 3 +- .../ftile/vertical/FtileDecorateOutLabel.java | 3 +- .../ftile/vertical/FtileDiamond.java | 3 +- .../ftile/vertical/FtileDiamondInside.java | 3 +- .../ftile/vertical/FtileDiamondInside2.java | 3 +- .../ftile/vertical/FtileDiamondSquare.java | 3 +- .../activitydiagram3/gtile/AbstractGtile.java | 2 +- ...GConnectionHorizontalThenVerticalDown.java | 2 +- .../activitydiagram3/gtile/GtileAssembly.java | 4 +- .../activitydiagram3/gtile/GtileColumns.java | 2 +- .../activitydiagram3/gtile/GtileEmpty.java | 3 +- .../gtile/GtileHexagonInsideLabelled.java | 1 - .../activitydiagram3/gtile/GtileIfAlone.java | 2 +- .../gtile/GtileIfHexagon.java | 2 +- .../activitydiagram3/gtile/GtileRepeat.java | 3 +- .../activitydiagram3/gtile/GtileSplit.java | 2 +- .../activitydiagram3/gtile/GtileTopDown.java | 2 +- .../activitydiagram3/gtile/GtileTopDown3.java | 2 +- .../gtile/GtileWithMargin.java | 2 +- .../gtile/GtileWithNoteOpale.java | 6 +- .../command/CommandLinkClass.java | 321 +++++------ .../note/CommandFactoryNoteOnEntity.java | 5 +- .../FactorySequenceNoteAcrossCommand.java | 5 +- .../sequence/FactorySequenceNoteCommand.java | 5 +- .../FactorySequenceNoteOnArrowCommand.java | 5 +- ...FactorySequenceNoteOverSeveralCommand.java | 5 +- .../cucadiagram/BodierLikeClassOrObject.java | 12 +- .../plantuml/cucadiagram/BodierSimple.java | 4 +- .../plantuml/cucadiagram/BodyEnhanced1.java | 44 +- .../plantuml/cucadiagram/BodyEnhanced2.java | 5 +- .../plantuml/cucadiagram/BodyFactory.java | 24 +- .../cucadiagram/MethodsOrFieldsArea.java | 30 +- .../cucadiagram/entity/EntityFactory.java | 4 - .../cucadiagram/entity/EntityImpl.java | 3 - .../dedication/PSystemDedication.java | 8 +- .../descdiagram/EntityImageRequirement.java | 46 +- .../plantuml/elk/CucaDiagramFileMakerElk.java | 5 +- src/net/sourceforge/plantuml/elk/ElkPath.java | 17 - .../plantuml/graphic/CircledCharacter.java | 3 +- .../plantuml/graphic/GraphicStrings.java | 2 +- .../plantuml/graphic/HorizontalAlignment.java | 2 +- .../plantuml/graphic/HtmlColorAndStyle.java | 1 - .../graphic/SimpleTextBlockBordered.java | 3 +- .../plantuml/graphic/SingleLine.java | 2 +- .../plantuml/graphic/SkinParameter.java | 225 -------- .../plantuml/graphic/SpecialText.java | 1 - .../plantuml/graphic/StringBounder.java | 1 - .../plantuml/graphic/StringBounderRaw.java | 2 +- .../plantuml/graphic/TextBlock.java | 2 +- .../plantuml/graphic/TextBlockArrow.java | 2 +- .../plantuml/graphic/TextBlockArrow2.java | 2 +- .../plantuml/graphic/TextBlockBordered.java | 3 +- .../plantuml/graphic/TextBlockEmpty.java | 3 +- .../plantuml/graphic/TextBlockGeneric.java | 1 - .../plantuml/graphic/TextBlockHorizontal.java | 2 +- .../plantuml/graphic/TextBlockLineBefore.java | 2 +- .../plantuml/graphic/TextBlockMarged.java | 2 +- .../plantuml/graphic/TextBlockMinWidth.java | 3 +- .../plantuml/graphic/TextBlockRaw.java | 2 +- .../plantuml/graphic/TextBlockRecentred.java | 1 - .../plantuml/graphic/TextBlockSimple.java | 2 +- .../plantuml/graphic/TextBlockSprited.java | 3 +- .../plantuml/graphic/TextBlockTitle.java | 2 +- .../plantuml/graphic/TextBlockUtils.java | 8 +- .../plantuml/graphic/TextBlockVertical2.java | 2 +- .../plantuml/graphic/TextBlockWithUrl.java | 2 +- .../plantuml/graphic/TileImage.java | 2 +- .../plantuml/graphic/TileImageSvg.java | 3 +- .../plantuml/graphic/TileText.java | 2 +- .../sourceforge/plantuml/graphic/USymbol.java | 24 +- .../plantuml/graphic/USymbolActor.java | 5 - .../plantuml/graphic/USymbolArtifact.java | 8 +- .../plantuml/graphic/USymbolBoundary.java | 5 - .../plantuml/graphic/USymbolCard.java | 14 +- .../plantuml/graphic/USymbolCloud.java | 7 +- .../plantuml/graphic/USymbolCollections.java | 21 +- .../plantuml/graphic/USymbolComponent1.java | 8 +- .../plantuml/graphic/USymbolComponent2.java | 8 +- .../plantuml/graphic/USymbolControl.java | 5 - .../plantuml/graphic/USymbolDatabase.java | 6 - .../plantuml/graphic/USymbolEntityDomain.java | 5 - .../plantuml/graphic/USymbolFile.java | 7 +- .../plantuml/graphic/USymbolFolder.java | 13 +- .../plantuml/graphic/USymbolFrame.java | 8 +- .../plantuml/graphic/USymbolHexagon.java | 8 +- .../plantuml/graphic/USymbolInterface.java | 5 - .../plantuml/graphic/USymbolLabel.java | 14 +- .../plantuml/graphic/USymbolNode.java | 11 +- .../plantuml/graphic/USymbolPerson.java | 8 +- .../plantuml/graphic/USymbolQueue.java | 8 +- .../plantuml/graphic/USymbolRectangle.java | 16 +- .../graphic/USymbolSimpleAbstract.java | 2 +- .../plantuml/graphic/USymbolStack.java | 7 +- .../plantuml/graphic/USymbolStorage.java | 8 +- .../plantuml/graphic/USymbolTogether.java | 8 +- .../plantuml/graphic/USymbols.java | 72 ++- .../plantuml/graphic/color/Colors.java | 5 +- .../plantuml/nwdiag/NwDiagram.java | 112 ++-- .../plantuml/nwdiag/core/NServer.java | 24 +- .../plantuml/nwdiag/core/Network.java | 4 +- .../plantuml/nwdiag/core/NwGroup.java | 26 +- .../plantuml/nwdiag/next/BooleanGrid.java | 8 +- .../nwdiag/next/GridTextBlockDecorated.java | 32 +- .../nwdiag/next/GridTextBlockSimple.java | 36 +- .../plantuml/nwdiag/next/LinkedElement.java | 29 +- .../plantuml/nwdiag/next/NBox.java | 12 +- .../plantuml/nwdiag/next/NPlayField.java | 25 +- .../plantuml/nwdiag/next/NStage.java | 8 +- .../plantuml/nwdiag/next/NTetris.java | 10 +- .../plantuml/nwdiag/next/NwArray.java | 26 - .../sourceforge/plantuml/posimo/Frame.java | 136 ----- .../plantuml/posimo/PathDrawerInterface.java | 324 ----------- .../plantuml/sdot/SmetanaPath.java | 100 ++-- .../plantuml/sequencediagram/LinkAnchor.java | 22 +- .../plantuml/sequencediagram/Note.java | 19 +- .../plantuml/sequencediagram/Participant.java | 86 +-- .../sequencediagram/ParticipantType.java | 82 ++- .../sequencediagram/command/CommandArrow.java | 30 +- .../sequencediagram/command/CommandSkin.java | 1 - .../graphic/DrawableSetInitializer.java | 2 +- .../graphic/ParticipantBox.java | 12 +- .../graphic/SequenceDiagramArea.java | 56 +- .../SequenceDiagramFileMakerPuma2.java | 62 +-- ...ommunicationTileNoteBottomTopAbstract.java | 16 +- .../sequencediagram/teoz/LivingSpace.java | 2 +- .../teoz/SequenceDiagramFileMakerTeoz.java | 52 +- .../plantuml/skin/AbstractComponent.java | 7 +- .../skin/AbstractTextualComponent.java | 64 +-- .../plantuml/skin/ArrowConfiguration.java | 86 +-- .../plantuml/skin/ComponentType.java | 73 ++- .../skin/rose/AbstractComponentRoseArrow.java | 26 +- .../skin/rose/ComponentRoseActiveLine.java | 13 +- .../skin/rose/ComponentRoseActor.java | 20 +- .../skin/rose/ComponentRoseArrow.java | 207 +++---- .../skin/rose/ComponentRoseBoundary.java | 21 +- .../skin/rose/ComponentRoseControl.java | 22 +- .../skin/rose/ComponentRoseDatabase.java | 20 +- .../skin/rose/ComponentRoseDelayLine.java | 1 - .../skin/rose/ComponentRoseDelayText.java | 11 +- .../skin/rose/ComponentRoseDivider.java | 48 +- .../skin/rose/ComponentRoseEnglober.java | 20 +- .../skin/rose/ComponentRoseEntity.java | 22 +- .../skin/rose/ComponentRoseGroupingElse.java | 33 +- .../rose/ComponentRoseGroupingHeader.java | 40 +- .../skin/rose/ComponentRoseGroupingSpace.java | 3 +- .../plantuml/skin/rose/ComponentRoseLine.java | 26 +- .../skin/rose/ComponentRoseNewpage.java | 1 - .../plantuml/skin/rose/ComponentRoseNote.java | 21 +- .../skin/rose/ComponentRoseNoteBox.java | 26 +- .../skin/rose/ComponentRoseNoteHexagonal.java | 24 +- .../skin/rose/ComponentRoseParticipant.java | 33 +- .../skin/rose/ComponentRoseQueue.java | 21 +- .../skin/rose/ComponentRoseReference.java | 32 +- .../skin/rose/ComponentRoseSelfArrow.java | 26 +- .../sourceforge/plantuml/skin/rose/Rose.java | 505 ++++++------------ src/net/sourceforge/plantuml/style/SName.java | 1 + .../sourceforge/plantuml/svek/Cluster.java | 42 +- .../plantuml/svek/ConcurrentStateImage.java | 163 ------ ...ucaDiagramFileMakerSvek2InternalImage.java | 11 +- .../plantuml/svek/EntityImageDegenerated.java | 8 +- .../plantuml/svek/GeneralImageBuilder.java | 191 +++---- .../plantuml/svek/GroupPngMakerActivity.java | 12 +- .../plantuml/svek/RoundedContainer.java | 2 - .../sourceforge/plantuml/svek/SvekResult.java | 65 +-- .../svek/image/EntityImageActivity.java | 82 ++- .../svek/image/EntityImageAssociation.java | 28 +- .../svek/image/EntityImageBranch.java | 29 +- .../svek/image/EntityImageCircleEnd.java | 25 +- .../svek/image/EntityImageCircleStart.java | 25 +- .../plantuml/svek/image/EntityImageClass.java | 73 +-- .../svek/image/EntityImageClassHeader.java | 82 +-- .../svek/image/EntityImageDescription.java | 15 +- .../svek/image/EntityImageEmptyPackage.java | 62 +-- .../plantuml/svek/image/EntityImageJson.java | 61 +-- .../image/EntityImageLollipopInterface.java | 41 +- .../EntityImageLollipopInterfaceEye2.java | 33 +- .../plantuml/svek/image/EntityImageNote.java | 70 +-- .../plantuml/svek/image/EntityImagePort.java | 20 +- .../svek/image/EntityImagePseudoState.java | 35 +- .../plantuml/svek/image/EntityImageState.java | 17 +- .../svek/image/EntityImageState2.java | 22 +- .../svek/image/EntityImageStateBorder.java | 21 +- .../svek/image/EntityImageStateCommon.java | 51 +- .../EntityImageStateEmptyDescription.java | 7 +- .../svek/image/EntityImageSynchroBar.java | 20 +- .../plantuml/svek/image/EntityImageTips.java | 50 +- .../svek/image/EntityImageUseCase.java | 69 +-- .../plantuml/timingdiagram/ChangeState.java | 13 +- .../plantuml/timingdiagram/Highlight.java | 16 +- .../plantuml/timingdiagram/PlayerBinary.java | 35 +- .../timingdiagram/PlayerRobustConcise.java | 17 +- .../TimeAxisStategy.java} | 9 +- .../timingdiagram/TimeConstraint.java | 13 - .../plantuml/timingdiagram/TimingDiagram.java | 14 +- .../plantuml/timingdiagram/TimingNote.java | 31 +- .../plantuml/timingdiagram/TimingRuler.java | 71 ++- .../command/CommandHideTimeAxis.java | 8 +- .../timingdiagram/graphic/Histogram.java | 37 +- .../timingdiagram/graphic/PlayerFrame.java | 7 - .../timingdiagram/graphic/Ribbon.java | 4 - .../plantuml/ugraphic/ImageBuilder.java | 19 +- .../plantuml/ugraphic/UPolygon.java | 2 + .../sourceforge/plantuml/version/Version.java | 2 +- .../plantuml/wbs/WBSTextBlock.java | 12 +- 251 files changed, 1916 insertions(+), 4319 deletions(-) delete mode 100644 src/net/sourceforge/plantuml/graphic/SkinParameter.java delete mode 100644 src/net/sourceforge/plantuml/posimo/Frame.java delete mode 100644 src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java delete mode 100644 src/net/sourceforge/plantuml/svek/ConcurrentStateImage.java rename src/net/sourceforge/plantuml/{UseStyle.java => timingdiagram/TimeAxisStategy.java} (91%) diff --git a/src/net/sourceforge/plantuml/ColorParam.java b/src/net/sourceforge/plantuml/ColorParam.java index 0ac7b1656..683eb55e0 100644 --- a/src/net/sourceforge/plantuml/ColorParam.java +++ b/src/net/sourceforge/plantuml/ColorParam.java @@ -40,144 +40,48 @@ import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; - @HaxeIgnored public enum ColorParam { - background(HColorUtils.WHITE, true, ColorType.BACK), + background(HColorUtils.WHITE, true, ColorType.BACK), hyperlink(HColorUtils.BLUE), - - activityDiamondBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - activityDiamondBorder(HColorUtils.MY_RED, ColorType.LINE), - activityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), + + activityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), activityBorder(HColorUtils.MY_RED, ColorType.LINE), - activityStart(HColorUtils.BLACK), - activityEnd(HColorUtils.BLACK), - activityBar(HColorUtils.BLACK), - swimlaneBorder(HColorUtils.BLACK), - swimlaneTitleBackground(null), - - usecaseBorder(HColorUtils.MY_RED, ColorType.LINE), - usecaseBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - objectBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - objectBorder(HColorUtils.MY_RED, ColorType.LINE), - - classHeaderBackground(null, true, ColorType.BACK), classBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - enumBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), + classBorder(HColorUtils.MY_RED, ColorType.LINE), - stereotypeCBackground(HColorUtils.COL_ADD1B2), - stereotypeNBackground(HColorUtils.COL_E3664A), - stereotypeABackground(HColorUtils.COL_A9DCDF), - stereotypeIBackground(HColorUtils.COL_B4A7E5), - stereotypeEBackground(HColorUtils.COL_EB937F), - stereotypeCBorder(null), - stereotypeNBorder(null), - stereotypeABorder(null), - stereotypeIBorder(null), - stereotypeEBorder(null), - - packageBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - packageBorder(HColorUtils.BLACK, ColorType.LINE), - partitionBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - partitionBorder(HColorUtils.BLACK, ColorType.LINE), - - componentBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - componentBorder(HColorUtils.MY_RED, ColorType.LINE), - interfaceBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - interfaceBorder(HColorUtils.MY_RED, ColorType.LINE), - arrow(HColorUtils.MY_RED, ColorType.ARROW), arrowHead(HColorUtils.MY_RED, null), - stateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), stateBorder(HColorUtils.MY_RED, ColorType.LINE), - stateStart(HColorUtils.BLACK), - stateEnd(HColorUtils.BLACK), - noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK), + noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK), noteBorder(HColorUtils.MY_RED, ColorType.LINE), - - legendBackground(HColorUtils.COL_DDDDDD, true, ColorType.BACK), - legendBorder(HColorUtils.BLACK, ColorType.LINE), - - titleBackground(null, true, ColorType.BACK), - titleBorder(null, ColorType.LINE), diagramBorder(null, ColorType.LINE), - - actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), + + actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), actorBorder(HColorUtils.MY_RED, ColorType.LINE), - participantBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - participantBorder(HColorUtils.MY_RED, ColorType.LINE), - sequenceGroupBorder(HColorUtils.BLACK, ColorType.LINE), - sequenceGroupBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK), sequenceGroupBodyBackground(HColorUtils.RED, true, ColorType.BACK), - sequenceReferenceBorder(HColorUtils.BLACK, ColorType.LINE), sequenceReferenceHeaderBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK), sequenceReferenceBackground(HColorUtils.WHITE, true, ColorType.BACK), - sequenceDividerBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK), - sequenceDividerBorder(HColorUtils.BLACK, ColorType.LINE), - sequenceLifeLineBackground(HColorUtils.WHITE, true, ColorType.BACK), sequenceLifeLineBorder(HColorUtils.MY_RED, ColorType.LINE), - sequenceNewpageSeparator(HColorUtils.BLACK, ColorType.LINE), + sequenceNewpageSeparator(HColorUtils.BLACK, ColorType.LINE), sequenceBoxBorder(HColorUtils.MY_RED, ColorType.LINE), - sequenceBoxBackground(HColorUtils.COL_DDDDDD, true, ColorType.BACK), - - artifactBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - artifactBorder(HColorUtils.BLACK, ColorType.LINE), - cloudBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - cloudBorder(HColorUtils.BLACK, ColorType.LINE), - queueBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - queueBorder(HColorUtils.MY_RED, ColorType.LINE), - stackBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - stackBorder(HColorUtils.MY_RED, ColorType.LINE), - databaseBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - databaseBorder(HColorUtils.BLACK, ColorType.LINE), - folderBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - folderBorder(HColorUtils.BLACK, ColorType.LINE), - fileBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - fileBorder(HColorUtils.BLACK, ColorType.LINE), - frameBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - frameBorder(HColorUtils.BLACK, ColorType.LINE), - nodeBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - nodeBorder(HColorUtils.BLACK, ColorType.LINE), - rectangleBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - rectangleBorder(HColorUtils.BLACK, ColorType.LINE), - hexagonBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - hexagonBorder(HColorUtils.BLACK, ColorType.LINE), - personBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - personBorder(HColorUtils.BLACK, ColorType.LINE), - archimateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - archimateBorder(HColorUtils.BLACK, ColorType.LINE), - cardBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - cardBorder(HColorUtils.BLACK, ColorType.LINE), - agentBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - agentBorder(HColorUtils.MY_RED, ColorType.LINE), - storageBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - storageBorder(HColorUtils.BLACK, ColorType.LINE), - boundaryBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - boundaryBorder(HColorUtils.MY_RED, ColorType.LINE), - collectionsBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - collectionsBorder(HColorUtils.MY_RED, ColorType.LINE), - controlBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - controlBorder(HColorUtils.MY_RED, ColorType.LINE), - entityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), - entityBorder(HColorUtils.MY_RED, ColorType.LINE), - - iconPrivate(HColorUtils.COL_C82930), + iconPrivate(HColorUtils.COL_C82930), iconPrivateBackground(HColorUtils.COL_F24D5C), - iconPackage(HColorUtils.COL_1963A0), + iconPackage(HColorUtils.COL_1963A0), iconPackageBackground(HColorUtils.COL_4177AF), - iconProtected(HColorUtils.COL_B38D22), + iconProtected(HColorUtils.COL_B38D22), iconProtectedBackground(HColorUtils.COL_FFFF44), - iconPublic(HColorUtils.COL_038048), + iconPublic(HColorUtils.COL_038048), iconPublicBackground(HColorUtils.COL_84BE84), iconIEMandatory(HColorUtils.BLACK), - + arrowLollipop(HColorUtils.WHITE), - + machineBackground(HColorUtils.WHITE), machineBorder(HColorUtils.BLACK, ColorType.LINE), requirementBackground(HColorUtils.WHITE), @@ -194,23 +98,23 @@ public enum ColorParam { private final boolean isBackground; private final HColor defaultValue; private final ColorType colorType; - + private ColorParam(HColor defaultValue, ColorType colorType) { this(defaultValue, false, colorType); } - + private ColorParam(HColor defaultValue) { this(defaultValue, false, null); } - + private ColorParam() { this(null, false, null); } - + private ColorParam(boolean isBackground) { this(null, isBackground, null); } - + private ColorParam(HColor defaultValue, boolean isBackground, ColorType colorType) { this.isBackground = isBackground; this.defaultValue = defaultValue; diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java index 0fc93d3c1..21ae738cf 100644 --- a/src/net/sourceforge/plantuml/FileFormat.java +++ b/src/net/sourceforge/plantuml/FileFormat.java @@ -213,6 +213,7 @@ public enum FileFormat { } protected Dimension2D calculateDimensionInternal(UFont font, String text) { + text = text.replace("\t", " "); final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text); final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), text); final Dimension2DDouble w3 = getJavaDimension(font.goTikz(1), text); diff --git a/src/net/sourceforge/plantuml/ISkinParam.java b/src/net/sourceforge/plantuml/ISkinParam.java index 6e78c4246..f3736ff56 100644 --- a/src/net/sourceforge/plantuml/ISkinParam.java +++ b/src/net/sourceforge/plantuml/ISkinParam.java @@ -41,7 +41,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.SkinParameter; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ArrowDirection; @@ -96,8 +95,6 @@ public interface ISkinParam extends ISkinSimple { public boolean shadowingForNote(Stereotype stereotype); - public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter); - public PackageStyle packageStyle(); public ComponentStyle componentStyle(); diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java index db7cd9b94..7dd0f6369 100644 --- a/src/net/sourceforge/plantuml/SkinParam.java +++ b/src/net/sourceforge/plantuml/SkinParam.java @@ -62,7 +62,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.SkinParameter; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ArrowDirection; @@ -738,32 +737,6 @@ public class SkinParam implements ISkinParam { return shadowing(stereotype); } - public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) { - final String name = Objects.requireNonNull(skinParameter).getUpperCaseName(); - if (stereotype != null) { - checkStereotype(stereotype); - final String value2 = getValue(name + "shadowing" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR)); - if (value2 != null) - return value2.equalsIgnoreCase("true"); - - } - - final String value = getValue(name + "shadowing"); - if (value == null) - return shadowing(stereotype); - - if ("false".equalsIgnoreCase(value)) - return false; - - if ("true".equalsIgnoreCase(value)) - return true; - - if (strictUmlStyle()) - return false; - - return true; - } - private final Map sprites = new HashMap(); public Collection getAllSpriteNames() { diff --git a/src/net/sourceforge/plantuml/SkinParamDelegator.java b/src/net/sourceforge/plantuml/SkinParamDelegator.java index b55311f93..e8d0bd79a 100644 --- a/src/net/sourceforge/plantuml/SkinParamDelegator.java +++ b/src/net/sourceforge/plantuml/SkinParamDelegator.java @@ -43,7 +43,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.SkinParameter; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ArrowDirection; @@ -136,11 +135,6 @@ public class SkinParamDelegator implements ISkinParam { return skinParam.shadowing(stereotype); } - @Override - public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) { - return skinParam.shadowing2(stereotype, skinParameter); - } - @Override public PackageStyle packageStyle() { return skinParam.packageStyle(); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java index 649f3057c..fc5624fae 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java @@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class InstructionEnd extends MonoSwimable implements Instruction { @@ -64,7 +65,7 @@ public class InstructionEnd extends MonoSwimable implements Instruction { @Override public Ftile createFtile(FtileFactory factory) { Ftile result = factory.end(getSwimlaneIn()); - result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); + result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER); return result; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java index 867e66364..1ca81b92f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java @@ -53,6 +53,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -124,7 +125,7 @@ public class InstructionFork extends WithNote implements Instruction { } Ftile result = factory.createParallel(all, style, label, swimlaneIn, swimlaneOut); if (getPositionedNotes().size() > 0) { - result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false); + result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER); } return result; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java index 604b58018..e68f10979 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java @@ -49,6 +49,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.USymbol; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -102,9 +103,9 @@ public class InstructionGroup extends AbstractInstruction implements Instruction @Override public Ftile createFtile(FtileFactory factory) { Ftile tmp = list.createFtile(factory); - if (note != null) { - tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam()); - } + if (note != null) + tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam(), VerticalAlignment.CENTER); + return factory.createGroup(tmp, title, backColor, titleColor, null, borderColor, type, roundCorner); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java index e2b72c04d..0545ce89f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java @@ -56,6 +56,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileIfHexagon; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -141,7 +142,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC elseBranch.updateFtile(factory); Ftile result = factory.createIf(swimlane, thens, elseBranch, outColor, topInlinkRendering, url); if (getPositionedNotes().size() > 0) { - result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false); + result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER); } final List weldingPoints = new ArrayList<>(); for (Branch branch : thens) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java index 8ac9ebbb7..1345ee6c4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java @@ -54,6 +54,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileEmpty; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -125,7 +126,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio return new FtileEmpty(factory.skinParam(), defaultSwimlane); } final List breaks = new ArrayList<>(); - Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn()); + Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn(), VerticalAlignment.CENTER); for (Instruction ins : all) { Ftile cur = ins.createFtile(factory); breaks.addAll(cur.getWeldingPoints()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java index db7eee52b..dbcd310a5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java @@ -53,6 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileRepeat; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -165,7 +166,7 @@ public class InstructionRepeat extends AbstractInstruction implements Instructio Ftile result = factory.activity(backward, swimlaneBackward, boxStyle, Colors.empty(), null); if (backwardNotes.size() > 0) - result = factory.addNote(result, swimlaneBackward, backwardNotes); + result = factory.addNote(result, swimlaneBackward, backwardNotes, VerticalAlignment.CENTER); return result; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java index 695d0c19c..7d9fc58c9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java @@ -53,6 +53,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; public class InstructionSimple extends MonoSwimable implements Instruction { @@ -104,7 +105,7 @@ public class InstructionSimple extends MonoSwimable implements Instruction { if (url != null) { result = factory.addUrl(result, url); } - result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); + result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER); if (killed) { return new FtileKilled(result); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java index f506e290b..be7b6aef7 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java @@ -47,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleSpot; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -72,7 +73,7 @@ public class InstructionSpot extends MonoSwimable implements Instruction { @Override public Ftile createFtile(FtileFactory factory) { Ftile result = factory.spot(getSwimlaneIn(), spot, color); - result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); + result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER); if (killed) return new FtileKilled(result); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java index 83a019051..8f32bd229 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java @@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class InstructionStart extends MonoSwimable implements Instruction { @@ -69,7 +70,7 @@ public class InstructionStart extends MonoSwimable implements Instruction { @Override public Ftile createFtile(FtileFactory factory) { Ftile result = factory.start(getSwimlaneIn()); - result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); + result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER); return result; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java index 9fbccc8b1..31e8ddede 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java @@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class InstructionStop extends MonoSwimable implements Instruction { @@ -69,7 +70,7 @@ public class InstructionStop extends MonoSwimable implements Instruction { @Override public Ftile createFtile(FtileFactory factory) { Ftile result = factory.stop(getSwimlaneIn()); - result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); + result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER); return result; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java index 679dda8f0..0a4748f74 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileIfHexagon; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -72,11 +73,10 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct @Override public boolean containsBreak() { - for (Branch branch : switches) { - if (branch.containsBreak()) { + for (Branch branch : switches) + if (branch.containsBreak()) return true; - } - } + return false; } @@ -91,9 +91,9 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct @Override public CommandExecutionResult add(Instruction ins) { - if (current == null) { + if (current == null) return CommandExecutionResult.error("No 'case' in this switch"); - } + return current.add(ins); } @@ -116,7 +116,9 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct for (Branch branch : switches) branch.updateFtile(factory); - return factory.createSwitch(swimlane, switches, afterEndwhile, topInlinkRendering, labelTest); + Ftile result = factory.createSwitch(swimlane, switches, afterEndwhile, topInlinkRendering, labelTest); + result = eventuallyAddNote(factory, result, getSwimlaneIn(), VerticalAlignment.TOP); + return result; } @Override @@ -132,12 +134,12 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct @Override public Set getSwimlanes() { final Set result = new HashSet<>(); - if (swimlane != null) { + if (swimlane != null) result.add(swimlane); - } - for (Branch branch : switches) { + + for (Branch branch : switches) result.addAll(branch.getSwimlanes()); - } + return Collections.unmodifiableSet(result); } @@ -177,11 +179,11 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct @Override public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { - if (current.isEmpty()) { + if (current == null || current.isEmpty()) return super.addNote(note, position, type, colors, swimlaneNote); - } else { + else return current.addNote(note, position, type, colors, swimlaneNote); - } + } } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java index 10f5a38ad..763e410b4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -116,12 +117,12 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi : factory.activity(backward, swimlane, boxStyle, Colors.empty(), null); Ftile tmp = repeatList.createFtile(factory); tmp = factory.createWhile(outColor, swimlane, tmp, test, yes, color, specialOut, back, incoming1, incoming2); - if (getPositionedNotes().size() > 0) { - tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false); - } - if (killed || specialOut != null) { + if (getPositionedNotes().size() > 0) + tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER); + + if (killed || specialOut != null) return new FtileKilled(tmp); - } + return tmp; } @@ -153,11 +154,10 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi @Override public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { - if (repeatList.isEmpty()) { + if (repeatList.isEmpty()) return super.addNote(note, position, type, colors, swimlaneNote); - } else { + else return repeatList.addNote(note, position, type, colors, swimlaneNote); - } } @Override diff --git a/src/net/sourceforge/plantuml/activitydiagram3/WithNote.java b/src/net/sourceforge/plantuml/activitydiagram3/WithNote.java index b490d4267..3cfbb9b6e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/WithNote.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/WithNote.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.cucadiagram.Display; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; @@ -56,11 +57,12 @@ abstract class WithNote extends AbstractInstruction { return true; } - final protected Ftile eventuallyAddNote(FtileFactory factory, Ftile ftile, Swimlane swimlane) { - if (notes.size() == 0) { + final protected Ftile eventuallyAddNote(FtileFactory factory, Ftile ftile, Swimlane swimlane, + VerticalAlignment verticalAlignment) { + if (notes.size() == 0) return ftile; - } - return factory.addNote(ftile, swimlane, notes); + + return factory.addNote(ftile, swimlane, notes, verticalAlignment); } public Collection getPositionedNotes() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java index 7573f93b6..71839a1a3 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java @@ -35,10 +35,8 @@ */ package net.sourceforge.plantuml.activitydiagram3.command; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.SingleLineCommand2; @@ -89,32 +87,18 @@ public class CommandPartition3 extends SingleLineCommand2 { } private USymbol getUSymbol(String type) { - if ("card".equalsIgnoreCase(type)) { + if ("card".equalsIgnoreCase(type)) return USymbols.CARD; - } - if ("package".equalsIgnoreCase(type)) { + + if ("package".equalsIgnoreCase(type)) return USymbols.PACKAGE; - } - if ("rectangle".equalsIgnoreCase(type)) { + + if ("rectangle".equalsIgnoreCase(type)) return USymbols.RECTANGLE; - } + return USymbols.FRAME; } - private ColorParam getColorParamBorder(final USymbol symbol) { - if (symbol == USymbols.FRAME) { - return ColorParam.partitionBorder; - } - return symbol.getColorParamBorder(); - } - - private ColorParam getColorParamBack(final USymbol symbol) { - if (symbol == USymbols.FRAME) { - return ColorParam.partitionBackground; - } - return symbol.getColorParamBack(); - } - private static ColorParser color(String id) { return ColorParser.simpleColor(ColorType.BACK, id); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java index d8f159eae..966b30d83 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.activitydiagram3.command; import java.util.List; -import java.util.regex.Pattern; import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java index dd3d6bafd..54b517b96 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java @@ -49,6 +49,7 @@ import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.USymbol; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -68,7 +69,8 @@ public interface FtileFactory { public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors, Stereotype stereotype); - public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes); + public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes, + VerticalAlignment verticalAlignment); public Ftile addUrl(Ftile ftile, Url url); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java index c596058d5..6b8344d38 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java @@ -55,6 +55,7 @@ import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.USymbol; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.SName; @@ -140,8 +141,9 @@ public class FtileFactoryDelegator implements FtileFactory { return factory.activity(label, swimlane, style, colors, stereotype); } - public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes) { - return factory.addNote(ftile, swimlane, notes); + public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes, + VerticalAlignment verticalAlignment) { + return factory.addNote(ftile, swimlane, notes, verticalAlignment); } public Ftile addUrl(Ftile ftile, Url url) { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java index 4bb902cc3..a6da13c06 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/AbstractParallelFtilesBuilder.java @@ -38,9 +38,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; import java.util.ArrayList; import java.util.List; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixedCentered; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java index 95829dfa8..536f489e6 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.sequencediagram.NoteType; public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator { @@ -52,22 +53,23 @@ public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator { } @Override - public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes) { - if (notes.size() == 0) { + public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes, + VerticalAlignment verticalAlignment) { + if (notes.size() == 0) throw new IllegalArgumentException(); - } - // if (notes.size() > 1) { + + // if (notes.size() > 1) // throw new IllegalArgumentException(); - // } + ISkinParam skinParam = skinParam(); if (ftile == null) { final PositionedNote note = notes.iterator().next(); - if (note.getColors() != null) { + if (note.getColors() != null) skinParam = note.getColors().mute(skinParam); - } + return new FtileNoteAlone(skinParam.shadowing(null), note.getDisplay(), skinParam, note.getType() == NoteType.NOTE, swimlane); } - return FtileWithNoteOpale.create(ftile, notes, skinParam, true); + return FtileWithNoteOpale.create(ftile, notes, skinParam, true, verticalAlignment); } } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java index 842c89344..66b05e503 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java @@ -37,13 +37,13 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; import java.util.Collections; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.USymbol; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -58,12 +58,10 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator { @Override public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note, HColor borderColor, USymbol type, double roundCorner) { - final HColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow); - Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor, - type, roundCorner); - if (note != null) { - result = new FtileWithNotes(result, Collections.singleton(note), skinParam()); - } + Ftile result = new FtileGroup(list, name, backColor, titleColor, skinParam(), borderColor, type, roundCorner); + if (note != null) + result = new FtileWithNotes(result, Collections.singleton(note), skinParam(), VerticalAlignment.CENTER); + return result; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java index 145502ffb..e69479062 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -48,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java index 9ae2c96ad..d41ac32ff 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -47,6 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java index bf213bbfa..3468992ea 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java @@ -86,8 +86,8 @@ public class FtileGroup extends AbstractFtile { return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.partition); } - public FtileGroup(Ftile inner, Display title, Display displayNote, HColor arrowColor, HColor backColor, - HColor titleColor, ISkinParam skinParam, HColor borderColor, USymbol type, double roundCorner) { + public FtileGroup(Ftile inner, Display title, HColor backColor, HColor titleColor, ISkinParam skinParam, + HColor borderColor, USymbol type, double roundCorner) { super(inner.skinParam()); this.roundCorner = roundCorner; this.type = type; @@ -109,10 +109,10 @@ public class FtileGroup extends AbstractFtile { else this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam); - if (Display.isNull(displayNote)) - this.headerNote = TextBlockUtils.empty(0, 0); - else - this.headerNote = new FloatingNote(displayNote, skinParam); +// if (Display.isNull(displayNote)) + this.headerNote = TextBlockUtils.empty(0, 0); +// else +// this.headerNote = new FloatingNote(displayNote, skinParam); this.stroke = thickness == null ? new UStroke(2) : thickness; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java index c6dd7df9a..37b2f2152 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfDown.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Arrays; @@ -61,6 +60,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.svek.ConditionEndStyle; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java index 302bfe7ef..4342cd2cb 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; @@ -63,6 +62,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java index 6528695f2..277336f0c 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; @@ -60,6 +59,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java index 6c2c0c2cf..ea40a2760 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Arrays; @@ -64,6 +63,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java index 427d7463b..0ada8ebc0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -47,6 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java index e74713f97..50f983b6a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -54,6 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java index a92702005..fbe794a90 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Arrays; @@ -63,6 +62,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java index 703ba82fb..028d129b0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java @@ -62,6 +62,7 @@ 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.VerticalAlignment; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.style.PName; @@ -79,6 +80,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea private final Ftile tile; private final Opale opale; + private final VerticalAlignment verticalAlignment; private final NotePosition notePosition; private final double suppSpace = 20; @@ -110,18 +112,21 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea return Collections.singleton(tile); } - public static Ftile create(Ftile tile, Collection notes, ISkinParam skinParam, boolean withLink) { - if (notes.size() > 1) { - return new FtileWithNotes(tile, notes, skinParam); - } - if (notes.size() == 0) { + public static Ftile create(Ftile tile, Collection notes, ISkinParam skinParam, boolean withLink, + VerticalAlignment verticalAlignment) { + if (notes.size() > 1) + return new FtileWithNotes(tile, notes, skinParam, verticalAlignment); + + if (notes.size() == 0) throw new IllegalArgumentException(); - } - return new FtileWithNoteOpale(tile, notes.iterator().next(), skinParam, withLink); + + return new FtileWithNoteOpale(tile, notes.iterator().next(), skinParam, withLink, verticalAlignment); } - private FtileWithNoteOpale(Ftile tile, PositionedNote note, ISkinParam skinParam, boolean withLink) { + private FtileWithNoteOpale(Ftile tile, PositionedNote note, ISkinParam skinParam, boolean withLink, + VerticalAlignment verticalAlignment) { super(tile.skinParam()); + this.verticalAlignment = verticalAlignment; this.swimlaneNote = note.getSwimlaneNote(); if (note.getColors() != null) skinParam = note.getColors().mute(skinParam); @@ -155,11 +160,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea final Dimension2D dimTile = tile.calculateDimension(stringBounder); final double yForFtile = (dimTotal.getHeight() - dimTile.getHeight()) / 2; final double marge; - if (notePosition == NotePosition.LEFT) { + if (notePosition == NotePosition.LEFT) marge = dimNote.getWidth() + suppSpace; - } else { + else marge = 0; - } return new UTranslate(marge, yForFtile); } @@ -177,22 +181,25 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea final Dimension2D dimTotal = calculateDimension(stringBounder); final Dimension2D dimNote = opale.calculateDimension(stringBounder); - final double yForNote = (dimTotal.getHeight() - dimNote.getHeight()) / 2; + final double yForNote; + if (verticalAlignment == VerticalAlignment.CENTER) + yForNote = (dimTotal.getHeight() - dimNote.getHeight()) / 2; + else + yForNote = 0; - if (notePosition == NotePosition.LEFT) { + if (notePosition == NotePosition.LEFT) return UTranslate.dy(yForNote); - } + final double dx = dimTotal.getWidth() - dimNote.getWidth(); return new UTranslate(dx, yForNote); } public void drawU(UGraphic ug) { final Swimlane intoSw; - if (ug instanceof UGraphicInterceptorOneSwimlane) { + if (ug instanceof UGraphicInterceptorOneSwimlane) intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane(); - } else { + else intoSw = null; - } final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dimNote = opale.calculateDimension(stringBounder); @@ -208,9 +215,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea final Point2D pp2 = new Point2D.Double(-suppSpace, dimNote.getHeight() / 2); opale.setOpale(strategy, pp1, pp2); } - if (ug instanceof UGraphicInterceptorOneSwimlane == false || swimlaneNote == null || intoSw == swimlaneNote) { + + if (ug instanceof UGraphicInterceptorOneSwimlane == false || swimlaneNote == null || intoSw == swimlaneNote) opale.drawU(ug.apply(getTranslateForOpale(ug))); - } + ug.apply(getTranslate(stringBounder)).draw(tile); } @@ -219,10 +227,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final FtileGeometry orig = tile.calculateDimension(stringBounder); final UTranslate translate = getTranslate(stringBounder); - if (orig.hasPointOut()) { + if (orig.hasPointOut()) return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy(), orig.getOutY() + translate.getDy()); - } + return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java index cdec49a0e..8d48001cd 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java @@ -58,8 +58,8 @@ 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.graphic.VerticalAlignment; import net.sourceforge.plantuml.sequencediagram.NotePosition; -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; @@ -77,6 +77,7 @@ public class FtileWithNotes extends AbstractFtile { private TextBlock left; private TextBlock right; + private final VerticalAlignment verticalAlignment; private final double suppSpace = 20; @@ -96,8 +97,10 @@ public class FtileWithNotes extends AbstractFtile { return tile.getSwimlaneOut(); } - public FtileWithNotes(Ftile tile, Collection notes, ISkinParam skinParam) { + public FtileWithNotes(Ftile tile, Collection notes, ISkinParam skinParam, + VerticalAlignment verticalAlignment) { super(tile.skinParam()); + this.verticalAlignment = verticalAlignment; this.tile = tile; for (PositionedNote note : notes) { @@ -161,7 +164,11 @@ public class FtileWithNotes extends AbstractFtile { final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimTile = tile.calculateDimension(stringBounder); final double xDelta = left.calculateDimension(stringBounder).getWidth(); - final double yDelta = (dimTotal.getHeight() - dimTile.getHeight()) / 2; + final double yDelta; + if (verticalAlignment == VerticalAlignment.TOP) + yDelta = 0; + else + yDelta = (dimTotal.getHeight() - dimTile.getHeight()) / 2; return new UTranslate(xDelta, yDelta); } @@ -169,7 +176,11 @@ public class FtileWithNotes extends AbstractFtile { final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimLeft = left.calculateDimension(stringBounder); final double xDelta = 0; - final double yDelta = (dimTotal.getHeight() - dimLeft.getHeight()) / 2; + final double yDelta; + if (verticalAlignment == VerticalAlignment.TOP) + yDelta = 0; + else + yDelta = (dimTotal.getHeight() - dimLeft.getHeight()) / 2; return new UTranslate(xDelta, yDelta); } @@ -177,7 +188,11 @@ public class FtileWithNotes extends AbstractFtile { final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimRight = right.calculateDimension(stringBounder); final double xDelta = dimTotal.getWidth() - dimRight.getWidth(); - final double yDelta = (dimTotal.getHeight() - dimRight.getHeight()) / 2; + final double yDelta; + if (verticalAlignment == VerticalAlignment.TOP) + yDelta = 0; + else + yDelta = (dimTotal.getHeight() - dimRight.getHeight()) / 2; return new UTranslate(xDelta, yDelta); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java index 6078aa2cc..6adee07c8 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java @@ -131,7 +131,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { final List conns = new ArrayList<>(); final Swimlane swimlaneBlack = in; final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); - final Ftile black = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack); + final Ftile black = new FtileBlackBlock(skinParam(), swimlaneBlack); double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); @@ -182,7 +182,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { @Override protected Ftile doStep2(Ftile middle, Ftile result) { final Swimlane swimlaneBlack = out; - final Ftile out = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack); + final Ftile out = new FtileBlackBlock(skinParam(), swimlaneBlack); ((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), barHeight); if (label != null) @@ -205,9 +205,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder { return result; } - private HColor barColor() { - return getRose().getHtmlColor(skinParam(), ColorParam.activityBar); - } +// private HColor barColor() { +// return getRose().getHtmlColor(skinParam(), ColorParam.activityBar); +// } class ConnectionIn extends AbstractConnection implements ConnectionTranslatable { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java index 824395818..20e152cbb 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java @@ -73,9 +73,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder { protected Ftile doStep1(Ftile inner) { Ftile result = inner; final List conns = new ArrayList<>(); - final HColor colorBar = getRose().getHtmlColor(skinParam(), ColorParam.activityBar); - final Ftile black = new FtileBlackBlock(skinParam(), colorBar, list99.get(0).getSwimlaneIn()); + final Ftile black = new FtileBlackBlock(skinParam(), list99.get(0).getSwimlaneIn()); double x = 0; for (Ftile tmp : list99) { final Dimension2D dim = tmp.calculateDimension(getStringBounder()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java index 0fe26ed1f..4cff5e372 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java @@ -40,7 +40,6 @@ import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java index c9d0fc27e..0829fe4da 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java @@ -63,6 +63,7 @@ import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.USymbol; +import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.PName; @@ -144,7 +145,8 @@ public class VCompactFactory implements FtileFactory { return FtileBox.create(colors.mute(skinParam), label, swimlane, boxStyle, stereotype); } - public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes) { + public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection notes, + VerticalAlignment verticalAlignment) { return ftile; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java index fbedb3aaf..0eba62c6a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java @@ -35,18 +35,17 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Objects; import java.util.Set; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; @@ -66,12 +65,11 @@ public class FtileBlackBlock extends AbstractFtile { private double width; private double height; private TextBlock label = TextBlockUtils.empty(0, 0); - private HColor colorBar; + private final Swimlane swimlane; - public FtileBlackBlock(ISkinParam skinParam, HColor colorBar, Swimlane swimlane) { + public FtileBlackBlock(ISkinParam skinParam, Swimlane swimlane) { super(skinParam); - this.colorBar = colorBar; this.swimlane = swimlane; } @@ -103,7 +101,8 @@ public class FtileBlackBlock extends AbstractFtile { final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final double shadowing = style.value(PName.Shadowing).asDouble(); rect.setDeltaShadow(shadowing); - colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()); + final HColor colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), + getIHtmlColorSet()); ug.apply(colorBar).apply(colorBar.bg()).draw(rect); final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java index 38f2a15ee..3a7d63b38 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox2.java @@ -43,7 +43,6 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SkinParamColors; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java index 63c26e30e..d0501f0db 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBoxOld.java @@ -35,25 +35,21 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SkinParamColors; -import net.sourceforge.plantuml.SkinParamUtils; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java index 5e14e0dd5..fc73779d8 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java @@ -41,7 +41,6 @@ import java.util.Set; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java index a645a88da..11d79be4f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java @@ -40,7 +40,6 @@ import java.util.Collections; import java.util.Set; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java index 4921cecd0..730c07e07 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java @@ -40,7 +40,6 @@ import java.util.Collections; import java.util.Set; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateInLabel.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateInLabel.java index 39e99b741..3bd02fa12 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateInLabel.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateInLabel.java @@ -35,10 +35,9 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOutLabel.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOutLabel.java index 41adeb4c0..dd5535b7e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOutLabel.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOutLabel.java @@ -35,10 +35,9 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java index 9f81d18dc..bf4046192 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java @@ -35,14 +35,13 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java index 5829988bc..ea0ad09bc 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java @@ -35,14 +35,13 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java index fd00c0695..bf6b5080e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java @@ -35,13 +35,12 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java index 7ad5307af..614072d17 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondSquare.java @@ -35,14 +35,13 @@ */ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/AbstractGtile.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/AbstractGtile.java index f9f2a0a74..8931d9cf4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/AbstractGtile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/AbstractGtile.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; @@ -43,6 +42,7 @@ import java.util.Set; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.ugraphic.UStroke; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java index 77ed0bcf2..d194393f0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GConnectionHorizontalThenVerticalDown.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import net.sourceforge.plantuml.Dimension2DDouble; @@ -44,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java index ab6d34b74..6f0f25b42 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileAssembly.java @@ -35,14 +35,12 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.LinkRendering; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.FontConfiguration; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileColumns.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileColumns.java index 44f21f78a..b0a64ffbc 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileColumns.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileColumns.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -43,6 +42,7 @@ import java.util.Set; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileEmpty.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileEmpty.java index d17934759..06112acc1 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileEmpty.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileEmpty.java @@ -35,11 +35,10 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInsideLabelled.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInsideLabelled.java index 247d18780..4ee68b2ac 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInsideLabelled.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileHexagonInsideLabelled.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.activitydiagram3.gtile; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java index e42f7a3b5..5ebeaa85b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfAlone.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Arrays; import java.util.Collection; @@ -43,6 +42,7 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java index 4bf922d29..994cf18d9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileIfHexagon.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -43,6 +42,7 @@ import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java index a93bcbf4f..49538847c 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileRepeat.java @@ -35,9 +35,7 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -45,6 +43,7 @@ import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlockUtils; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java index 7324b3abd..d1da17d02 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileSplit.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.StyleSignatureBasic; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown.java index 14b2cdfbe..caf3b56f2 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collections; import java.util.HashSet; import java.util.Set; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown3.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown3.java index cc5f6e673..5fbb0660e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileTopDown3.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collections; import java.util.HashSet; import java.util.Set; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithMargin.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithMargin.java index 3d6e8d901..cb7d6d322 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithMargin.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithMargin.java @@ -35,13 +35,13 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collection; import java.util.Collections; import java.util.Set; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java index 35b2e6746..786b67957 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/GtileWithNoteOpale.java @@ -35,18 +35,15 @@ */ package net.sourceforge.plantuml.activitydiagram3.gtile; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Set; import net.sourceforge.plantuml.AlignmentParam; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -59,7 +56,6 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NoteType; -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; diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java index f9363997e..86fcf93d2 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java @@ -137,16 +137,14 @@ final public class CommandLinkClass extends SingleLineCommand2".equals(s)) { + if ("|>".equals(s)) return LinkDecor.EXTENDS; - } - if (":|>".equals(s)) { + + if (":|>".equals(s)) return LinkDecor.DEFINEDBY; - } - if ("||>".equals(s)) { + + if ("||>".equals(s)) return LinkDecor.REDEFINES; - } - if (">".equals(s)) { + + if (">".equals(s)) return LinkDecor.ARROW; - } - if ("{".equals(s)) { + + if ("{".equals(s)) return LinkDecor.CROWFOOT; - } - if ("o{".equals(s)) { + + if ("o{".equals(s)) return LinkDecor.CIRCLE_CROWFOOT; - } - if ("|{".equals(s)) { + + if ("|{".equals(s)) return LinkDecor.LINE_CROWFOOT; - } - if ("o|".equals(s)) { + + if ("o|".equals(s)) return LinkDecor.CIRCLE_LINE; - } - if ("||".equals(s)) { + + if ("||".equals(s)) return LinkDecor.DOUBLE_LINE; - } - if ("^".equals(s)) { + + if ("^".equals(s)) return LinkDecor.EXTENDS; - } - if ("+".equals(s)) { + + if ("+".equals(s)) return LinkDecor.PLUS; - } - if ("o".equals(s)) { + + if ("o".equals(s)) return LinkDecor.AGREGATION; - } - if ("x".equals(s)) { + + if ("x".equals(s)) return LinkDecor.NOT_NAVIGABLE; - } - if ("*".equals(s)) { + + if ("*".equals(s)) return LinkDecor.COMPOSITION; - } - if ("#".equals(s)) { + + if ("#".equals(s)) return LinkDecor.SQUARE; - } - if ("(".equals(s)) { + + if ("(".equals(s)) return LinkDecor.PARENTHESIS; - } + return LinkDecor.NONE; } @@ -654,19 +640,19 @@ final public class CommandLinkClass extends SingleLineCommand2 urls = new ArrayList<>(); - private final Stereotype stereotype; + private final ILeaf entity; private final boolean inEllipse; private final Style style; - BodyEnhanced1(HorizontalAlignment align, List rawBody, FontParam fontParam, ISkinParam skinParam, - Stereotype stereotype, ILeaf entity, Style style) { + BodyEnhanced1(HorizontalAlignment align, List rawBody, ISkinParam skinParam, ILeaf entity, + Style style) { super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); this.style = style; this.rawBody2 = Display.create(rawBody); - this.stereotype = stereotype; - this.fontParam = fontParam; + this.skinParam = skinParam; this.lineFirst = true; @@ -89,20 +87,19 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi this.inEllipse = false; } - BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam, - Stereotype stereotype, ILeaf entity, Style style) { - super(align, style == null ? FontConfiguration.create(skinParam, fontParam, stereotype) - : style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); + BodyEnhanced1(HorizontalAlignment align, Display display, ISkinParam skinParam, ILeaf entity, + Style style) { + super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); this.style = style; this.entity = entity; - this.stereotype = stereotype; - this.fontParam = fontParam; + this.skinParam = skinParam; this.lineFirst = false; - this.inEllipse = fontParam == FontParam.USECASE; + final LeafType leafType = entity.getLeafType(); + this.inEllipse = leafType == LeafType.USECASE || leafType == LeafType.USECASE_BUSINESS; if (inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString())) display = display.add(""); @@ -137,8 +134,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi if (cs instanceof EmbeddedDiagram) { if (display.size() > 0 || separator != 0) { blocks.add(decorate(stringBounder, - new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), - separator, title)); + new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title)); separator = 0; title = null; display = Display.empty(); @@ -148,23 +144,24 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi final String s = cs.toString(); if (isBlockSeparator(s)) { blocks.add(decorate(stringBounder, - new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), - separator, title)); + new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title)); separator = s.charAt(0); title = getTitle(s, skinParam); display = Display.empty(); } else if (isTreeOrTable(s)) { final boolean isTable = CreoleParser.isTableLine(s); if (display.size() > 0) - blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(display, fontParam, skinParam, align, - stereotype, entity, style), separator, title)); + blocks.add(decorate(stringBounder, + new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title)); separator = 0; title = null; display = Display.empty(); final List allTree = buildTreeOrTable(s, it); - TextBlock bloc = Display.create(allTree).create7(fontParam.getFontConfiguration(skinParam), align, - skinParam, CreoleMode.FULL); + final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + TextBlock bloc = Display.create(allTree).create7(fontConfiguration, align, skinParam, + CreoleMode.FULL); if (isTable) bloc = TextBlockUtils.withMargin(bloc, 10, 10, 0, 5); @@ -180,8 +177,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi if (inEllipse && display.size() == 0) { display = display.add(""); } - blocks.add(decorate(stringBounder, - new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), separator, + blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title)); if (blocks.size() == 1) diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java index 8d9d6d60a..55ae370d1 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.cucadiagram; import java.util.ArrayList; import java.util.List; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.LineBreakStrategy; @@ -57,8 +56,8 @@ public class BodyEnhanced2 extends BodyEnhancedAbstract { private final LineBreakStrategy lineBreakStrategy; - BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple skinParam, HorizontalAlignment align, - FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) { + BodyEnhanced2(Display rawBody, ISkinSimple skinParam, HorizontalAlignment align, FontConfiguration titleConfig, + LineBreakStrategy lineBreakStrategy, Style style) { super(align, titleConfig, style); this.rawBody = rawBody; this.lineBreakStrategy = lineBreakStrategy; diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java b/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java index a28db0eab..04f32ed10 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.cucadiagram; import java.util.List; import java.util.Set; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.LineBreakStrategy; @@ -53,9 +52,9 @@ public class BodyFactory { public final static boolean BODY3 = false; public static Bodier createLeaf(LeafType type, Set hides) { - if (type.isLikeClass() || type == LeafType.OBJECT) { + if (type.isLikeClass() || type == LeafType.OBJECT) return new BodierLikeClassOrObject(type, hides); - } + return new BodierSimple(); } @@ -63,20 +62,19 @@ public class BodyFactory { return new BodierSimple(); } - public static TextBlock create1(HorizontalAlignment align, List rawBody, FontParam fontParam, - ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { - return new BodyEnhanced1(align, rawBody, fontParam, skinParam, stereotype, entity, style); + public static TextBlock create1(HorizontalAlignment align, List rawBody, ISkinParam skinParam, + Stereotype stereotype, ILeaf entity, Style style) { + return new BodyEnhanced1(align, rawBody, skinParam, entity, style); } - public static TextBlock create2(HorizontalAlignment align, Display display, FontParam fontParam, - ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { - return new BodyEnhanced1(align, display, fontParam, skinParam, stereotype, entity, style); + public static TextBlock create2(HorizontalAlignment align, Display display, ISkinParam skinParam, + Stereotype stereotype, ILeaf entity, Style style) { + return new BodyEnhanced1(align, display, skinParam, entity, style); } - public static TextBlock create3(Display rawBody, FontParam fontParam, ISkinSimple skinParam, - HorizontalAlignment align, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, - Style style) { - return new BodyEnhanced2(rawBody, fontParam, skinParam, align, titleConfig, lineBreakStrategy, style); + public static TextBlock create3(Display rawBody, ISkinSimple skinParam, HorizontalAlignment align, + FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) { + return new BodyEnhanced2(rawBody, skinParam, align, titleConfig, lineBreakStrategy, style); } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java index e3bd08d41..ab8cb5df1 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java +++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java @@ -41,7 +41,6 @@ import java.util.HashSet; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.EmbeddedDiagram; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.awt.geom.Dimension2D; @@ -77,35 +76,32 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, TextBlockUtils.withMargin(this, 6, 4)); } - private final FontParam fontParam; private final ISkinParam skinParam; private final Display members; private final HorizontalAlignment align; - private final Stereotype stereotype; + private final ILeaf leaf; private final Style style; - public MethodsOrFieldsArea(Display members, FontParam fontParam, ISkinParam skinParam, Stereotype stereotype, - ILeaf leaf, Style style) { - this(members, fontParam, skinParam, HorizontalAlignment.LEFT, stereotype, leaf, style); + public MethodsOrFieldsArea(Display members, ISkinParam skinParam, ILeaf leaf, Style style) { + this(members, skinParam, HorizontalAlignment.LEFT, leaf, style); } - public MethodsOrFieldsArea(Display members, FontParam fontParam, ISkinParam skinParam, HorizontalAlignment align, - Stereotype stereotype, ILeaf leaf, Style style) { + public MethodsOrFieldsArea(Display members, ISkinParam skinParam, HorizontalAlignment align, ILeaf leaf, + Style style) { this.style = style; this.leaf = leaf; - this.stereotype = stereotype; + this.align = align; this.skinParam = skinParam; - this.fontParam = fontParam; this.members = members; } private boolean hasSmallIcon() { - if (skinParam.classAttributeIconSize() == 0) { + if (skinParam.classAttributeIconSize() == 0) return false; - } + for (CharSequence cs : members) { if (cs instanceof Member == false) continue; @@ -119,9 +115,9 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, public Dimension2D calculateDimension(StringBounder stringBounder) { double smallIcon = 0; - if (hasSmallIcon()) { + if (hasSmallIcon()) smallIcon = skinParam.getCircledCharacterRadius() + 3; - } + double x = 0; double y = 0; for (CharSequence cs : members) { @@ -178,11 +174,7 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock, private TextBlock createTextBlock(CharSequence cs) { - FontConfiguration config; - if (style != null) - config = FontConfiguration.create(skinParam, style); - else - config = FontConfiguration.create(skinParam, fontParam, stereotype); + FontConfiguration config = FontConfiguration.create(skinParam, style); if (cs instanceof Member) { final Member m = (Member) cs; diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java index 9e8e79994..ddb13921a 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java @@ -47,9 +47,7 @@ import java.util.Map.Entry; import java.util.Objects; import java.util.Set; -import net.sourceforge.plantuml.ColorParam; 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; @@ -69,9 +67,7 @@ import net.sourceforge.plantuml.cucadiagram.LeafType; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.SuperGroup; import net.sourceforge.plantuml.graphic.USymbol; -import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.skin.VisibilityModifier; -import net.sourceforge.plantuml.ugraphic.color.HColor; public final class EntityFactory { diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java index b1d4a9252..f0e966a38 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java +++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java @@ -666,9 +666,6 @@ final public class EntityImpl implements ILeaf, IGroup { } private FontParam getTitleFontParam() { - if (symbol != null) { - return symbol.getFontParam(); - } return getGroupType() == GroupType.STATE ? FontParam.STATE : FontParam.PACKAGE; } diff --git a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java index 9c6daebdd..2a972cb6d 100644 --- a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java +++ b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java @@ -50,6 +50,7 @@ import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; +import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UImage; public class PSystemDedication extends PlainDiagram { @@ -63,7 +64,12 @@ public class PSystemDedication extends PlainDiagram { @Override protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) { - return ug -> ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR))); + // return ug -> ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR))); + return new UDrawable() { + public void drawU(UGraphic ug) { + ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR))); + } + }; } public static BufferedImage getBufferedImage(InputStream is) { diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java index 70b852392..d101335d7 100644 --- a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java +++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.descdiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.Guillemet; @@ -44,6 +42,7 @@ import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.Stencil; import net.sourceforge.plantuml.cucadiagram.BodyFactory; import net.sourceforge.plantuml.cucadiagram.Display; @@ -51,11 +50,13 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.SkinParameter; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.color.ColorType; +import net.sourceforge.plantuml.style.SName; +import net.sourceforge.plantuml.style.Style; +import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.svek.AbstractEntityImage; import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; @@ -78,7 +79,7 @@ public class EntityImageRequirement extends AbstractEntityImage { final Stereotype stereotype = entity.getStereotype(); final TextBlock tmp = BodyFactory.create2(skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), - entity.getDisplay(), FontParam.REQUIREMENT, skinParam, stereotype, entity, null); + entity.getDisplay(), skinParam, stereotype, entity, getStyle()); if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { this.desc = tmp; @@ -91,13 +92,18 @@ public class EntityImageRequirement extends AbstractEntityImage { this.url = entity.getUrl99(); } + + private Style getStyle() { + return StyleSignatureBasic.of(SName.root, SName.element, SName.componentDiagram, SName.requirement) + .withTOBECHANGED(getEntity().getStereotype()).getMergedStyle(getSkinParam().getCurrentStyleBuilder()); + } + private UStroke getStroke() { UStroke stroke = getSkinParam().getThickness(LineParam.requirementBorder, getStereo()); - if (stroke == null) { + if (stroke == null) stroke = new UStroke(7, 7, 1.5); -// stroke = new UStroke(1.5); - } + return stroke; } @@ -108,32 +114,28 @@ public class EntityImageRequirement extends AbstractEntityImage { final public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder); - if (getSkinParam().shadowing2(getStereo(), SkinParameter.USECASE)) { - ellipse.setDeltaShadow(3); - } - if (url != null) { + if (url != null) ug.startUrl(url); - } ug = ug.apply(getStroke()); HColor linecolor = getEntity().getColors().getColor(ColorType.LINE); - if (linecolor == null) { + if (linecolor == null) linecolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBorder); - } + ug = ug.apply(linecolor); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); - if (backcolor == null) { + if (backcolor == null) backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBackground); - } + ug = ug.apply(backcolor.bg()); final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse()); ellipse.drawU(ug2); - if (url != null) { + if (url != null) ug.closeUrl(); - } + } public ShapeType getShapeType() { @@ -159,13 +161,13 @@ public class EntityImageRequirement extends AbstractEntityImage { } private double getNormalized(double y) { - if (y < yTheoricalPosition) { + if (y < yTheoricalPosition) throw new IllegalArgumentException(); - } + y = y - yTheoricalPosition; - if (y > ellipse.getHeight()) { + if (y > ellipse.getHeight()) throw new IllegalArgumentException(); - } + return y; } diff --git a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java index 0b973a067..6a2cf9f77 100644 --- a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java +++ b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java @@ -264,8 +264,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(), group.getUSymbol()); - final double roundCorner = group.getUSymbol() == null ? 0 - : group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype()); + final double roundCorner = style.value(PName.RoundCorner).asDouble(); +// final double roundCorner = group.getUSymbol() == null ? 0 +// : group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype()); final TextBlock ztitle = getTitleBlock(group); final TextBlock zstereo = TextBlockUtils.empty(0, 0); diff --git a/src/net/sourceforge/plantuml/elk/ElkPath.java b/src/net/sourceforge/plantuml/elk/ElkPath.java index 3e3fa0327..e40f5023f 100644 --- a/src/net/sourceforge/plantuml/elk/ElkPath.java +++ b/src/net/sourceforge/plantuml/elk/ElkPath.java @@ -39,10 +39,8 @@ import java.awt.geom.Point2D; import java.util.Collection; import java.util.List; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.LinkDecor; @@ -112,21 +110,6 @@ public class ElkPath implements UDrawable { } - private ColorParam getArrowColorParam() { - if (diagram.getUmlDiagramType() == UmlDiagramType.CLASS) - return ColorParam.arrow; - else if (diagram.getUmlDiagramType() == UmlDiagramType.OBJECT) - return ColorParam.arrow; - else if (diagram.getUmlDiagramType() == UmlDiagramType.DESCRIPTION) - return ColorParam.arrow; - else if (diagram.getUmlDiagramType() == UmlDiagramType.ACTIVITY) - return ColorParam.arrow; - else if (diagram.getUmlDiagramType() == UmlDiagramType.STATE) - return ColorParam.arrow; - - throw new IllegalStateException(); - } - private Style getStyle() { final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, styleName, SName.arrow); return signature.getMergedStyle(diagram.getCurrentStyleBuilder()); diff --git a/src/net/sourceforge/plantuml/graphic/CircledCharacter.java b/src/net/sourceforge/plantuml/graphic/CircledCharacter.java index 3e7634302..ac07c5751 100644 --- a/src/net/sourceforge/plantuml/graphic/CircledCharacter.java +++ b/src/net/sourceforge/plantuml/graphic/CircledCharacter.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UFont; diff --git a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java index 1e5db5916..3db773ff3 100644 --- a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java +++ b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.SpriteContainerEmpty; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.svek.IEntityImage; diff --git a/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java b/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java index d7dacd1d7..718461d21 100644 --- a/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java +++ b/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Objects; import net.sourceforge.plantuml.StringUtils; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java index c8924afe5..96435324a 100644 --- a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java +++ b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.graphic; import java.util.Objects; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; diff --git a/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java b/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java index 012113605..a8e71b271 100644 --- a/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java +++ b/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/SingleLine.java b/src/net/sourceforge/plantuml/graphic/SingleLine.java index 822fd5734..9bbffe183 100644 --- a/src/net/sourceforge/plantuml/graphic/SingleLine.java +++ b/src/net/sourceforge/plantuml/graphic/SingleLine.java @@ -35,13 +35,13 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.SpriteContainer; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/SkinParameter.java b/src/net/sourceforge/plantuml/graphic/SkinParameter.java deleted file mode 100644 index d20579999..000000000 --- a/src/net/sourceforge/plantuml/graphic/SkinParameter.java +++ /dev/null @@ -1,225 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2023, 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.graphic; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.CornerParam; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.cucadiagram.Stereotype; -import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.ugraphic.UStroke; - -public class SkinParameter { - - public static final SkinParameter DATABASE = new SkinParameter(SName.database, "DATABASE", - ColorParam.databaseBackground, ColorParam.databaseBorder, FontParam.DATABASE, - FontParam.DATABASE_STEREOTYPE); - - public static final SkinParameter ARTIFACT = new SkinParameter(SName.artifact, "ARTIFACT", - ColorParam.artifactBackground, ColorParam.artifactBorder, FontParam.ARTIFACT, - FontParam.ARTIFACT_STEREOTYPE); - - public static final SkinParameter COMPONENT1 = new SkinParameter(SName.component, "COMPONENT1", - ColorParam.componentBackground, ColorParam.componentBorder, FontParam.COMPONENT, - FontParam.COMPONENT_STEREOTYPE, CornerParam.component, LineParam.componentBorder); - - public static final SkinParameter NODE = new SkinParameter(SName.node, "NODE", ColorParam.nodeBackground, - ColorParam.nodeBorder, FontParam.NODE, FontParam.NODE_STEREOTYPE); - - public static final SkinParameter STORAGE = new SkinParameter(SName.storage, "STORAGE", - ColorParam.storageBackground, ColorParam.storageBorder, FontParam.STORAGE, FontParam.STORAGE_STEREOTYPE); - - public static final SkinParameter QUEUE = new SkinParameter(SName.queue, "QUEUE", ColorParam.queueBackground, - ColorParam.queueBorder, FontParam.QUEUE, FontParam.QUEUE_STEREOTYPE); - - public static final SkinParameter STACK = new SkinParameter(SName.stack, "STACK", ColorParam.stackBackground, - ColorParam.stackBorder, FontParam.STACK, FontParam.STACK_STEREOTYPE); - - public static final SkinParameter CLOUD = new SkinParameter(SName.cloud, "CLOUD", ColorParam.cloudBackground, - ColorParam.cloudBorder, FontParam.CLOUD, FontParam.CLOUD_STEREOTYPE); - - public static final SkinParameter FRAME = new SkinParameter(SName.frame, "FRAME", ColorParam.frameBackground, - ColorParam.frameBorder, FontParam.FRAME, FontParam.FRAME_STEREOTYPE); - - public static final SkinParameter COMPONENT2 = new SkinParameter(SName.component, "COMPONENT2", - ColorParam.componentBackground, ColorParam.componentBorder, FontParam.COMPONENT, - FontParam.COMPONENT_STEREOTYPE, CornerParam.component, LineParam.componentBorder); - - public static final SkinParameter AGENT = new SkinParameter(SName.agent, "AGENT", ColorParam.agentBackground, - ColorParam.agentBorder, FontParam.AGENT, FontParam.AGENT_STEREOTYPE, CornerParam.agent, - LineParam.agentBorder); - - public static final SkinParameter FOLDER = new SkinParameter(SName.folder, "FOLDER", ColorParam.folderBackground, - ColorParam.folderBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE); - - public static final SkinParameter FILE = new SkinParameter(SName.file, "FILE", ColorParam.fileBackground, - ColorParam.fileBorder, FontParam.FILE, FontParam.FILE_STEREOTYPE); - - public static final SkinParameter PACKAGE = new SkinParameter(SName.package_, "PACKAGE", - ColorParam.packageBackground, ColorParam.packageBorder, FontParam.PACKAGE, FontParam.PACKAGE_STEREOTYPE, - CornerParam.DEFAULT, LineParam.packageBorder); - - public static final SkinParameter CARD = new SkinParameter(SName.card, "CARD", ColorParam.cardBackground, - ColorParam.cardBorder, FontParam.CARD, FontParam.CARD_STEREOTYPE, CornerParam.card, LineParam.cardBorder); - - public static final SkinParameter RECTANGLE = new SkinParameter(SName.rectangle, "RECTANGLE", - ColorParam.rectangleBackground, ColorParam.rectangleBorder, FontParam.RECTANGLE, - FontParam.RECTANGLE_STEREOTYPE, CornerParam.rectangle, LineParam.rectangleBorder); - - public static final SkinParameter LABEL = new SkinParameter(SName.label, "LABEL", ColorParam.rectangleBackground, - ColorParam.rectangleBorder, FontParam.LABEL, FontParam.LABEL_STEREOTYPE); - - public static final SkinParameter HEXAGON = new SkinParameter(SName.hexagon, "HEXAGON", - ColorParam.hexagonBackground, ColorParam.hexagonBorder, FontParam.HEXAGON, FontParam.HEXAGON_STEREOTYPE, - CornerParam.hexagon, LineParam.hexagonBorder); - - public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON", ColorParam.personBackground, - ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE, CornerParam.person, - LineParam.personBorder); - - public static final SkinParameter ARCHIMATE = new SkinParameter(SName.archimate, "ARCHIMATE", - ColorParam.archimateBackground, ColorParam.archimateBorder, FontParam.ARCHIMATE, - FontParam.ARCHIMATE_STEREOTYPE, CornerParam.archimate, LineParam.archimateBorder); - - public static final SkinParameter COLLECTIONS = new SkinParameter(SName.collections, "COLLECTIONS", - ColorParam.collectionsBackground, ColorParam.collectionsBorder, FontParam.RECTANGLE, - FontParam.RECTANGLE_STEREOTYPE); - - public static final SkinParameter ACTOR = new SkinParameter(SName.actor, "ACTOR", ColorParam.actorBackground, - ColorParam.actorBorder, FontParam.ACTOR, FontParam.ACTOR_STEREOTYPE); - - public static final SkinParameter USECASE = new SkinParameter(SName.usecase, "USECASE", - ColorParam.usecaseBackground, ColorParam.usecaseBorder, FontParam.USECASE, FontParam.USECASE_STEREOTYPE); - - public static final SkinParameter BOUNDARY = new SkinParameter(SName.boundary, "BOUNDARY", - ColorParam.boundaryBackground, ColorParam.boundaryBorder, FontParam.BOUNDARY, - FontParam.BOUNDARY_STEREOTYPE); - - public static final SkinParameter CONTROL = new SkinParameter(SName.control, "CONTROL", - ColorParam.controlBackground, ColorParam.controlBorder, FontParam.CONTROL, FontParam.CONTROL_STEREOTYPE); - - public static final SkinParameter ENTITY = new SkinParameter(SName.entity, "ENTITY", ColorParam.entityBackground, - ColorParam.entityBorder, FontParam.ENTITY, FontParam.ENTITY_STEREOTYPE); - - public static final SkinParameter INTERFACE = new SkinParameter(SName.interface_, "INTERFACE", - ColorParam.interfaceBackground, ColorParam.interfaceBorder, FontParam.INTERFACE, - FontParam.INTERFACE_STEREOTYPE); - - public static final SkinParameter PARTICIPANT = new SkinParameter(SName.participant, "PARTICIPANT", - ColorParam.participantBackground, ColorParam.participantBorder, FontParam.PARTICIPANT, - FontParam.PARTICIPANT_STEREOTYPE); - - private final ColorParam colorParamBorder; - private final ColorParam colorParamBack; - private final FontParam fontParam; - private final FontParam fontParamStereotype; - private final String name; - private final LineParam lineParam; - private final CornerParam roundParam; - private final SName styleName; - - @Override - public String toString() { - return name; - } - - public SName getStyleName() { - return styleName; - } - - private SkinParameter(SName styleName, String name, ColorParam colorParamBack, ColorParam colorParamBorder, - FontParam fontParam, FontParam fontParamStereotype, CornerParam roundParam, LineParam lineParam) { - this.name = name; - this.styleName = styleName; - this.colorParamBack = colorParamBack; - this.colorParamBorder = colorParamBorder; - this.fontParam = fontParam; - this.fontParamStereotype = fontParamStereotype; - this.lineParam = lineParam; - this.roundParam = roundParam; - } - - private SkinParameter(SName styleName, String name, ColorParam colorParamBack, ColorParam colorParamBorder, - FontParam fontParam, FontParam fontParamStereotype) { - this(styleName, name, colorParamBack, colorParamBorder, fontParam, fontParamStereotype, CornerParam.DEFAULT, - null); - } - - public String getUpperCaseName() { - if (name.endsWith("1") || name.endsWith("2")) { - return name.substring(0, name.length() - 1); - } - return name; - } - - public ColorParam getColorParamBorder() { - return colorParamBorder; - } - - public ColorParam getColorParamBack() { - return colorParamBack; - } - - public FontParam getFontParam() { - return fontParam; - } - - public FontParam getFontParamStereotype() { - return fontParamStereotype; - } - - public double getRoundCorner(ISkinParam skinParam, Stereotype stereotype) { - return skinParam.getRoundCorner(roundParam, stereotype); - } - - public double getDiagonalCorner(ISkinParam skinParam, Stereotype stereotype) { - return skinParam.getDiagonalCorner(roundParam, stereotype); - } - - public UStroke getStroke(ISkinParam skinParam, Stereotype stereotype) { - UStroke result = null; - if (lineParam != null) { - result = skinParam.getThickness(lineParam, stereotype); - } - if (result == null) { - result = new UStroke(1.5); - } - return result; - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/graphic/SpecialText.java b/src/net/sourceforge/plantuml/graphic/SpecialText.java index e8a4d8dcc..f476a0ba1 100644 --- a/src/net/sourceforge/plantuml/graphic/SpecialText.java +++ b/src/net/sourceforge/plantuml/graphic/SpecialText.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.graphic; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UShapeIgnorableForCompression; diff --git a/src/net/sourceforge/plantuml/graphic/StringBounder.java b/src/net/sourceforge/plantuml/graphic/StringBounder.java index 4905d69d7..c616610bc 100644 --- a/src/net/sourceforge/plantuml/graphic/StringBounder.java +++ b/src/net/sourceforge/plantuml/graphic/StringBounder.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.graphic; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ugraphic.UFont; public interface StringBounder { diff --git a/src/net/sourceforge/plantuml/graphic/StringBounderRaw.java b/src/net/sourceforge/plantuml/graphic/StringBounderRaw.java index a2e54c417..e4b57bac3 100644 --- a/src/net/sourceforge/plantuml/graphic/StringBounderRaw.java +++ b/src/net/sourceforge/plantuml/graphic/StringBounderRaw.java @@ -37,10 +37,10 @@ package net.sourceforge.plantuml.graphic; import java.awt.font.FontRenderContext; import java.awt.font.LineMetrics; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FileFormat; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.text.RichText; import net.sourceforge.plantuml.text.StyledString; import net.sourceforge.plantuml.ugraphic.UFont; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlock.java b/src/net/sourceforge/plantuml/graphic/TextBlock.java index 25d3b0d91..94d2ff756 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlock.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlock.java @@ -35,9 +35,9 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UShape; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java b/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java index 7bf082070..10bd90b26 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Objects; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Direction; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockArrow2.java b/src/net/sourceforge/plantuml/graphic/TextBlockArrow2.java index 9870cd457..9f512d737 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockArrow2.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockArrow2.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.Objects; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.svek.GuideLine; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPolygon; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java index c3340cf51..876ac9c97 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.SheetBlock2; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.ugraphic.Shadowable; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java b/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java index 3879a2f62..6f88837c7 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; public class TextBlockEmpty extends AbstractTextBlock { diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java index 7093bfd6f..444501720 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.graphic; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.UStroke; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java b/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java index a2acc5e05..d4c6fd96c 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java index 396870fc0..783e51ae3 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.svek.Ports; import net.sourceforge.plantuml.svek.WithPorts; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java b/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java index e773322ef..3ac83eefd 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.svek.Ports; import net.sourceforge.plantuml.svek.WithPorts; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java b/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java index 4ada65982..76fdf847a 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java b/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java index a19c68277..de3e72f10 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java index 58a68ab35..c5c4967b6 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.graphic; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java b/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java index 4e66be8fa..51585cddd 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -43,6 +42,7 @@ import java.util.StringTokenizer; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.EmbeddedDiagram; import net.sourceforge.plantuml.SpriteContainer; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java b/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java index 96494fc6a..54209976e 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java b/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java index caa2e3bc8..da217a166 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.LineBreakStrategy; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.ugraphic.MinMax; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java index 4d460d280..3e4562047 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java @@ -37,21 +37,16 @@ package net.sourceforge.plantuml.graphic; import java.awt.font.FontRenderContext; import java.awt.font.TextLayout; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.CornerParam; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.posimo.Positionable; import net.sourceforge.plantuml.posimo.PositionableImpl; -import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.LimitFinder; @@ -62,7 +57,6 @@ import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class TextBlockUtils { diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java index 80c16776f..b99e7f40d 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.svek.Ports; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.svek.WithPorts; diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java b/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java index bd083300b..a225e8e0f 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockWithUrl.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/graphic/TileImage.java b/src/net/sourceforge/plantuml/graphic/TileImage.java index 4a0154377..0d4401b70 100644 --- a/src/net/sourceforge/plantuml/graphic/TileImage.java +++ b/src/net/sourceforge/plantuml/graphic/TileImage.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import java.util.Objects; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/graphic/TileImageSvg.java b/src/net/sourceforge/plantuml/graphic/TileImageSvg.java index 2d8c351c8..82911a800 100644 --- a/src/net/sourceforge/plantuml/graphic/TileImageSvg.java +++ b/src/net/sourceforge/plantuml/graphic/TileImageSvg.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UImageSvg; diff --git a/src/net/sourceforge/plantuml/graphic/TileText.java b/src/net/sourceforge/plantuml/graphic/TileText.java index 0f7f35814..887a1c3d9 100644 --- a/src/net/sourceforge/plantuml/graphic/TileText.java +++ b/src/net/sourceforge/plantuml/graphic/TileText.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.StringTokenizer; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/USymbol.java b/src/net/sourceforge/plantuml/graphic/USymbol.java index e805a9175..7bf28607e 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbol.java +++ b/src/net/sourceforge/plantuml/graphic/USymbol.java @@ -35,36 +35,14 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; public abstract class USymbol { - abstract public SkinParameter getSkinParameter(); - abstract public SName getSName(); - public FontParam getFontParam() { - return getSkinParameter().getFontParam(); - } - - public FontParam getFontParamStereotype() { - return getSkinParameter().getFontParamStereotype(); - - } - - public ColorParam getColorParamBack() { - return getSkinParameter().getColorParamBack(); - } - - public ColorParam getColorParamBorder() { - return getSkinParameter().getColorParamBorder(); - } - public abstract TextBlock asSmall(TextBlock name, TextBlock label, TextBlock stereotype, SymbolContext symbolContext, HorizontalAlignment stereoAlignment); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolActor.java b/src/net/sourceforge/plantuml/graphic/USymbolActor.java index 8e426aace..0f833949a 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolActor.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolActor.java @@ -47,11 +47,6 @@ class USymbolActor extends USymbolSimpleAbstract { } - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.ACTOR; - } - @Override public SName getSName() { return SName.actor; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java index ab60cffef..216bf1278 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -48,11 +47,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolArtifact extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.ARTIFACT; - } - @Override public SName getSName() { return SName.artifact; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java b/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java index 1ece998e5..6ccc142a5 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java @@ -40,11 +40,6 @@ import net.sourceforge.plantuml.svek.Boundary; class USymbolBoundary extends USymbolSimpleAbstract { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.BOUNDARY; - } - @Override public SName getSName() { return SName.boundary; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCard.java b/src/net/sourceforge/plantuml/graphic/USymbolCard.java index 7e5ff2c7d..a79eccc64 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolCard.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolCard.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -47,22 +46,11 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolCard extends USymbol { - private final SkinParameter skinParameter; - - public USymbolCard(SkinParameter skinParameter) { - this.skinParameter = skinParameter; - } - @Override public SName getSName() { return SName.card; } - @Override - public SkinParameter getSkinParameter() { - return skinParameter; - } - private void drawCard(UGraphic ug, double width, double height, double shadowing, double top, double roundCorner) { final URectangle shape = new URectangle(width, height).rounded(roundCorner); shape.setDeltaShadow(shadowing); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java index 30c7257ad..49339ea37 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java @@ -35,13 +35,13 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -57,11 +57,6 @@ class USymbolCloud extends USymbol { private final static boolean NEW = true; private final static boolean DEBUG = false; - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.CLOUD; - } - @Override public SName getSName() { return SName.cloud; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java index 0a97d19ff..81fd419de 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -46,24 +45,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolCollections extends USymbol { - private final SkinParameter skinParameter; - // private final HorizontalAlignment stereotypeAlignement; - - public USymbolCollections(SkinParameter skinParameter) { - this.skinParameter = skinParameter; - // this.stereotypeAlignement = stereotypeAlignement; - } - -// @Override -// public USymbol withStereoAlignment(HorizontalAlignment alignment) { -// return new USymbolCollections(skinParameter, alignment); -// } - - @Override - public SkinParameter getSkinParameter() { - return skinParameter; - } - @Override public SName getSName() { return SName.collections; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java index 4b8682e60..447c45d64 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -47,11 +46,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolComponent1 extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.COMPONENT1; - } - @Override public SName getSName() { return SName.component; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java index 443e5c9c4..6c38492d1 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -47,11 +46,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolComponent2 extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.COMPONENT2; - } - @Override public SName getSName() { return SName.component; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolControl.java b/src/net/sourceforge/plantuml/graphic/USymbolControl.java index 2e5bddc92..f8ce01243 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolControl.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolControl.java @@ -40,11 +40,6 @@ import net.sourceforge.plantuml.svek.Control; class USymbolControl extends USymbolSimpleAbstract { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.CONTROL; - } - @Override public SName getSName() { return SName.control; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java index e9b381ba4..ecb1d00c0 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.graphic; import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; @@ -49,11 +48,6 @@ import net.sourceforge.plantuml.ugraphic.color.HColorNone; class USymbolDatabase extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.DATABASE; - } - @Override public SName getSName() { return SName.database; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java index 3729f4655..0c31ef0b8 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java @@ -40,11 +40,6 @@ import net.sourceforge.plantuml.svek.EntityDomain; class USymbolEntityDomain extends USymbolSimpleAbstract { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.ENTITY; - } - @Override public SName getSName() { return SName.entity; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFile.java b/src/net/sourceforge/plantuml/graphic/USymbolFile.java index 655001a89..50cb88aee 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolFile.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolFile.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -51,11 +51,6 @@ class USymbolFile extends USymbol { private final HorizontalAlignment stereotypeAlignement = HorizontalAlignment.CENTER; - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.FILE; - } - @Override public SName getSName() { return SName.file; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java index ad6ebdda7..3d70c81d1 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.Objects; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -58,24 +58,17 @@ public class USymbolFolder extends USymbol { private final static int marginTitleY1 = 3; private final static int marginTitleY2 = 3; - private final SkinParameter skinParameter; private final SName sname; private final boolean showTitle; - public USymbolFolder(SName sname, SkinParameter skinParameter, boolean showTitle) { - this.skinParameter = skinParameter; + public USymbolFolder(SName sname, boolean showTitle) { this.showTitle = showTitle; this.sname = sname; } @Override public String toString() { - return super.toString() + " " + skinParameter + " " + showTitle; - } - - @Override - public SkinParameter getSkinParameter() { - return skinParameter; + return super.toString() + " " + showTitle; } @Override diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java index 8bda13e6a..7c7a072cd 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -49,11 +48,6 @@ import net.sourceforge.plantuml.ugraphic.color.HColorNone; class USymbolFrame extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.FRAME; - } - @Override public SName getSName() { return SName.frame; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java b/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java index ffe7a6e96..62aeb8746 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolHexagon.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UPath; @@ -45,11 +44,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; public class USymbolHexagon extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.HEXAGON; - } - @Override public SName getSName() { return SName.hexagon; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolInterface.java b/src/net/sourceforge/plantuml/graphic/USymbolInterface.java index 85ab1d54a..2b97b29e7 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolInterface.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolInterface.java @@ -40,11 +40,6 @@ import net.sourceforge.plantuml.svek.CircleInterface2; public class USymbolInterface extends USymbolSimpleAbstract { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.INTERFACE; - } - @Override public SName getSName() { return SName.interface_; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolLabel.java b/src/net/sourceforge/plantuml/graphic/USymbolLabel.java index 74057cbb3..a9710e0b3 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolLabel.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolLabel.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -45,22 +44,11 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolLabel extends USymbol { - private final SkinParameter skinParameter; - - public USymbolLabel(SkinParameter skinParameter) { - this.skinParameter = skinParameter; - } - @Override public SName getSName() { return SName.label; } - @Override - public SkinParameter getSkinParameter() { - return skinParameter; - } - private Margin getMargin() { return new Margin(10, 10, 10, 10); } diff --git a/src/net/sourceforge/plantuml/graphic/USymbolNode.java b/src/net/sourceforge/plantuml/graphic/USymbolNode.java index 6b14a0e2e..a4775ae4c 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolNode.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolNode.java @@ -35,10 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.UseStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; import net.sourceforge.plantuml.ugraphic.UEmpty; @@ -51,13 +49,6 @@ import net.sourceforge.plantuml.ugraphic.color.HColorNone; class USymbolNode extends USymbol { - // private final HorizontalAlignment stereotypeAlignement; - - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.NODE; - } - @Override public SName getSName() { return SName.node; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolPerson.java b/src/net/sourceforge/plantuml/graphic/USymbolPerson.java index 557ff273a..711dbe6e6 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolPerson.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolPerson.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -47,11 +46,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolPerson extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.PERSON; - } - @Override public SName getSName() { return SName.person; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java index e6c5c1aca..e9a5e140a 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.Stencil; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; @@ -49,11 +48,6 @@ import net.sourceforge.plantuml.ugraphic.color.HColorNone; class USymbolQueue extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.QUEUE; - } - @Override public SName getSName() { return SName.queue; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolRectangle.java b/src/net/sourceforge/plantuml/graphic/USymbolRectangle.java index 4ba8bec17..53a2cf07a 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolRectangle.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolRectangle.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -47,20 +46,15 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolRectangle extends USymbol { - private final SkinParameter skinParameter; + private final SName sname; - public USymbolRectangle(SkinParameter skinParameter) { - this.skinParameter = skinParameter; + public USymbolRectangle(SName sname) { + this.sname = sname; } @Override public SName getSName() { - return SName.rectangle; - } - - @Override - public SkinParameter getSkinParameter() { - return skinParameter; + return sname; } private void drawRect(UGraphic ug, double width, double height, double shadowing, double roundCorner, diff --git a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java index cc0e6f823..36f07e5fa 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Objects; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStack.java b/src/net/sourceforge/plantuml/graphic/USymbolStack.java index e335c2bf3..5acfda06d 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolStack.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolStack.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -49,11 +49,6 @@ import net.sourceforge.plantuml.ugraphic.color.HColorNone; class USymbolStack extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.STACK; - } - @Override public SName getSName() { return SName.stack; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java index 6e65b16a8..cd3fbde29 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; @@ -46,11 +45,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; class USymbolStorage extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.STORAGE; - } - @Override public SName getSName() { return SName.storage; diff --git a/src/net/sourceforge/plantuml/graphic/USymbolTogether.java b/src/net/sourceforge/plantuml/graphic/USymbolTogether.java index 7896fd488..325a38f30 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolTogether.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolTogether.java @@ -35,19 +35,13 @@ */ package net.sourceforge.plantuml.graphic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.ugraphic.UGraphic; class USymbolTogether extends USymbol { - @Override - public SkinParameter getSkinParameter() { - return SkinParameter.STORAGE; - } - @Override public SName getSName() { return SName.storage; diff --git a/src/net/sourceforge/plantuml/graphic/USymbols.java b/src/net/sourceforge/plantuml/graphic/USymbols.java index d041852da..7e2925034 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbols.java +++ b/src/net/sourceforge/plantuml/graphic/USymbols.java @@ -52,52 +52,42 @@ public abstract class USymbols { private static final Map all = new HashMap(); - private static USymbol record(String code, SkinParameter skinParameter, USymbol symbol) { + private static USymbol record(String code, USymbol symbol) { all.put(StringUtils.goUpperCase(code), symbol); return symbol; } - public final static USymbol STORAGE = record("STORAGE", SkinParameter.STORAGE, new USymbolStorage()); - public final static USymbol DATABASE = record("DATABASE", SkinParameter.DATABASE, new USymbolDatabase()); - public final static USymbol CLOUD = record("CLOUD", SkinParameter.CLOUD, new USymbolCloud()); - public final static USymbol CARD = record("CARD", SkinParameter.CARD, new USymbolCard(SkinParameter.CARD)); - public final static USymbol FRAME = record("FRAME", SkinParameter.FRAME, new USymbolFrame()); - public final static USymbol NODE = record("NODE", SkinParameter.NODE, new USymbolNode()); - public final static USymbol ARTIFACT = record("ARTIFACT", SkinParameter.ARTIFACT, new USymbolArtifact()); - public final static USymbol PACKAGE = record("PACKAGE", SkinParameter.PACKAGE, - new USymbolFolder(SName.package_, SkinParameter.PACKAGE, true)); - public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, - new USymbolFolder(SName.folder, SkinParameter.FOLDER, false)); - public final static USymbol FILE = record("FILE", SkinParameter.FILE, new USymbolFile()); - public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.RECTANGLE, - new USymbolRectangle(SkinParameter.RECTANGLE)); - public final static USymbol HEXAGON = record("HEXAGON", SkinParameter.HEXAGON, new USymbolHexagon()); - public final static USymbol PERSON = record("PERSON", SkinParameter.PERSON, new USymbolPerson()); - public final static USymbol LABEL = record("LABEL", SkinParameter.LABEL, new USymbolLabel(SkinParameter.LABEL)); - public final static USymbol ARCHIMATE = record("ARCHIMATE", SkinParameter.ARCHIMATE, - new USymbolRectangle(SkinParameter.ARCHIMATE)); - public final static USymbol COLLECTIONS = record("COLLECTIONS", SkinParameter.COLLECTIONS, - new USymbolCollections(SkinParameter.COLLECTIONS)); - public final static USymbol AGENT = record("AGENT", SkinParameter.AGENT, new USymbolRectangle(SkinParameter.AGENT)); - public final static USymbol ACTOR_STICKMAN = record("ACTOR_STICKMAN", SkinParameter.ACTOR, - new USymbolActor(ActorStyle.STICKMAN)); - public final static USymbol ACTOR_STICKMAN_BUSINESS = record("ACTOR_STICKMAN_BUSINESS", SkinParameter.ACTOR, - new USymbolActor(ActorStyle.STICKMAN_BUSINESS)); - public final static USymbol ACTOR_AWESOME = record("ACTOR_AWESOME", SkinParameter.ACTOR, - new USymbolActor(ActorStyle.AWESOME)); - public final static USymbol ACTOR_HOLLOW = record("ACTOR_HOLLOW", SkinParameter.ACTOR, - new USymbolActor(ActorStyle.HOLLOW)); + public final static USymbol STORAGE = record("STORAGE", new USymbolStorage()); + public final static USymbol DATABASE = record("DATABASE", new USymbolDatabase()); + public final static USymbol CLOUD = record("CLOUD", new USymbolCloud()); + public final static USymbol CARD = record("CARD", new USymbolCard()); + public final static USymbol FRAME = record("FRAME", new USymbolFrame()); + public final static USymbol NODE = record("NODE", new USymbolNode()); + public final static USymbol ARTIFACT = record("ARTIFACT", new USymbolArtifact()); + public final static USymbol PACKAGE = record("PACKAGE", new USymbolFolder(SName.package_, true)); + public final static USymbol FOLDER = record("FOLDER", new USymbolFolder(SName.folder, false)); + public final static USymbol FILE = record("FILE", new USymbolFile()); + public final static USymbol RECTANGLE = record("RECTANGLE", new USymbolRectangle(SName.rectangle)); + public final static USymbol HEXAGON = record("HEXAGON", new USymbolHexagon()); + public final static USymbol PERSON = record("PERSON", new USymbolPerson()); + public final static USymbol LABEL = record("LABEL", new USymbolLabel()); + public final static USymbol ARCHIMATE = record("ARCHIMATE", new USymbolRectangle(SName.archimate)); + public final static USymbol COLLECTIONS = record("COLLECTIONS", new USymbolCollections()); + public final static USymbol AGENT = record("AGENT", new USymbolRectangle(SName.agent)); + public final static USymbol ACTOR_STICKMAN = record("ACTOR_STICKMAN", new USymbolActor(ActorStyle.STICKMAN)); + public final static USymbol ACTOR_STICKMAN_BUSINESS = record("ACTOR_STICKMAN_BUSINESS", new USymbolActor(ActorStyle.STICKMAN_BUSINESS)); + public final static USymbol ACTOR_AWESOME = record("ACTOR_AWESOME", new USymbolActor(ActorStyle.AWESOME)); + public final static USymbol ACTOR_HOLLOW = record("ACTOR_HOLLOW", new USymbolActor(ActorStyle.HOLLOW)); public final static USymbol USECASE = null; - public final static USymbol COMPONENT1 = record("COMPONENT1", SkinParameter.COMPONENT1, new USymbolComponent1()); - public final static USymbol COMPONENT2 = record("COMPONENT2", SkinParameter.COMPONENT2, new USymbolComponent2()); - public final static USymbol BOUNDARY = record("BOUNDARY", SkinParameter.BOUNDARY, new USymbolBoundary()); - public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", SkinParameter.ENTITY, - new USymbolEntityDomain()); - public final static USymbol CONTROL = record("CONTROL", SkinParameter.CONTROL, new USymbolControl()); - public final static USymbol INTERFACE = record("INTERFACE", SkinParameter.INTERFACE, new USymbolInterface()); - public final static USymbol QUEUE = record("QUEUE", SkinParameter.QUEUE, new USymbolQueue()); - public final static USymbol STACK = record("STACK", SkinParameter.STACK, new USymbolStack()); - public final static USymbol TOGETHER = record("TOGETHER", SkinParameter.QUEUE, new USymbolTogether()); + public final static USymbol COMPONENT1 = record("COMPONENT1", new USymbolComponent1()); + public final static USymbol COMPONENT2 = record("COMPONENT2", new USymbolComponent2()); + public final static USymbol BOUNDARY = record("BOUNDARY", new USymbolBoundary()); + public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", new USymbolEntityDomain()); + public final static USymbol CONTROL = record("CONTROL", new USymbolControl()); + public final static USymbol INTERFACE = record("INTERFACE", new USymbolInterface()); + public final static USymbol QUEUE = record("QUEUE", new USymbolQueue()); + public final static USymbol STACK = record("STACK", new USymbolStack()); + public final static USymbol TOGETHER = record("TOGETHER", new USymbolTogether()); public static USymbol fromString(String s, ActorStyle actorStyle, ComponentStyle componentStyle, PackageStyle packageStyle) { diff --git a/src/net/sourceforge/plantuml/graphic/color/Colors.java b/src/net/sourceforge/plantuml/graphic/color/Colors.java index 392938f55..62646f716 100644 --- a/src/net/sourceforge/plantuml/graphic/color/Colors.java +++ b/src/net/sourceforge/plantuml/graphic/color/Colors.java @@ -41,7 +41,6 @@ import java.util.Objects; import java.util.StringTokenizer; import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamColors; import net.sourceforge.plantuml.StringUtils; @@ -187,8 +186,8 @@ public class Colors { return add(colorType, colors); } - public Colors applyStereotypeForNote(Stereotype stereotype, ISkinParam skinParam, FontParam fontParam, - ColorParam... params) throws NoSuchColorException { + public Colors applyStereotypeForNote(Stereotype stereotype, ISkinParam skinParam, ColorParam... params) + throws NoSuchColorException { Objects.requireNonNull(stereotype); Colors result = this; for (ColorParam param : Objects.requireNonNull(params)) diff --git a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java index 64a826fac..04f9f2118 100644 --- a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java +++ b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java @@ -106,32 +106,18 @@ public class NwDiagram extends UmlDiagram { } private Network lastNetwork() { - if (networks.size() == 0) { + if (networks.size() == 0) return null; - } + return networks.get(networks.size() - 1); } - private Network stackedNetwork() { - for (NStackable element : stack) - if (element instanceof Network) - return (Network) element; - return null; - } - - private NwGroup stakedGroup() { - for (NStackable element : stack) - if (element instanceof NwGroup) - return (NwGroup) element; - return null; - } - private final List stack = new ArrayList(); public CommandExecutionResult openGroup(String name) { - if (initDone == false) { + if (initDone == false) return errorNoInit(); - } + for (NStackable element : stack) if (element instanceof NwGroup) return CommandExecutionResult.error("Cannot nest group"); @@ -144,9 +130,9 @@ public class NwDiagram extends UmlDiagram { } public CommandExecutionResult openNetwork(String name) { - if (initDone == false) { + if (initDone == false) return errorNoInit(); - } + for (NStackable element : stack) if (element instanceof Network) return CommandExecutionResult.error("Cannot nest network"); @@ -156,9 +142,9 @@ public class NwDiagram extends UmlDiagram { } public CommandExecutionResult closeSomething() { - if (initDone == false) { + if (initDone == false) return errorNoInit(); - } + if (stack.size() > 0) stack.remove(0); this.currentGroup = null; @@ -172,9 +158,9 @@ public class NwDiagram extends UmlDiagram { } public CommandExecutionResult link(String name1, String name2) { - if (initDone == false) { + if (initDone == false) return errorNoInit(); - } + final NServer server2; if (lastNetwork() == null) { createNetwork(name1); @@ -183,9 +169,9 @@ public class NwDiagram extends UmlDiagram { final NServer server1 = servers.get(name1); final Network network1 = createNetwork(""); network1.goInvisible(); - if (server1 != null) { + if (server1 != null) server1.connectTo(lastNetwork()); - } + server2 = new NServer(name2, server1.getBar()); } servers.put(name2, server2); @@ -195,17 +181,21 @@ public class NwDiagram extends UmlDiagram { } public CommandExecutionResult addElement(String name, String definition) { - if (initDone == false) { + if (initDone == false) return errorNoInit(); - } + if (currentGroup != null) { + if (alreadyInSomeGroup(name)) + return CommandExecutionResult.error("Element already in another group."); + currentGroup.addName(name); } + NServer server = null; if (lastNetwork() == null) { - if (currentGroup != null) { + if (currentGroup != null) return CommandExecutionResult.ok(); - } + assert currentGroup == null; final Network network1 = createNetwork(""); network1.goInvisible(); @@ -226,15 +216,23 @@ public class NwDiagram extends UmlDiagram { return CommandExecutionResult.ok(); } + private boolean alreadyInSomeGroup(String name) { + for (NwGroup g : groups) + if (g.names().contains(name)) + return true; + + return false; + } + private CommandExecutionResult errorNoInit() { return CommandExecutionResult.error("Maybe you forget 'nwdiag {' in your diagram ?"); } private Map toSet(String definition) { final Map result = new HashMap(); - if (definition == null) { + if (definition == null) return result; - } + final Pattern p = Pattern.compile("\\s*(\\w+)\\s*=\\s*(\"([^\"]*)\"|[^\\s,]+)"); final Matcher m = p.matcher(definition); while (m.find()) { @@ -283,9 +281,9 @@ public class NwDiagram extends UmlDiagram { } private TextBlock toTextBlockForNetworkName(String name, String s) { - if (s != null) { + if (s != null) name += "\\n" + s; - } + final StyleBuilder styleBuilder = getSkinParam().getCurrentStyleBuilder(); final Style style = getStyleDefinitionNetwork(SName.network).getMergedStyle(styleBuilder); final FontConfiguration fontConfiguration = style.getFontConfiguration(getSkinParam().getThemeStyle(), @@ -319,9 +317,9 @@ public class NwDiagram extends UmlDiagram { final String address = current.getOwnAdress(); final TextBlock desc = toTextBlockForNetworkName(current.getDisplayName(), address); final Dimension2D dim = desc.calculateDimension(stringBounder); - if (i == 0) { + if (i == 0) deltaY = (dim.getHeight() - GridTextBlockDecorated.NETWORK_THIN) / 2; - } + deltaX = Math.max(deltaX, dim.getWidth()); } double y = 0; @@ -348,9 +346,9 @@ public class NwDiagram extends UmlDiagram { final Map result = new LinkedHashMap<>(); for (Network network : networks) { final String s = element.getAdress(network); - if (s != null) { + if (s != null) result.put(network, s); - } + } return result; } @@ -369,7 +367,9 @@ public class NwDiagram extends UmlDiagram { final NServer server = ent.getValue(); if (server.getMainNetworkNext() == current) { final Map conns = getLinks(server); - final int col = layout.get(server.getBar()); + final Integer col = layout.get(server.getBar()); + if (col == null) + continue; double topMargin = LinkedElement.MAGIC; NwGroup group = getGroupOf(server); if (group != null) @@ -383,40 +383,38 @@ public class NwDiagram extends UmlDiagram { } private NwGroup getGroupOf(NServer server) { - for (NwGroup group : groups) { - if (group.contains(server)) { + for (NwGroup group : groups) + if (group.contains(server)) return group; - } - } + return null; } public CommandExecutionResult setProperty(String property, String value) { - if (initDone == false) { + if (initDone == false) return errorNoInit(); - } - if ("address".equalsIgnoreCase(property) && lastNetwork() != null) { + + if ("address".equalsIgnoreCase(property) && lastNetwork() != null) lastNetwork().setOwnAdress(value); - } - if ("width".equalsIgnoreCase(property) && lastNetwork() != null) { + + if ("width".equalsIgnoreCase(property) && lastNetwork() != null) lastNetwork().setFullWidth("full".equalsIgnoreCase(value)); - } + if ("color".equalsIgnoreCase(property)) { final HColor color = value == null ? null : getSkinParam().getIHtmlColorSet().getColorOrWhite(getSkinParam().getThemeStyle(), value); - if (currentGroup != null) { + if (currentGroup != null) currentGroup.setColor(color); - } else if (lastNetwork() != null) { + else if (lastNetwork() != null) lastNetwork().setColor(color); - } + } - if ("description".equalsIgnoreCase(property)) { - if (currentGroup == null) { + if ("description".equalsIgnoreCase(property)) + if (currentGroup == null) lastNetwork().setDescription(value); - } else { + else currentGroup.setDescription(value); - } - } + return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/nwdiag/core/NServer.java b/src/net/sourceforge/plantuml/nwdiag/core/NServer.java index 88c297161..6a491a576 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/NServer.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/NServer.java @@ -86,12 +86,12 @@ public class NServer { } private TextBlock toTextBlock(String s, ISkinParam skinParam, SName sname) { - if (s == null) { + if (s == null) return null; - } - if (s.length() == 0) { + + if (s.length() == 0) return TextBlockUtils.empty(0, 0); - } + s = s.replace(", ", "\\n"); return Display.getWithNewlines(s).create(getFontConfiguration(skinParam, sname), HorizontalAlignment.LEFT, skinParam); @@ -114,9 +114,9 @@ public class NServer { .getSymbolContext(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); final Map conns2 = new LinkedHashMap(); - for (Entry ent : conns.entrySet()) { + for (Entry ent : conns.entrySet()) conns2.put(ent.getKey(), toTextBlock(ent.getValue(), skinParam, SName.arrow)); - } + final TextBlock desc = toTextBlock(getDescription(), skinParam, SName.server); final TextBlock box = getShape().asSmall(TextBlockUtils.empty(0, 0), desc, TextBlockUtils.empty(0, 0), @@ -131,9 +131,9 @@ public class NServer { public void connectTo(Network network, String address) { if (address == null) address = ""; - if (address.length() == 0 && connections.containsKey(network)) { + if (address.length() == 0 && connections.containsKey(network)) return; - } + connections.put(network, address); if (bar.getStart() == null) bar.addStage(network.getNstage()); @@ -143,13 +143,13 @@ public class NServer { public void updateProperties(Map props) { final String description = props.get("description"); - if (description != null) { + if (description != null) this.setDescription(description); - } + final String shape = props.get("shape"); - if (shape != null) { + if (shape != null) this.setShape(shape); - } + } @Override diff --git a/src/net/sourceforge/plantuml/nwdiag/core/Network.java b/src/net/sourceforge/plantuml/nwdiag/core/Network.java index 7bc6154b2..940ed71f1 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/Network.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/Network.java @@ -87,9 +87,9 @@ public class Network implements NStackable { } public final String getDisplayName() { - if (this.description == null) { + if (this.description == null) return name; - } + return this.description; } diff --git a/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java b/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java index d2370ec25..cbc3d2588 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java @@ -67,20 +67,19 @@ public class NwGroup implements NStackable { private NBox nbox; public NBox getNboxInternal() { - if (nbox == null) { + if (nbox == null) nbox = new NBox(); - } + return nbox; } public final NBox getNbox(Map servers) { if (nbox == null) { nbox = new NBox(); - for (Entry ent : servers.entrySet()) { - if (names.contains(ent.getKey())) { + for (Entry ent : servers.entrySet()) + if (names.contains(ent.getKey())) nbox.add(ent.getValue().getBar()); - } - } + } return nbox; } @@ -130,9 +129,9 @@ public class NwGroup implements NStackable { public double getTopHeaderHeight(StringBounder stringBounder, ISkinParam skinParam) { final TextBlock block = buildHeaderName(skinParam); - if (block == null) { + if (block == null) return 0; - } + final Dimension2D blockDim = block.calculateDimension(stringBounder); return blockDim.getHeight(); } @@ -151,21 +150,20 @@ public class NwGroup implements NStackable { size = size.addPoint(size.getMinX(), dy); } HColor color = getColor(); - if (color == null) { + if (color == null) color = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - } size.draw(ug, color); - if (block != null) { + if (block != null) block.drawU(ug.apply(new UTranslate(size.getMinX() + 5, size.getMinY()))); - } + } private TextBlock buildHeaderName(ISkinParam skinParam) { - if (getDescription() == null) { + if (getDescription() == null) return null; - } + final StyleBuilder styleBuilder = skinParam.getCurrentStyleBuilder(); final Style style = getStyleDefinition().getMergedStyle(styleBuilder); return Display.getWithNewlines(getDescription()).create( diff --git a/src/net/sourceforge/plantuml/nwdiag/next/BooleanGrid.java b/src/net/sourceforge/plantuml/nwdiag/next/BooleanGrid.java index faddb0761..0bdcccce5 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/BooleanGrid.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/BooleanGrid.java @@ -47,9 +47,9 @@ public class BooleanGrid { public void burn(int x, int y) { final boolean added = burned.add(merge(x, y)); - if (added == false) { + if (added == false) throw new IllegalArgumentException("Already present"); - } + } public boolean isBurned(int x, int y) { @@ -87,9 +87,9 @@ public class BooleanGrid { // ----------------- public boolean isSpaceAvailable(Staged element, int x) { - if (isBurnRect(x, element.getStart().getNumber(), x + element.getNWidth() - 1, element.getEnd().getNumber())) { + if (isBurnRect(x, element.getStart().getNumber(), x + element.getNWidth() - 1, element.getEnd().getNumber())) return false; - } + return true; } diff --git a/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java b/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java index 169dc07d6..108a78d55 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockDecorated.java @@ -67,9 +67,9 @@ public class GridTextBlockDecorated extends GridTextBlockSimple { @Override protected void drawGrid(UGraphic ug) { - for (NwGroup group : groups) { + for (NwGroup group : groups) drawGroups(ug, group, getSkinParam()); - } + drawNetworkTube(ug); drawLinks(ug, getSkinParam().getCurrentStyleBuilder()); } @@ -88,9 +88,9 @@ public class GridTextBlockDecorated extends GridTextBlockSimple { double x = 0; for (int j = 0; j < data.getNbCols(); j++) { final double colWidth = colWidth(stringBounder, j); - if (data.get(i, j) != null) { + if (data.get(i, j) != null) data.get(i, j).drawLinks(ug, x, colWidth, lineHeight); - } + x += colWidth; } } @@ -126,9 +126,9 @@ public class GridTextBlockDecorated extends GridTextBlockSimple { private boolean isThereALink(int j, Network network) { for (int i = 0; i < data.getNbLines(); i++) { final LinkedElement element = data.get(i, j); - if (element != null && element.isLinkedTo(network)) { + if (element != null && element.isLinkedTo(network)) return true; - } + } return false; } @@ -157,15 +157,15 @@ public class GridTextBlockDecorated extends GridTextBlockSimple { .asColor(getSkinParam().getThemeStyle(), getSkinParam().getIHtmlColorSet()).bg()); rect.setDeltaShadow(deltaShadow); - if (network != null && network.getColor() != null) { + if (network != null && network.getColor() != null) ug2 = ug2.apply(network.getColor().bg()); - } - if (network != null) { + + if (network != null) network.setY(y); - } - if (network.isVisible()) { + + if (network.isVisible()) ug2.draw(rect); - } + y += lineHeight(stringBounder, i); } } @@ -176,13 +176,13 @@ public class GridTextBlockDecorated extends GridTextBlockSimple { double xmax = 0; for (int j = 0; j < line.length; j++) { final boolean hline = isThereALink(j, network); - if (hline && xmin < 0) { + if (hline && xmin < 0) xmin = x; - } + x += colWidth(stringBounder, j); - if (hline || network.isFullWidth()) { + if (hline || network.isFullWidth()) xmax = x; - } + } network.setMinMax(xmin, xmax); diff --git a/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockSimple.java b/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockSimple.java index 696fc4a8b..409351b3b 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockSimple.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/GridTextBlockSimple.java @@ -34,11 +34,11 @@ */ package net.sourceforge.plantuml.nwdiag.next; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ISkinParam; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; @@ -68,9 +68,9 @@ public class GridTextBlockSimple implements TextBlock { double x = 0; for (int j = 0; j < data.getNbCols(); j++) { final double colWidth = colWidth(stringBounder, j); - if (data.get(i, j) != null) { + if (data.get(i, j) != null) data.get(i, j).drawMe(ug.apply(new UTranslate(x, y)), colWidth, lineHeight); - } + x += colWidth; } y += lineHeight; @@ -79,36 +79,34 @@ public class GridTextBlockSimple implements TextBlock { protected double colWidth(StringBounder stringBounder, final int j) { double width = 0; - for (int i = 0; i < data.getNbLines(); i++) { - if (data.get(i, j) != null) { + for (int i = 0; i < data.getNbLines(); i++) + if (data.get(i, j) != null) width = Math.max(width, data.get(i, j).naturalDimension(stringBounder).getWidth()); - } - } + return width; } public double lineHeight(StringBounder stringBounder, final int i) { double height = 50; - for (int j = 0; j < data.getNbCols(); j++) { - if (data.get(i, j) != null) { + for (int j = 0; j < data.getNbCols(); j++) + if (data.get(i, j) != null) height = Math.max(height, data.get(i, j).naturalDimension(stringBounder).getHeight()); - } - } + return height; } public Dimension2D calculateDimension(StringBounder stringBounder) { - if (data.getNbLines() == 0) { + if (data.getNbLines() == 0) return new Dimension2DDouble(0, 0); - } + double height = 0; - for (int i = 0; i < data.getNbLines(); i++) { + for (int i = 0; i < data.getNbLines(); i++) height += lineHeight(stringBounder, i); - } + double width = 0; - for (int j = 0; j < data.getNbCols(); j++) { + for (int j = 0; j < data.getNbCols(); j++) width += colWidth(stringBounder, j); - } + return new Dimension2DDouble(width, height); } @@ -123,11 +121,9 @@ public class GridTextBlockSimple implements TextBlock { public void add(int i, int j, LinkedElement value) { data.set(i, j, value); } - + protected final ISkinParam getSkinParam() { return skinParam; } - - } diff --git a/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java b/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java index a4f908e70..c68dbd8fe 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/LinkedElement.java @@ -34,7 +34,6 @@ */ package net.sourceforge.plantuml.nwdiag.next; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Collections; import java.util.List; import java.util.Map; @@ -42,6 +41,7 @@ import java.util.Map.Entry; import java.util.TreeSet; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.nwdiag.VerticalLine; @@ -127,33 +127,32 @@ public class LinkedElement { skip.add(n.getY()); } - if (server.printFirstLink()) { - if (network.isVisible()) { + if (server.printFirstLink()) + if (network.isVisible()) new VerticalLine(ynet1 + GridTextBlockDecorated.NETWORK_THIN, ynet1 + alpha, skip) .drawU(ug.apply(UTranslate.dx(xLinkPos + network.magicDelta()))); - } else { + else new VerticalLine(ynet1, ynet1 + alpha, Collections.emptySet()) .drawU(ug.apply(UTranslate.dx(xLinkPos + network.magicDelta()))); - } - } + drawCenter(ug, link1(), xMiddle + network.magicDelta(), ynet1 + posLink1); final double seven = 9.0; double x = xLinkPos - (conns.size() - 2) * seven / 2; boolean first = true; for (Entry ent : conns.entrySet()) { - if (ent.getKey() == network) { + if (ent.getKey() == network) continue; - } + final double ynet2 = ent.getKey().getY(); new VerticalLine(ynet1 + yMiddle + dimBox.getHeight() / 2, ynet2, skip) .drawU(ug.apply(UTranslate.dx(x - ent.getKey().magicDelta()))); final double xtext; - if (first && conns.size() > 2) { + if (first && conns.size() > 2) xtext = x - ent.getValue().calculateDimension(stringBounder).getWidth() / 2; - } else { + else xtext = x; - } + drawCenter(ug, ent.getValue(), xtext - ent.getKey().magicDelta(), ynet2 - alpha / 2); x += seven; first = false; @@ -168,16 +167,16 @@ public class LinkedElement { private TextBlock link2() { final int i = networks.indexOf(network); - if (i == networks.size() - 1) { + if (i == networks.size() - 1) return null; - } + return conns.get(networks.get(i + 1)); } private void drawCenter(UGraphic ug, TextBlock block, double x, double y) { - if (block == null) { + if (block == null) return; - } + final Dimension2D dim = block.calculateDimension(ug.getStringBounder()); block.drawU(ug.apply(new UTranslate(x - dim.getWidth() / 2, y - dim.getHeight() / 2))); diff --git a/src/net/sourceforge/plantuml/nwdiag/next/NBox.java b/src/net/sourceforge/plantuml/nwdiag/next/NBox.java index 61eabf78a..ef3dd9b47 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/NBox.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/NBox.java @@ -44,9 +44,9 @@ public class NBox implements Staged { private final NTetris tetris = new NTetris<>(); public void add(NBar bar) { - if (this.bars.contains(bar)) { + if (this.bars.contains(bar)) return; - } + this.bars.add(bar); this.tetris.add(bar); } @@ -54,18 +54,18 @@ public class NBox implements Staged { @Override public NStage getStart() { NStage result = bars.get(0).getStart(); - for (int i = 1; i < bars.size(); i++) { + for (int i = 1; i < bars.size(); i++) result = NStage.getMin(result, bars.get(i).getStart()); - } + return result; } @Override public NStage getEnd() { NStage result = bars.get(0).getEnd(); - for (int i = 1; i < bars.size(); i++) { + for (int i = 1; i < bars.size(); i++) result = NStage.getMax(result, bars.get(i).getEnd()); - } + return result; } diff --git a/src/net/sourceforge/plantuml/nwdiag/next/NPlayField.java b/src/net/sourceforge/plantuml/nwdiag/next/NPlayField.java index 0c6ce8e0c..303b09bfd 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/NPlayField.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/NPlayField.java @@ -52,16 +52,16 @@ public class NPlayField { private final List boxes = new ArrayList<>(); public NStage getStage(int num) { - while (stages.size() <= num) { + while (stages.size() <= num) stages.add(new NStage(stages.size())); - } + return stages.get(num); } public NStage getLast() { - if (stages.size() == 0) { + if (stages.size() == 0) return null; - } + return getStage(stages.size() - 1); } @@ -82,9 +82,9 @@ public class NPlayField { public Map doLayout() { final NTetris tetris = new NTetris<>(); - for (NBox box : boxes) { + for (NBox box : boxes) tetris.add(box); - } + final Map result = new HashMap<>(); final Map pos = tetris.getPositions(); @@ -93,23 +93,18 @@ public class NPlayField { final int boxPos = ent.getValue(); final Map bars = box.getPositions(); - for (Entry bar : bars.entrySet()) { + for (Entry bar : bars.entrySet()) result.put(bar.getKey(), boxPos + bar.getValue()); - } } return Collections.unmodifiableMap(result); } public void fixGroups(List groups, Collection servers) { - for (NwGroup group : groups) { - for (NServer server : servers) { - if (group.contains(server)) { + for (NwGroup group : groups) + for (NServer server : servers) + if (group.contains(server)) fixServerInGroup(server, group); - } - } - } - } private void fixServerInGroup(NServer server, NwGroup group) { diff --git a/src/net/sourceforge/plantuml/nwdiag/next/NStage.java b/src/net/sourceforge/plantuml/nwdiag/next/NStage.java index ce9f06ae7..afa3c2487 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/NStage.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/NStage.java @@ -57,16 +57,16 @@ public class NStage implements Comparable { } public static NStage getMin(NStage stage1, NStage stage2) { - if (stage1.number < stage2.number) { + if (stage1.number < stage2.number) return stage1; - } + return stage2; } public static NStage getMax(NStage stage1, NStage stage2) { - if (stage1.number > stage2.number) { + if (stage1.number > stage2.number) return stage1; - } + return stage2; } diff --git a/src/net/sourceforge/plantuml/nwdiag/next/NTetris.java b/src/net/sourceforge/plantuml/nwdiag/next/NTetris.java index 069307bdc..3364a6f9b 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/NTetris.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/NTetris.java @@ -43,7 +43,7 @@ public class NTetris { private final Map all = new LinkedHashMap<>(); private final BooleanGrid grid = new BooleanGrid(); - + @Override public String toString() { return all.toString(); @@ -58,9 +58,9 @@ public class NTetris { return; } x++; - if (x > 100) { + if (x > 100) throw new IllegalStateException(); - } + } } @@ -70,9 +70,9 @@ public class NTetris { public int getNWidth() { int max = 0; - for (Entry ent : all.entrySet()) { + for (Entry ent : all.entrySet()) max = Math.max(max, ent.getValue() + ent.getKey().getNWidth()); - } + return max; } diff --git a/src/net/sourceforge/plantuml/nwdiag/next/NwArray.java b/src/net/sourceforge/plantuml/nwdiag/next/NwArray.java index f119ba0c1..b3c98c148 100644 --- a/src/net/sourceforge/plantuml/nwdiag/next/NwArray.java +++ b/src/net/sourceforge/plantuml/nwdiag/next/NwArray.java @@ -62,30 +62,4 @@ public class NwArray { data[i][j] = value; } -// public void swapCols(int col1, int col2) { -// if (col1 == col2) { -// throw new IllegalArgumentException(); -// } -// for (int i = 0; i < getNbLines(); i++) { -// final LinkedElement tmp = data[i][col1]; -// data[i][col1] = data[i][col2]; -// data[i][col2] = tmp; -// } -// -// } -// -// public Footprint getFootprint(NwGroupLegacy group) { -// int min = Integer.MAX_VALUE; -// int max = Integer.MIN_VALUE; -// for (int i = 0; i < getNbLines(); i++) { -// for (int j = 0; j < getNbCols(); j++) { -// if (data[i][j] != null && group.matches(data[i][j])) { -// min = Math.min(min, j); -// max = Math.max(max, j); -// } -// } -// } -// return new Footprint(min, max); -// } - } diff --git a/src/net/sourceforge/plantuml/posimo/Frame.java b/src/net/sourceforge/plantuml/posimo/Frame.java deleted file mode 100644 index 840059256..000000000 --- a/src/net/sourceforge/plantuml/posimo/Frame.java +++ /dev/null @@ -1,136 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2023, 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.posimo; - -import net.sourceforge.plantuml.awt.geom.Dimension2D; -import java.util.List; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.Component; -import net.sourceforge.plantuml.skin.Context2D; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignatureBasic; -import net.sourceforge.plantuml.ugraphic.UFont; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UPolygon; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorNone; - -public class Frame implements Component { - - public Style[] getUsedStyles() { - throw new UnsupportedOperationException(); - } - - public StyleSignatureBasic getStyleSignature() { - throw new UnsupportedOperationException(); - } - - - private final List name; - private final ISkinParam skinParam; - private final Rose rose = new Rose(); - - public Frame(List name, ISkinParam skinParam) { - this.name = name; - this.skinParam = skinParam; - } - - public void drawU(UGraphic ug, Area area, Context2D context) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final HColor lineColor = rose.getHtmlColor(skinParam, ColorParam.packageBorder); - ug = ug.apply(lineColor); - ug = ug.apply(new HColorNone().bg()); - ug.apply(new UStroke(1.4)).draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight())); - - final TextBlock textBlock = createTextBloc(); - textBlock.drawU(ug.apply(new UTranslate(2, 2))); - - final Dimension2D textDim = getTextDim(ug.getStringBounder()); - final double x = textDim.getWidth() + 6; - final double y = textDim.getHeight() + 6; - final UPolygon poly = new UPolygon(); - poly.addPoint(x, 0); - poly.addPoint(x, y - 6); - poly.addPoint(x - 6, y); - poly.addPoint(0, y); - poly.addPoint(0, 0); - ug.apply(new UStroke(1.4)).draw(poly); - - } - - public double getPreferredHeight(StringBounder stringBounder) { - final Dimension2D dim = getTextDim(stringBounder); - return dim.getHeight() + 8; - } - - public double getPreferredWidth(StringBounder stringBounder) { - final Dimension2D dim = getTextDim(stringBounder); - return dim.getWidth() + 8; - } - - public Dimension2D getTextDim(StringBounder stringBounder) { - final TextBlock bloc = createTextBloc(); - return bloc.calculateDimension(stringBounder); - } - - private TextBlock createTextBloc() { - final UFont font = skinParam.getFont(null, false, FontParam.PACKAGE); - final HColor textColor = skinParam.getFontHtmlColor(null, FontParam.PACKAGE); - // final TextBlock bloc = Display.create(name).create(FontConfiguration.create(font, textColor, - // skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink()), HorizontalAlignment.LEFT, new - // SpriteContainerEmpty()); - // return bloc; - throw new UnsupportedOperationException(); - } - - public final Dimension2D getPreferredDimension(StringBounder stringBounder) { - final double w = getPreferredWidth(stringBounder); - final double h = getPreferredHeight(stringBounder); - return new Dimension2DDouble(w, h); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java b/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java deleted file mode 100644 index 8de1da943..000000000 --- a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java +++ /dev/null @@ -1,324 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2023, 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.posimo; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Point2D; -import java.util.Collection; -import java.util.Objects; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.cucadiagram.LinkDecor; -import net.sourceforge.plantuml.cucadiagram.LinkStyle; -import net.sourceforge.plantuml.cucadiagram.LinkType; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UPolygon; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class PathDrawerInterface implements PathDrawer { - - private final Rose rose; - private final ISkinParam param; - private final LinkType linkType; - - public static PathDrawerInterface create(ISkinParam param, LinkType linkType) { - return new PathDrawerInterface(new Rose(), param, linkType); - } - - private PathDrawerInterface(Rose rose, ISkinParam param, LinkType linkType) { - this.rose = rose; - this.param = param; - this.linkType = linkType; - } - - public void drawPathBefore(UGraphic ug, Positionable start, Positionable end, Path path) { - // // final DotPath dotPath = path.getDotPath(); - // // goDash(ug); - // // ug.draw(0, 0, dotPath); - // // noDash(ug); - } - - private void noDash(UGraphic ug) { - // ug.getParam().resetStroke(); - throw new UnsupportedOperationException(); - } - - private void goDash(UGraphic ug) { - // ug.getParam().setStroke(new UStroke(8, 8, 1.0)); - throw new UnsupportedOperationException(); - } - - public void drawPathAfter(UGraphic ug, Positionable start, Positionable end, Path path) { - DotPath dotPath = path.getDotPath(); - final Racorder racorder = new RacorderOrthogonal(); - // final Racorder racorder = new RacorderInToCenter(); - // final Racorder racorder = new RacorderFollowTangeante(); - - final Point2D endPath = dotPath.getEndPoint(); - final DotPath in = racorder.getRacordIn(PositionableUtils.convert(end), dotPath.getEndTangeante()); - // final Point2D inPoint = in.getFrontierIntersection(end); - final Point2D inPoint = in.getEndPoint(); - // final double theta1_ = in.getEndAngle() + Math.PI / 2; - // Log.println("theta1_=" + theta1_ + " " + theta1_ * 180 / - // Math.PI); - final double theta1 = atan2(endPath, inPoint); - // Log.println("theta1=" + theta1 + " " + theta1 * 180 / - // Math.PI); - final Point2D middle1 = drawSymbol(ug, theta1, inPoint, linkType.getDecor1()); - - final Point2D startPath = dotPath.getStartPoint(); - final DotPath out = racorder.getRacordOut(PositionableUtils.convert(start), dotPath.getStartTangeante()); - // final Point2D outPoint = out.getFrontierIntersection(start); - final Point2D outPoint = out.getStartPoint(); - // final double theta2_ = out.getStartAngle() - Math.PI / 2; - // Log.println("theta2_=" + theta2_ + " " + theta2_ * 180 / - // Math.PI); - final double theta2 = atan2(startPath, outPoint); - // Log.println("theta2=" + theta2 + " " + theta2 * 180 / - // Math.PI); - final Point2D middle2 = drawSymbol(ug, theta2, outPoint, linkType.getDecor2()); - - if (middle1 != null) { - final CubicCurve2D.Double after = getLine(endPath, middle1); - dotPath = dotPath.addAfter(after); - // dotPath = dotPath.addAfter(in); - } - - if (middle2 != null) { - final CubicCurve2D.Double before = getLine(middle2, startPath); - dotPath = dotPath.addBefore(before); - // dotPath = dotPath.addBefore(out); - } - - final LinkStyle style = linkType.getStyle(); -// if (style == LinkStyle.__toremove_INTERFACE_PROVIDER || style == LinkStyle.__toremove_INTERFACE_USER) { -// final Decor decor = new DecorInterfaceProvider(style); -// final Map all = dotPath.somePoints(); -// final Point2D p = getFarest(outPoint, inPoint, all.keySet()); -// -// ug = ug.apply(UChangeBackColor.nnn(rose.getHtmlColor(param, ColorParam.background))); -// ug = ug.apply(UChangeColor.nnn(rose.getHtmlColor(param, ColorParam.classBorder))); -// -// decor.drawDecor(ug, p, all.get(p)); -// } - - throw new UnsupportedOperationException(); -// ug = ug.apply(UChangeColor.nnn(rose.getHtmlColor(param, ColorParam.classBorder))); -// if (linkType.isDashed()) { -// goDash(ug); -// } -// ug.draw(dotPath); -// if (linkType.isDashed()) { -// noDash(ug); -// } - } - - private double atan2(final Point2D endPath, final Point2D inPoint) { - final double y = -endPath.getX() + inPoint.getX(); - final double x = endPath.getY() - inPoint.getY(); - final double angle = Math.atan2(y, x); - // Log.println("x=" + x + " y=" + y + " angle=" + angle + " " + angle * 180.0 / Math.PI); - return angle; - } - - private Point2D drawSymbol(UGraphic ug, double theta, final Point2D position, LinkDecor decor) { - // if (1==1) { - // return null; - // } - // Point2D middle1 = null; - // // final double theta = Math.atan2( - // // -direction.getX() + position.getX(), direction.getY() - // // - position.getY()); - // if (decor == LinkDecor.SQUARE) { - // middle1 = drawSquare(ug, position.getX(), position.getY()); - // } else if (decor == LinkDecor.EXTENDS) { - // middle1 = drawExtends(ug, position.getX(), position.getY(), theta); - // } else if (decor == LinkDecor.AGREGATION) { - // ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.background)); - // ug.getParam().setColor(rose.getHtmlColor(param, ColorParam.classBorder)); - // middle1 = drawDiamond(ug, position.getX(), position.getY(), theta); - // } else if (decor == LinkDecor.COMPOSITION) { - // ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.classBorder)); - // ug.getParam().setColor(null); - // middle1 = drawDiamond(ug, position.getX(), position.getY(), theta); - // } else if (decor == LinkDecor.NONE) { - // middle1 = position; - // } else if (decor == LinkDecor.ARROW) { - // ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.classBorder)); - // ug.getParam().setColor(rose.getHtmlColor(param, ColorParam.classBorder)); - // middle1 = drawArrow(ug, position.getX(), position.getY(), theta); - // } - // return middle1; - throw new UnsupportedOperationException(); - } - - private CubicCurve2D.Double getLine(final Point2D p1, Point2D p2) { - return new CubicCurve2D.Double(p1.getX(), p1.getY(), p1.getX(), p1.getY(), p2.getX(), p2.getY(), p2.getX(), - p2.getY()); - } - - private static Point2D getFarest(Point2D p1, Point2D p2, Collection all) { - Point2D result = null; - double farest = 0; - for (Point2D p : all) { - if (result == null) { - result = p; - farest = p1.distanceSq(result) + p2.distanceSq(result); - continue; - } - final double candidat = p1.distanceSq(p) + p2.distanceSq(p); - if (candidat < farest) { - result = p; - farest = candidat; - } - } - return Objects.requireNonNull(result); - } - - private Point2D drawSquare(UGraphic ug, double centerX, double centerY) { - ug = ug.apply(rose.getHtmlColor(param, ColorParam.classBackground).bg()); - ug = ug.apply(rose.getHtmlColor(param, ColorParam.classBorder)); - final double width = 10; - final double height = 10; - ug.apply(new UTranslate(centerX - width / 2, centerY - height / 2)).draw(new URectangle(width, height)); - return new Point2D.Double(centerX, centerY); - } - - Point2D drawExtends(UGraphic ug, double x, double y, double theta) { - ug = ug.apply(rose.getHtmlColor(param, ColorParam.background).bg()); - ug = ug.apply(rose.getHtmlColor(param, ColorParam.classBorder)); - - // final double theta = Math.atan2(-pathPoint.getX() + x, - // pathPoint.getY() - y); - - final UPolygon triangle = new UPolygon(); - triangle.addPoint(0, 1); - final double width = 18; - final double height = 26; - triangle.addPoint(-width / 2, height); - triangle.addPoint(width / 2, height); - triangle.rotate(theta); - ug.apply(new UTranslate(x, y)).draw(triangle); - - final Point2D middle = BezierUtils.middle(triangle.getPoints().get(1), triangle.getPoints().get(2)); - middle.setLocation(middle.getX() + x, middle.getY() + y); - return middle; - } - - private Point2D drawDiamond(UGraphic ug, double x, double y, double theta) { - - // final double theta = Math.atan2(-pathPoint.getX() + x, - // pathPoint.getY() - y); - - final UPolygon triangle = new UPolygon(); - triangle.addPoint(0, 0); - final double width = 10; - final double height = 14; - triangle.addPoint(-width / 2, height / 2); - triangle.addPoint(0, height); - triangle.addPoint(width / 2, height / 2); - triangle.rotate(theta); - ug.apply(new UTranslate(x, y)).draw(triangle); - - final Point2D middle = triangle.getPoints().get(2); - middle.setLocation(middle.getX() + x, middle.getY() + y); - return middle; - - } - - private Point2D drawArrow(UGraphic ug, double x, double y, double theta) { - - // final double theta = Math.atan2(-pathPoint.getX() + x, - // pathPoint.getY() - y); - - final UPolygon triangle = new UPolygon(); - triangle.addPoint(0, 0); - final double width = 12; - final double height = 10; - triangle.addPoint(-width / 2, height); - final double height2 = 4; - triangle.addPoint(0, height2); - triangle.addPoint(width / 2, height); - triangle.rotate(theta); - ug.apply(new UTranslate(x, y)).draw(triangle); - - final Point2D middle = triangle.getPoints().get(2); - middle.setLocation(middle.getX() + x, middle.getY() + y); - return middle; - } - - private Point2D nullIfContained(Point2D p, Positionable start, Positionable end) { - if (PositionableUtils.contains(start, p)) { - return null; - } - if (PositionableUtils.contains(end, p)) { - return null; - } - return p; - } - - // private void drawPath(UGraphic ug, PointList points, Positionable start, - // Positionable end) { - // Decor decor = new DecorInterfaceProvider(); - // Point2D last = null; - // final int nb = 10; - // final double t1 = - // points.getIntersectionDouble(PositionableUtils.convert(start)); - // final double t2 = - // points.getIntersectionDouble(PositionableUtils.convert(end)); - // for (int i = 0; i <= nb; i++) { - // final double d = t1 + (t2 - t1) * i / nb; - // final Point2D cur = nullIfContained(points.getPoint(d), start, end); - // if (last != null && cur != null) { - // ug.draw(last.getX(), last.getY(), new ULine(cur.getX() - last.getX(), - // cur.getY() - last.getY())); - // if (decor != null) { - // decor.drawLine(ug, last, cur); - // decor = null; - // } - // } - // last = cur; - // } - // - // for (Point2D p : points.getPoints()) { - // ug.draw(p.getX() - 1, p.getY() - 1, new UEllipse(2, 2)); - // } - // } - -} diff --git a/src/net/sourceforge/plantuml/sdot/SmetanaPath.java b/src/net/sourceforge/plantuml/sdot/SmetanaPath.java index 4b4279230..f4529eb1d 100644 --- a/src/net/sourceforge/plantuml/sdot/SmetanaPath.java +++ b/src/net/sourceforge/plantuml/sdot/SmetanaPath.java @@ -43,10 +43,7 @@ import h.ST_bezier; import h.ST_pointf; import h.ST_splines; import h.ST_textlabel_t; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.UmlDiagramType; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.LinkType; @@ -91,73 +88,46 @@ public class SmetanaPath implements UDrawable { this.headLabel = headLabel; } - private ColorParam getArrowColorParam() { - if (diagram.getUmlDiagramType() == UmlDiagramType.CLASS) { - return ColorParam.arrow; - } else if (diagram.getUmlDiagramType() == UmlDiagramType.OBJECT) { - return ColorParam.arrow; - } else if (diagram.getUmlDiagramType() == UmlDiagramType.DESCRIPTION) { - return ColorParam.arrow; - } else if (diagram.getUmlDiagramType() == UmlDiagramType.ACTIVITY) { - return ColorParam.arrow; - } else if (diagram.getUmlDiagramType() == UmlDiagramType.STATE) { - return ColorParam.arrow; - } - throw new IllegalStateException(); - } - public void drawU(UGraphic ug) { - if (link.isHidden()) { + if (link.isHidden()) return; - } - - HColor color; - if (UseStyle.useBetaStyle()) { - 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()); - } else { - color = rose.getHtmlColor(diagram.getSkinParam(), null, getArrowColorParam()); - } + HColor 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()); if (this.link.getColors() != null) { final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE); - if (newColor != null) { + if (newColor != null) color = newColor; - } - - } else if (this.link.getSpecificColor() != null) { + } else if (this.link.getSpecificColor() != null) color = this.link.getSpecificColor(); - } DotPath dotPath = getDotPath(edge); - if (ymirror != null && dotPath != null) { + if (ymirror != null && dotPath != null) dotPath = ymirror.getMirrored(dotPath); - } if (dotPath != null) { final LinkType linkType = link.getType(); UStroke stroke = linkType.getStroke3(diagram.getSkinParam().getThickness(LineParam.arrow, null)); - if (link.getColors() != null && link.getColors().getSpecificLineStroke() != null) { + if (link.getColors() != null && link.getColors().getSpecificLineStroke() != null) stroke = link.getColors().getSpecificLineStroke(); - } ug.apply(stroke).apply(color).draw(dotPath); printExtremityAtStart(ug.apply(color)); printExtremityAtEnd(ug.apply(color)); } - if (getLabelRectangleTranslate("label") != null) { + if (getLabelRectangleTranslate("label") != null) label.drawU(ug.apply(getLabelRectangleTranslate("label"))); - } - if (getLabelRectangleTranslate("head_label") != null) { + + if (getLabelRectangleTranslate("head_label") != null) headLabel.drawU(ug.apply(getLabelRectangleTranslate("head_label"))); - } - if (getLabelRectangleTranslate("tail_label") != null) { + + if (getLabelRectangleTranslate("tail_label") != null) tailLabel.drawU(ug.apply(getLabelRectangleTranslate("tail_label"))); - } + // printDebug(ug); } @@ -165,9 +135,9 @@ public class SmetanaPath implements UDrawable { private void printExtremityAtStart(UGraphic ug) { final ExtremityFactory extremityFactory2 = link.getType().getDecor2() .getExtremityFactoryComplete(diagram.getSkinParam().getBackgroundColor()); - if (extremityFactory2 == null) { + if (extremityFactory2 == null) return; - } + final ST_splines splines = getSplines(edge); DotPath s = getDotPath(splines); Point2D p0 = s.getStartPoint(); @@ -178,9 +148,9 @@ public class SmetanaPath implements UDrawable { } try { final UDrawable extremity2 = extremityFactory2.createUDrawable(p0, startAngle, null); - if (extremity2 != null) { + if (extremity2 != null) extremity2.drawU(ug); - } + } catch (UnsupportedOperationException e) { System.err.println("CANNOT DRAW printExtremityAtStart"); } @@ -189,9 +159,9 @@ public class SmetanaPath implements UDrawable { private void printExtremityAtEnd(UGraphic ug) { final ExtremityFactory extremityFactory1 = link.getType().getDecor1() .getExtremityFactoryComplete(diagram.getSkinParam().getBackgroundColor()); - if (extremityFactory1 == null) { + if (extremityFactory1 == null) return; - } + final ST_splines splines = getSplines(edge); DotPath s = getDotPath(splines); Point2D p0 = s.getEndPoint(); @@ -202,9 +172,9 @@ public class SmetanaPath implements UDrawable { } try { final UDrawable extremity1 = extremityFactory1.createUDrawable(p0, endAngle, null); - if (extremity1 != null) { + if (extremity1 != null) extremity1.drawU(ug); - } + } catch (UnsupportedOperationException e) { System.err.println("CANNOT DRAW printExtremityAtEnd"); } @@ -216,9 +186,9 @@ public class SmetanaPath implements UDrawable { final ST_bezier beziers = splines.list.get__(0); for (int i = 0; i < beziers.size; i++) { Point2D pt = getPoint(splines, i); - if (ymirror != null) { + if (ymirror != null) pt = ymirror.getMirrored(pt); - } + ug.apply(new UTranslate(pt).compose(new UTranslate(-1, -1))).draw(new UEllipse(3, 3)); } if (getLabelRectangleTranslate("label") != null && getLabelURectangle() != null) { @@ -231,9 +201,9 @@ public class SmetanaPath implements UDrawable { private URectangle getLabelURectangle() { final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(edge).castTo(ST_Agedgeinfo_t.class); ST_textlabel_t label = (ST_textlabel_t) data.label; - if (label == null) { + if (label == null) return null; - } + final ST_pointf dimen = (ST_pointf) label.dimen; final ST_pointf space = (ST_pointf) label.space; final ST_pointf pos = (ST_pointf) label.pos; @@ -248,16 +218,16 @@ public class SmetanaPath implements UDrawable { // final String fieldName = "label"; final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(edge); ST_textlabel_t label = null; - if (fieldName.equals("label")) { + if (fieldName.equals("label")) label = data.label; - } else if (fieldName.equals("head_label")) { + else if (fieldName.equals("head_label")) label = data.head_label; - } else if (fieldName.equals("tail_label")) { + else if (fieldName.equals("tail_label")) label = data.tail_label; - } - if (label == null) { + + if (label == null) return null; - } + final ST_pointf dimen = (ST_pointf) label.dimen; final ST_pointf space = (ST_pointf) label.space; final ST_pointf pos = (ST_pointf) label.pos; @@ -266,9 +236,9 @@ public class SmetanaPath implements UDrawable { final double width = dimen.x; final double height = dimen.y; - if (ymirror == null) { + if (ymirror == null) return new UTranslate(x - width / 2, y - height / 2); - } + return ymirror.getMirrored(new UTranslate(x - width / 2, y + height / 2)); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java index 47c4b22d2..e89a73483 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java +++ b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java @@ -35,10 +35,7 @@ */ package net.sourceforge.plantuml.sequencediagram; -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.cucadiagram.Display; @@ -47,7 +44,6 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.sequencediagram.teoz.CommonTile; -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; @@ -94,19 +90,13 @@ public class LinkAnchor { final double ymin = Math.min(y1, y2); final double ymax = Math.max(y1, y2); - final HColor color; - final FontConfiguration fontConfiguration; - if (UseStyle.useBetaStyle()) { - final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, - SName.arrow); - final Style style = signature.getMergedStyle(skinParam.getCurrentStyleBuilder()); + final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, + SName.arrow); + final Style style = signature.getMergedStyle(skinParam.getCurrentStyleBuilder()); - color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()); - fontConfiguration = FontConfiguration.create(skinParam, style); - } else { - color = new Rose().getHtmlColor(skinParam, ColorParam.arrow); - fontConfiguration = FontConfiguration.create(skinParam, FontParam.ARROW, null); - } + final HColor color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + final FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, style); final Rainbow rainbow = Rainbow.fromColor(color, null); diff --git a/src/net/sourceforge/plantuml/sequencediagram/Note.java b/src/net/sourceforge/plantuml/sequencediagram/Note.java index 446368b58..4ab0063ee 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/Note.java +++ b/src/net/sourceforge/plantuml/sequencediagram/Note.java @@ -40,7 +40,6 @@ import java.util.List; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SpecificBackcolorable; import net.sourceforge.plantuml.Url; -import net.sourceforge.plantuml.UseStyle; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.color.Colors; @@ -77,9 +76,9 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo } public Style[] getUsedStyles() { - if (style != null) { + if (style != null) return new Style[] { style.eventuallyOverride(colors) }; - } + return new Style[] { style }; } @@ -102,22 +101,18 @@ final public class Note extends AbstractEvent implements Event, SpecificBackcolo this.styleBuilder = styleBuilder; this.position = position; this.strings = strings; - if (UseStyle.useBetaStyle()) { - this.style = getStyleSignature().getMergedStyle(styleBuilder); - } + this.style = getStyleSignature().getMergedStyle(styleBuilder); } public void setStereotype(Stereotype stereotype) { - if (UseStyle.useBetaStyle()) { - final List