summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrew.shadura@collabora.co.uk>2016-03-02 13:54:28 +0100
committerAndrew Shadura <andrew.shadura@collabora.co.uk>2016-03-02 13:54:28 +0100
commitc8193f238ed8e884ba793479204846db8354d1c0 (patch)
treed3a8307484a37cb81b21f29b16dd76935277846b
parent26b872bb194ec7622997914bba53309a94b64d20 (diff)
Imported Upstream version 8036
-rw-r--r--COPYING2
-rw-r--r--build.xml9
-rw-r--r--src/net/sourceforge/plantuml/AbstractPSystem.java19
-rw-r--r--src/net/sourceforge/plantuml/AlignParam.java4
-rw-r--r--src/net/sourceforge/plantuml/AnimatedGifEncoder.java6
-rw-r--r--src/net/sourceforge/plantuml/Annotated.java51
-rw-r--r--src/net/sourceforge/plantuml/AnnotatedWorker.java135
-rw-r--r--src/net/sourceforge/plantuml/BasicEnsureVisible.java4
-rw-r--r--src/net/sourceforge/plantuml/BlockUml.java49
-rw-r--r--src/net/sourceforge/plantuml/BlockUmlBuilder.java53
-rw-r--r--src/net/sourceforge/plantuml/CMapData.java8
-rw-r--r--src/net/sourceforge/plantuml/CharSequence2.java53
-rw-r--r--src/net/sourceforge/plantuml/CharSequence2Impl.java91
-rw-r--r--src/net/sourceforge/plantuml/ColorParam.java166
-rw-r--r--src/net/sourceforge/plantuml/CounterOutputStream.java4
-rw-r--r--src/net/sourceforge/plantuml/Dimension2DDouble.java4
-rw-r--r--src/net/sourceforge/plantuml/DirWatcher.java8
-rw-r--r--src/net/sourceforge/plantuml/DirWatcher2.java8
-rw-r--r--src/net/sourceforge/plantuml/Direction.java4
-rw-r--r--src/net/sourceforge/plantuml/EmbededDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/EmptyImageBuilder.java14
-rw-r--r--src/net/sourceforge/plantuml/EnsureVisible.java4
-rw-r--r--src/net/sourceforge/plantuml/ErrorUml.java13
-rw-r--r--src/net/sourceforge/plantuml/ErrorUmlType.java4
-rw-r--r--src/net/sourceforge/plantuml/FileFormat.java4
-rw-r--r--src/net/sourceforge/plantuml/FileFormatOption.java32
-rw-r--r--src/net/sourceforge/plantuml/FileGroup.java4
-rw-r--r--src/net/sourceforge/plantuml/FileSystem.java4
-rw-r--r--src/net/sourceforge/plantuml/FileUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/FileWatcher.java4
-rw-r--r--src/net/sourceforge/plantuml/FontParam.java17
-rw-r--r--src/net/sourceforge/plantuml/GeneratedImage.java58
-rw-r--r--src/net/sourceforge/plantuml/GeneratedImageImpl.java93
-rw-r--r--src/net/sourceforge/plantuml/Hideable.java4
-rw-r--r--src/net/sourceforge/plantuml/ISkinParam.java23
-rw-r--r--src/net/sourceforge/plantuml/ISkinSimple.java11
-rw-r--r--src/net/sourceforge/plantuml/ISourceFileReader.java7
-rw-r--r--src/net/sourceforge/plantuml/LineConfigurable.java14
-rw-r--r--src/net/sourceforge/plantuml/LineLocation.java62
-rw-r--r--src/net/sourceforge/plantuml/LineLocationImpl.java (renamed from src/net/sourceforge/plantuml/sequencediagram/ParticipantEngloberContexted.java)62
-rw-r--r--src/net/sourceforge/plantuml/LineParam.java8
-rw-r--r--src/net/sourceforge/plantuml/Log.java4
-rw-r--r--src/net/sourceforge/plantuml/NewpagedDiagram.java16
-rw-r--r--src/net/sourceforge/plantuml/NullOutputStream.java4
-rw-r--r--src/net/sourceforge/plantuml/Option.java4
-rw-r--r--src/net/sourceforge/plantuml/OptionFlags.java8
-rw-r--r--src/net/sourceforge/plantuml/OptionPrint.java4
-rw-r--r--src/net/sourceforge/plantuml/PSystemBuilder.java31
-rw-r--r--src/net/sourceforge/plantuml/PSystemError.java119
-rw-r--r--src/net/sourceforge/plantuml/PSystemUtils.java8
-rw-r--r--src/net/sourceforge/plantuml/Pragma.java9
-rw-r--r--src/net/sourceforge/plantuml/Removeable.java4
-rw-r--r--src/net/sourceforge/plantuml/Run.java8
-rw-r--r--src/net/sourceforge/plantuml/Scale.java4
-rw-r--r--src/net/sourceforge/plantuml/ScaleHeight.java4
-rw-r--r--src/net/sourceforge/plantuml/ScaleMaxHeight.java52
-rw-r--r--src/net/sourceforge/plantuml/ScaleMaxWidth.java52
-rw-r--r--src/net/sourceforge/plantuml/ScaleMaxWidthAndHeight.java (renamed from src/net/sourceforge/plantuml/version/IteratorCounterImpl.java)44
-rw-r--r--src/net/sourceforge/plantuml/ScaleSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/ScaleWidth.java4
-rw-r--r--src/net/sourceforge/plantuml/ScaleWidthAndHeight.java4
-rw-r--r--src/net/sourceforge/plantuml/SignatureUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/SingleLine.java4
-rw-r--r--src/net/sourceforge/plantuml/SkinParam.java147
-rw-r--r--src/net/sourceforge/plantuml/SkinParamBackcolored.java6
-rw-r--r--src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java5
-rw-r--r--src/net/sourceforge/plantuml/SkinParamColors.java87
-rw-r--r--src/net/sourceforge/plantuml/SkinParamDelegator.java40
-rw-r--r--src/net/sourceforge/plantuml/SkinParamForceColor.java60
-rw-r--r--src/net/sourceforge/plantuml/SkinParamForecolored.java8
-rw-r--r--src/net/sourceforge/plantuml/SkinParamSameClassWidth.java5
-rw-r--r--src/net/sourceforge/plantuml/SkinParamUtils.java10
-rw-r--r--src/net/sourceforge/plantuml/SourceFileReader.java106
-rw-r--r--src/net/sourceforge/plantuml/SourceFileReader2.java11
-rw-r--r--src/net/sourceforge/plantuml/SourceStringReader.java9
-rw-r--r--src/net/sourceforge/plantuml/SpecificBackcolorable.java12
-rw-r--r--src/net/sourceforge/plantuml/SpriteContainer.java6
-rw-r--r--src/net/sourceforge/plantuml/SpriteContainerEmpty.java24
-rw-r--r--src/net/sourceforge/plantuml/StringUtils.java202
-rw-r--r--src/net/sourceforge/plantuml/UmlDiagram.java138
-rw-r--r--src/net/sourceforge/plantuml/UmlDiagramType.java4
-rw-r--r--src/net/sourceforge/plantuml/Url.java15
-rw-r--r--src/net/sourceforge/plantuml/UrlBuilder.java37
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java12
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/ConditionalContext.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandElse.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandEndPartition.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandEndif.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandInnerConcurrent.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java17
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java65
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity2.java220
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java10
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java130
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java21
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/Branch.java21
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/Instruction.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionCollection.java (renamed from src/net/sourceforge/plantuml/version/IteratorCounter.java)12
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java72
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java17
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionGoto.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java28
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java43
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionLabel.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java13
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionPartition.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java26
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java22
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionSplit.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java18
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java34
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/LinkRendering.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java19
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java59
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java28
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandElse3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java9
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandEnd3.java (renamed from src/net/sourceforge/plantuml/activitydiagram3/command/CommandStopLegacy1.java)14
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndPartition3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndif3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandFork3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkAgain3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkEnd3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandGoto.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroupEnd3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandKill3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandLabel.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java18
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java28
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java (renamed from src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2Multilines.java)68
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplit3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitAgain3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitEnd3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandStart3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandStop3.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java9
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractConnection.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Arrows.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java6
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Connection.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionCross.java10
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionTranslatable.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Diamond.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java15
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java16
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java18
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java57
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometry.java28
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometryMerger.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileLabel.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java16
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java88
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java12
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileOverpassing.java (renamed from src/net/sourceforge/plantuml/cucadiagram/BlockMember.java)14
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileUtils.java22
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithConnection.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithSwimlanes.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithUrl.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/GotoInterceptor.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java24
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/SnakeDirection.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimable.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java24
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java51
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java20
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddUrl.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAssembly.java31
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateFork.java40
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java9
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateSplit.java37
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java42
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java19
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java17
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java70
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java29
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong.java516
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java (renamed from src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong2.java)87
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java587
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java45
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java49
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java16
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorGoto.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java8
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java42
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java218
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileDimensionMemoize.java57
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java157
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java171
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java (renamed from src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIf.java)401
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java30
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java109
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java7
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateIn.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOut.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecoratePointOut.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java9
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java4
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java31
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java22
-rw-r--r--src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java177
-rw-r--r--src/net/sourceforge/plantuml/anim/AffineTransformation.java7
-rw-r--r--src/net/sourceforge/plantuml/anim/Animation.java4
-rw-r--r--src/net/sourceforge/plantuml/anim/AnimationDecoder.java15
-rw-r--r--src/net/sourceforge/plantuml/anim/AnimationScript.java4
-rw-r--r--src/net/sourceforge/plantuml/ant/PlantUmlTask.java4
-rw-r--r--src/net/sourceforge/plantuml/api/CountRate.java4
-rw-r--r--src/net/sourceforge/plantuml/api/INumberAnalyzed.java4
-rw-r--r--src/net/sourceforge/plantuml/api/ImageDataComplex.java4
-rw-r--r--src/net/sourceforge/plantuml/api/ImageDataSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/api/MagicArray.java4
-rw-r--r--src/net/sourceforge/plantuml/api/MyRunnable.java4
-rw-r--r--src/net/sourceforge/plantuml/api/NiceNumber.java4
-rw-r--r--src/net/sourceforge/plantuml/api/NumberAnalyzed.java4
-rw-r--r--src/net/sourceforge/plantuml/api/PSystemFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/api/PlantumlUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/api/TimeoutExecutor.java4
-rw-r--r--src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java4
-rw-r--r--src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java4
-rw-r--r--src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java4
-rw-r--r--src/net/sourceforge/plantuml/applet/VersionApplet.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/BasicCharArea.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextActiveLine.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java18
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingBody.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingElse.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingTail.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextLine.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextNewpage.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/TextSkin.java6
-rw-r--r--src/net/sourceforge/plantuml/asciiart/TextStringBounder.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/TranslatedCharArea.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/UmlCharArea.java4
-rw-r--r--src/net/sourceforge/plantuml/asciiart/UmlCharAreaImpl.java7
-rw-r--r--src/net/sourceforge/plantuml/braille/BrailleUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/AbstractEntityDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java14
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java58
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/FullLayout.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/RowLayout.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java6
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandAllowMixing.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java49
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java124
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java21
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java7
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow3.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java18
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandImport.java7
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandLayoutNewLine.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java117
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java26
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandMouseOver.java123
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandNamespaceSeparator.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java6
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/GenericRegexProducer.java4
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/JavaClass.java9
-rw-r--r--src/net/sourceforge/plantuml/classdiagram/command/JavaFile.java6
-rw-r--r--src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java22
-rw-r--r--src/net/sourceforge/plantuml/code/AsciiEncoder.java4
-rw-r--r--src/net/sourceforge/plantuml/code/Base64Coder.java4
-rw-r--r--src/net/sourceforge/plantuml/code/Compression.java4
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionGZip.java4
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionHuffman.java4
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionNone.java4
-rw-r--r--src/net/sourceforge/plantuml/code/CompressionZlib.java4
-rw-r--r--src/net/sourceforge/plantuml/code/StringCompressor.java4
-rw-r--r--src/net/sourceforge/plantuml/code/StringCompressorNone.java4
-rw-r--r--src/net/sourceforge/plantuml/code/Transcoder.java4
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderSmart.java4
-rw-r--r--src/net/sourceforge/plantuml/code/TranscoderUtil.java4
-rw-r--r--src/net/sourceforge/plantuml/code/URLEncoder.java4
-rw-r--r--src/net/sourceforge/plantuml/command/BlocLines.java260
-rw-r--r--src/net/sourceforge/plantuml/command/Command.java10
-rw-r--r--src/net/sourceforge/plantuml/command/CommandAffineTransform.java6
-rw-r--r--src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java12
-rw-r--r--src/net/sourceforge/plantuml/command/CommandCaption.java58
-rw-r--r--src/net/sourceforge/plantuml/command/CommandComment.java7
-rw-r--r--src/net/sourceforge/plantuml/command/CommandControl.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandDecoratorMultine.java83
-rw-r--r--src/net/sourceforge/plantuml/command/CommandEndPackage.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandExecutionResult.java45
-rw-r--r--src/net/sourceforge/plantuml/command/CommandFootboxIgnored.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandFooter.java13
-rw-r--r--src/net/sourceforge/plantuml/command/CommandHeader.java14
-rw-r--r--src/net/sourceforge/plantuml/command/CommandHideUnlinked.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMinwidth.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilines.java12
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilines2.java20
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilines3.java102
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesBracket.java14
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesComment.java17
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java24
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java27
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java19
-rw-r--r--src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java18
-rw-r--r--src/net/sourceforge/plantuml/command/CommandNamespace.java13
-rw-r--r--src/net/sourceforge/plantuml/command/CommandNope.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandPackage.java35
-rw-r--r--src/net/sourceforge/plantuml/command/CommandPackageEmpty.java9
-rw-r--r--src/net/sourceforge/plantuml/command/CommandPage.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandPragma.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandRankDir.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandRotate.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScale.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java55
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java55
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java56
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandSkinParam.java4
-rw-r--r--src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java37
-rw-r--r--src/net/sourceforge/plantuml/command/CommandSpriteFile.java25
-rw-r--r--src/net/sourceforge/plantuml/command/CommandTitle.java10
-rw-r--r--src/net/sourceforge/plantuml/command/FactorySpriteCommand.java35
-rw-r--r--src/net/sourceforge/plantuml/command/MultilinesStrategy.java19
-rw-r--r--src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java13
-rw-r--r--src/net/sourceforge/plantuml/command/PSystemBasicFactory.java21
-rw-r--r--src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java23
-rw-r--r--src/net/sourceforge/plantuml/command/Position.java15
-rw-r--r--src/net/sourceforge/plantuml/command/ProtectedCommand.java29
-rw-r--r--src/net/sourceforge/plantuml/command/SingleLineCommand.java16
-rw-r--r--src/net/sourceforge/plantuml/command/SingleLineCommand2.java19
-rw-r--r--src/net/sourceforge/plantuml/command/UmlDiagramFactory.java156
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java43
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java46
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java82
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java55
-rw-r--r--src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java178
-rw-r--r--src/net/sourceforge/plantuml/command/note/SingleMultiFactoryCommand.java6
-rw-r--r--src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java64
-rw-r--r--src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java47
-rw-r--r--src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java48
-rw-r--r--src/net/sourceforge/plantuml/command/regex/IRegex.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/MatcherIterator.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/MyPattern.java14
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexComposed.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexConcat.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexLeaf.java9
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexOptional.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexOr.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexPartialMatch.java4
-rw-r--r--src/net/sourceforge/plantuml/command/regex/RegexResult.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/CompositeDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/command/CommandEndPackageBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/core/Diagram.java4
-rw-r--r--src/net/sourceforge/plantuml/core/DiagramDescription.java4
-rw-r--r--src/net/sourceforge/plantuml/core/DiagramDescriptionImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/core/DiagramType.java5
-rw-r--r--src/net/sourceforge/plantuml/core/ImageData.java4
-rw-r--r--src/net/sourceforge/plantuml/core/UmlSource.java61
-rw-r--r--src/net/sourceforge/plantuml/creole/Atom.java6
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java13
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomImg.java35
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomOpenIcon.java6
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomSprite.java6
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomTable.java65
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomText.java20
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomTree.java103
-rw-r--r--src/net/sourceforge/plantuml/creole/AtomWithMargin.java6
-rw-r--r--src/net/sourceforge/plantuml/creole/Bullet.java6
-rw-r--r--src/net/sourceforge/plantuml/creole/Command.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleImg.java17
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java16
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CreoleContext.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java8
-rw-r--r--src/net/sourceforge/plantuml/creole/CreoleMode.java40
-rw-r--r--src/net/sourceforge/plantuml/creole/CreoleParser.java40
-rw-r--r--src/net/sourceforge/plantuml/creole/CreoleStripeSimpleParser.java40
-rw-r--r--src/net/sourceforge/plantuml/creole/Fission.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/PSystemCreole.java15
-rw-r--r--src/net/sourceforge/plantuml/creole/PSystemCreoleFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/Position.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/Sea.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/Sheet.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/SheetBlock1.java15
-rw-r--r--src/net/sourceforge/plantuml/creole/SheetBlock2.java14
-rw-r--r--src/net/sourceforge/plantuml/creole/Stencil.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/Stripe.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeSimple.java14
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeStyleType.java6
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeTable.java44
-rw-r--r--src/net/sourceforge/plantuml/creole/StripeTree.java77
-rw-r--r--src/net/sourceforge/plantuml/creole/UCreole.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Bodier.java75
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java57
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java17
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Code.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java12
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Display.java269
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Display2.java241
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java77
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/EntityGender.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/EntityGenderUtils.java12
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/EntityPortion.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/EntityUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/GroupHierarchy.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java94
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/GroupType.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/IEntity.java26
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/IGroup.java13
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/ILeaf.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Ident.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LeafType.java6
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Link.java72
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkHat.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java21
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LinkType.java12
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/LongCode.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Magma.java12
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/MagmaList.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Member.java157
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/MemberImpl.java210
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java71
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Namespace.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/PortionShower.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Rankdir.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/RuleType.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/SquareLinker.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/SquareMaker.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/Stereotype.java33
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/UnparsableGraphvizException.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java6
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramPngMaker3.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierActivity.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierState.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java20
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/DotMaker2.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/DotSplines.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/Graphviz.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java16
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java6
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersions.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindows.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/OS.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/dot/ProcessState.java4
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java6
-rw-r--r--src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java179
-rw-r--r--src/net/sourceforge/plantuml/cute/ApolloniusSolver.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/ApolloniusSolver2.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Arc.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Balloon.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/BetweenCorners.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Cheese.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Circle.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Corner.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Crossing.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/CrossingSegment.java (renamed from src/net/sourceforge/plantuml/cucadiagram/BlockMemberImpl.java)46
-rw-r--r--src/net/sourceforge/plantuml/cute/CrossingSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/CutePath.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/CuteShape.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/CuteShapeFactory.java12
-rw-r--r--src/net/sourceforge/plantuml/cute/Group.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/InfiniteLine.java9
-rw-r--r--src/net/sourceforge/plantuml/cute/MyDouble.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/MyPoint2D.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/PSystemCute.java13
-rw-r--r--src/net/sourceforge/plantuml/cute/PSystemCuteFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Positionned.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/PositionnedImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Rectangle.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/RotationZoom.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Segment.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Stick.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Tension.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/Triangle.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/TriangleCorner.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/TriangleCornerSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/cute/VarArgs.java4
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java6
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java27
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java36
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java82
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java64
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandNamespaceSeparator.java4
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandNewpage.java6
-rw-r--r--src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java13
-rw-r--r--src/net/sourceforge/plantuml/directdot/PSystemDot.java4
-rw-r--r--src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/donors/PSystemDonors.java13
-rw-r--r--src/net/sourceforge/plantuml/donors/PSystemDonorsFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/EggUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/GraphicsPath.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java6
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemCharlie.java6
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemEgg.java6
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemLost.java6
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemPath.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemRIP.java6
-rw-r--r--src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/SentenceDecoder.java4
-rw-r--r--src/net/sourceforge/plantuml/eggs/SentenceProducer.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/EpsGraphics.java10
-rw-r--r--src/net/sourceforge/plantuml/eps/EpsGraphicsMacro.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/EpsGraphicsMacroAndText.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/EpsStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommand.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommandCurveTo.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommandLineTo.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommandMacro.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommandMoveTo.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommandQuadTo.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptCommandRaw.java4
-rw-r--r--src/net/sourceforge/plantuml/eps/PostScriptData.java4
-rw-r--r--src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/flashcode/FlashCodeUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java4
-rw-r--r--src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java16
-rw-r--r--src/net/sourceforge/plantuml/flowdiagram/CommandLineSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/flowdiagram/CommandLink.java4
-rw-r--r--src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java11
-rw-r--r--src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/font/PSystemListFonts.java6
-rw-r--r--src/net/sourceforge/plantuml/font/PSystemListFontsFactory.java6
-rw-r--r--src/net/sourceforge/plantuml/ftp/FtpConnexion.java4
-rw-r--r--src/net/sourceforge/plantuml/ftp/FtpLoop.java4
-rw-r--r--src/net/sourceforge/plantuml/ftp/FtpServer.java4
-rw-r--r--src/net/sourceforge/plantuml/fun/IconLoader.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/AbstractFigure.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/AbstractLineSegment.java35
-rw-r--r--src/net/sourceforge/plantuml/geom/AbstractPolyline.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Box.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/ClosedArea.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/CollectionUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Dijkstra.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/InflateData.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/InflationTransform.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Kingdom.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/LineSegmentDouble.java20
-rw-r--r--src/net/sourceforge/plantuml/geom/LineSegmentInt.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Neighborhood.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Orientation.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Point2DInt.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Pointable.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Polyline.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/PolylineBreakeable.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/PolylineImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/Singularity.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/SpiderWeb.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/XMoveable.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/Frame.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/MoveObserver.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/Path.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/Point2DCharge.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/SegmentCutter.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/VectorForce.java4
-rw-r--r--src/net/sourceforge/plantuml/geom/kinetic/World.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/Magnet.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/MinMaxDouble.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/MinMaxGolem.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/Path.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/Position.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/Square.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/Tile.java13
-rw-r--r--src/net/sourceforge/plantuml/golem/TileArea.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/TileGeometry.java4
-rw-r--r--src/net/sourceforge/plantuml/golem/TilesField.java7
-rw-r--r--src/net/sourceforge/plantuml/graph/ALink.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/ALinkImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/ANode.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/ANodeImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/AbstractEntityImage.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Board.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/BoardCollection.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/BoardExplorer.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/CostComputer.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Elastane.java10
-rw-r--r--src/net/sourceforge/plantuml/graph/ElectricCharge.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/ElectricWord.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageActivity.java12
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java10
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageComponent.java97
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageDefault.java12
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageNote.java12
-rw-r--r--src/net/sourceforge/plantuml/graph/EntityImageUsecase.java16
-rw-r--r--src/net/sourceforge/plantuml/graph/Galaxy4.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/GeneralPathFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Graph1.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Graph2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Graph3.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Graph4.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Graph5.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Heap.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/KenavoCostComputer.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/LinkString.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java8
-rw-r--r--src/net/sourceforge/plantuml/graph/Move.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Oven.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/SimpleCostComputer.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/SortedCollection.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Zoda1.java4
-rw-r--r--src/net/sourceforge/plantuml/graph/Zoda2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/Dijkstra.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/GeomUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/IInflationTransform.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/InflateData2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/InflationTransform2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/Measurer.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/MyCurve.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/Neighborhood2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/Plan.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/Polyline2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/RectanglesCollection.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/Singularity2.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/SortedList.java4
-rw-r--r--src/net/sourceforge/plantuml/graph2/SortedListImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java44
-rw-r--r--src/net/sourceforge/plantuml/graphic/AddStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/CircledCharacter.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/ColorChange.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/DateEventUtils.java54
-rw-r--r--src/net/sourceforge/plantuml/graphic/DisplayUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/EmbededSystemLine.java13
-rw-r--r--src/net/sourceforge/plantuml/graphic/ExposantChange.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/FontChange.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/FontConfiguration.java71
-rw-r--r--src/net/sourceforge/plantuml/graphic/FontFamilyChange.java7
-rw-r--r--src/net/sourceforge/plantuml/graphic/FontPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/FontStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/GraphicPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/GraphicStrings.java17
-rw-r--r--src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java23
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColor.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorGradient.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorSet.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorUserDef.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlColorUtils.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlCommand.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/HtmlCommandFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/IHtmlColorSet.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/Img.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/ImgValign.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/Line.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/QuoteUtils.java30
-rw-r--r--src/net/sourceforge/plantuml/graphic/RemoveStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/ResetFont.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/SingleLine.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/SizeChange.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/SkinParameter.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/Splitter.java11
-rw-r--r--src/net/sourceforge/plantuml/graphic/SpriteCommand.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/StringBounder.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/StringBounderUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/SvgAttributes.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/SvgAttributesChange.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/SymbolContext.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/Text.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlock.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockArrow.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockBordered.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java12
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockMarged.java20
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java11
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockSimple.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockSpotted.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockUtils.java122
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java32
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockWidth.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextBlockWidthAdapter.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TextLink.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/TileImage.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TileImageSvg.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/TileText.java6
-rw-r--r--src/net/sourceforge/plantuml/graphic/UDrawable.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/UDrawableUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/UGraphicInterceptorUDrawable.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbol.java18
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolActor.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolArtifact.java29
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolBoundary.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolCard.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolCloud.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolComponent1.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolComponent2.java25
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolControl.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolDatabase.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolFolder.java24
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolFrame.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolInterface.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolNode.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolQueue.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolRect.java41
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java8
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolStorage.java10
-rw-r--r--src/net/sourceforge/plantuml/graphic/UnusedSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/VerticalAlignment.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/VerticalPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/graphic/color/ColorParser.java110
-rw-r--r--src/net/sourceforge/plantuml/graphic/color/ColorType.java48
-rw-r--r--src/net/sourceforge/plantuml/graphic/color/Colors.java237
-rw-r--r--src/net/sourceforge/plantuml/hector/Box2D.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector2.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector3.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector4.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB2.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/GrowingTree.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/HectorPath.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/Pin.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/PinFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/PinLink.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/Skeleton.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonBuilder.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SkeletonMutation.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/SmartConnection.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java4
-rw-r--r--src/net/sourceforge/plantuml/hector/UnlinearCompression.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/CucaDiagramFileMakerHectorC1.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/MinMax.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/graphic/Foo1.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/graphic/Foo2.java7
-rw-r--r--src/net/sourceforge/plantuml/hector2/layering/Layer.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/mpos/Distribution.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java4
-rw-r--r--src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java4
-rw-r--r--src/net/sourceforge/plantuml/html/CucaDiagramHtmlMaker.java12
-rw-r--r--src/net/sourceforge/plantuml/html/LinkHtmlPrinter.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/CommandAddLevel.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/CommandEmpty.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/GNode.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/GNodeUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/GTile.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/GTileGeometry.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/GTileLeftRight.java7
-rw-r--r--src/net/sourceforge/plantuml/jungle/GTileNode.java18
-rw-r--r--src/net/sourceforge/plantuml/jungle/GTileOneLevelFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/GTileStack.java7
-rw-r--r--src/net/sourceforge/plantuml/jungle/Needle.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/PSystemTree.java6
-rw-r--r--src/net/sourceforge/plantuml/jungle/PSystemTreeFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/jungle/Rendering.java4
-rw-r--r--src/net/sourceforge/plantuml/mda/MDADiagramImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/mda/MDAEntityImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/mda/MDAPackageImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/mjpeg/MJPEGGenerator.java4
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java22
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/ObjectDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/ObjectDiagramFactory.java11
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java12
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java18
-rw-r--r--src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java36
-rw-r--r--src/net/sourceforge/plantuml/openiconic/Movement.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/OpenIcon.java7
-rw-r--r--src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java6
-rw-r--r--src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconicFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java6
-rw-r--r--src/net/sourceforge/plantuml/openiconic/PSystemOpenIconicFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/StringDecipher.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/SvgCommand.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/SvgCommandLetter.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/SvgCommandNumber.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/SvgPath.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/SvgPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/openiconic/data/DummyIcon.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/BasicGame.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/Keyboard.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/KeyboardList.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/MagicTable.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/NoInputException.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/OregonBasicGame.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/PSystemOregon.java6
-rw-r--r--src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/Screen.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/SecureCoder.java4
-rw-r--r--src/net/sourceforge/plantuml/oregon/SmartKeyboard.java4
-rw-r--r--src/net/sourceforge/plantuml/pdf/PdfConverter.java4
-rw-r--r--src/net/sourceforge/plantuml/png/Metadata.java4
-rw-r--r--src/net/sourceforge/plantuml/png/MetadataTag.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngFlashcoder.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngIO.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngIOMetadata.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngRotation.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngSegment.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngSizer.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngSplitter.java4
-rw-r--r--src/net/sourceforge/plantuml/png/PngTitler.java11
-rw-r--r--src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java8
-rw-r--r--src/net/sourceforge/plantuml/posimo/BezierUtils.java22
-rw-r--r--src/net/sourceforge/plantuml/posimo/Block.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Cluster.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Clusterable.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Decor.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/DotPath.java139
-rw-r--r--src/net/sourceforge/plantuml/posimo/DotxMaker.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/EntityImageNote2.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Frame.java16
-rw-r--r--src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Label.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/LabelImage.java17
-rw-r--r--src/net/sourceforge/plantuml/posimo/LineRectIntersection.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/MargedBlock.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Mirror.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Moveable.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Path.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/PathDrawer.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Positionable.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/PositionableImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/PositionableUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/Racorder.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/RacorderAbstract.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/SimpleDrawer.java4
-rw-r--r--src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/Area.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/AreaLayout.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/CommandWidth.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/Elastic.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/postit/PostIt.java12
-rw-r--r--src/net/sourceforge/plantuml/postit/PostItDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/preproc/Defines.java50
-rw-r--r--src/net/sourceforge/plantuml/preproc/FileWithSuffix.java81
-rw-r--r--src/net/sourceforge/plantuml/preproc/IfManager.java13
-rw-r--r--src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java12
-rw-r--r--src/net/sourceforge/plantuml/preproc/IfManagerPositif.java10
-rw-r--r--src/net/sourceforge/plantuml/preproc/Preprocessor.java58
-rw-r--r--src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java77
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLine.java8
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java22
-rw-r--r--src/net/sourceforge/plantuml/preproc/ReadLineReader.java53
-rw-r--r--src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java23
-rw-r--r--src/net/sourceforge/plantuml/preproc/UncommentReadLine.java23
-rw-r--r--src/net/sourceforge/plantuml/printskin/PrintSkin.java8
-rw-r--r--src/net/sourceforge/plantuml/printskin/PrintSkinFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Constant.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Day.java4
-rw-r--r--src/net/sourceforge/plantuml/project/DayClose.java4
-rw-r--r--src/net/sourceforge/plantuml/project/DayCloseNone.java4
-rw-r--r--src/net/sourceforge/plantuml/project/DayCloseOr.java4
-rw-r--r--src/net/sourceforge/plantuml/project/DayCloseWeekDay.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Duration.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Expression.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Formal.java4
-rw-r--r--src/net/sourceforge/plantuml/project/FormalAddition.java4
-rw-r--r--src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java4
-rw-r--r--src/net/sourceforge/plantuml/project/FreeVariable.java4
-rw-r--r--src/net/sourceforge/plantuml/project/IncompleteItem.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Instant.java4
-rw-r--r--src/net/sourceforge/plantuml/project/InstantArithmetic.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Item.java4
-rw-r--r--src/net/sourceforge/plantuml/project/ItemCaract.java4
-rw-r--r--src/net/sourceforge/plantuml/project/ItemComparator.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Jalon.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Load.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Month.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Numeric.java4
-rw-r--r--src/net/sourceforge/plantuml/project/NumericNumber.java4
-rw-r--r--src/net/sourceforge/plantuml/project/NumericType.java4
-rw-r--r--src/net/sourceforge/plantuml/project/PSystemProject.java6
-rw-r--r--src/net/sourceforge/plantuml/project/ParentItem.java4
-rw-r--r--src/net/sourceforge/plantuml/project/Project.java6
-rw-r--r--src/net/sourceforge/plantuml/project/Ressource.java4
-rw-r--r--src/net/sourceforge/plantuml/project/WeekDay.java4
-rw-r--r--src/net/sourceforge/plantuml/project/command/CommandAffectation.java9
-rw-r--r--src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java4
-rw-r--r--src/net/sourceforge/plantuml/project/graphic/GanttDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/project/graphic/ItemHeader.java11
-rw-r--r--src/net/sourceforge/plantuml/project/graphic/TimeScale.java18
-rw-r--r--src/net/sourceforge/plantuml/project2/Day.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/GanttDiagram2.java8
-rw-r--r--src/net/sourceforge/plantuml/project2/Knowledge.java8
-rw-r--r--src/net/sourceforge/plantuml/project2/PSystemProject2.java6
-rw-r--r--src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/Project2.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/Ressource.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/Row.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/RowMerge.java9
-rw-r--r--src/net/sourceforge/plantuml/project2/RowOverwrite.java7
-rw-r--r--src/net/sourceforge/plantuml/project2/RowSimple.java7
-rw-r--r--src/net/sourceforge/plantuml/project2/RowUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/Task.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TaskAttribute.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TaskContainer.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TaskImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TaskMerge.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeConverter.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeConverterDay.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeElement.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeHeaderDay.java12
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java14
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeLine.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeLineDay.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeResolution.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/TimeUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/Value.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/ValueInt.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/ValueTime.java4
-rw-r--r--src/net/sourceforge/plantuml/project2/command/CommandAffectation.java9
-rw-r--r--src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java4
-rw-r--r--src/net/sourceforge/plantuml/real/AbstractReal.java67
-rw-r--r--src/net/sourceforge/plantuml/real/PositiveForce.java32
-rw-r--r--src/net/sourceforge/plantuml/real/Real.java12
-rw-r--r--src/net/sourceforge/plantuml/real/RealDelta.java18
-rw-r--r--src/net/sourceforge/plantuml/real/RealImpl.java28
-rw-r--r--src/net/sourceforge/plantuml/real/RealLine.java108
-rw-r--r--src/net/sourceforge/plantuml/real/RealMax.java43
-rw-r--r--src/net/sourceforge/plantuml/real/RealMiddle.java18
-rw-r--r--src/net/sourceforge/plantuml/real/RealMiddle2.java72
-rw-r--r--src/net/sourceforge/plantuml/real/RealMin.java33
-rw-r--r--src/net/sourceforge/plantuml/real/RealMoveable.java25
-rw-r--r--src/net/sourceforge/plantuml/real/RealOrigin.java40
-rw-r--r--src/net/sourceforge/plantuml/real/RealUtils.java32
-rw-r--r--src/net/sourceforge/plantuml/salt/Cell.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/DataSource.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/DataSourceImpl.java9
-rw-r--r--src/net/sourceforge/plantuml/salt/Dictionary.java23
-rw-r--r--src/net/sourceforge/plantuml/salt/PSystemSalt.java6
-rw-r--r--src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java7
-rw-r--r--src/net/sourceforge/plantuml/salt/Position.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/Positionner2.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/SaltUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/Terminated.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/Terminator.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/AbstractElement.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/AbstractElementText.java15
-rw-r--r--src/net/sourceforge/plantuml/salt/element/Element.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementBorder.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementButton.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementDroplist.java7
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementEmpty.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementImage.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementLine.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java10
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementPyramid.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java10
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementTabBar.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementText.java10
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementTextField.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementTree.java64
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/Grid.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/Grid2.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/LeftFirst.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/ListWidth.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/Segment.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/Skeleton.java95
-rw-r--r--src/net/sourceforge/plantuml/salt/element/Skeleton2.java133
-rw-r--r--src/net/sourceforge/plantuml/salt/element/TableStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/TopFirst.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/element/WrappedElement.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java7
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java7
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java7
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java7
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java8
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java4
-rw-r--r--src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/AbstractEvent.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java15
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Delay.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Divider.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Englober.java214
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Event.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/EventWithDeactivate.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Grouping.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/GroupingType.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/HSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/InGroupable.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/InGroupableList.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/LifeEvent.java17
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/LifeEventType.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Message.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/MessageExo.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/MessageExoType.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/MessageNumber.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Newpage.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Note.java49
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/NotePosition.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Notes.java13
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Participant.java38
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/Reference.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java94
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java14
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java15
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate2.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoNewpage.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoactivate.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java6
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java71
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java54
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxEnd.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java75
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandFootbox.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandFootboxOld.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandHSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandIgnoreNewpage.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java6
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java11
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java15
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java6
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandSkin.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/command/CommandUrl.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Arrow.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndNoteBox.java10
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Constraint.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java72
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java34
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FileMaker.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Frontier.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierComplex.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStack.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStackImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDelayText.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElement.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElementLiveEvent.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalHSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalReference.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElement.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementElse.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementTail.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/InGroupablesStack.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Lazy.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/LifeDestroy.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java35
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/LifeSegmentVariation.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/LivingParticipantBox.java19
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/MessageArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/MessageExoArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/MessageSelfArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/NoteBox.java23
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/NotesBoxes.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Page.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/PageSplitter.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java9
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBoxSimple.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantRange.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Pushable.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Segment.java16
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java31
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramArea.java65
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java125
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Stairs.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java15
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java8
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java16
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/Bordered.java44
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java99
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java92
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java25
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java28
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java10
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/ComponentAdapter.java73
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java61
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java26
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/ElseTile.java62
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/EmptyTile.java93
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java125
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistory.java51
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistoryMode.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java119
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/HSpaceTile.java75
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/IntegerColored.java15
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java33
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java89
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxesDrawer.java124
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java78
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java57
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/MainTile.java91
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/MainTileAdapter.java98
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java40
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java20
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java176
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java13
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java262
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/Stairs2.java21
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/StairsPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java77
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/Tile.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileArguments.java44
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java69
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileMarged.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileUtils.java6
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithCallbackY.java41
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithUpdateStairs.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/UGraphicInterceptorTile.java4
-rw-r--r--src/net/sourceforge/plantuml/sequencediagram/teoz/YPositionedTile.java7
-rw-r--r--src/net/sourceforge/plantuml/skin/AbstractComponent.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java9
-rw-r--r--src/net/sourceforge/plantuml/skin/Area.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowBody.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowComponent.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowConfiguration.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowDecoration.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowDirection.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowDressing.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowHead.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ArrowPart.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/CircleInterface.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/Component.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/ComponentType.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/Context2D.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/GrayComponent.java8
-rw-r--r--src/net/sourceforge/plantuml/skin/ProtectedSkin.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/SimpleContext2D.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/Skin.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/SkinUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/StickMan.java7
-rw-r--r--src/net/sourceforge/plantuml/skin/VisibilityModifier.java17
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java51
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java17
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/AbstractComponentRoseArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseActiveLine.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseActor.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseBoundary.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseControl.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseDatabase.java8
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayLine.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayText.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseDestroy.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseDivider.java16
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseEntity.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingElse.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java19
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseLine.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseNewpage.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java7
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteBox.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteHexagonal.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseParticipant.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseReference.java7
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseSelfArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/ComponentRoseTitle.java4
-rw-r--r--src/net/sourceforge/plantuml/skin/rose/Rose.java37
-rw-r--r--src/net/sourceforge/plantuml/statediagram/StateDiagram.java11
-rw-r--r--src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java11
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java6
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandConcurrentState.java4
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java35
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java38
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandEndState.java4
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandHideEmptyDescription.java4
-rw-r--r--src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java13
-rw-r--r--src/net/sourceforge/plantuml/suggest/SuggestEngine.java132
-rw-r--r--src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java8
-rw-r--r--src/net/sourceforge/plantuml/suggest/SuggestEngineStatus.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/Variator.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorAddOneChar.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorAddOneCharBetweenWords.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorAddTwoChar.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorIteratorAdaptor.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorRemoveOneChar.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorSwapChar.java4
-rw-r--r--src/net/sourceforge/plantuml/suggest/VariatorSwapLetter.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/AbstractEntityImage.java8
-rw-r--r--src/net/sourceforge/plantuml/svek/AbstractExtremityFactory.java9
-rw-r--r--src/net/sourceforge/plantuml/svek/ArithmeticStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/ArithmeticStrategySum.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/Bibliotekon.java13
-rw-r--r--src/net/sourceforge/plantuml/svek/Boundary.java12
-rw-r--r--src/net/sourceforge/plantuml/svek/CircleAndArrow.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/CircleInterface2.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/Cluster.java61
-rw-r--r--src/net/sourceforge/plantuml/svek/ClusterDecoration.java307
-rw-r--r--src/net/sourceforge/plantuml/svek/ClusterPosition.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/ColorSequence.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/ConditionStyle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/Control.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/CucaDiagramFileMaker.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java66
-rw-r--r--src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2.java91
-rw-r--r--src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/DecorateEntityImage.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/DecorateEntityImage3.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/DecorateTextBlock.java136
-rw-r--r--src/net/sourceforge/plantuml/svek/DotMode.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/DotStringFactory.java29
-rw-r--r--src/net/sourceforge/plantuml/svek/EmptySvgException.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/EntityDomain.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/EntityImageProtected.java13
-rw-r--r--src/net/sourceforge/plantuml/svek/FrontierCalculator.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/GraphvizCrash.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/GroupPngMakerActivity.java13
-rw-r--r--src/net/sourceforge/plantuml/svek/GroupPngMakerState.java29
-rw-r--r--src/net/sourceforge/plantuml/svek/HeaderLayout.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/IEntityImage.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/IShapePseudo.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/InnerActivity.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/InnerStateAutonom.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/Line.java164
-rw-r--r--src/net/sourceforge/plantuml/svek/MinFinder.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/Oscillator.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/PackageStyle.java30
-rw-r--r--src/net/sourceforge/plantuml/svek/PointAndAngle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/PointDirected.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/RoundedContainer.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/Shape.java32
-rw-r--r--src/net/sourceforge/plantuml/svek/ShapePseudoImpl.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/ShapeType.java6
-rw-r--r--src/net/sourceforge/plantuml/svek/SingleStrategy.java9
-rw-r--r--src/net/sourceforge/plantuml/svek/SvekResult.java8
-rw-r--r--src/net/sourceforge/plantuml/svek/SvekUtils.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/TextBlockBackcolored.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/UGraphicForSnake.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/Untranslated.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/Extremity.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityArrow.java30
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityArrowAndCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleConnect.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleCross.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityDiamond.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactory.java6
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrow.java9
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrowAndCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleConnect.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleCross.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryDiamond.java10
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryParenthesis.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryPlus.java11
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactorySquarre.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryTriangle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis2.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityPlus.java19
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremitySquarre.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine1.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine2.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/ExtremityTriangle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircledMode.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/Circle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/ConnectedCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/ContainingEllipse.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageActivity.java12
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java19
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageAssociation.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageAssociationPoint.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageCircleEnd.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageCircleStart.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageClass.java75
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java30
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java (renamed from src/net/sourceforge/plantuml/svek/image/EntityImageComponent.java)55
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java (renamed from src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage2.java)25
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java6
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java12
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java12
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java17
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageNote.java64
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java13
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageObject.java42
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImagePseudoState.java10
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageState.java27
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageState2.java13
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageStateBorder.java12
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java17
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageSynchroBar.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageTips.java165
-rw-r--r--src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java17
-rw-r--r--src/net/sourceforge/plantuml/svek/image/Footprint.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/Opale.java7
-rw-r--r--src/net/sourceforge/plantuml/svek/image/SmallestEnclosingCircle.java4
-rw-r--r--src/net/sourceforge/plantuml/svek/image/YTransformer.java4
-rw-r--r--src/net/sourceforge/plantuml/svg/SvgData.java10
-rw-r--r--src/net/sourceforge/plantuml/svg/SvgGraphics.java58
-rw-r--r--src/net/sourceforge/plantuml/swing/AboutWindow.java4
-rw-r--r--src/net/sourceforge/plantuml/swing/ImageHelper.java4
-rw-r--r--src/net/sourceforge/plantuml/swing/ImageWindow2.java141
-rw-r--r--src/net/sourceforge/plantuml/swing/LicenseWindow.java4
-rw-r--r--src/net/sourceforge/plantuml/swing/MainWindow2.java14
-rw-r--r--src/net/sourceforge/plantuml/swing/ScrollablePicture.java4
-rw-r--r--src/net/sourceforge/plantuml/swing/SimpleLine2.java14
-rw-r--r--src/net/sourceforge/plantuml/swing/SpriteWindow.java8
-rw-r--r--src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java8
-rw-r--r--src/net/sourceforge/plantuml/syntax/SyntaxChecker.java6
-rw-r--r--src/net/sourceforge/plantuml/syntax/SyntaxResult.java14
-rw-r--r--src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java4
-rw-r--r--src/net/sourceforge/plantuml/telnet/TelnetServer.java4
-rw-r--r--src/net/sourceforge/plantuml/tikz/TikzGraphics.java153
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/AbstractPlacementStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/AbstractShadowable.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/AbstractUGraphic.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java7
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ClipContainer.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ColorChangerMonochrome.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ColorMapper.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ColorMapperIdentity.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ColorMapperMonochrome.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ColorMapperTransparentWrapper.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/FontChecker.java13
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java46
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/InflaterSet.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/LimitFinder.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/MinMax.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/MinMaxMutable.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategy.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategyVisibility.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1X2.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1Y2Y3.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Center.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Left.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/Scalable.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ShadowManager.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/Shadowable.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/Slot.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/SlotFinder.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/SlotSet.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/TextBlockInEllipse.java7
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UAntiAliasing.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UCenteredCharacter.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UChange.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UChangeBackColor.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UChangeColor.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UClip.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UDriver.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UEllipse.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UEmpty.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UFont.java9
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UFontContext.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UFontUser.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphic.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphic2.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java15
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicFilter.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicStencil.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UHidden.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UImage.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UImageSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ULayoutGroup.java22
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/ULine.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UMotif.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UParam.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UParamNull.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UPath.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UPattern.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UPixel.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UPolygon.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/URectangle.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UScale.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/USegment.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/USegmentType.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UShape.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UStroke.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UText.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/UTranslate.java9
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/arc/ExtendedGeneralPath.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/arc/ExtendedPathIterator.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java194
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverCenteredCharacterEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverDotPathEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverEllipseEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverImageEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverLineEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverPathEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverPolygonEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverRectangleEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverCenteredCharacterG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverDotPathG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2dLegacy.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathOldG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverPixelG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverPolygonG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverShadowedG2d.java6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/HandJiggle.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UDotPathHand.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UEllipseHand.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/ULineHand.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/UPolygonHand.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/hand/URectangleHand.java6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/html5/DriverLineHtml5.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/html5/DriverNopHtml5.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/html5/DriverRectangleHtml5.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/html5/Html5Drawer.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSprites.java94
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSpritesFactory.java52
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java118
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/Sprite.java (renamed from src/net/sourceforge/plantuml/ugraphic/Sprite.java)6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java (renamed from src/net/sourceforge/plantuml/ugraphic/SpriteGrayLevel.java)15
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteImage.java (renamed from src/net/sourceforge/plantuml/ugraphic/SpriteImage.java)38
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java (renamed from src/net/sourceforge/plantuml/ugraphic/SpriteMonochrome.java)14
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java (renamed from src/net/sourceforge/plantuml/ugraphic/SpriteUtils.java)8
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverCenteredCharacterSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverDotPathSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverImagePng.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverImageSvgSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverPathSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverPolygonSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverTextAsPathSvg.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/DriverTextSvg.java15
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java25
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverLineTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverNoneTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java6
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverDotPathVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverLineVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverNoneVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverPolygonVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverRectangleVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverTextVdx.java7
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/DriverUPathVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/VisioGraphics.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/VisioLine.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/VisioRectangle.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/VisioShape.java4
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/visio/VisioText.java4
-rw-r--r--src/net/sourceforge/plantuml/utils/CharHidder.java8
-rw-r--r--src/net/sourceforge/plantuml/utils/MathUtils.java12
-rw-r--r--src/net/sourceforge/plantuml/utils/StartUtils.java35
-rw-r--r--src/net/sourceforge/plantuml/utils/UniqueSequence.java4
-rw-r--r--src/net/sourceforge/plantuml/version/IteratorCounter2.java (renamed from src/net/sourceforge/plantuml/preproc/StackReadLine.java)27
-rw-r--r--src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java86
-rw-r--r--src/net/sourceforge/plantuml/version/License.java15
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemLicense.java6
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemLicenseFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemVersion.java17
-rw-r--r--src/net/sourceforge/plantuml/version/PSystemVersionFactory.java4
-rw-r--r--src/net/sourceforge/plantuml/version/Version.java28
-rw-r--r--src/net/sourceforge/plantuml/version/out.pngbin0 -> 1761 bytes
-rw-r--r--src/net/sourceforge/plantuml/webp/BoolDecoder.java169
-rw-r--r--src/net/sourceforge/plantuml/webp/DeltaQ.java56
-rw-r--r--src/net/sourceforge/plantuml/webp/Globals.java854
-rw-r--r--src/net/sourceforge/plantuml/webp/IDCT.java172
-rw-r--r--src/net/sourceforge/plantuml/webp/LoopFilter.java656
-rw-r--r--src/net/sourceforge/plantuml/webp/MacroBlock.java798
-rw-r--r--src/net/sourceforge/plantuml/webp/Portrait.java79
-rw-r--r--src/net/sourceforge/plantuml/webp/Portraits.java104
-rw-r--r--src/net/sourceforge/plantuml/webp/Segment.java62
-rw-r--r--src/net/sourceforge/plantuml/webp/SegmentQuant.java137
-rw-r--r--src/net/sourceforge/plantuml/webp/SegmentQuants.java132
-rw-r--r--src/net/sourceforge/plantuml/webp/SubBlock.java651
-rw-r--r--src/net/sourceforge/plantuml/webp/VP8Decoder.java191
-rw-r--r--src/net/sourceforge/plantuml/webp/VP8Frame.java1090
-rw-r--r--src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java4
-rw-r--r--src/net/sourceforge/plantuml/xmi/IXmiClassDiagram.java4
-rw-r--r--src/net/sourceforge/plantuml/xmi/XmiClassDiagramArgo.java8
-rw-r--r--src/net/sourceforge/plantuml/xmi/XmiClassDiagramStandard.java8
-rw-r--r--src/net/sourceforge/plantuml/xmi/XmiClassDiagramStar.java8
-rw-r--r--src/sprites/archimate/access.pngbin0 -> 210 bytes
-rw-r--r--src/sprites/archimate/activity.pngbin0 -> 214 bytes
-rw-r--r--src/sprites/archimate/actor.pngbin0 -> 247 bytes
-rw-r--r--src/sprites/archimate/aggregation.pngbin0 -> 224 bytes
-rw-r--r--src/sprites/archimate/application-collaboration.pngbin0 -> 251 bytes
-rw-r--r--src/sprites/archimate/application-component.pngbin0 -> 246 bytes
-rw-r--r--src/sprites/archimate/application-data-object.pngbin0 -> 215 bytes
-rw-r--r--src/sprites/archimate/application-function.pngbin0 -> 266 bytes
-rw-r--r--src/sprites/archimate/application-interaction.pngbin0 -> 258 bytes
-rw-r--r--src/sprites/archimate/application-interface.pngbin0 -> 247 bytes
-rw-r--r--src/sprites/archimate/application-service.pngbin0 -> 221 bytes
-rw-r--r--src/sprites/archimate/assessment-filled.pngbin0 -> 249 bytes
-rw-r--r--src/sprites/archimate/assessment.pngbin0 -> 226 bytes
-rw-r--r--src/sprites/archimate/assignment.pngbin0 -> 203 bytes
-rw-r--r--src/sprites/archimate/association.pngbin0 -> 191 bytes
-rw-r--r--src/sprites/archimate/business-activity.pngbin0 -> 243 bytes
-rw-r--r--src/sprites/archimate/business-actor.pngbin0 -> 257 bytes
-rw-r--r--src/sprites/archimate/business-collaboration.pngbin0 -> 251 bytes
-rw-r--r--src/sprites/archimate/business-contract.pngbin0 -> 215 bytes
-rw-r--r--src/sprites/archimate/business-event.pngbin0 -> 252 bytes
-rw-r--r--src/sprites/archimate/business-function.pngbin0 -> 266 bytes
-rw-r--r--src/sprites/archimate/business-interaction.pngbin0 -> 258 bytes
-rw-r--r--src/sprites/archimate/business-interface.pngbin0 -> 247 bytes
-rw-r--r--src/sprites/archimate/business-location.pngbin0 -> 256 bytes
-rw-r--r--src/sprites/archimate/business-meaning.pngbin0 -> 279 bytes
-rw-r--r--src/sprites/archimate/business-object.pngbin0 -> 215 bytes
-rw-r--r--src/sprites/archimate/business-process.pngbin0 -> 249 bytes
-rw-r--r--src/sprites/archimate/business-product.pngbin0 -> 232 bytes
-rw-r--r--src/sprites/archimate/business-representation.pngbin0 -> 231 bytes
-rw-r--r--src/sprites/archimate/business-role.pngbin0 -> 250 bytes
-rw-r--r--src/sprites/archimate/business-service.pngbin0 -> 221 bytes
-rw-r--r--src/sprites/archimate/business-value.pngbin0 -> 254 bytes
-rw-r--r--src/sprites/archimate/collaboration.pngbin0 -> 232 bytes
-rw-r--r--src/sprites/archimate/communication-path.pngbin0 -> 232 bytes
-rw-r--r--src/sprites/archimate/component.pngbin0 -> 231 bytes
-rw-r--r--src/sprites/archimate/composition.pngbin0 -> 216 bytes
-rw-r--r--src/sprites/archimate/constraint-filled.pngbin0 -> 246 bytes
-rw-r--r--src/sprites/archimate/constraint.pngbin0 -> 226 bytes
-rw-r--r--src/sprites/archimate/contract.pngbin0 -> 211 bytes
-rw-r--r--src/sprites/archimate/deliverable-filled.pngbin0 -> 240 bytes
-rw-r--r--src/sprites/archimate/device.pngbin0 -> 221 bytes
-rw-r--r--src/sprites/archimate/driver-filled.pngbin0 -> 306 bytes
-rw-r--r--src/sprites/archimate/driver.pngbin0 -> 253 bytes
-rw-r--r--src/sprites/archimate/event.pngbin0 -> 231 bytes
-rw-r--r--src/sprites/archimate/flow.pngbin0 -> 192 bytes
-rw-r--r--src/sprites/archimate/function.pngbin0 -> 249 bytes
-rw-r--r--src/sprites/archimate/gap-filled.pngbin0 -> 263 bytes
-rw-r--r--src/sprites/archimate/gap.pngbin0 -> 237 bytes
-rw-r--r--src/sprites/archimate/goal-filled.pngbin0 -> 298 bytes
-rw-r--r--src/sprites/archimate/goal.pngbin0 -> 255 bytes
-rw-r--r--src/sprites/archimate/influence.pngbin0 -> 182 bytes
-rw-r--r--src/sprites/archimate/interaction.pngbin0 -> 231 bytes
-rw-r--r--src/sprites/archimate/interface-required.pngbin0 -> 217 bytes
-rw-r--r--src/sprites/archimate/interface-symmetric.pngbin0 -> 220 bytes
-rw-r--r--src/sprites/archimate/interface.pngbin0 -> 220 bytes
-rw-r--r--src/sprites/archimate/junction-and.pngbin0 -> 235 bytes
-rw-r--r--src/sprites/archimate/junction-or.pngbin0 -> 242 bytes
-rw-r--r--src/sprites/archimate/junction.pngbin0 -> 236 bytes
-rw-r--r--src/sprites/archimate/location.pngbin0 -> 239 bytes
-rw-r--r--src/sprites/archimate/meaning.pngbin0 -> 260 bytes
-rw-r--r--src/sprites/archimate/network.pngbin0 -> 248 bytes
-rw-r--r--src/sprites/archimate/node.pngbin0 -> 240 bytes
-rw-r--r--src/sprites/archimate/object.pngbin0 -> 211 bytes
-rw-r--r--src/sprites/archimate/plateau.pngbin0 -> 210 bytes
-rw-r--r--src/sprites/archimate/principle-filled.pngbin0 -> 233 bytes
-rw-r--r--src/sprites/archimate/principle.pngbin0 -> 223 bytes
-rw-r--r--src/sprites/archimate/process.pngbin0 -> 228 bytes
-rw-r--r--src/sprites/archimate/product.pngbin0 -> 216 bytes
-rw-r--r--src/sprites/archimate/realisation.pngbin0 -> 173 bytes
-rw-r--r--src/sprites/archimate/representation.pngbin0 -> 223 bytes
-rw-r--r--src/sprites/archimate/requirement-filled.pngbin0 -> 241 bytes
-rw-r--r--src/sprites/archimate/requirement.pngbin0 -> 209 bytes
-rw-r--r--src/sprites/archimate/role.pngbin0 -> 230 bytes
-rw-r--r--src/sprites/archimate/service.pngbin0 -> 212 bytes
-rw-r--r--src/sprites/archimate/specialisation.pngbin0 -> 225 bytes
-rw-r--r--src/sprites/archimate/stakeholder-filled.pngbin0 -> 251 bytes
-rw-r--r--src/sprites/archimate/system-software.pngbin0 -> 249 bytes
-rw-r--r--src/sprites/archimate/technology-artifact.pngbin0 -> 240 bytes
-rw-r--r--src/sprites/archimate/technology-communication-path.pngbin0 -> 249 bytes
-rw-r--r--src/sprites/archimate/technology-device.pngbin0 -> 241 bytes
-rw-r--r--src/sprites/archimate/technology-function.pngbin0 -> 274 bytes
-rw-r--r--src/sprites/archimate/technology-infra-interface.pngbin0 -> 248 bytes
-rw-r--r--src/sprites/archimate/technology-infra-service.pngbin0 -> 224 bytes
-rw-r--r--src/sprites/archimate/technology-network.pngbin0 -> 262 bytes
-rw-r--r--src/sprites/archimate/technology-node.pngbin0 -> 256 bytes
-rw-r--r--src/sprites/archimate/technology-system-software.pngbin0 -> 284 bytes
-rw-r--r--src/sprites/archimate/triggering.pngbin0 -> 217 bytes
-rw-r--r--src/sprites/archimate/used-by.pngbin0 -> 215 bytes
-rw-r--r--src/sprites/archimate/value.pngbin0 -> 230 bytes
-rw-r--r--src/sprites/archimate/workpackage-filled.pngbin0 -> 227 bytes
1755 files changed, 22807 insertions, 9568 deletions
diff --git a/COPYING b/COPYING
index 8f0d396..14f7482 100644
--- a/COPYING
+++ b/COPYING
@@ -2,7 +2,7 @@
PlantUML : a free UML diagram generator
========================================================================
-(C) Copyright 2009-2014, Arnaud Roques
+(C) Copyright 2009-2017, Arnaud Roques
PlantUML is free software; you can redistribute it and/or modify it under the
terms of the MIT License.
diff --git a/build.xml b/build.xml
index 87e1cc8..a4c0fc2 100644
--- a/build.xml
+++ b/build.xml
@@ -20,7 +20,7 @@
<target name="compile">
<delete dir="build" />
<mkdir dir="build" />
- <javac target="1.6" srcdir="src" destdir="build" />
+ <javac target="1.6" srcdir="src" destdir="build" debug="on" />
<copy file="src/net/sourceforge/plantuml/version/logo.png"
todir="build/net/sourceforge/plantuml/version" />
<copy file="src/net/sourceforge/plantuml/version/favicon.png"
@@ -41,6 +41,11 @@
<include name="*.png" />
</fileset>
</copy>
+ <copy todir="build/sprites/archimate">
+ <fileset dir="src/sprites/archimate">
+ <include name="*.png" />
+ </fileset>
+ </copy>
</target>
<target name="dist" depends="compile">
@@ -49,6 +54,8 @@
<jar jarfile="plantuml.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
+ <attribute name="SplashScreen-Image" value="net/sourceforge/plantuml/version/logo.png" />
+ <attribute name="Class-Path" value="batik-all-1.7.jar fop.jar" />
</manifest>
</jar>
<delete dir="build" />
diff --git a/src/net/sourceforge/plantuml/AbstractPSystem.java b/src/net/sourceforge/plantuml/AbstractPSystem.java
index c9d1d9a..6013cc1 100644
--- a/src/net/sourceforge/plantuml/AbstractPSystem.java
+++ b/src/net/sourceforge/plantuml/AbstractPSystem.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,16 +34,19 @@
*/
package net.sourceforge.plantuml;
-import java.util.Date;
import java.util.List;
import java.util.Properties;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.ProtectedCommand;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.version.License;
import net.sourceforge.plantuml.version.Version;
@@ -88,11 +91,11 @@ public abstract class AbstractPSystem implements Diagram {
return 1;
}
- public Display getTitle() {
+ public DisplayPositionned getTitle() {
if (source == null) {
- return Display.empty();
+ return new DisplayPositionned(Display.empty(), HorizontalAlignment.CENTER, VerticalAlignment.TOP);
}
- return source.getTitle();
+ return new DisplayPositionned(source.getTitle(), HorizontalAlignment.CENTER, VerticalAlignment.TOP);
}
public String getWarningOrError() {
@@ -106,11 +109,11 @@ public abstract class AbstractPSystem implements Diagram {
return true;
}
- public CommandExecutionResult executeCommand(Command cmd, List<String> lines) {
+ public CommandExecutionResult executeCommand(Command cmd, BlocLines lines) {
cmd = new ProtectedCommand(cmd);
return cmd.execute(this, lines);
}
-
+
public boolean hasUrl() {
return false;
}
diff --git a/src/net/sourceforge/plantuml/AlignParam.java b/src/net/sourceforge/plantuml/AlignParam.java
index cc021c4..f004438 100644
--- a/src/net/sourceforge/plantuml/AlignParam.java
+++ b/src/net/sourceforge/plantuml/AlignParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/AnimatedGifEncoder.java b/src/net/sourceforge/plantuml/AnimatedGifEncoder.java
index ab6ae7d..4cae3df 100644
--- a/src/net/sourceforge/plantuml/AnimatedGifEncoder.java
+++ b/src/net/sourceforge/plantuml/AnimatedGifEncoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -142,7 +142,6 @@ public class AnimatedGifEncoder {
*
* @param iter
* int number of iterations.
- * @return
*/
public void setRepeat(int iter) {
if (iter >= 0) {
@@ -264,7 +263,6 @@ public class AnimatedGifEncoder {
*
* @param quality
* int greater than 0.
- * @return
*/
public void setQuality(int quality) {
if (quality < 1)
diff --git a/src/net/sourceforge/plantuml/Annotated.java b/src/net/sourceforge/plantuml/Annotated.java
new file mode 100644
index 0000000..992eaf7
--- /dev/null
+++ b/src/net/sourceforge/plantuml/Annotated.java
@@ -0,0 +1,51 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+
+public interface Annotated {
+
+ public DisplayPositionned getTitle();
+
+ public DisplayPositionned getCaption();
+
+ public DisplayPositionned getLegend();
+
+ public DisplayPositionned getHeader();
+
+ public DisplayPositionned getFooter();
+
+}
diff --git a/src/net/sourceforge/plantuml/AnnotatedWorker.java b/src/net/sourceforge/plantuml/AnnotatedWorker.java
new file mode 100644
index 0000000..732ac8d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/AnnotatedWorker.java
@@ -0,0 +1,135 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.svek.DecorateEntityImage;
+import net.sourceforge.plantuml.svek.TextBlockBackcolored;
+
+public class AnnotatedWorker {
+
+ private final Annotated annotated;
+ private final ISkinParam skinParam;
+
+ public AnnotatedWorker(Annotated annotated, ISkinParam skinParam) {
+ this.annotated = annotated;
+ this.skinParam = skinParam;
+
+ }
+
+ public TextBlockBackcolored addAdd(TextBlock result) {
+ result = addLegend(result);
+ result = addTitle(result);
+ result = addCaption(result);
+ result = addHeaderAndFooter(result);
+ return (TextBlockBackcolored) result;
+ }
+
+ private TextBlock addLegend(TextBlock original) {
+ if (DisplayPositionned.isNull(annotated.getLegend())) {
+ return original;
+ }
+ final TextBlock text = EntityImageLegend.create(annotated.getLegend().getDisplay(), getSkinParam());
+
+ return DecorateEntityImage.add(original, text, annotated.getLegend().getHorizontalAlignment(), annotated
+ .getLegend().getVerticalAlignment());
+ }
+
+ private ISkinParam getSkinParam() {
+ return skinParam;
+ }
+
+ private TextBlock addCaption(TextBlock original) {
+ if (DisplayPositionned.isNull(annotated.getCaption())) {
+ return original;
+ }
+ final TextBlock text = getCaption();
+
+ return DecorateEntityImage.addBottom(original, text, HorizontalAlignment.CENTER);
+ }
+
+ public TextBlock getCaption() {
+ if (DisplayPositionned.isNull(annotated.getCaption())) {
+ return TextBlockUtils.empty(0, 0);
+ }
+ return annotated
+ .getCaption()
+ .getDisplay()
+ .create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null), HorizontalAlignment.CENTER,
+ getSkinParam());
+ }
+
+ private TextBlock addTitle(TextBlock original) {
+ if (DisplayPositionned.isNull(annotated.getTitle())) {
+ return original;
+ }
+ final TextBlock text = annotated
+ .getTitle()
+ .getDisplay()
+ .create(new FontConfiguration(getSkinParam(), FontParam.TITLE, null), HorizontalAlignment.CENTER,
+ getSkinParam());
+
+ return DecorateEntityImage.addTop(original, text, HorizontalAlignment.CENTER);
+ // return new DecorateTextBlock(original, text, HorizontalAlignment.CENTER);
+ }
+
+ private TextBlock addHeaderAndFooter(TextBlock original) {
+ if (DisplayPositionned.isNull(annotated.getFooter()) && DisplayPositionned.isNull(annotated.getHeader())) {
+ return original;
+ }
+ final TextBlock textFooter = DisplayPositionned.isNull(annotated.getFooter()) ? null : annotated
+ .getFooter()
+ .getDisplay()
+ .create(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null),
+ annotated.getFooter().getHorizontalAlignment(), getSkinParam());
+ final TextBlock textHeader = DisplayPositionned.isNull(annotated.getHeader()) ? null : annotated
+ .getHeader()
+ .getDisplay()
+ .create(new FontConfiguration(getSkinParam(), FontParam.HEADER, null),
+ annotated.getHeader().getHorizontalAlignment(), getSkinParam());
+
+ // return new DecorateTextBlock(original, textHeader, annotated.getHeader().getHorizontalAlignment(),
+ // textFooter,
+ // annotated.getFooter().getHorizontalAlignment());
+ return new DecorateEntityImage(original, textHeader, annotated.getHeader().getHorizontalAlignment(),
+ textFooter, annotated.getFooter().getHorizontalAlignment());
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/BasicEnsureVisible.java b/src/net/sourceforge/plantuml/BasicEnsureVisible.java
index b7d7997..6d69539 100644
--- a/src/net/sourceforge/plantuml/BasicEnsureVisible.java
+++ b/src/net/sourceforge/plantuml/BasicEnsureVisible.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/BlockUml.java b/src/net/sourceforge/plantuml/BlockUml.java
index 067267b..acf4956 100644
--- a/src/net/sourceforge/plantuml/BlockUml.java
+++ b/src/net/sourceforge/plantuml/BlockUml.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,30 +45,54 @@ import net.sourceforge.plantuml.core.Diagram;
public class BlockUml {
- private final List<? extends CharSequence> data;
+ private final List<CharSequence2> data;
private final int startLine;
private Diagram system;
private static final Pattern patternFilename = MyPattern.cmpile("^@start[^%s{}%g]+[%s{][%s%g]*([^%g]*?)[%s}%g]*$");
BlockUml(String... strings) {
- this(Arrays.asList(strings), 0);
+ this(convert(strings), 0);
}
- public BlockUml(List<? extends CharSequence> strings, int startLine) {
+ public String getFlashData() {
+ final StringBuilder sb = new StringBuilder();
+ for (CharSequence2 line : data) {
+ sb.append(line);
+ sb.append('\r');
+ sb.append('\n');
+ }
+ return sb.toString();
+ }
+
+ public static List<CharSequence2> convert(String... strings) {
+ return convert(Arrays.asList(strings));
+ }
+
+ public static List<CharSequence2> convert(List<String> strings) {
+ final List<CharSequence2> result = new ArrayList<CharSequence2>();
+ LineLocationImpl location = new LineLocationImpl("block", null);
+ for (String s : strings) {
+ location = location.oneLineRead();
+ result.add(new CharSequence2Impl(s, location));
+ }
+ return result;
+ }
+
+ public BlockUml(List<CharSequence2> strings, int startLine) {
this.startLine = startLine;
- final String s0 = strings.get(0).toString().trim();
+ final CharSequence2 s0 = strings.get(0).trin();
if (s0.startsWith("@start") == false) {
throw new IllegalArgumentException();
}
- this.data = new ArrayList<CharSequence>(strings);
+ this.data = new ArrayList<CharSequence2>(strings);
}
- public String getFilename() {
+ public String getFileOrDirname() {
if (OptionFlags.getInstance().isWord()) {
return null;
}
- final Matcher m = patternFilename.matcher(data.get(0).toString().trim());
+ final Matcher m = patternFilename.matcher(StringUtils.trin(data.get(0).toString()));
final boolean ok = m.find();
if (ok == false) {
return null;
@@ -84,6 +108,9 @@ public class BlockUml {
return null;
}
}
+ if (result.startsWith("file://")) {
+ result = result.substring("file://".length());
+ }
return result;
}
@@ -98,4 +125,8 @@ public class BlockUml {
return startLine;
}
+ public final List<CharSequence2> getData() {
+ return data;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/BlockUmlBuilder.java b/src/net/sourceforge/plantuml/BlockUmlBuilder.java
index 8b325a1..7d287e9 100644
--- a/src/net/sourceforge/plantuml/BlockUmlBuilder.java
+++ b/src/net/sourceforge/plantuml/BlockUmlBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,12 +38,14 @@ import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.sourceforge.plantuml.preproc.Defines;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
import net.sourceforge.plantuml.preproc.Preprocessor;
import net.sourceforge.plantuml.preproc.ReadLineReader;
import net.sourceforge.plantuml.preproc.UncommentReadLine;
@@ -52,31 +54,36 @@ import net.sourceforge.plantuml.utils.StartUtils;
final public class BlockUmlBuilder {
private final List<BlockUml> blocks = new ArrayList<BlockUml>();
- private final Set<File> usedFiles = new HashSet<File>();
+ private Set<FileWithSuffix> usedFiles = new HashSet<FileWithSuffix>();
private final UncommentReadLine reader2;
- public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader reader, File newCurrentDir)
- throws IOException {
+ public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader reader, File newCurrentDir,
+ String desc) throws IOException {
Preprocessor includer = null;
try {
- reader2 = new UncommentReadLine(new ReadLineReader(reader));
- includer = new Preprocessor(reader2, charset, defines, usedFiles, newCurrentDir);
+ reader2 = new UncommentReadLine(new ReadLineReader(reader, desc));
+ includer = new Preprocessor(reader2, charset, defines, newCurrentDir);
init(includer, config);
} finally {
if (includer != null) {
includer.close();
+ usedFiles = includer.getFilesUsed();
}
}
}
+ public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader reader) throws IOException {
+ this(config, charset, defines, reader, null, null);
+ }
+
private void init(Preprocessor includer, List<String> config) throws IOException {
- String s = null;
- List<String> current = null;
+ CharSequence2 s = null;
+ List<CharSequence2> current2 = null;
boolean paused = false;
int startLine = 0;
while ((s = includer.readLine()) != null) {
if (StartUtils.isArobaseStartDiagram(s)) {
- current = new ArrayList<String>();
+ current2 = new ArrayList<CharSequence2>();
paused = false;
startLine = includer.getLineNumber();
}
@@ -84,12 +91,12 @@ final public class BlockUmlBuilder {
paused = true;
reader2.setPaused(true);
}
- if (current != null && paused == false) {
- current.add(s);
+ if (current2 != null && paused == false) {
+ current2.add(s);
} else if (paused) {
- final String append = StartUtils.getPossibleAppend(s);
+ final CharSequence2 append = StartUtils.getPossibleAppend(s);
if (append != null) {
- current.add(append);
+ current2.add(append);
}
}
@@ -97,20 +104,28 @@ final public class BlockUmlBuilder {
paused = false;
reader2.setPaused(false);
}
- if (StartUtils.isArobaseEndDiagram(s) && current != null) {
- current.addAll(1, config);
- blocks.add(new BlockUml(current, startLine));
- current = null;
+ if (StartUtils.isArobaseEndDiagram(s) && current2 != null) {
+ current2.addAll(1, convert(config, s.getLocation()));
+ blocks.add(new BlockUml(current2, startLine));
+ current2 = null;
reader2.setPaused(false);
}
}
}
+ private Collection<CharSequence2> convert(List<String> config, LineLocation location) {
+ final List<CharSequence2> result = new ArrayList<CharSequence2>();
+ for (String s : config) {
+ result.add(new CharSequence2Impl(s, location));
+ }
+ return result;
+ }
+
public List<BlockUml> getBlockUmls() {
return Collections.unmodifiableList(blocks);
}
- public final Set<File> getIncludedFiles() {
+ public final Set<FileWithSuffix> getIncludedFiles() {
return Collections.unmodifiableSet(usedFiles);
}
diff --git a/src/net/sourceforge/plantuml/CMapData.java b/src/net/sourceforge/plantuml/CMapData.java
index 91b8e30..937c8ee 100644
--- a/src/net/sourceforge/plantuml/CMapData.java
+++ b/src/net/sourceforge/plantuml/CMapData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -65,7 +65,9 @@ public class CMapData {
appendString("\" href=\"");
appendString(url.getUrl());
appendString("\" title=\"");
- appendString(url.getTooltip());
+ final String tooltip = url.getTooltip().replaceAll("\\\\n", "\n").replaceAll("&", "&#38;")
+ .replaceAll("\"", "&#34;").replaceAll("\'", "&#39;");
+ appendString(tooltip);
appendString("\" alt=\"\" coords=\"");
appendString(url.getCoords(scale));
appendString("\"/>");
diff --git a/src/net/sourceforge/plantuml/CharSequence2.java b/src/net/sourceforge/plantuml/CharSequence2.java
new file mode 100644
index 0000000..11f46d9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/CharSequence2.java
@@ -0,0 +1,53 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+public interface CharSequence2 extends CharSequence {
+
+ public int length();
+
+ public char charAt(int index);
+
+ public CharSequence2 subSequence(int start, int end);
+
+ public String toString2();
+
+ public LineLocation getLocation();
+
+ public CharSequence2 trin();
+
+ public boolean startsWith(String string);
+
+}
diff --git a/src/net/sourceforge/plantuml/CharSequence2Impl.java b/src/net/sourceforge/plantuml/CharSequence2Impl.java
new file mode 100644
index 0000000..a660066
--- /dev/null
+++ b/src/net/sourceforge/plantuml/CharSequence2Impl.java
@@ -0,0 +1,91 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+public class CharSequence2Impl implements CharSequence2 {
+
+ private final CharSequence s;
+ private final LineLocation location;
+
+ public CharSequence2Impl(CharSequence s, LineLocation location) {
+ if (s == null) {
+ throw new IllegalArgumentException();
+ }
+ this.s = s;
+ this.location = location;
+ }
+
+ public static CharSequence2 errorPreprocessor(CharSequence s, LineLocation lineLocation) {
+ return new CharSequence2Impl(s, lineLocation);
+ }
+
+ public int length() {
+ return s.length();
+ }
+
+ public char charAt(int index) {
+ return s.charAt(index);
+ }
+
+ public CharSequence2 subSequence(int start, int end) {
+ return new CharSequence2Impl(s.subSequence(start, end), location);
+ }
+
+ public CharSequence toCharSequence() {
+ return s;
+ }
+
+ @Override
+ public String toString() {
+ return s.toString();
+ }
+
+ public String toString2() {
+ return s.toString();
+ }
+
+ public LineLocation getLocation() {
+ return location;
+ }
+
+ public CharSequence2 trin() {
+ return new CharSequence2Impl(StringUtils.trin(s.toString()), location);
+ }
+
+ public boolean startsWith(String start) {
+ return s.toString().startsWith(start);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ColorParam.java b/src/net/sourceforge/plantuml/ColorParam.java
index 9d04d94..22fcc84 100644
--- a/src/net/sourceforge/plantuml/ColorParam.java
+++ b/src/net/sourceforge/plantuml/ColorParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,102 +36,106 @@ package net.sourceforge.plantuml;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public enum ColorParam {
- background(HtmlColorUtils.WHITE),
+ background(HtmlColorUtils.WHITE, ColorType.BACK),
hyperlink(HtmlColorUtils.BLUE),
- activityBackground(HtmlColorUtils.MY_YELLOW),
- activityBorder(HtmlColorUtils.MY_RED),
+ activityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ activityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
activityStart(HtmlColorUtils.BLACK),
activityEnd(HtmlColorUtils.BLACK),
activityBar(HtmlColorUtils.BLACK),
- activityArrow(HtmlColorUtils.MY_RED),
+ activityArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
+ swimlaneBorder(HtmlColorUtils.BLACK),
- usecaseBorder(HtmlColorUtils.MY_RED),
- usecaseBackground(HtmlColorUtils.MY_YELLOW),
- usecaseArrow(HtmlColorUtils.MY_RED),
+ usecaseBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ usecaseBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ usecaseArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
- objectBackground(HtmlColorUtils.MY_YELLOW),
- objectBorder(HtmlColorUtils.MY_RED),
- objectArrow(HtmlColorUtils.MY_RED),
+ objectBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ objectBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ objectArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
- classHeaderBackground(null),
- classBackground(HtmlColorUtils.MY_YELLOW),
- classBorder(HtmlColorUtils.MY_RED),
+ classHeaderBackground(null, ColorType.BACK),
+ classBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ classBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
stereotypeCBackground(HtmlColorUtils.COL_ADD1B2),
stereotypeABackground(HtmlColorUtils.COL_A9DCDF),
stereotypeIBackground(HtmlColorUtils.COL_B4A7E5),
stereotypeEBackground(HtmlColorUtils.COL_EB937F),
- classArrow(HtmlColorUtils.MY_RED),
+ classArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
- packageBackground(HtmlColorUtils.MY_YELLOW),
- packageBorder(HtmlColorUtils.BLACK),
+ packageBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ packageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- partitionBackground(HtmlColorUtils.MY_YELLOW),
- partitionBorder(HtmlColorUtils.BLACK),
+ partitionBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ partitionBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- componentBackground(HtmlColorUtils.MY_YELLOW),
- componentBorder(HtmlColorUtils.MY_RED),
- interfaceBackground(HtmlColorUtils.MY_YELLOW),
- interfaceBorder(HtmlColorUtils.MY_RED),
- // componentArrow,
+ componentBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ componentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ interfaceBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ interfaceBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ componentArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
- stateBackground(HtmlColorUtils.MY_YELLOW),
- stateBorder(HtmlColorUtils.MY_RED),
- stateArrow(HtmlColorUtils.MY_RED),
+ stateBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ stateBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ stateArrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
stateStart(HtmlColorUtils.BLACK),
stateEnd(HtmlColorUtils.BLACK),
- noteBackground(HtmlColorUtils.COL_FBFB77, true),
- noteBorder(HtmlColorUtils.MY_RED),
+ noteBackground(HtmlColorUtils.COL_FBFB77, true, ColorType.BACK),
+ noteBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- legendBackground(HtmlColorUtils.COL_DDDDDD, true),
- legendBorder(HtmlColorUtils.BLACK),
+ legendBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
+ legendBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- actorBackground(HtmlColorUtils.MY_YELLOW, true),
- actorBorder(HtmlColorUtils.MY_RED),
- participantBackground(HtmlColorUtils.MY_YELLOW, true),
- participantBorder(HtmlColorUtils.MY_RED),
- sequenceGroupBorder(HtmlColorUtils.BLACK),
- sequenceGroupBackground(HtmlColorUtils.COL_EEEEEE, true),
- sequenceReferenceBorder(HtmlColorUtils.BLACK),
- sequenceReferenceHeaderBackground(HtmlColorUtils.COL_EEEEEE, true),
- sequenceReferenceBackground(HtmlColorUtils.WHITE, true),
- sequenceDividerBackground(HtmlColorUtils.COL_EEEEEE, true),
- sequenceLifeLineBackground(HtmlColorUtils.WHITE, true),
- sequenceLifeLineBorder(HtmlColorUtils.MY_RED),
+ actorBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
+ actorBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ participantBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
+ participantBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ sequenceGroupBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ sequenceGroupBackground(HtmlColorUtils.COL_EEEEEE, true, ColorType.BACK),
+ sequenceGroupBodyBackground(HtmlColorUtils.RED, true, ColorType.BACK),
+ sequenceReferenceBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ sequenceReferenceHeaderBackground(HtmlColorUtils.COL_EEEEEE, true, ColorType.BACK),
+ sequenceReferenceBackground(HtmlColorUtils.WHITE, true, ColorType.BACK),
+ sequenceDividerBackground(HtmlColorUtils.COL_EEEEEE, true, ColorType.BACK),
+ sequenceDividerBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ sequenceLifeLineBackground(HtmlColorUtils.WHITE, true, ColorType.BACK),
+ sequenceLifeLineBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
sequenceArrow(HtmlColorUtils.MY_RED),
- sequenceBoxBorder(HtmlColorUtils.MY_RED),
- sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true),
+ sequenceBoxBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
- artifactBackground(HtmlColorUtils.MY_YELLOW),
- artifactBorder(HtmlColorUtils.MY_RED),
- cloudBackground(HtmlColorUtils.MY_YELLOW),
- cloudBorder(HtmlColorUtils.MY_RED),
- queueBackground(HtmlColorUtils.MY_YELLOW),
- queueBorder(HtmlColorUtils.MY_RED),
- databaseBackground(HtmlColorUtils.MY_YELLOW),
- databaseBorder(HtmlColorUtils.MY_RED),
- folderBackground(HtmlColorUtils.MY_YELLOW),
- folderBorder(HtmlColorUtils.MY_RED),
- frameBackground(HtmlColorUtils.MY_YELLOW),
- frameBorder(HtmlColorUtils.MY_RED),
- nodeBackground(HtmlColorUtils.MY_YELLOW),
- nodeBorder(HtmlColorUtils.MY_RED),
- rectangleBackground(HtmlColorUtils.MY_YELLOW),
- rectangleBorder(HtmlColorUtils.MY_RED),
- agentBackground(HtmlColorUtils.MY_YELLOW),
- agentBorder(HtmlColorUtils.MY_RED),
- storageBackground(HtmlColorUtils.MY_YELLOW),
- storageBorder(HtmlColorUtils.MY_RED),
- boundaryBackground(HtmlColorUtils.MY_YELLOW),
- boundaryBorder(HtmlColorUtils.MY_RED),
- controlBackground(HtmlColorUtils.MY_YELLOW),
- controlBorder(HtmlColorUtils.MY_RED),
- entityBackground(HtmlColorUtils.MY_YELLOW),
- entityBorder(HtmlColorUtils.MY_RED),
+ artifactBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ artifactBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ cloudBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ cloudBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ queueBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ queueBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ databaseBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ databaseBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ folderBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ folderBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ frameBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ frameBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ nodeBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ nodeBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ rectangleBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ rectangleBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ agentBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ agentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ storageBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ boundaryBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ controlBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ entityBackground(HtmlColorUtils.MY_YELLOW, ColorType.BACK),
+ entityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
iconPrivate(HtmlColorUtils.COL_C82930),
@@ -145,22 +149,28 @@ public enum ColorParam {
private final boolean isBackground;
private final HtmlColor defaultValue;
+ private final ColorType colorType;
+
+ private ColorParam(HtmlColor defaultValue, ColorType colorType) {
+ this(defaultValue, false, colorType);
+ }
private ColorParam(HtmlColor defaultValue) {
- this(defaultValue, false);
+ this(defaultValue, false, null);
}
private ColorParam() {
- this(null, false);
+ this(null, false, null);
}
private ColorParam(boolean isBackground) {
- this(null, isBackground);
+ this(null, isBackground, null);
}
- private ColorParam(HtmlColor defaultValue, boolean isBackground) {
+ private ColorParam(HtmlColor defaultValue, boolean isBackground, ColorType colorType) {
this.isBackground = isBackground;
this.defaultValue = defaultValue;
+ this.colorType = colorType;
}
protected boolean isBackground() {
@@ -170,4 +180,8 @@ public enum ColorParam {
public final HtmlColor getDefaultValue() {
return defaultValue;
}
+
+ public ColorType getColorType() {
+ return colorType;
+ }
}
diff --git a/src/net/sourceforge/plantuml/CounterOutputStream.java b/src/net/sourceforge/plantuml/CounterOutputStream.java
index 52ebf10..df173eb 100644
--- a/src/net/sourceforge/plantuml/CounterOutputStream.java
+++ b/src/net/sourceforge/plantuml/CounterOutputStream.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/Dimension2DDouble.java b/src/net/sourceforge/plantuml/Dimension2DDouble.java
index db30050..feffc95 100644
--- a/src/net/sourceforge/plantuml/Dimension2DDouble.java
+++ b/src/net/sourceforge/plantuml/Dimension2DDouble.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/DirWatcher.java b/src/net/sourceforge/plantuml/DirWatcher.java
index 8df6f25..cc59a7a 100644
--- a/src/net/sourceforge/plantuml/DirWatcher.java
+++ b/src/net/sourceforge/plantuml/DirWatcher.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,12 +39,12 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.sourceforge.plantuml.preproc.Defines;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
@Deprecated
public class DirWatcher {
@@ -79,7 +79,7 @@ public class DirWatcher {
if (watcher == null || watcher.hasChanged()) {
final SourceFileReader sourceFileReader = new SourceFileReader(new Defines(), f, option.getOutputDir(),
option.getConfig(), option.getCharset(), option.getFileFormatOption());
- final Set<File> files = new HashSet<File>(sourceFileReader.getIncludedFiles());
+ final Set<File> files = FileWithSuffix.convert(sourceFileReader.getIncludedFiles());
files.add(f);
for (GeneratedImage g : sourceFileReader.getGeneratedImages()) {
result.add(g);
diff --git a/src/net/sourceforge/plantuml/DirWatcher2.java b/src/net/sourceforge/plantuml/DirWatcher2.java
index 1f2bf39..b5c037f 100644
--- a/src/net/sourceforge/plantuml/DirWatcher2.java
+++ b/src/net/sourceforge/plantuml/DirWatcher2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,6 @@ package net.sourceforge.plantuml;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -50,6 +49,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import net.sourceforge.plantuml.preproc.Defines;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
public class DirWatcher2 {
@@ -91,7 +91,7 @@ public class DirWatcher2 {
try {
final List<GeneratedImage> generatedImages = sourceFileReader
.getGeneratedImages();
- final Set<File> files = new HashSet<File>(sourceFileReader.getIncludedFiles());
+ final Set<File> files = FileWithSuffix.convert(sourceFileReader.getIncludedFiles());
files.add(f);
modifieds.put(f, new FileWatcher(files));
return Collections.unmodifiableList(generatedImages);
diff --git a/src/net/sourceforge/plantuml/Direction.java b/src/net/sourceforge/plantuml/Direction.java
index 9d5b8f5..60a2192 100644
--- a/src/net/sourceforge/plantuml/Direction.java
+++ b/src/net/sourceforge/plantuml/Direction.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/EmbededDiagram.java b/src/net/sourceforge/plantuml/EmbededDiagram.java
index 1993519..40742de 100644
--- a/src/net/sourceforge/plantuml/EmbededDiagram.java
+++ b/src/net/sourceforge/plantuml/EmbededDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/EmptyImageBuilder.java b/src/net/sourceforge/plantuml/EmptyImageBuilder.java
index a363548..733f942 100644
--- a/src/net/sourceforge/plantuml/EmptyImageBuilder.java
+++ b/src/net/sourceforge/plantuml/EmptyImageBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
+import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
@@ -47,12 +48,21 @@ public class EmptyImageBuilder {
private final BufferedImage im;
private final Graphics2D g2d;
+ static final private int LIMIT = GraphvizUtils.getenvImageLimit();
public EmptyImageBuilder(double width, double height, Color background) {
this((int) width, (int) height, background);
}
public EmptyImageBuilder(int width, int height, Color background) {
+ if (width > LIMIT) {
+ Log.info("Width too large " + width);
+ width = LIMIT;
+ }
+ if (height > LIMIT) {
+ Log.info("Height too large " + height);
+ height = LIMIT;
+ }
Log.info("Creating image " + width + "x" + height);
im = new BufferedImage(width, height, background == null ? BufferedImage.TYPE_INT_ARGB
: BufferedImage.TYPE_INT_RGB);
diff --git a/src/net/sourceforge/plantuml/EnsureVisible.java b/src/net/sourceforge/plantuml/EnsureVisible.java
index 8aa0bb5..dee3593 100644
--- a/src/net/sourceforge/plantuml/EnsureVisible.java
+++ b/src/net/sourceforge/plantuml/EnsureVisible.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ErrorUml.java b/src/net/sourceforge/plantuml/ErrorUml.java
index 96dba20..095d780 100644
--- a/src/net/sourceforge/plantuml/ErrorUml.java
+++ b/src/net/sourceforge/plantuml/ErrorUml.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,14 +43,16 @@ public class ErrorUml {
private final int position;
private final ErrorUmlType type;
private SuggestEngineResult suggest;
+ private final LineLocation lineLocation;
- public ErrorUml(ErrorUmlType type, String error, int position) {
+ public ErrorUml(ErrorUmlType type, String error, int position, LineLocation lineLocation) {
if (error == null || type == null || StringUtils.isEmpty(error)) {
throw new IllegalArgumentException();
}
this.error = error;
this.type = type;
this.position = position;
+ this.lineLocation = lineLocation;
}
@Override
@@ -81,6 +83,10 @@ public class ErrorUml {
return position;
}
+ public LineLocation getLineLocation() {
+ return lineLocation;
+ }
+
public final SuggestEngineResult getSuggest() {
return suggest;
}
@@ -93,4 +99,5 @@ public class ErrorUml {
this.suggest = suggest;
}
+
}
diff --git a/src/net/sourceforge/plantuml/ErrorUmlType.java b/src/net/sourceforge/plantuml/ErrorUmlType.java
index ca10a54..fe65b76 100644
--- a/src/net/sourceforge/plantuml/ErrorUmlType.java
+++ b/src/net/sourceforge/plantuml/ErrorUmlType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java
index 60ab6e7..7b9db72 100644
--- a/src/net/sourceforge/plantuml/FileFormat.java
+++ b/src/net/sourceforge/plantuml/FileFormat.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/FileFormatOption.java b/src/net/sourceforge/plantuml/FileFormatOption.java
index cc805c5..0527fff 100644
--- a/src/net/sourceforge/plantuml/FileFormatOption.java
+++ b/src/net/sourceforge/plantuml/FileFormatOption.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
+import java.io.Serializable;
import net.sourceforge.plantuml.eps.EpsStrategy;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -65,15 +66,20 @@ import net.sourceforge.plantuml.StringUtils;
* @author Arnaud Roques
*
*/
-public class FileFormatOption {
+public class FileFormatOption implements Serializable {
private final FileFormat fileFormat;
private final AffineTransform affineTransform;
private final boolean withMetadata;
private final boolean useRedForError;
+ private final String svgLinkTarget;
public FileFormatOption(FileFormat fileFormat) {
- this(fileFormat, null, true, false);
+ this(fileFormat, null, true, false, "_top");
+ }
+
+ public String getSvgLinkTarget() {
+ return svgLinkTarget;
}
public final boolean isWithMetadata() {
@@ -81,18 +87,24 @@ public class FileFormatOption {
}
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
- this(fileFormat, null, false, false);
+ this(fileFormat, null, false, false, "_top");
}
- private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError) {
+ private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError,
+ String svgLinkTarget) {
this.fileFormat = fileFormat;
this.affineTransform = at;
this.withMetadata = withMetadata;
this.useRedForError = useRedForError;
+ this.svgLinkTarget = svgLinkTarget;
}
public FileFormatOption withUseRedForError() {
- return new FileFormatOption(fileFormat, affineTransform, withMetadata, true);
+ return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget);
+ }
+
+ public FileFormatOption withSvgLinkTarget(String target) {
+ return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, target);
}
@Override
@@ -153,11 +165,11 @@ public class FileFormatOption {
}
final UGraphicSvg ug;
if (mybackcolor instanceof HtmlColorGradient) {
- ug = new UGraphicSvg(colorMapper, (HtmlColorGradient) mybackcolor, false, scale);
+ ug = new UGraphicSvg(colorMapper, (HtmlColorGradient) mybackcolor, false, scale, getSvgLinkTarget());
} else if (backColor == null || backColor.equals(Color.WHITE)) {
- ug = new UGraphicSvg(colorMapper, false, scale);
+ ug = new UGraphicSvg(colorMapper, false, scale, getSvgLinkTarget());
} else {
- ug = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(backColor), false, scale);
+ ug = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(backColor), false, scale, getSvgLinkTarget());
}
return ug;
diff --git a/src/net/sourceforge/plantuml/FileGroup.java b/src/net/sourceforge/plantuml/FileGroup.java
index bbbaa3c..c2a352e 100644
--- a/src/net/sourceforge/plantuml/FileGroup.java
+++ b/src/net/sourceforge/plantuml/FileGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/FileSystem.java b/src/net/sourceforge/plantuml/FileSystem.java
index dfaa378..4503ade 100644
--- a/src/net/sourceforge/plantuml/FileSystem.java
+++ b/src/net/sourceforge/plantuml/FileSystem.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/FileUtils.java b/src/net/sourceforge/plantuml/FileUtils.java
index 9dae20b..553734a 100644
--- a/src/net/sourceforge/plantuml/FileUtils.java
+++ b/src/net/sourceforge/plantuml/FileUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/FileWatcher.java b/src/net/sourceforge/plantuml/FileWatcher.java
index df3b30c..6981952 100644
--- a/src/net/sourceforge/plantuml/FileWatcher.java
+++ b/src/net/sourceforge/plantuml/FileWatcher.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/FontParam.java b/src/net/sourceforge/plantuml/FontParam.java
index 22b4fa5..283865c 100644
--- a/src/net/sourceforge/plantuml/FontParam.java
+++ b/src/net/sourceforge/plantuml/FontParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,8 @@ package net.sourceforge.plantuml;
import java.awt.Font;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+
interface FontParamConstant {
String FAMILY = "SansSerif";
String COLOR = "black";
@@ -59,6 +61,7 @@ public enum FontParam {
COMPONENT_STEREOTYPE(14, Font.ITALIC), //
NOTE(13, Font.PLAIN), //
PACKAGE(14, Font.PLAIN), //
+ PACKAGE_STEREOTYPE(14, Font.ITALIC), //
ACTOR(14, Font.PLAIN), //
ARTIFACT(14, Font.PLAIN), //
CLOUD(14, Font.PLAIN), //
@@ -86,6 +89,8 @@ public enum FontParam {
STATE_ATTRIBUTE(12, Font.PLAIN), //
LEGEND(14, Font.PLAIN), //
TITLE(18, Font.PLAIN), //
+ CAPTION(14, Font.PLAIN), //
+ SWIMLANE_TITLE(18, Font.PLAIN), //
FOOTER(10, Font.PLAIN, "#888888", FontParamConstant.FAMILY), //
HEADER(10, Font.PLAIN, "#888888", FontParamConstant.FAMILY), //
USECASE(14, Font.PLAIN), //
@@ -104,7 +109,9 @@ public enum FontParam {
DATABASE_STEREOTYPE(14, Font.ITALIC), //
QUEUE_STEREOTYPE(14, Font.ITALIC), //
ACTOR_STEREOTYPE(14, Font.ITALIC), //
- SEQUENCE_STEREOTYPE(14, Font.ITALIC); //
+ SEQUENCE_STEREOTYPE(14, Font.ITALIC), //
+ PARTITION(14, Font.PLAIN); //
+
private final int defaultSize;
private final int fontStyle;
@@ -147,4 +154,8 @@ public enum FontParam {
return defaultFamily;
}
+ public FontConfiguration getFontConfiguration(ISkinParam skinParam) {
+ return new FontConfiguration(skinParam, this, null);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/GeneratedImage.java b/src/net/sourceforge/plantuml/GeneratedImage.java
index 6753446..910be04 100644
--- a/src/net/sourceforge/plantuml/GeneratedImage.java
+++ b/src/net/sourceforge/plantuml/GeneratedImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,58 +36,12 @@ package net.sourceforge.plantuml;
import java.io.File;
-import net.sourceforge.plantuml.core.Diagram;
+public interface GeneratedImage extends Comparable<GeneratedImage> {
-public class GeneratedImage implements Comparable<GeneratedImage> {
+ public File getPngFile();
- private final File pngFile;
- private final String description;
- private final BlockUml blockUml;
+ public String getDescription();
- public GeneratedImage(File pngFile, String description, BlockUml blockUml) {
- this.blockUml = blockUml;
- this.pngFile = pngFile;
- this.description = description;
- }
-
- public File getPngFile() {
- return pngFile;
- }
-
- public String getDescription() {
- return description;
- }
-
- public int lineErrorRaw() {
- final Diagram system = blockUml.getDiagram();
- if (system instanceof PSystemError) {
- return ((PSystemError) system).getHigherErrorPosition() + blockUml.getStartLine();
- }
- return -1;
- }
-
- @Override
- public String toString() {
- return pngFile.getAbsolutePath() + " " + description;
- }
-
- public int compareTo(GeneratedImage this2) {
- final int cmp = this.pngFile.compareTo(this2.pngFile);
- if (cmp != 0) {
- return cmp;
- }
- return this.description.compareTo(this2.description);
- }
-
- @Override
- public int hashCode() {
- return pngFile.hashCode() + description.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- final GeneratedImage this2 = (GeneratedImage) obj;
- return this2.pngFile.equals(this.pngFile) && this2.description.equals(this.description);
- }
+ public int lineErrorRaw();
}
diff --git a/src/net/sourceforge/plantuml/GeneratedImageImpl.java b/src/net/sourceforge/plantuml/GeneratedImageImpl.java
new file mode 100644
index 0000000..cf9daf1
--- /dev/null
+++ b/src/net/sourceforge/plantuml/GeneratedImageImpl.java
@@ -0,0 +1,93 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+import java.io.File;
+
+import net.sourceforge.plantuml.core.Diagram;
+
+public class GeneratedImageImpl implements GeneratedImage {
+
+ private final File pngFile;
+ private final String description;
+ private final BlockUml blockUml;
+
+ public GeneratedImageImpl(File pngFile, String description, BlockUml blockUml) {
+ this.blockUml = blockUml;
+ this.pngFile = pngFile;
+ this.description = description;
+ }
+
+ public File getPngFile() {
+ return pngFile;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public int lineErrorRaw() {
+ final Diagram system = blockUml.getDiagram();
+ if (system instanceof PSystemError) {
+ return ((PSystemError) system).getHigherErrorPosition() + blockUml.getStartLine();
+ }
+ return -1;
+ }
+
+ @Override
+ public String toString() {
+ return pngFile.getAbsolutePath() + " " + description;
+ }
+
+ public int compareTo(GeneratedImage this2) {
+ final int cmp = this.pngFile.compareTo(this2.getPngFile());
+ if (cmp != 0) {
+ return cmp;
+ }
+ return this.description.compareTo(this2.getDescription());
+ }
+
+ @Override
+ public int hashCode() {
+ return pngFile.hashCode() + description.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ final GeneratedImageImpl this2 = (GeneratedImageImpl) obj;
+ return this2.pngFile.equals(this.pngFile) && this2.description.equals(this.description);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/Hideable.java b/src/net/sourceforge/plantuml/Hideable.java
index 0dbc37f..a644da9 100644
--- a/src/net/sourceforge/plantuml/Hideable.java
+++ b/src/net/sourceforge/plantuml/Hideable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ISkinParam.java b/src/net/sourceforge/plantuml/ISkinParam.java
index e139548..79f2c5b 100644
--- a/src/net/sourceforge/plantuml/ISkinParam.java
+++ b/src/net/sourceforge/plantuml/ISkinParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.SkinParameter;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
@@ -58,11 +59,13 @@ public interface ISkinParam extends ISkinSimple {
public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable);
- public HtmlColor getFontHtmlColor(FontParam param, Stereotype stereotype);
+ public Colors getColors(ColorParam param, Stereotype stereotype);
+
+ public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param);
public UStroke getThickness(LineParam param, Stereotype stereotype);
- public UFont getFont(FontParam fontParam, Stereotype stereotype, boolean inPackageTitle);
+ public UFont getFont(Stereotype stereotype, boolean inPackageTitle, FontParam... fontParam);
public HorizontalAlignment getHorizontalAlignment(AlignParam param);
@@ -81,6 +84,8 @@ public interface ISkinParam extends ISkinSimple {
public GraphvizLayoutStrategy getStrategy();
public boolean shadowing();
+
+ public boolean shadowingForNote(Stereotype stereotype);
public boolean shadowing2(SkinParameter skinParameter);
@@ -114,12 +119,16 @@ public interface ISkinParam extends ISkinSimple {
public boolean useOctagonForActivity(Stereotype stereotype);
- public IHtmlColorSet getIHtmlColorSet();
-
public int groupInheritance();
-
+
public boolean useGuillemet();
public boolean handwritten();
+ public String getSvgLinkTarget();
+
+ public int getTabSize();
+
+ public int maxAsciiMessageLength();
+
}
diff --git a/src/net/sourceforge/plantuml/ISkinSimple.java b/src/net/sourceforge/plantuml/ISkinSimple.java
index 8a8fad4..4b0a547 100644
--- a/src/net/sourceforge/plantuml/ISkinSimple.java
+++ b/src/net/sourceforge/plantuml/ISkinSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,11 +34,18 @@
*/
package net.sourceforge.plantuml;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+
public interface ISkinSimple extends SpriteContainer {
public String getValue(String key);
public double getPadding();
+
+ public String getMonospacedFamily();
+ public int getTabSize();
+
+ public IHtmlColorSet getIHtmlColorSet();
}
diff --git a/src/net/sourceforge/plantuml/ISourceFileReader.java b/src/net/sourceforge/plantuml/ISourceFileReader.java
index 71fa4ce..5bc0061 100644
--- a/src/net/sourceforge/plantuml/ISourceFileReader.java
+++ b/src/net/sourceforge/plantuml/ISourceFileReader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,5 +44,8 @@ public interface ISourceFileReader {
public List<String> getEncodedUrl() throws IOException;
public boolean hasError();
+
+ public void setFileFormatOption(FileFormatOption fileFormatOption);
+
}
diff --git a/src/net/sourceforge/plantuml/LineConfigurable.java b/src/net/sourceforge/plantuml/LineConfigurable.java
index 1c8e647..6d25528 100644
--- a/src/net/sourceforge/plantuml/LineConfigurable.java
+++ b/src/net/sourceforge/plantuml/LineConfigurable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,16 +35,18 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.UStroke;
public interface LineConfigurable {
- public HtmlColor getSpecificLineColor();
+ public Colors getColors(ISkinParam skinParam);
+
+ public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color);
- public void setSpecificLineColor(HtmlColor specificLinecolor);
+// public void setSpecificLineStroke(UStroke specificLineStroke);
- public UStroke getSpecificLineStroke();
- public void setSpecificLineStroke(UStroke specificLineStoke);
}
diff --git a/src/net/sourceforge/plantuml/LineLocation.java b/src/net/sourceforge/plantuml/LineLocation.java
new file mode 100644
index 0000000..2f74f4a
--- /dev/null
+++ b/src/net/sourceforge/plantuml/LineLocation.java
@@ -0,0 +1,62 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+/**
+ * Indicates the location of a line of code within a resource.
+ * The resource maybe a local file or a remote URL.
+ *
+ */
+public interface LineLocation {
+
+ /**
+ * Position of the line, starting at 0.
+ */
+ public int getPosition();
+
+ /**
+ * A description of the ressource.
+ * If the ressource is a file, this is the complete path of the file.
+ */
+ public String getDescription();
+
+ /**
+ * Get the parent of this location.
+ * If this resource has been included by a !include or !includeurl directive,
+ * this return the location of the !include line.
+ */
+ public LineLocation getParent();
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/ParticipantEngloberContexted.java b/src/net/sourceforge/plantuml/LineLocationImpl.java
index 5ab0b33..64b4fe4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/ParticipantEngloberContexted.java
+++ b/src/net/sourceforge/plantuml/LineLocationImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,47 +32,53 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.sequencediagram;
+package net.sourceforge.plantuml;
-import java.util.ArrayList;
-import java.util.List;
+public class LineLocationImpl implements LineLocation {
-public class ParticipantEngloberContexted {
+ private final String desc;
+ private final int position;
+ private final LineLocation parent;
- final private ParticipantEnglober participantEnglober;
- final private List<Participant> participants = new ArrayList<Participant>();
+ @Override
+ public String toString() {
+ if (desc == null) {
+ return "[?] : " + position;
+ }
+ return desc + " : " + position;
+ }
- public ParticipantEngloberContexted(ParticipantEnglober participantEnglober, Participant first) {
- this.participantEnglober = participantEnglober;
- this.participants.add(first);
+ public LineLocationImpl(String desc, LineLocation parent) {
+ this(desc, parent, -1);
}
- public final ParticipantEnglober getParticipantEnglober() {
- return participantEnglober;
+ private LineLocationImpl(String desc, LineLocation parent, int position) {
+ this.parent = parent;
+ this.desc = desc;
+ this.position = position;
}
-
- public boolean contains(Participant p) {
- return participants.contains(p);
+
+ public LineLocationImpl oneLineRead() {
+ return new LineLocationImpl(desc, parent, position + 1);
}
- public void add(Participant p) {
- if (participants.contains(p)) {
- throw new IllegalArgumentException();
+ public static LineLocation fromLine(CharSequence cs) {
+ if (cs instanceof CharSequence2) {
+ return ((CharSequence2) cs).getLocation();
}
- participants.add(p);
+ return null;
}
- public final Participant getFirst2() {
- return participants.get(0);
+ public int getPosition() {
+ return position;
}
- public final Participant getLast2() {
- return participants.get(participants.size() - 1);
+ public String getDescription() {
+ return desc;
}
-
- @Override
- public String toString() {
- return super.toString()+" "+participants;
+
+ public LineLocation getParent() {
+ return parent;
}
}
diff --git a/src/net/sourceforge/plantuml/LineParam.java b/src/net/sourceforge/plantuml/LineParam.java
index 88c428c..685f478 100644
--- a/src/net/sourceforge/plantuml/LineParam.java
+++ b/src/net/sourceforge/plantuml/LineParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,9 @@ public enum LineParam {
sequenceLifeLineBorder,
sequenceParticipantBorder, noteBorder, sequenceGroupBorder, sequenceReferenceBorder,
classBorder, objectBorder,
- packageBorder;
+ partitionBorder,
+ packageBorder,
+ swimlaneBorder;
// sequenceBoxBorder(0.1);
}
diff --git a/src/net/sourceforge/plantuml/Log.java b/src/net/sourceforge/plantuml/Log.java
index 30f1fcf..d41fc2d 100644
--- a/src/net/sourceforge/plantuml/Log.java
+++ b/src/net/sourceforge/plantuml/Log.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/NewpagedDiagram.java b/src/net/sourceforge/plantuml/NewpagedDiagram.java
index 8814b8d..15813c0 100644
--- a/src/net/sourceforge/plantuml/NewpagedDiagram.java
+++ b/src/net/sourceforge/plantuml/NewpagedDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,8 +37,10 @@ package net.sourceforge.plantuml;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.Diagram;
@@ -66,7 +68,11 @@ public class NewpagedDiagram extends AbstractPSystem {
return super.toString() + " SIZE=" + diagrams.size() + " " + diagrams;
}
- public CommandExecutionResult executeCommand(Command cmd, List<String> lines) {
+ public Diagram getLastDiagram() {
+ return diagrams.get(diagrams.size() - 1);
+ }
+
+ public CommandExecutionResult executeCommand(Command cmd, BlocLines lines) {
final int nb = diagrams.size();
final CommandExecutionResult tmp = cmd.execute(diagrams.get(nb - 1), lines);
if (tmp.getNewDiagram() instanceof NewpagedDiagram) {
@@ -132,4 +138,8 @@ public class NewpagedDiagram extends AbstractPSystem {
}
}
+ public final List<Diagram> getDiagrams() {
+ return Collections.unmodifiableList(diagrams);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/NullOutputStream.java b/src/net/sourceforge/plantuml/NullOutputStream.java
index 837f9c2..6867097 100644
--- a/src/net/sourceforge/plantuml/NullOutputStream.java
+++ b/src/net/sourceforge/plantuml/NullOutputStream.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/Option.java b/src/net/sourceforge/plantuml/Option.java
index 8400b7c..6cf1953 100644
--- a/src/net/sourceforge/plantuml/Option.java
+++ b/src/net/sourceforge/plantuml/Option.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/OptionFlags.java b/src/net/sourceforge/plantuml/OptionFlags.java
index 8ccb342..40c80af 100644
--- a/src/net/sourceforge/plantuml/OptionFlags.java
+++ b/src/net/sourceforge/plantuml/OptionFlags.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -54,10 +54,14 @@ public class OptionFlags {
static public final boolean USE_HECTOR = false;
static public boolean ADD_NICE_FOR_DOT = false;
static public final boolean STRICT_SELFMESSAGE_POSITION = true;
+
+ // static public final boolean USE_IF_VERTICAL = true;
static public final boolean FORCE_TEOZ = false;
static public final boolean USE_INTERFACE_EYE1 = false;
static public final boolean USE_INTERFACE_EYE2 = false;
static public final boolean SWI2 = false;
+ static public final boolean USE_COMPOUND = false;
+ static public final boolean OMEGA_CROSSING = false;
public void reset() {
reset(false);
diff --git a/src/net/sourceforge/plantuml/OptionPrint.java b/src/net/sourceforge/plantuml/OptionPrint.java
index 61b65b2..1d77cfd 100644
--- a/src/net/sourceforge/plantuml/OptionPrint.java
+++ b/src/net/sourceforge/plantuml/OptionPrint.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java
index 366393d..997f1a9 100644
--- a/src/net/sourceforge/plantuml/PSystemBuilder.java
+++ b/src/net/sourceforge/plantuml/PSystemBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -70,6 +70,7 @@ import net.sourceforge.plantuml.project2.PSystemProjectFactory2;
import net.sourceforge.plantuml.salt.PSystemSaltFactory;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagramFactory;
import net.sourceforge.plantuml.statediagram.StateDiagramFactory;
+import net.sourceforge.plantuml.ugraphic.sprite.PSystemListInternalSpritesFactory;
import net.sourceforge.plantuml.version.License;
import net.sourceforge.plantuml.version.PSystemLicenseFactory;
import net.sourceforge.plantuml.version.PSystemVersionFactory;
@@ -78,13 +79,13 @@ public class PSystemBuilder {
public static final long startTime = System.currentTimeMillis();
- final public Diagram createPSystem(final List<? extends CharSequence> strings) {
+ final public Diagram createPSystem(final List<CharSequence2> strings2) {
final List<PSystemFactory> factories = getAllFactories();
- final DiagramType type = DiagramType.getTypeFromArobaseStart(strings.get(0).toString());
+ final DiagramType type = DiagramType.getTypeFromArobaseStart(strings2.get(0).toString2());
- final UmlSource umlSource = new UmlSource(strings, type == DiagramType.UML);
+ final UmlSource umlSource = new UmlSource(strings2, type == DiagramType.UML);
final DiagramType diagramType = umlSource.getDiagramType();
final List<PSystemError> errors = new ArrayList<PSystemError>();
for (PSystemFactory systemFactory : factories) {
@@ -98,7 +99,7 @@ public class PSystemBuilder {
errors.add((PSystemError) sys);
}
- final PSystemError err = merge(errors);
+ final PSystemError err = PSystemError.merge(errors);
// if (OptionFlags.getInstance().isQuiet() == false) {
// err.print(System.err);
// }
@@ -115,7 +116,7 @@ public class PSystemBuilder {
factories.add(new StateDiagramFactory());
factories.add(new ActivityDiagramFactory3());
factories.add(new CompositeDiagramFactory());
- factories.add(new ObjectDiagramFactory());
+ // factories.add(new ObjectDiagramFactory());
factories.add(new PostIdDiagramFactory());
factories.add(new PrintSkinFactory());
factories.add(new PSystemLicenseFactory());
@@ -124,6 +125,7 @@ public class PSystemBuilder {
factories.add(new PSystemListFontsFactory());
factories.add(new PSystemOpenIconicFactory());
factories.add(new PSystemListOpenIconicFactory());
+ factories.add(new PSystemListInternalSpritesFactory());
factories.add(new PSystemSaltFactory(DiagramType.SALT));
factories.add(new PSystemSaltFactory(DiagramType.UML));
factories.add(new PSystemDotFactory(DiagramType.DOT));
@@ -143,21 +145,6 @@ public class PSystemBuilder {
return factories;
}
- private PSystemError merge(Collection<PSystemError> ps) {
- UmlSource source = null;
- final List<ErrorUml> errors = new ArrayList<ErrorUml>();
- for (PSystemError system : ps) {
- if (system.getSource() != null && source == null) {
- source = system.getSource();
- }
- errors.addAll(system.getErrorsUml());
- }
- if (source == null) {
- throw new IllegalStateException();
- }
- return new PSystemError(source, errors);
- }
-
private boolean isOk(Diagram ps) {
if (ps == null || ps instanceof PSystemError) {
return false;
diff --git a/src/net/sourceforge/plantuml/PSystemError.java b/src/net/sourceforge/plantuml/PSystemError.java
index 694ed2e..7c1c20f 100644
--- a/src/net/sourceforge/plantuml/PSystemError.java
+++ b/src/net/sourceforge/plantuml/PSystemError.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -56,24 +56,15 @@ import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
public class PSystemError extends AbstractPSystem {
- private String getSuggestColor(boolean useRed) {
- if (useRed) {
- return "black";
- }
- return "white";
- }
-
- private String getRed(boolean useRed) {
- if (useRed) {
- return "#CD0A0A";
- }
- return "red";
- }
-
private final int higherErrorPosition;
private final List<ErrorUml> printedErrors;
+ private final List<String> debugLines = new ArrayList<String>();
- public PSystemError(UmlSource source, List<ErrorUml> all) {
+ public PSystemError(UmlSource source, ErrorUml singleError, List<String> debugLines) {
+ this(source, Collections.singletonList(singleError), debugLines);
+ }
+
+ private PSystemError(UmlSource source, List<ErrorUml> all, List<String> debugLines) {
this.setSource(source);
final int higherErrorPositionExecution = getHigherErrorPosition(ErrorUmlType.EXECUTION_ERROR, all);
@@ -92,10 +83,24 @@ public class PSystemError extends AbstractPSystem {
printedErrors = getErrorsAt(higherErrorPositionSyntax, ErrorUmlType.SYNTAX_ERROR, all);
}
+ if (debugLines != null) {
+ this.debugLines.addAll(debugLines);
+ }
+
+ }
+
+ private String getSuggestColor(boolean useRed) {
+ if (useRed) {
+ return "black";
+ }
+ return "white";
}
- public PSystemError(UmlSource source, ErrorUml singleError) {
- this(source, Collections.singletonList(singleError));
+ private String getRed(boolean useRed) {
+ if (useRed) {
+ return "#CD0A0A";
+ }
+ return "red";
}
public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
@@ -112,11 +117,14 @@ public class PSystemError extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private List<String> getTextStrings() {
- final List<String> result = new ArrayList<String>();
+ final List<String> result = new ArrayList<String>(getStack());
+ if (result.size() > 0) {
+ result.add(" ");
+ }
final int limit = 4;
int start;
@@ -160,12 +168,44 @@ public class PSystemError extends AbstractPSystem {
}
first = false;
}
+ result.addAll(this.debugLines);
+
+ return result;
+ }
+ private List<String> getStack() {
+ LineLocation lineLocation = getLineLocation();
+ final List<String> result = new ArrayList<String>();
+ if (lineLocation != null) {
+ append(result, lineLocation);
+ while (lineLocation.getParent() != null) {
+ lineLocation = lineLocation.getParent();
+ append(result, lineLocation);
+ }
+ }
return result;
}
+ public LineLocation getLineLocation() {
+ for (ErrorUml err : printedErrors) {
+ if (err.getLineLocation() != null) {
+ return err.getLineLocation();
+ }
+ }
+ return null;
+ }
+
+ private void append(List<String> result, LineLocation lineLocation) {
+ if (lineLocation.getDescription() != null) {
+ result.add("[From " + lineLocation.getDescription() + " (line " + (lineLocation.getPosition() + 1) + ") ]");
+ }
+ }
+
private List<String> getHtmlStrings(boolean useRed) {
- final List<String> htmlStrings = new ArrayList<String>();
+ final List<String> htmlStrings = new ArrayList<String>(getStack());
+ if (htmlStrings.size() > 0) {
+ htmlStrings.add("----");
+ }
final int limit = 4;
int start;
@@ -188,10 +228,10 @@ public class PSystemError extends AbstractPSystem {
if (StringUtils.isNotEmpty(err)) {
htmlStrings.add("<w:" + getRed(useRed) + ">" + err + "</w>");
}
-// final StringBuilder underscore = new StringBuilder();
-// for (int i = 0; i < errorLine.length(); i++) {
-// underscore.append("^");
-// }
+ // final StringBuilder underscore = new StringBuilder();
+ // for (int i = 0; i < errorLine.length(); i++) {
+ // underscore.append("^");
+ // }
final Collection<String> textErrors = new LinkedHashSet<String>();
for (ErrorUml er : printedErrors) {
textErrors.add(er.getError());
@@ -209,6 +249,7 @@ public class PSystemError extends AbstractPSystem {
}
first = false;
}
+ htmlStrings.addAll(this.debugLines);
return htmlStrings;
}
@@ -284,7 +325,7 @@ public class PSystemError extends AbstractPSystem {
final StringBuilder sb = new StringBuilder();
sb.append(getDescription());
sb.append('\n');
- for (CharSequence t : getTitle()) {
+ for (CharSequence t : getTitle().getDisplay()) {
sb.append(t);
sb.append('\n');
}
@@ -295,4 +336,28 @@ public class PSystemError extends AbstractPSystem {
}
return sb.toString();
}
+
+ public static PSystemError merge(Collection<PSystemError> ps) {
+ UmlSource source = null;
+ final List<ErrorUml> errors = new ArrayList<ErrorUml>();
+ final List<String> debugs = new ArrayList<String>();
+ for (PSystemError system : ps) {
+ if (system == null) {
+ continue;
+ }
+ if (system.getSource() != null && source == null) {
+ source = system.getSource();
+ }
+ errors.addAll(system.getErrorsUml());
+ debugs.addAll(system.debugLines);
+ if (system.debugLines.size() > 0) {
+ debugs.add("-");
+ }
+ }
+ if (source == null) {
+ throw new IllegalStateException();
+ }
+ return new PSystemError(source, errors, debugs);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/PSystemUtils.java b/src/net/sourceforge/plantuml/PSystemUtils.java
index 7d7e0fc..97a285a 100644
--- a/src/net/sourceforge/plantuml/PSystemUtils.java
+++ b/src/net/sourceforge/plantuml/PSystemUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -56,6 +56,10 @@ public class PSystemUtils {
public static List<File> exportDiagrams(Diagram system, File suggestedFile, FileFormatOption fileFormatOption)
throws IOException {
+ if (system instanceof UmlDiagram) {
+ final ISkinParam skinParam = ((UmlDiagram) system).getSkinParam();
+ fileFormatOption = fileFormatOption.withSvgLinkTarget(skinParam.getSvgLinkTarget());
+ }
if (system instanceof NewpagedDiagram) {
return exportDiagramsNewpaged((NewpagedDiagram) system, suggestedFile, fileFormatOption);
}
diff --git a/src/net/sourceforge/plantuml/Pragma.java b/src/net/sourceforge/plantuml/Pragma.java
index dcd268f..8bdadde 100644
--- a/src/net/sourceforge/plantuml/Pragma.java
+++ b/src/net/sourceforge/plantuml/Pragma.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -66,6 +66,11 @@ public class Pragma {
return isDefine("horizontallinebetweendifferentpackageallowed");
}
+ public boolean useVerticalIf() {
+ final String teoz = getValue("useverticalif");
+ return "true".equalsIgnoreCase(teoz) || "on".equalsIgnoreCase(teoz);
+ }
+
public boolean useTeozLayout() {
final String teoz = getValue("teoz");
return "true".equalsIgnoreCase(teoz) || "on".equalsIgnoreCase(teoz);
diff --git a/src/net/sourceforge/plantuml/Removeable.java b/src/net/sourceforge/plantuml/Removeable.java
index 10d5339..825c957 100644
--- a/src/net/sourceforge/plantuml/Removeable.java
+++ b/src/net/sourceforge/plantuml/Removeable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java
index 5536ca1..1db0519 100644
--- a/src/net/sourceforge/plantuml/Run.java
+++ b/src/net/sourceforge/plantuml/Run.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -65,8 +65,8 @@ import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagramFactory;
import net.sourceforge.plantuml.statediagram.StateDiagramFactory;
import net.sourceforge.plantuml.swing.MainWindow2;
-import net.sourceforge.plantuml.ugraphic.SpriteGrayLevel;
-import net.sourceforge.plantuml.ugraphic.SpriteUtils;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteUtils;
import net.sourceforge.plantuml.version.Version;
public class Run {
diff --git a/src/net/sourceforge/plantuml/Scale.java b/src/net/sourceforge/plantuml/Scale.java
index 9d6a4cd..9387ad9 100644
--- a/src/net/sourceforge/plantuml/Scale.java
+++ b/src/net/sourceforge/plantuml/Scale.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ScaleHeight.java b/src/net/sourceforge/plantuml/ScaleHeight.java
index 7186497..c57c8ac 100644
--- a/src/net/sourceforge/plantuml/ScaleHeight.java
+++ b/src/net/sourceforge/plantuml/ScaleHeight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ScaleMaxHeight.java b/src/net/sourceforge/plantuml/ScaleMaxHeight.java
new file mode 100644
index 0000000..f865318
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ScaleMaxHeight.java
@@ -0,0 +1,52 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+public class ScaleMaxHeight implements Scale {
+
+ private final double maxHeight;
+
+ public ScaleMaxHeight(double maxHeight) {
+ this.maxHeight = maxHeight;
+ }
+
+ public double getScale(double width, double height) {
+ final double result = maxHeight / height;
+ if (result > 1) {
+ return 1;
+ }
+ return result;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/ScaleMaxWidth.java b/src/net/sourceforge/plantuml/ScaleMaxWidth.java
new file mode 100644
index 0000000..2a17f27
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ScaleMaxWidth.java
@@ -0,0 +1,52 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+public class ScaleMaxWidth implements Scale {
+
+ private final double maxWidth;
+
+ public ScaleMaxWidth(double maxWidth) {
+ this.maxWidth = maxWidth;
+ }
+
+ public double getScale(double width, double height) {
+ final double result = maxWidth / width;
+ if (result > 1) {
+ return 1;
+ }
+ return result;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/version/IteratorCounterImpl.java b/src/net/sourceforge/plantuml/ScaleMaxWidthAndHeight.java
index 876e35e..27b9bf9 100644
--- a/src/net/sourceforge/plantuml/version/IteratorCounterImpl.java
+++ b/src/net/sourceforge/plantuml/ScaleMaxWidthAndHeight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,35 +32,25 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.version;
+package net.sourceforge.plantuml;
-import java.util.Iterator;
+public class ScaleMaxWidthAndHeight implements Scale {
-public class IteratorCounterImpl implements IteratorCounter {
+ private final double maxWidth;
+ private final double maxHeight;
- private final Iterator<String> it;
- private int nb;
-
- public IteratorCounterImpl(Iterator<String> it) {
- this.it = it;
- this.nb = 0;
- }
-
- public int currentNum() {
- return nb;
- }
-
- public boolean hasNext() {
- return it.hasNext();
+ public ScaleMaxWidthAndHeight(double maxWidth, double maxHeight) {
+ this.maxWidth = maxWidth;
+ this.maxHeight = maxHeight;
}
- public String next() {
- nb++;
- return it.next();
+ public double getScale(double width, double height) {
+ final double scale1 = maxWidth / width;
+ final double scale2 = maxHeight / height;
+ final double min = Math.min(scale1, scale2);
+ if (min > 1) {
+ return 1;
+ }
+ return min;
}
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
}
diff --git a/src/net/sourceforge/plantuml/ScaleSimple.java b/src/net/sourceforge/plantuml/ScaleSimple.java
index 5969d1a..8f927fa 100644
--- a/src/net/sourceforge/plantuml/ScaleSimple.java
+++ b/src/net/sourceforge/plantuml/ScaleSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ScaleWidth.java b/src/net/sourceforge/plantuml/ScaleWidth.java
index 282aaa9..596a3ce 100644
--- a/src/net/sourceforge/plantuml/ScaleWidth.java
+++ b/src/net/sourceforge/plantuml/ScaleWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ScaleWidthAndHeight.java b/src/net/sourceforge/plantuml/ScaleWidthAndHeight.java
index fa03322..302906a 100644
--- a/src/net/sourceforge/plantuml/ScaleWidthAndHeight.java
+++ b/src/net/sourceforge/plantuml/ScaleWidthAndHeight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/SignatureUtils.java b/src/net/sourceforge/plantuml/SignatureUtils.java
index 5f5cbde..b4ab439 100644
--- a/src/net/sourceforge/plantuml/SignatureUtils.java
+++ b/src/net/sourceforge/plantuml/SignatureUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/SingleLine.java b/src/net/sourceforge/plantuml/SingleLine.java
index 86fa5c5..9aba0b6 100644
--- a/src/net/sourceforge/plantuml/SingleLine.java
+++ b/src/net/sourceforge/plantuml/SingleLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java
index 8e0fc6b..1825de0 100644
--- a/src/net/sourceforge/plantuml/SkinParam.java
+++ b/src/net/sourceforge/plantuml/SkinParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,6 +46,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
@@ -56,14 +57,16 @@ import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.SkinParameter;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ColorMapperMonochrome;
-import net.sourceforge.plantuml.ugraphic.Sprite;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteImage;
public class SkinParam implements ISkinParam {
@@ -71,30 +74,20 @@ public class SkinParam implements ISkinParam {
private Rankdir rankdir = Rankdir.TOP_TO_BOTTOM;
public void setParam(String key, String value) {
- params.put(cleanForKey(key), value.trim());
+ params.put(cleanForKey(key), StringUtils.trin(value));
}
private static final String stereoPatternString = "\\<\\<(.*?)\\>\\>";
private static final Pattern stereoPattern = MyPattern.cmpile(stereoPatternString);
- // public SkinParam() {
- //
- // }
-
public static SkinParam noShadowing() {
final SkinParam result = new SkinParam();
result.setParam("shadowing", "false");
return result;
}
- // public SkinParam(String type) {
- // if (type == null) {
- // setParam("shadowing", "false");
- // }
- // }
-
static String cleanForKey(String key) {
- key = StringUtils.goLowerCase(key).trim();
+ key = StringUtils.trin(StringUtils.goLowerCase(key));
key = key.replaceAll("_|\\.|\\s", "");
key = replaceSmart(key, "partition", "package");
key = replaceSmart(key, "sequenceparticipant", "participant");
@@ -169,13 +162,28 @@ public class SkinParam implements ISkinParam {
}
}
final String value = getValue(getParamName(param, clickable));
- final boolean acceptTransparent = param == ColorParam.background;
if (value == null) {
return null;
}
+ final boolean acceptTransparent = param == ColorParam.background;
return getIHtmlColorSet().getColorIfValid(value, acceptTransparent);
}
+ public Colors getColors(ColorParam param, Stereotype stereotype) {
+ if (stereotype != null) {
+ checkStereotype(stereotype);
+ final String value2 = getValue(param.name() + "color" + stereotype.getLabel(false));
+ if (value2 != null && getIHtmlColorSet().getColorIfValid(value2) != null) {
+ return new Colors(value2, getIHtmlColorSet(), param.getColorType());
+ }
+ }
+ final String value = getValue(getParamName(param, false));
+ if (value == null) {
+ return Colors.empty();
+ }
+ return new Colors(value, getIHtmlColorSet(), param.getColorType());
+ }
+
private String getParamName(ColorParam param, boolean clickable) {
String n = param.name();
if (clickable && n.endsWith("Background")) {
@@ -192,78 +200,88 @@ public class SkinParam implements ISkinParam {
// }
}
- private int getFontSize(FontParam param, Stereotype stereotype) {
+ private int getFontSize(Stereotype stereotype, FontParam... param) {
if (stereotype != null) {
checkStereotype(stereotype);
- final String value2 = getValue(param.name() + "fontsize" + stereotype.getLabel(false));
+ final String value2 = getFirstValueNonNullWithSuffix("fontsize" + stereotype.getLabel(false), param);
if (value2 != null && value2.matches("\\d+")) {
return Integer.parseInt(value2);
}
}
- String value = getValue(param.name() + "fontsize");
+ String value = getFirstValueNonNullWithSuffix("fontsize", param);
if (value == null || value.matches("\\d+") == false) {
value = getValue("defaultfontsize");
}
if (value == null || value.matches("\\d+") == false) {
- return param.getDefaultSize(this);
+ return param[0].getDefaultSize(this);
}
return Integer.parseInt(value);
}
- private String getFontFamily(FontParam param, Stereotype stereotype) {
+ private String getFontFamily(Stereotype stereotype, FontParam... param) {
if (stereotype != null) {
checkStereotype(stereotype);
- final String value2 = getValue(param.name() + "fontname" + stereotype.getLabel(false));
+ final String value2 = getFirstValueNonNullWithSuffix("fontname" + stereotype.getLabel(false), param);
if (value2 != null) {
return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value2);
}
}
// Times, Helvetica, Courier or Symbol
- String value = getValue(param.name() + "fontname");
+ String value = getFirstValueNonNullWithSuffix("fontname", param);
if (value != null) {
return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value);
}
- if (param != FontParam.CIRCLED_CHARACTER) {
+ if (param[0] != FontParam.CIRCLED_CHARACTER) {
value = getValue("defaultfontname");
if (value != null) {
return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value);
}
}
- return param.getDefaultFamily();
+ return param[0].getDefaultFamily();
}
- public HtmlColor getFontHtmlColor(FontParam param, Stereotype stereotype) {
+ public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
String value = null;
if (stereotype != null) {
checkStereotype(stereotype);
- value = getValue(param.name() + "fontcolor" + stereotype.getLabel(false));
+ value = getFirstValueNonNullWithSuffix("fontcolor" + stereotype.getLabel(false), param);
}
if (value == null || getIHtmlColorSet().getColorIfValid(value) == null) {
- value = getValue(param.name() + "fontcolor");
+ value = getFirstValueNonNullWithSuffix("fontcolor", param);
}
if (value == null || getIHtmlColorSet().getColorIfValid(value) == null) {
value = getValue("defaultfontcolor");
}
if (value == null || getIHtmlColorSet().getColorIfValid(value) == null) {
- value = param.getDefaultColor();
+ value = param[0].getDefaultColor();
}
return getIHtmlColorSet().getColorIfValid(value);
}
- private int getFontStyle(FontParam param, Stereotype stereotype, boolean inPackageTitle) {
+ private String getFirstValueNonNullWithSuffix(String suffix, FontParam... param) {
+ for (FontParam p : param) {
+ final String v = getValue(p.name() + suffix);
+ if (v != null) {
+ return v;
+ }
+ }
+ return null;
+ }
+
+ private int getFontStyle(Stereotype stereotype, boolean inPackageTitle, FontParam... param) {
String value = null;
if (stereotype != null) {
checkStereotype(stereotype);
- value = getValue(param.name() + "fontstyle" + stereotype.getLabel(false));
+ value = getFirstValueNonNullWithSuffix("fontstyle" + stereotype.getLabel(false), param);
}
if (value == null) {
- value = getValue(param.name() + "fontstyle");
+ value = getFirstValueNonNullWithSuffix("fontstyle", param);
}
if (value == null) {
value = getValue("defaultfontstyle");
}
if (value == null) {
- return param.getDefaultFontStyle(this, inPackageTitle);
+ return param[0].getDefaultFontStyle(this, inPackageTitle);
}
int result = Font.PLAIN;
if (StringUtils.goLowerCase(value).contains("bold")) {
@@ -275,13 +293,13 @@ public class SkinParam implements ISkinParam {
return result;
}
- public UFont getFont(FontParam fontParam, Stereotype stereotype, boolean inPackageTitle) {
+ public UFont getFont(Stereotype stereotype, boolean inPackageTitle, FontParam... fontParam) {
if (stereotype != null) {
checkStereotype(stereotype);
}
- final String fontFamily = getFontFamily(fontParam, stereotype);
- final int fontStyle = getFontStyle(fontParam, stereotype, inPackageTitle);
- final int fontSize = getFontSize(fontParam, stereotype);
+ final String fontFamily = getFontFamily(stereotype, fontParam);
+ final int fontStyle = getFontStyle(stereotype, inPackageTitle, fontParam);
+ final int fontSize = getFontSize(stereotype, fontParam);
return new UFont(fontFamily, fontStyle, fontSize);
}
@@ -293,7 +311,7 @@ public class SkinParam implements ISkinParam {
// return 11;
// Log.println("SIZE1="+getFontSize(FontParam.CIRCLED_CHARACTER));
// Log.println("SIZE1="+getFontSize(FontParam.CIRCLED_CHARACTER)/3);
- return getFontSize(FontParam.CIRCLED_CHARACTER, null) / 3 + 6;
+ return getFontSize(null, FontParam.CIRCLED_CHARACTER) / 3 + 6;
}
public int classAttributeIconSize() {
@@ -436,6 +454,21 @@ public class SkinParam implements ISkinParam {
return true;
}
+ public boolean shadowingForNote(Stereotype stereotype) {
+ if (stereotype != null) {
+ checkStereotype(stereotype);
+ final String value2 = getValue("note" + "shadowing" + stereotype.getLabel(false));
+ if (value2 != null) {
+ return value2.equalsIgnoreCase("true");
+ }
+ }
+ final String value2 = getValue("note" + "shadowing");
+ if (value2 != null) {
+ return value2.equalsIgnoreCase("true");
+ }
+ return shadowing();
+ }
+
public boolean shadowing2(SkinParameter skinParameter) {
if (skinParameter == null) {
throw new IllegalArgumentException();
@@ -473,7 +506,11 @@ public class SkinParam implements ISkinParam {
}
public Sprite getSprite(String name) {
- return sprites.get(name);
+ Sprite result = sprites.get(name);
+ if (result == null) {
+ result = SpriteImage.fromInternal(name);
+ }
+ return result;
}
public boolean useUml2ForComponent() {
@@ -665,4 +702,36 @@ public class SkinParam implements ISkinParam {
return false;
}
+ public String getSvgLinkTarget() {
+ final String value = getValue("svglinktarget");
+ if (value == null) {
+ return "_top";
+ }
+ return value;
+ }
+
+ public String getMonospacedFamily() {
+ final String value = getValue("defaultMonospacedFontName");
+ if (value == null) {
+ return CommandCreoleMonospaced.MONOSPACED;
+ }
+ return value;
+ }
+
+ public int getTabSize() {
+ final String value = getValue("tabsize");
+ if (value != null && value.matches("\\d+")) {
+ return Integer.parseInt(value);
+ }
+ return 8;
+ }
+
+ public int maxAsciiMessageLength() {
+ final String value = getValue("maxasciimessagelength");
+ if (value != null && value.matches("\\d+")) {
+ return Integer.parseInt(value);
+ }
+ return -1;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/SkinParamBackcolored.java b/src/net/sourceforge/plantuml/SkinParamBackcolored.java
index 0b27f44..f402327 100644
--- a/src/net/sourceforge/plantuml/SkinParamBackcolored.java
+++ b/src/net/sourceforge/plantuml/SkinParamBackcolored.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -63,6 +63,7 @@ public class SkinParamBackcolored extends SkinParamDelegator {
this.backColorGeneral = backColorGeneral;
}
+ @Override
public HtmlColor getBackgroundColor() {
if (backColorGeneral != null) {
return backColorGeneral;
@@ -70,6 +71,7 @@ public class SkinParamBackcolored extends SkinParamDelegator {
return super.getBackgroundColor();
}
+ @Override
public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
if (param.isBackground() && backColorElement != null) {
return backColorElement;
diff --git a/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java b/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java
index 0a96ecb..bfb50f2 100644
--- a/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java
+++ b/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,6 +49,7 @@ public class SkinParamBackcoloredReference extends SkinParamDelegator {
this.sequenceReferenceHeaderBackground = sequenceReferenceHeaderBackground;
}
+ @Override
public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
if (param == ColorParam.sequenceReferenceHeaderBackground && sequenceReferenceHeaderBackground != null) {
return sequenceReferenceHeaderBackground;
diff --git a/src/net/sourceforge/plantuml/SkinParamColors.java b/src/net/sourceforge/plantuml/SkinParamColors.java
new file mode 100644
index 0000000..39e7345
--- /dev/null
+++ b/src/net/sourceforge/plantuml/SkinParamColors.java
@@ -0,0 +1,87 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
+
+public class SkinParamColors extends SkinParamDelegator {
+
+ final private Colors colors;
+
+ public SkinParamColors(ISkinParam skinParam, Colors colors) {
+ super(skinParam);
+ this.colors = colors;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + colors;
+ }
+
+ @Override
+ public boolean shadowing() {
+ if (colors.getShadowing() == null) {
+ return super.shadowing();
+ }
+ return colors.getShadowing();
+ }
+
+ @Override
+ public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
+ final HtmlColor value = colors.getColor(ColorType.TEXT);
+ if (value == null) {
+ return super.getFontHtmlColor(stereotype, param);
+ }
+ return value;
+ }
+
+ @Override
+ public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ final ColorType type = param.getColorType();
+ if (type == null) {
+ return super.getHtmlColor(param, stereotype, clickable);
+ }
+ final HtmlColor value = colors.getColor(type);
+ if (value != null) {
+ return value;
+ }
+ assert value == null;
+ return super.getHtmlColor(param, stereotype, clickable);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/SkinParamDelegator.java b/src/net/sourceforge/plantuml/SkinParamDelegator.java
index 6264ccc..9d5c8c8 100644
--- a/src/net/sourceforge/plantuml/SkinParamDelegator.java
+++ b/src/net/sourceforge/plantuml/SkinParamDelegator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,12 +42,13 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.SkinParameter;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
-import net.sourceforge.plantuml.ugraphic.Sprite;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class SkinParamDelegator implements ISkinParam {
@@ -69,12 +70,12 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.getCircledCharacterRadius();
}
- public UFont getFont(FontParam fontParam, Stereotype stereotype, boolean inPackageTitle) {
- return skinParam.getFont(fontParam, stereotype, false);
+ public UFont getFont(Stereotype stereotype, boolean inPackageTitle, FontParam... fontParam) {
+ return skinParam.getFont(stereotype, false, fontParam);
}
- public HtmlColor getFontHtmlColor(FontParam param, Stereotype stereotype) {
- return skinParam.getFontHtmlColor(param, stereotype);
+ public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
+ return skinParam.getFontHtmlColor(stereotype, param);
}
public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
@@ -180,7 +181,7 @@ public class SkinParamDelegator implements ISkinParam {
public Rankdir getRankdir() {
return skinParam.getRankdir();
}
-
+
public boolean useOctagonForActivity(Stereotype stereotype) {
return skinParam.useOctagonForActivity(stereotype);
}
@@ -213,5 +214,28 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.handwritten();
}
+ public String getSvgLinkTarget() {
+ return skinParam.getSvgLinkTarget();
+ }
+
+ public String getMonospacedFamily() {
+ return skinParam.getMonospacedFamily();
+ }
+
+ public Colors getColors(ColorParam param, Stereotype stereotype) {
+ return skinParam.getColors(param, stereotype);
+ }
+
+ public int getTabSize() {
+ return skinParam.getTabSize();
+ }
+
+ public boolean shadowingForNote(Stereotype stereotype) {
+ return shadowingForNote(stereotype);
+ }
+
+ public int maxAsciiMessageLength() {
+ return skinParam.maxAsciiMessageLength();
+ }
}
diff --git a/src/net/sourceforge/plantuml/SkinParamForceColor.java b/src/net/sourceforge/plantuml/SkinParamForceColor.java
new file mode 100644
index 0000000..201c580
--- /dev/null
+++ b/src/net/sourceforge/plantuml/SkinParamForceColor.java
@@ -0,0 +1,60 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml;
+
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+
+public class SkinParamForceColor extends SkinParamDelegator {
+
+ final private ColorParam colorParam;;
+ final private HtmlColor color;
+
+ public SkinParamForceColor(ISkinParam skinParam, ColorParam colorParam, HtmlColor color) {
+ super(skinParam);
+ this.color = color;
+ this.colorParam = colorParam;
+ }
+
+ @Override
+ public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ if (colorParam == param) {
+ return color;
+ }
+ // return color;
+ return super.getHtmlColor(param, stereotype, clickable);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/SkinParamForecolored.java b/src/net/sourceforge/plantuml/SkinParamForecolored.java
index b04c027..2977400 100644
--- a/src/net/sourceforge/plantuml/SkinParamForecolored.java
+++ b/src/net/sourceforge/plantuml/SkinParamForecolored.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColor;
public class SkinParamForecolored extends SkinParamDelegator {
@@ -45,7 +46,8 @@ public class SkinParamForecolored extends SkinParamDelegator {
this.forecolor = forecolor;
}
- public HtmlColor getHtmlColor(ColorParam param, String stereotype, boolean clickable) {
+ @Override
+ public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
return forecolor;
}
diff --git a/src/net/sourceforge/plantuml/SkinParamSameClassWidth.java b/src/net/sourceforge/plantuml/SkinParamSameClassWidth.java
index c5b5ff0..6058b63 100644
--- a/src/net/sourceforge/plantuml/SkinParamSameClassWidth.java
+++ b/src/net/sourceforge/plantuml/SkinParamSameClassWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,6 +43,7 @@ public class SkinParamSameClassWidth extends SkinParamDelegator {
this.width = width;
}
+ @Override
public double minClassWidth() {
return width;
}
diff --git a/src/net/sourceforge/plantuml/SkinParamUtils.java b/src/net/sourceforge/plantuml/SkinParamUtils.java
index 58c8c3a..3d83ba7 100644
--- a/src/net/sourceforge/plantuml/SkinParamUtils.java
+++ b/src/net/sourceforge/plantuml/SkinParamUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,15 +44,15 @@ public class SkinParamUtils {
private static final Rose rose = new Rose();
public static UFont getFont(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {
- return skinParam.getFont(fontParam, stereo, false);
+ return skinParam.getFont(stereo, false, fontParam);
}
public static HtmlColor getFontColor(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {
- return skinParam.getFontHtmlColor(fontParam, stereo);
+ return skinParam.getFontHtmlColor(stereo, fontParam);
}
public static HtmlColor getColor(ISkinParam skinParam, ColorParam colorParam, Stereotype stereo) {
return rose.getHtmlColor(skinParam, colorParam, stereo);
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/SourceFileReader.java b/src/net/sourceforge/plantuml/SourceFileReader.java
index 3a99030..3b9353d 100644
--- a/src/net/sourceforge/plantuml/SourceFileReader.java
+++ b/src/net/sourceforge/plantuml/SourceFileReader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,12 +34,14 @@
*/
package net.sourceforge.plantuml;
+import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.io.OutputStream;
import java.io.PrintStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
@@ -52,6 +54,7 @@ import net.sourceforge.plantuml.code.Transcoder;
import net.sourceforge.plantuml.code.TranscoderUtil;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.preproc.Defines;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
public class SourceFileReader implements ISourceFileReader {
@@ -99,7 +102,7 @@ public class SourceFileReader implements ISourceFileReader {
this.outputDirectory = outputDirectory;
builder = new BlockUmlBuilder(config, charset, defines, getReader(charset), file.getAbsoluteFile()
- .getParentFile());
+ .getParentFile(), file.getAbsolutePath());
}
public boolean hasError() {
@@ -111,6 +114,53 @@ public class SourceFileReader implements ISourceFileReader {
return false;
}
+ private File getDirIfDirectory(String newName) {
+ Log.info("Checking=" + newName);
+ if (endsWithSlashOrAntislash(newName)) {
+ Log.info("It ends with / so it looks like a directory");
+ newName = newName.substring(0, newName.length() - 1);
+ File f = new File(newName);
+ Log.info("f=" + f);
+ if (f.isAbsolute() == false) {
+ Log.info("It's relative, so let's change it");
+ f = new File(outputDirectory, newName);
+ Log.info("f=" + f);
+ }
+ if (f.exists() == false) {
+ Log.info("It does not exist: let's create it");
+ try {
+ f.mkdirs();
+ } catch (Exception e) {
+ Log.info("Error " + e);
+ }
+ if (f.exists() && f.isDirectory()) {
+ Log.info("Creation ok");
+ return f;
+ }
+ Log.info("We cannot create it");
+ } else if (f.isDirectory() == false) {
+ Log.info("It exists, but is not a directory: we ignore it");
+ return null;
+ }
+ return f;
+
+ }
+ File f = new File(newName);
+ Log.info("f=" + f);
+ if (f.isAbsolute() == false) {
+ Log.info("Relative, so let's change it");
+ f = new File(outputDirectory, newName);
+ Log.info("f=" + f);
+ }
+ if (f.exists() && f.isDirectory()) {
+ Log.info("It's an existing directory");
+ return f;
+ }
+ Log.info("It's not a directory");
+ return null;
+
+ }
+
public List<GeneratedImage> getGeneratedImages() throws IOException {
Log.info("Reading file: " + file);
@@ -118,16 +168,46 @@ public class SourceFileReader implements ISourceFileReader {
final List<GeneratedImage> result = new ArrayList<GeneratedImage>();
for (BlockUml blockUml : builder.getBlockUmls()) {
- String newName = blockUml.getFilename();
-
- if (newName == null) {
+ String newName = blockUml.getFileOrDirname();
+ Log.info("name from block=" + newName);
+ File suggested = null;
+ if (newName != null) {
+ final File dir = getDirIfDirectory(newName);
+ if (dir == null) {
+ Log.info(newName + " is not taken as a directory");
+ suggested = new File(outputDirectory, newName);
+ } else {
+ Log.info("We are going to create files in directory " + dir);
+ newName = fileFormatOption.getFileFormat().changeName(file.getName(), cpt++);
+ suggested = new File(dir, newName);
+ }
+ Log.info("We are going to put data in " + suggested);
+ }
+ if (suggested == null) {
newName = fileFormatOption.getFileFormat().changeName(file.getName(), cpt++);
+ suggested = new File(outputDirectory, newName);
}
-
- final File suggested = new File(outputDirectory, newName);
suggested.getParentFile().mkdirs();
- final Diagram system = blockUml.getDiagram();
+ final Diagram system;
+ try {
+ system = blockUml.getDiagram();
+ } catch (Throwable t) {
+ final GeneratedImage image = new GeneratedImageImpl(suggested, "Crash Error", blockUml);
+ OutputStream os = null;
+ try {
+ os = new BufferedOutputStream(new FileOutputStream(suggested));
+ UmlDiagram.exportDiagramError2(os, t, fileFormatOption, null, blockUml.getFlashData(),
+ UmlDiagram.getFailureText2(t));
+ } finally {
+ if (os != null) {
+ os.close();
+ }
+ }
+
+ return Collections.singletonList(image);
+ }
+
final List<File> exportDiagrams = PSystemUtils.exportDiagrams(system, suggested, fileFormatOption);
OptionFlags.getInstance().logData(file, system);
@@ -143,7 +223,7 @@ public class SourceFileReader implements ISourceFileReader {
ps.close();
}
}
- final GeneratedImage generatedImage = new GeneratedImage(f, desc, blockUml);
+ final GeneratedImage generatedImage = new GeneratedImageImpl(f, desc, blockUml);
result.add(generatedImage);
}
@@ -154,6 +234,10 @@ public class SourceFileReader implements ISourceFileReader {
return Collections.unmodifiableList(result);
}
+ private boolean endsWithSlashOrAntislash(String newName) {
+ return newName.endsWith("/") || newName.endsWith("\\");
+ }
+
public List<String> getEncodedUrl() throws IOException {
final List<String> result = new ArrayList<String>();
final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder();
@@ -178,7 +262,7 @@ public class SourceFileReader implements ISourceFileReader {
this.fileFormatOption = fileFormatOption;
}
- public final Set<File> getIncludedFiles() {
+ public final Set<FileWithSuffix> getIncludedFiles() {
return builder.getIncludedFiles();
}
diff --git a/src/net/sourceforge/plantuml/SourceFileReader2.java b/src/net/sourceforge/plantuml/SourceFileReader2.java
index 855e8ba..ca913b0 100644
--- a/src/net/sourceforge/plantuml/SourceFileReader2.java
+++ b/src/net/sourceforge/plantuml/SourceFileReader2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,6 +50,7 @@ import net.sourceforge.plantuml.code.Transcoder;
import net.sourceforge.plantuml.code.TranscoderUtil;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.preproc.Defines;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
public class SourceFileReader2 implements ISourceFileReader {
@@ -70,7 +71,7 @@ public class SourceFileReader2 implements ISourceFileReader {
FileSystem.getInstance().setCurrentDir(file.getAbsoluteFile().getParentFile());
builder = new BlockUmlBuilder(config, charset, defines, getReader(charset), file.getAbsoluteFile()
- .getParentFile());
+ .getParentFile(), file.getAbsolutePath());
}
public boolean hasError() {
@@ -95,7 +96,7 @@ public class SourceFileReader2 implements ISourceFileReader {
for (File f : PSystemUtils.exportDiagrams(system, suggested, fileFormatOption)) {
final String desc = "[" + file.getName() + "] " + system.getDescription();
- final GeneratedImage generatedImage = new GeneratedImage(f, desc, blockUml);
+ final GeneratedImage generatedImage = new GeneratedImageImpl(f, desc, blockUml);
result.add(generatedImage);
}
@@ -130,7 +131,7 @@ public class SourceFileReader2 implements ISourceFileReader {
this.fileFormatOption = fileFormatOption;
}
- public final Set<File> getIncludedFiles() {
+ public final Set<FileWithSuffix> getIncludedFiles2() {
return builder.getIncludedFiles();
}
diff --git a/src/net/sourceforge/plantuml/SourceStringReader.java b/src/net/sourceforge/plantuml/SourceStringReader.java
index a306d44..5053492 100644
--- a/src/net/sourceforge/plantuml/SourceStringReader.java
+++ b/src/net/sourceforge/plantuml/SourceStringReader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -73,8 +73,7 @@ public class SourceStringReader {
// WARNING GLOBAL LOCK HERE
synchronized (SourceStringReader.class) {
try {
- final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source),
- null);
+ final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source));
this.blocks = builder.getBlockUmls();
} catch (IOException e) {
Log.error("error " + e);
@@ -131,7 +130,7 @@ public class SourceStringReader {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, error.getBackcolor(), null,
null, 0, 0, null, false);
imageBuilder.addUDrawable(error);
- imageBuilder.writeImageTOBEMOVED(fileFormatOption.getFileFormat(), os);
+ imageBuilder.writeImageTOBEMOVED(fileFormatOption, os);
}
public DiagramDescription generateDiagramDescription(OutputStream os) throws IOException {
diff --git a/src/net/sourceforge/plantuml/SpecificBackcolorable.java b/src/net/sourceforge/plantuml/SpecificBackcolorable.java
index 1648fc4..bf56cc5 100644
--- a/src/net/sourceforge/plantuml/SpecificBackcolorable.java
+++ b/src/net/sourceforge/plantuml/SpecificBackcolorable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,12 +34,14 @@
*/
package net.sourceforge.plantuml;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.Colors;
public interface SpecificBackcolorable {
- public HtmlColor getSpecificBackColor();
+ public Colors getColors(ISkinParam skinParam);
- public void setSpecificBackcolor(HtmlColor specificBackcolor);
+ // public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color);
+
+ public void setColors(Colors colors);
}
diff --git a/src/net/sourceforge/plantuml/SpriteContainer.java b/src/net/sourceforge/plantuml/SpriteContainer.java
index e35dd71..33a2a77 100644
--- a/src/net/sourceforge/plantuml/SpriteContainer.java
+++ b/src/net/sourceforge/plantuml/SpriteContainer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,7 +34,7 @@
*/
package net.sourceforge.plantuml;
-import net.sourceforge.plantuml.ugraphic.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public interface SpriteContainer {
diff --git a/src/net/sourceforge/plantuml/SpriteContainerEmpty.java b/src/net/sourceforge/plantuml/SpriteContainerEmpty.java
index 21421ca..f731ebb 100644
--- a/src/net/sourceforge/plantuml/SpriteContainerEmpty.java
+++ b/src/net/sourceforge/plantuml/SpriteContainerEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,12 +34,16 @@
*/
package net.sourceforge.plantuml;
-import net.sourceforge.plantuml.ugraphic.Sprite;
+import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
+import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteImage;
public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
public Sprite getSprite(String name) {
- return null;
+ return SpriteImage.fromInternal(name);
}
public String getValue(String key) {
@@ -54,4 +58,16 @@ public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
return false;
}
+ public String getMonospacedFamily() {
+ return CommandCreoleMonospaced.MONOSPACED;
+ }
+
+ public int getTabSize() {
+ return 8;
+ }
+
+ public IHtmlColorSet getIHtmlColorSet() {
+ return new HtmlColorSetSimple();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/StringUtils.java b/src/net/sourceforge/plantuml/StringUtils.java
index ac14e10..e43255e 100644
--- a/src/net/sourceforge/plantuml/StringUtils.java
+++ b/src/net/sourceforge/plantuml/StringUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,23 +36,18 @@ package net.sourceforge.plantuml;
import java.awt.Color;
import java.io.File;
-import java.io.IOException;
-import java.io.StringReader;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.command.regex.MyPattern;
-import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorTransparent;
-import net.sourceforge.plantuml.preproc.ReadLineReader;
-import net.sourceforge.plantuml.preproc.UncommentReadLine;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
// Do not move
@@ -62,11 +57,7 @@ public class StringUtils {
return file.getAbsolutePath();
}
- public static List<String> getWithNewlines2(Code s) {
- return getWithNewlines2(s.getFullName());
- }
-
- public static List<String> getWithNewlines2(String s) {
+ public static List<String> getWithNewlines(CharSequence s) {
if (s == null) {
return null;
}
@@ -93,17 +84,6 @@ public class StringUtils {
return Collections.unmodifiableList(result);
}
- public static String getMergedLines(List<? extends CharSequence> strings) {
- final StringBuilder sb = new StringBuilder();
- for (int i = 0; i < strings.size(); i++) {
- sb.append(strings.get(i));
- if (i < strings.size() - 1) {
- sb.append("\\n");
- }
- }
- return sb.toString();
- }
-
final static public List<String> getSplit(Pattern pattern, String line) {
final Matcher m = pattern.matcher(line);
if (m.find() == false) {
@@ -118,7 +98,7 @@ public class StringUtils {
}
public static boolean isNotEmpty(String input) {
- return input != null && input.trim().length() > 0;
+ return input != null && trin(input).length() > 0;
}
public static boolean isNotEmpty(List<? extends CharSequence> input) {
@@ -126,7 +106,7 @@ public class StringUtils {
}
public static boolean isEmpty(String input) {
- return input == null || input.trim().length() == 0;
+ return input == null || trin(input).length() == 0;
}
public static String manageHtml(String s) {
@@ -180,7 +160,7 @@ public class StringUtils {
public static String capitalize(String s) {
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
}
-
+
public static String goUpperCase(String s) {
return s.toUpperCase(Locale.ENGLISH);
}
@@ -314,6 +294,10 @@ public class StringUtils {
return '\u0006';
}
+ public static char hiddenNewLine() {
+ return '\u0009';
+ }
+
public static String hideComparatorCharacters(String s) {
s = s.replace('<', hiddenLesserThan());
s = s.replace('>', hiddenBiggerThan());
@@ -326,16 +310,6 @@ public class StringUtils {
return s;
}
- public static int getWidth(List<? extends CharSequence> stringsToDisplay) {
- int result = 1;
- for (CharSequence s : stringsToDisplay) {
- if (result < s.length()) {
- result = s.length();
- }
- }
- return result;
- }
-
public static int getWidth(Display stringsToDisplay) {
int result = 1;
for (CharSequence s : stringsToDisplay) {
@@ -354,72 +328,8 @@ public class StringUtils {
return stringsToDisplay.size();
}
- private static void removeFirstColumn(List<String> data) {
- for (int i = 0; i < data.size(); i++) {
- final String s = data.get(i);
- if (s.length() > 0) {
- data.set(i, s.substring(1));
- }
- }
- }
-
- private static boolean firstColumnRemovable(List<String> data) {
- boolean allEmpty = true;
- for (String s : data) {
- if (s.length() == 0) {
- continue;
- }
- allEmpty = false;
- final char c = s.charAt(0);
- if (c != ' ' && c != '\t') {
- return false;
- }
- }
- return allEmpty == false;
- }
-
- public static List<String> removeEmptyColumns(List<String> data) {
- if (firstColumnRemovable(data) == false) {
- return data;
- }
- final List<String> result = new ArrayList<String>(data);
- do {
- removeFirstColumn(result);
- } while (firstColumnRemovable(result));
- return result;
- }
-
- public static void trim(List<String> data, boolean removeEmptyLines) {
- for (int i = 0; i < data.size(); i++) {
- final String s = data.get(i);
- data.set(i, s.trim());
- }
- if (removeEmptyLines) {
- for (final Iterator<String> it = data.iterator(); it.hasNext();) {
- if (it.next().length() == 0) {
- it.remove();
- }
- }
- }
- }
-
- public static String uncommentSource(String source) {
- final StringReader sr = new StringReader(source);
- final UncommentReadLine un = new UncommentReadLine(new ReadLineReader(sr));
- final StringBuilder sb = new StringBuilder();
- String s = null;
- try {
- while ((s = un.readLine()) != null) {
- sb.append(s);
- sb.append('\n');
- }
- } catch (IOException e) {
- Log.error("Error " + e);
- throw new IllegalStateException(e.toString());
- }
-
- sr.close();
- return sb.toString();
+ private static boolean isSpaceOrTab(char c) {
+ return c == ' ' || c == '\t';
}
public static boolean isDiagramCacheable(String uml) {
@@ -440,7 +350,7 @@ public class StringUtils {
}
public static List<String> splitComma(String s) {
- s = s.trim();
+ s = trin(s);
// if (s.matches("([\\p{L}0-9_.]+|[%g][^%g]+[%g])(\\s*,\\s*([\\p{L}0-9_.]+|[%g][^%g]+[%g]))*") == false) {
// throw new IllegalArgumentException();
// }
@@ -481,10 +391,6 @@ public class StringUtils {
return uid1 + String.format("%04d", uid2);
}
- public static boolean isMethod(String s) {
- return s.contains("(") || s.contains(")");
- }
-
public static <O> List<O> merge(List<O> l1, List<O> l2) {
final List<O> result = new ArrayList<O>(l1);
result.addAll(l2);
@@ -495,5 +401,85 @@ public class StringUtils {
return s.endsWith("\\") && s.endsWith("\\\\") == false;
}
+ public static String manageGuillemetStrict(String st) {
+ if (st.startsWith("<< ")) {
+ st = "\u00AB" + st.substring(3);
+ } else if (st.startsWith("<<")) {
+ st = "\u00AB" + st.substring(2);
+ }
+ if (st.endsWith(" >>")) {
+ st = st.substring(0, st.length() - 3) + "\u00BB";
+ } else if (st.endsWith(">>")) {
+ st = st.substring(0, st.length() - 2) + "\u00BB";
+ }
+ return st;
+ }
+
+ public static String manageGuillemet(String st) {
+ return st.replaceAll("\\<\\<([^<>]+)\\>\\>", "\u00AB$1\u00BB");
+ }
+
+ public static String manageUnicodeNotationUplus(String s) {
+ final Pattern pattern = Pattern.compile("\\<U\\+([0-9a-fA-F]{4})\\>");
+ final Matcher matcher = pattern.matcher(s);
+ final StringBuffer result = new StringBuffer();
+ while (matcher.find()) {
+ final String num = matcher.group(1);
+ final int value = Integer.parseInt(num, 16);
+ final char c = (char) value;
+ matcher.appendReplacement(result, "" + c);
+ }
+ matcher.appendTail(result);
+ return result.toString();
+ }
+
+ public static String manageAmpDiese(String s) {
+ final Pattern pattern = Pattern.compile("\\&#([0-9]+);");
+ final Matcher matcher = pattern.matcher(s);
+ final StringBuffer result = new StringBuffer();
+ while (matcher.find()) {
+ final String num = matcher.group(1);
+ final char c = (char) Integer.parseInt(num);
+ matcher.appendReplacement(result, "" + c);
+ }
+ matcher.appendTail(result);
+ return result.toString();
+ }
+
+ public static String manageTildeArobaseStart(String s) {
+ s = s.replaceAll("~@start", "@start");
+ return s;
+ }
+
+ public static String trinNoTrace(CharSequence s) {
+ return s.toString().trim();
+ }
+
+ public static String trin(CharSequence arg) {
+ if (arg.length() == 0) {
+ return arg.toString();
+ }
+ int i = 0;
+ while (i < arg.length() && isSpaceOrTab(arg.charAt(i))) {
+ i++;
+ }
+ int j = arg.length() - 1;
+ while (j >= i && isSpaceOrTab(arg.charAt(j))) {
+ j--;
+ }
+ if (i == 0 && j == arg.length() - 1) {
+ return arg.toString();
+ }
+ return arg.subSequence(i, j + 1).toString();
+ }
+
+ public static List<String> splitHiddenNewLine(String s) {
+ return Arrays.asList(s.split("" + hiddenNewLine()));
+ }
+
+ public static String manageNewLine(String string) {
+ return string.replace(hiddenNewLine(), '\n');
+ }
+
// http://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html
}
diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java
index 02b9a0f..ed1b500 100644
--- a/src/net/sourceforge/plantuml/UmlDiagram.java
+++ b/src/net/sourceforge/plantuml/UmlDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -56,10 +56,11 @@ import javax.script.ScriptException;
import net.sourceforge.plantuml.anim.Animation;
import net.sourceforge.plantuml.anim.AnimationDecoder;
import net.sourceforge.plantuml.api.ImageDataSimple;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.core.UmlSource;
-import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException;
import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
@@ -77,41 +78,47 @@ import net.sourceforge.plantuml.svek.EmptySvgException;
import net.sourceforge.plantuml.svek.GraphvizCrash;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
-import net.sourceforge.plantuml.ugraphic.Sprite;
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
import net.sourceforge.plantuml.version.Version;
-public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
+public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Annotated {
private boolean rotation;
private boolean hideUnlinkedData;
private int minwidth = Integer.MAX_VALUE;
- private Display title;
- private Display header;
- private Display footer;
- private Display legend = null;
- private HorizontalAlignment legendAlignment = HorizontalAlignment.CENTER;
- private VerticalAlignment legendVerticalAlignment = VerticalAlignment.BOTTOM;
+ private DisplayPositionned title = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.TOP);
+ private DisplayPositionned caption = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
+ private DisplayPositionned header = DisplayPositionned.none(HorizontalAlignment.RIGHT, VerticalAlignment.TOP);
+ private DisplayPositionned footer = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
+ private DisplayPositionned legend = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
- private HorizontalAlignment headerAlignment = HorizontalAlignment.RIGHT;
- private HorizontalAlignment footerAlignment = HorizontalAlignment.CENTER;
private final Pragma pragma = new Pragma();
private Scale scale;
private Animation animation;
private final SkinParam skinParam = new SkinParam();
- final public void setTitle(Display strings) {
- this.title = strings;
+ final public void setTitle(DisplayPositionned title) {
+ this.title = title;
}
- final public Display getTitle() {
+ final public void setCaption(DisplayPositionned caption) {
+ this.caption = caption;
+ }
+
+ final public DisplayPositionned getCaption() {
+ return caption;
+ }
+
+ @Override
+ final public DisplayPositionned getTitle() {
return title;
}
@@ -139,36 +146,30 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
skinParam.setParam(StringUtils.goLowerCase(key), value);
}
- public final Display getHeader() {
+ public final DisplayPositionned getHeader() {
return header;
}
- public final void setHeader(Display header) {
+ public final void setHeader(DisplayPositionned header) {
this.header = header;
}
- public final Display getFooter() {
+ public final DisplayPositionned getFooter() {
return footer;
}
- public final void setFooter(Display footer) {
+ public final void setFooter(DisplayPositionned footer) {
this.footer = footer;
}
- public final HorizontalAlignment getHeaderAlignment() {
- return headerAlignment;
- }
-
- public final void setHeaderAlignment(HorizontalAlignment headerAlignment) {
- this.headerAlignment = headerAlignment;
- }
-
- public final HorizontalAlignment getFooterAlignment() {
- return footerAlignment;
- }
-
- public final void setFooterAlignment(HorizontalAlignment footerAlignment) {
- this.footerAlignment = footerAlignment;
+ public final DisplayPositionned getFooterOrHeaderTeoz(FontParam param) {
+ if (param == FontParam.FOOTER) {
+ return getFooter();
+ }
+ if (param == FontParam.HEADER) {
+ return getHeader();
+ }
+ throw new IllegalArgumentException();
}
abstract public UmlDiagramType getUmlDiagramType();
@@ -185,7 +186,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
return scale;
}
- final public void setAnimation(List<String> animationData) {
+ final public void setAnimation(Iterable<CharSequence> animationData) {
try {
final AnimationDecoder animationDecoder = new AnimationDecoder(animationData);
this.animation = Animation.create(animationDecoder.decode());
@@ -231,36 +232,27 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
return imageData;
} catch (UnparsableGraphvizException e) {
e.printStackTrace();
- exportDiagramError(os, e.getCause(), fileFormatOption, e.getGraphvizVersion(), e.getDebugData());
+ exportDiagramError(os, e.getCause(), fileFormatOption, e.getGraphvizVersion());
} catch (Exception e) {
e.printStackTrace();
- exportDiagramError(os, e, fileFormatOption, null, null);
+ exportDiagramError(os, e, fileFormatOption, null);
}
return new ImageDataSimple();
-
}
private void exportDiagramError(OutputStream os, Throwable exception, FileFormatOption fileFormat,
- String graphvizVersion, String svg) throws IOException {
- final UFont font = new UFont("SansSerif", Font.PLAIN, 12);
- final List<String> strings = getFailureText(exception, graphvizVersion);
-
- final String flash = getFlashData();
- for (StackTraceElement ste : exception.getStackTrace()) {
- strings.add(" " + ste.toString());
- }
- if (exception.getCause() != null) {
- final Throwable cause = exception.getCause();
- strings.add(" ");
- strings.add("Caused by " + cause.toString());
- for (StackTraceElement ste : cause.getStackTrace()) {
- strings.add(" " + ste.toString());
- }
+ String graphvizVersion) throws IOException {
+ exportDiagramError2(os, exception, fileFormat, getMetadata(), getFlashData(),
+ getFailureText1(exception, graphvizVersion));
+ }
- }
+ public static void exportDiagramError2(OutputStream os, Throwable exception, FileFormatOption fileFormat,
+ String metadata, String flash, List<String> strings) throws IOException {
+ final UFont font = new UFont("SansSerif", Font.PLAIN, 12);
+ strings.addAll(CommandExecutionResult.getStackTrace(exception));
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
- getMetadata(), null, 0, 0, null, getSkinParam().handwritten());
+ metadata, null, 0, 0, null, false);
final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
final BufferedImage im = utils.exportFlashcode(flash);
@@ -284,20 +276,17 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
}
});
}
- imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private String getFlashData() {
- // for (Map.Entry<Object, Object> ent : System.getProperties().entrySet()) {
- // System.err.println("p1=" + ent.getKey() + " " + ent.getValue());
- // }
final StringBuilder result = new StringBuilder();
final UmlSource source = getSource();
result.append(source.getPlainString());
return result.toString();
}
- private List<String> getFailureText(Throwable exception, String graphvizVersion) {
+ static private List<String> getFailureText1(Throwable exception, String graphvizVersion) {
final List<String> strings = new ArrayList<String>();
strings.add("An error has occured : " + exception);
final String quote = QuoteUtils.getSomeQuote();
@@ -321,7 +310,20 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
strings.add("You should send this diagram and this image to <b>plantuml@gmail.com</b> to solve this issue.");
strings.add("You can try to turn arround this issue by simplifing your diagram.");
strings.add(" ");
- strings.add(exception.toString());
+ return strings;
+ }
+
+ public static List<String> getFailureText2(Throwable exception) {
+ final List<String> strings = new ArrayList<String>();
+ strings.add("An error has occured : " + exception);
+ final String quote = QuoteUtils.getSomeQuote();
+ strings.add("<i>" + quote);
+ strings.add(" ");
+ strings.add("PlantUML (" + Version.versionString() + ") has crashed.");
+ strings.add(" ");
+ strings.add("You should send this diagram and this image to <b>plantuml@gmail.com</b> to solve this issue.");
+ strings.add("You can try to turn arround this issue by simplifing your diagram.");
+ strings.add(" ");
return strings;
}
@@ -410,21 +412,11 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram {
skinParam.addSprite(name, sprite);
}
- public final Display getLegend() {
+ public final DisplayPositionned getLegend() {
return legend;
}
- public final HorizontalAlignment getLegendAlignment() {
- return legendAlignment;
- }
-
- public final VerticalAlignment getLegendVerticalAlignment() {
- return legendVerticalAlignment;
- }
-
- public final void setLegend(Display legend, HorizontalAlignment horizontalAlignment, VerticalAlignment valignment) {
+ public final void setLegend(DisplayPositionned legend) {
this.legend = legend;
- this.legendAlignment = horizontalAlignment;
- this.legendVerticalAlignment = valignment;
}
}
diff --git a/src/net/sourceforge/plantuml/UmlDiagramType.java b/src/net/sourceforge/plantuml/UmlDiagramType.java
index 301ee57..297cab3 100644
--- a/src/net/sourceforge/plantuml/UmlDiagramType.java
+++ b/src/net/sourceforge/plantuml/UmlDiagramType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/Url.java b/src/net/sourceforge/plantuml/Url.java
index f181637..80c7ec7 100644
--- a/src/net/sourceforge/plantuml/Url.java
+++ b/src/net/sourceforge/plantuml/Url.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -57,7 +57,7 @@ public class Url implements EnsureVisible {
if (tooltip == null) {
this.tooltip = url;
} else {
- this.tooltip = tooltip;
+ this.tooltip = StringUtils.manageNewLine(tooltip);
}
if (label == null) {
this.label = url;
@@ -65,6 +65,15 @@ public class Url implements EnsureVisible {
this.label = label;
}
}
+
+ public static boolean isLatex(String pendingUrl) {
+ return pendingUrl.startsWith("latex://");
+ }
+
+ public boolean isLatex() {
+ return isLatex(url);
+ }
+
public final String getUrl() {
return url;
diff --git a/src/net/sourceforge/plantuml/UrlBuilder.java b/src/net/sourceforge/plantuml/UrlBuilder.java
index 2ab4865..6cf6252 100644
--- a/src/net/sourceforge/plantuml/UrlBuilder.java
+++ b/src/net/sourceforge/plantuml/UrlBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,7 +45,21 @@ public class UrlBuilder {
STRICT, AT_START, ANYWHERE, AT_END
}
- private static final String URL_PATTERN = "\\[\\[([%g][^%g]+[%g]|[^{}%s\\]\\[]*)(?:[%s]*\\{([^{}]+)\\})?(?:[%s]*([^\\]\\[]+))?\\]\\]";
+ private static String level0() {
+ return "(?:[^{}]|\\{[^{}]*\\})+";
+ }
+
+ private static String levelN(int n) {
+ if (n == 0) {
+ return level0();
+ }
+ return "(?:[^{}]|\\{" + levelN(n - 1) + "\\})+";
+ }
+
+ private static final String URL_PATTERN_OLD = "\\[\\[([%g][^%g]+[%g]|[^{}%s\\]\\[]*)(?:[%s]*\\{((?:[^{}]|\\{[^{}]*\\})+)\\})?(?:[%s]*([^\\]\\[]+))?\\]\\]";
+
+ private static final String URL_PATTERN = "\\[\\[([%g][^%g]+[%g]|[^{}%s\\]\\[]*)(?:[%s]*\\{" + "(" + levelN(3)
+ + ")" + "\\})?(?:[%s]*([^\\]\\[]+))?\\]\\]";
private final String topurl;
private ModeUrl mode;
@@ -55,6 +69,21 @@ public class UrlBuilder {
this.mode = mode;
}
+ public static String multilineTooltip(String label) {
+ final Pattern p = MyPattern.cmpile("(?i)^(" + URL_PATTERN + ")?(.*)$");
+ final Matcher m = p.matcher(label);
+ if (m.matches() == false) {
+ return label;
+ }
+ String gr1 = m.group(1);
+ if (gr1 == null) {
+ return label;
+ }
+ final String gr2 = m.group(m.groupCount());
+ gr1 = gr1.replaceAll("\\\\n", "\n");
+ return gr1 + gr2;
+ }
+
public Url getUrl(String s) {
final Pattern p;
if (mode == ModeUrl.STRICT) {
@@ -68,7 +97,7 @@ public class UrlBuilder {
} else {
throw new IllegalStateException();
}
- final Matcher m = p.matcher(s.trim());
+ final Matcher m = p.matcher(StringUtils.trinNoTrace(s));
if (m.matches() == false) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java
index f124580..21b953e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java
index 3a7dba8..2454605 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.activitydiagram.command.CommandEndPartition;
import net.sourceforge.plantuml.activitydiagram.command.CommandEndif;
import net.sourceforge.plantuml.activitydiagram.command.CommandIf;
import net.sourceforge.plantuml.activitydiagram.command.CommandLinkActivity;
-import net.sourceforge.plantuml.activitydiagram.command.CommandLinkLongActivity2;
+import net.sourceforge.plantuml.activitydiagram.command.CommandLinkLongActivity;
import net.sourceforge.plantuml.activitydiagram.command.CommandPartition;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandFootboxIgnored;
@@ -67,15 +67,15 @@ public class ActivityDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandPartition());
cmds.add(new CommandEndPartition());
- cmds.add(new CommandLinkLongActivity2());
+ cmds.add(new CommandLinkLongActivity());
final FactoryNoteActivityCommand factoryNoteActivityCommand = new FactoryNoteActivityCommand();
cmds.add(factoryNoteActivityCommand.createSingleLine());
- cmds.add(factoryNoteActivityCommand.createMultiLine());
+ cmds.add(factoryNoteActivityCommand.createMultiLine(false));
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
- cmds.add(factoryNoteOnLinkCommand.createMultiLine());
+ cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
cmds.add(new CommandIf());
cmds.add(new CommandElse());
diff --git a/src/net/sourceforge/plantuml/activitydiagram/ConditionalContext.java b/src/net/sourceforge/plantuml/activitydiagram/ConditionalContext.java
index 20cba23..e0fa7d9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/ConditionalContext.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/ConditionalContext.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandElse.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandElse.java
index 031a2a1..b08f60d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandElse.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandElse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndPartition.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndPartition.java
index a9ce25c..67c0242 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndPartition.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndPartition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndif.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndif.java
index ed0ca2c..0e1a8bb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndif.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandEndif.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java
index 8fd2456..28b8c28 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandInnerConcurrent.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandInnerConcurrent.java
index 517e94b..a6a2865 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandInnerConcurrent.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandInnerConcurrent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
index c76aa00..c3072eb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.activitydiagram.command;
import net.sourceforge.plantuml.Direction;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
@@ -57,8 +58,8 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
@@ -77,7 +78,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("BACKCOLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp2(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
@@ -104,7 +105,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("PARTITION2", "(?:in[%s]+([%g][^%g]+[%g]|\\S+))?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("BACKCOLOR2", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp3(), //
new RegexLeaf("$"));
}
@@ -118,7 +119,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
entity1.setStereotype(new Stereotype(arg.get("STEREOTYPE", 0)));
}
if (arg.get("BACKCOLOR", 0) != null) {
- entity1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet()
+ entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(arg.get("BACKCOLOR", 0)));
}
@@ -127,7 +128,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
return CommandExecutionResult.error("No such activity");
}
if (arg.get("BACKCOLOR2", 0) != null) {
- entity2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet()
+ entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(arg.get("BACKCOLOR2", 0)));
}
if (arg.get("STEREOTYPE2", 0) != null) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java
index 7e2c6a1..f26004c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,10 +37,13 @@ package net.sourceforge.plantuml.activitydiagram.command;
import java.util.List;
import net.sourceforge.plantuml.Direction;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
+import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
@@ -59,7 +62,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram> {
@@ -86,7 +89,15 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
new RegexLeaf("BACKCOLOR", "(#\\w+)?"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
- new RegexLeaf("ARROW", "([-=.]+(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.]))?[-=.]*\\>)"), //
+
+ new RegexLeaf("ARROW_BODY1", "([-.]+)"), //
+ new RegexLeaf("ARROW_STYLE1",
+ "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden)(?:,#\\w+|,dotted|,dashed|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), //
+ new RegexLeaf("ARROW_STYLE2",
+ "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden)(?:,#\\w+|,dotted|,dashed|,bold|,hidden)*)\\])?"), //
+ new RegexLeaf("ARROW_BODY2", "([-.]*)\\>"), //
+
new RegexLeaf("[%s]*"), //
new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"), //
new RegexLeaf("[%s]*"), //
@@ -95,9 +106,9 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
new RegexLeaf("$"));
}
- public CommandExecutionResult executeNow(final ActivityDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) {
+ lines = lines.trim(false);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final IEntity entity1 = CommandLinkActivity.getEntity(diagram, line0, true);
@@ -105,7 +116,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
entity1.setStereotype(new Stereotype(line0.get("STEREOTYPE", 0)));
}
if (line0.get("BACKCOLOR", 0) != null) {
- entity1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet()
+ entity1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(line0.get("BACKCOLOR", 0)));
}
final StringBuilder sb = new StringBuilder();
@@ -113,29 +124,29 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
final String desc0 = line0.get("DESC", 0);
Url urlActivity = null;
if (StringUtils.isNotEmpty(desc0)) {
- final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- urlActivity = urlBuilder.getUrl(desc0);
+ urlActivity = extractUrl(diagram, desc0);
if (urlActivity == null) {
sb.append(desc0);
sb.append("\\n");
}
}
- for (int i = 1; i < lines.size() - 1; i++) {
+ int i = 0;
+ for (CharSequence cs : lines.subExtract(1, 1)) {
+ i++;
if (i == 1 && urlActivity == null) {
- final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- urlActivity = urlBuilder.getUrl(lines.get(i));
+ urlActivity = extractUrl(diagram, cs);
if (urlActivity != null) {
continue;
}
}
- sb.append(lines.get(i));
+ sb.append(cs);
if (i < lines.size() - 2) {
sb.append("\\n");
}
}
- final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()),
- lines.get(lines.size() - 1));
+ final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()), lines.getLast499()
+ .toString());
if (StringUtils.isNotEmpty(lineLast.get(0))) {
if (sb.length() > 0 && sb.toString().endsWith("\\n") == false) {
sb.append("\\n");
@@ -152,8 +163,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
partition = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(partition);
}
if (partition != null) {
- diagram.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
- null);
+ diagram.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE, null);
}
final IEntity entity2 = diagram.createLeaf(code, Display.getWithNewlines(display), LeafType.ACTIVITY, null);
if (partition != null) {
@@ -167,24 +177,29 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
entity2.setStereotype(new Stereotype(lineLast.get(2)));
}
if (lineLast.get(4) != null) {
- entity2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(lineLast.get(4)));
+ entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(lineLast.get(4)));
}
if (entity1 == null || entity2 == null) {
return CommandExecutionResult.error("No such entity");
}
- final String arrow = StringUtils.manageArrowForCuca(line0.get("ARROW", 0));
+ final String arrowBody1 = CommandLinkClass.notNull(line0.get("ARROW_BODY1", 0));
+ final String arrowBody2 = CommandLinkClass.notNull(line0.get("ARROW_BODY2", 0));
+ final String arrowDirection = CommandLinkClass.notNull(line0.get("ARROW_DIRECTION", 0));
+
+ final String arrow = StringUtils.manageArrowForCuca(arrowBody1 + arrowDirection + arrowBody2 + ">");
+
final int lenght = arrow.length() - 1;
final Display linkLabel = Display.getWithNewlines(line0.get("BRACKET", 0));
LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
- if (line0.get("ARROW", 0).contains(".")) {
+ if (arrow.contains(".")) {
type = type.getDotted();
}
Link link = new Link(entity1, entity2, type, linkLabel, lenght);
- final Direction direction = StringUtils.getArrowDirection(line0.get("ARROW", 0));
+ final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">");
if (direction == Direction.LEFT || direction == Direction.UP) {
link = link.getInv();
}
@@ -195,9 +210,15 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
link.setUrl(urlLink);
}
+ CommandLinkClass.applyStyle(line0.getLazzy("ARROW_STYLE", 0), link);
diagram.addLink(link);
return CommandExecutionResult.ok();
}
+ public Url extractUrl(final ActivityDiagram diagram, CharSequence string) {
+ final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ return urlBuilder.getUrl(string.toString());
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity2.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity2.java
deleted file mode 100644
index 7c57629..0000000
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity2.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2014, Arnaud Roques
- *
- * Project Info: http://plantuml.sourceforge.net
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.activitydiagram.command;
-
-import java.util.List;
-
-import net.sourceforge.plantuml.Direction;
-import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.UrlBuilder;
-import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
-import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
-import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
-import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.CommandMultilines2;
-import net.sourceforge.plantuml.command.MultilinesStrategy;
-import net.sourceforge.plantuml.command.regex.MyPattern;
-import net.sourceforge.plantuml.command.regex.RegexConcat;
-import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.command.regex.RegexOptional;
-import net.sourceforge.plantuml.command.regex.RegexOr;
-import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.cucadiagram.Code;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.GroupType;
-import net.sourceforge.plantuml.cucadiagram.IEntity;
-import net.sourceforge.plantuml.cucadiagram.LeafType;
-import net.sourceforge.plantuml.cucadiagram.Link;
-import net.sourceforge.plantuml.cucadiagram.LinkDecor;
-import net.sourceforge.plantuml.cucadiagram.LinkType;
-import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
-
-public class CommandLinkLongActivity2 extends CommandMultilines2<ActivityDiagram> {
-
- public CommandLinkLongActivity2() {
- super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
- }
-
- @Override
- public String getPatternEnd() {
- return "(?i)^[%s]*([^%g]*)[%g](?:[%s]+as[%s]+([\\p{L}0-9][\\p{L}0-9_.]*))?[%s]*(\\<\\<.*\\>\\>)?[%s]*(?:in[%s]+([%g][^%g]+[%g]|\\S+))?[%s]*(#\\w+)?$";
- }
-
- static RegexConcat getRegexConcat() {
- return new RegexConcat(new RegexLeaf("^"), //
- new RegexOptional(//
- new RegexOr("FIRST", //
- new RegexLeaf("STAR", "(\\(\\*(top)?\\))"), //
- new RegexLeaf("CODE", "([\\p{L}0-9][\\p{L}0-9_.]*)"), //
- new RegexLeaf("BAR", "(?:==+)[%s]*([\\p{L}0-9_.]+)[%s]*(?:==+)"), //
- new RegexLeaf("QUOTED", "[%g]([^%g]+)[%g](?:[%s]+as[%s]+([\\p{L}0-9_.]+))?"))), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("BACKCOLOR", "(#\\w+)?"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
-
- new RegexLeaf("ARROW_BODY1", "([-.]+)"), //
- new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden)(?:,#\\w+|,dotted|,dashed|,bold|,hidden)*)\\])?"), //
- new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), //
- new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden)(?:,#\\w+|,dotted|,dashed|,bold|,hidden)*)\\])?"), //
- new RegexLeaf("ARROW_BODY2", "([-.]*)\\>"), //
-
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("BRACKET", "(?:\\[([^\\]*]+[^\\]]*)\\])?"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("DESC", "[%g]([^%g]*?)"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("$"));
- }
-
- public CommandExecutionResult executeNow(final ActivityDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
-
- final IEntity entity1 = CommandLinkActivity.getEntity(diagram, line0, true);
-
- if (line0.get("STEREOTYPE", 0) != null) {
- entity1.setStereotype(new Stereotype(line0.get("STEREOTYPE", 0)));
- }
- if (line0.get("BACKCOLOR", 0) != null) {
- entity1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet()
- .getColorIfValid(line0.get("BACKCOLOR", 0)));
- }
- final StringBuilder sb = new StringBuilder();
-
- final String desc0 = line0.get("DESC", 0);
- Url urlActivity = null;
- if (StringUtils.isNotEmpty(desc0)) {
- final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- urlActivity = urlBuilder.getUrl(desc0);
- if (urlActivity == null) {
- sb.append(desc0);
- sb.append("\\n");
- }
- }
- for (int i = 1; i < lines.size() - 1; i++) {
- if (i == 1 && urlActivity == null) {
- final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- urlActivity = urlBuilder.getUrl(lines.get(i));
- if (urlActivity != null) {
- continue;
- }
- }
- sb.append(lines.get(i));
- if (i < lines.size() - 2) {
- sb.append("\\n");
- }
- }
-
- final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()),
- lines.get(lines.size() - 1));
- if (StringUtils.isNotEmpty(lineLast.get(0))) {
- if (sb.length() > 0 && sb.toString().endsWith("\\n") == false) {
- sb.append("\\n");
- }
- sb.append(lineLast.get(0));
- }
-
- final String display = sb.toString();
- final Code code = Code.of(lineLast.get(1) == null ? display : lineLast.get(1));
-
- String partition = null;
- if (lineLast.get(3) != null) {
- partition = lineLast.get(3);
- partition = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(partition);
- }
- if (partition != null) {
- diagram.getOrCreateGroup(Code.of(partition), Display.getWithNewlines(partition), GroupType.PACKAGE,
- null);
- }
- final IEntity entity2 = diagram.createLeaf(code, Display.getWithNewlines(display), LeafType.ACTIVITY, null);
- if (partition != null) {
- diagram.endGroup();
- }
- if (urlActivity != null) {
- entity2.addUrl(urlActivity);
- }
-
- if (lineLast.get(2) != null) {
- entity2.setStereotype(new Stereotype(lineLast.get(2)));
- }
- if (lineLast.get(4) != null) {
- entity2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(lineLast.get(4)));
- }
-
- if (entity1 == null || entity2 == null) {
- return CommandExecutionResult.error("No such entity");
- }
-
- final String arrowBody1 = CommandLinkClass.notNull(line0.get("ARROW_BODY1", 0));
- final String arrowBody2 = CommandLinkClass.notNull(line0.get("ARROW_BODY2", 0));
- final String arrowDirection = CommandLinkClass.notNull(line0.get("ARROW_DIRECTION", 0));
-
- final String arrow = StringUtils.manageArrowForCuca(arrowBody1 + arrowDirection + arrowBody2 + ">");
-
- final int lenght = arrow.length() - 1;
-
- final Display linkLabel = Display.getWithNewlines(line0.get("BRACKET", 0));
-
- LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
- if (arrow.contains(".")) {
- type = type.getDotted();
- }
- Link link = new Link(entity1, entity2, type, linkLabel, lenght);
- final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">");
- if (direction == Direction.LEFT || direction == Direction.UP) {
- link = link.getInv();
- }
-
- if (line0.get("URL", 0) != null) {
- final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- final Url urlLink = urlBuilder.getUrl(line0.get("URL", 0));
- link.setUrl(urlLink);
- }
-
- CommandLinkClass.applyStyle(line0.getLazzy("ARROW_STYLE", 0), link);
- diagram.addLink(link);
-
- return CommandExecutionResult.ok();
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java
index c4e3cee..6fddb07 100644
--- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java
+++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.activitydiagram.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
@@ -44,8 +45,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandPartition extends SingleLineCommand<ActivityDiagram> {
@@ -61,7 +61,7 @@ public class CommandPartition extends SingleLineCommand<ActivityDiagram> {
currentPackage);
final String color = arg.get(1);
if (color != null) {
- p.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+ p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
}
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
index cbcd1ec..bbfbfdf 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,42 +35,34 @@
package net.sourceforge.plantuml.activitydiagram3;
import java.awt.geom.Dimension2D;
-import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.List;
+import net.sourceforge.plantuml.AnnotatedWorker;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption;
-import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Scale;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
-import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlanes;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.DiagramDescriptionImpl;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockCompressed;
import net.sourceforge.plantuml.graphic.TextBlockRecentred;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
-import net.sourceforge.plantuml.svek.DecorateEntityImage;
-import net.sourceforge.plantuml.svek.DecorateTextBlock;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
-import net.sourceforge.plantuml.ugraphic.UFont;
public class ActivityDiagram3 extends UmlDiagram {
@@ -80,7 +72,7 @@ public class ActivityDiagram3 extends UmlDiagram {
private SwimlaneStrategy swimlaneStrategy;
- private final Swimlanes swinlanes = new Swimlanes(getSkinParam());
+ private final Swimlanes swinlanes = new Swimlanes(getSkinParam(), getPragma());
private void manageSwimlaneStrategy() {
if (swimlaneStrategy == null) {
@@ -112,10 +104,10 @@ public class ActivityDiagram3 extends UmlDiagram {
return swinlanes.nextLinkRenderer();
}
- public void addActivity(Display activity, HtmlColor color, BoxStyle style, Url url) {
+ public void addActivity(Display activity, BoxStyle style, Url url, Colors colors) {
manageSwimlaneStrategy();
- final InstructionSimple ins = new InstructionSimple(activity, color, nextLinkRenderer(),
- swinlanes.getCurrentSwimlane(), style, url);
+ final InstructionSimple ins = new InstructionSimple(activity, nextLinkRenderer(),
+ swinlanes.getCurrentSwimlane(), style, url, colors);
current().add(ins);
setNextLinkRendererInternal(null);
manageHasUrl(activity);
@@ -148,6 +140,11 @@ public class ActivityDiagram3 extends UmlDiagram {
current().add(new InstructionStop(swinlanes.getCurrentSwimlane(), nextLinkRenderer()));
}
+ public void end() {
+ manageSwimlaneStrategy();
+ current().add(new InstructionEnd(swinlanes.getCurrentSwimlane(), nextLinkRenderer()));
+ }
+
public DiagramDescription getDescription() {
return new DiagramDescriptionImpl("activity3", getClass());
}
@@ -157,16 +154,6 @@ public class ActivityDiagram3 extends UmlDiagram {
return UmlDiagramType.ACTIVITY;
}
- private TextBlock addLegend(TextBlock original) {
- final Display legend = getLegend();
- if (legend == null) {
- return original;
- }
- final TextBlock text = EntityImageLegend.create(legend, getSkinParam());
-
- return DecorateEntityImage.add(original, text, getLegendAlignment(), getLegendVerticalAlignment());
- }
-
@Override
protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption)
throws IOException {
@@ -175,10 +162,8 @@ public class ActivityDiagram3 extends UmlDiagram {
// TextBlock result = swinlanes;
TextBlock result = new TextBlockCompressed(swinlanes);
result = new TextBlockRecentred(result);
- result = addLegend(result);
- result = addTitle(result);
- result = addHeaderAndFooter(result);
final ISkinParam skinParam = getSkinParam();
+ result = new AnnotatedWorker(this, skinParam).addAdd(result);
final Dimension2D dim = TextBlockUtils.getMinMax(result).getDimension();
final double margin = 10;
final double dpiFactor = getDpiFactor(fileFormatOption, Dimension2DDouble.delta(dim, 2 * margin, 0));
@@ -188,7 +173,7 @@ public class ActivityDiagram3 extends UmlDiagram {
margin, margin, getAnimation(), getSkinParam().handwritten());
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormatOption.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormatOption, os);
}
@@ -203,43 +188,15 @@ public class ActivityDiagram3 extends UmlDiagram {
return dpiFactor;
}
- private TextBlock addTitle(TextBlock original) {
- final Display title = getTitle();
- if (title == null) {
- return original;
- }
- final TextBlock text = TextBlockUtils.create(title, new FontConfiguration(getFont(FontParam.TITLE),
- getFontColor(FontParam.TITLE, null), getSkinParam().getHyperlinkColor(), getSkinParam()
- .useUnderlineForHyperlink()), HorizontalAlignment.CENTER, getSkinParam());
-
- return new DecorateTextBlock(original, text, HorizontalAlignment.CENTER);
- }
-
- private TextBlock addHeaderAndFooter(TextBlock original) {
- final Display footer = getFooter();
- final Display header = getHeader();
- if (footer == null && header == null) {
- return original;
- }
- final TextBlock textFooter = footer == null ? null : TextBlockUtils.create(footer, new FontConfiguration(
- getFont(FontParam.FOOTER), getFontColor(FontParam.FOOTER, null), getSkinParam().getHyperlinkColor(),
- getSkinParam().useUnderlineForHyperlink()), getFooterAlignment(), getSkinParam());
- final TextBlock textHeader = header == null ? null : TextBlockUtils.create(header, new FontConfiguration(
- getFont(FontParam.HEADER), getFontColor(FontParam.HEADER, null), getSkinParam().getHyperlinkColor(),
- getSkinParam().useUnderlineForHyperlink()), getHeaderAlignment(), getSkinParam());
-
- return new DecorateTextBlock(original, textHeader, getHeaderAlignment(), textFooter, getFooterAlignment());
- }
-
- private final UFont getFont(FontParam fontParam) {
- final ISkinParam skinParam = getSkinParam();
- return skinParam.getFont(fontParam, null, false);
- }
-
- private final HtmlColor getFontColor(FontParam fontParam, Stereotype stereotype2) {
- final ISkinParam skinParam = getSkinParam();
- return skinParam.getFontHtmlColor(fontParam, stereotype2);
- }
+ // private final UFont getFont(FontParam fontParam) {
+ // final ISkinParam skinParam = getSkinParam();
+ // return skinParam.getFont(null, false, fontParam);
+ // }
+ //
+ // private final HtmlColor getFontColor(FontParam fontParam, Stereotype stereotype2) {
+ // final ISkinParam skinParam = getSkinParam();
+ // return skinParam.getFontHtmlColor(stereotype2, fontParam);
+ // }
public void fork() {
final InstructionFork instructionFork = new InstructionFork(current(), nextLinkRenderer());
@@ -250,7 +207,10 @@ public class ActivityDiagram3 extends UmlDiagram {
public CommandExecutionResult forkAgain() {
if (current() instanceof InstructionFork) {
- ((InstructionFork) current()).forkAgain();
+ final InstructionFork currentFork = (InstructionFork) current();
+ currentFork.manageOutRendering(nextLinkRenderer());
+ setNextLinkRendererInternal(null);
+ currentFork.forkAgain();
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Cannot find fork");
@@ -258,7 +218,10 @@ public class ActivityDiagram3 extends UmlDiagram {
public CommandExecutionResult endFork() {
if (current() instanceof InstructionFork) {
- setCurrent(((InstructionFork) current()).getParent());
+ final InstructionFork currentFork = (InstructionFork) current();
+ currentFork.manageOutRendering(nextLinkRenderer());
+ setNextLinkRendererInternal(null);
+ setCurrent(currentFork.getParent());
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Cannot find fork");
@@ -301,7 +264,10 @@ public class ActivityDiagram3 extends UmlDiagram {
public CommandExecutionResult elseIf(Display test, Display whenThen, HtmlColor color) {
if (current() instanceof InstructionIf) {
- ((InstructionIf) current()).elseIf(test, whenThen, nextLinkRenderer(), color);
+ final boolean ok = ((InstructionIf) current()).elseIf(test, whenThen, nextLinkRenderer(), color);
+ if (ok == false) {
+ return CommandExecutionResult.error("You cannot put an elseIf here");
+ }
setNextLinkRendererInternal(null);
return CommandExecutionResult.ok();
}
@@ -321,6 +287,7 @@ public class ActivityDiagram3 extends UmlDiagram {
}
public CommandExecutionResult endif() {
+ // System.err.println("Activity3::endif");
if (current() instanceof InstructionIf) {
((InstructionIf) current()).endif(nextLinkRenderer());
setNextLinkRendererInternal(null);
@@ -381,9 +348,10 @@ public class ActivityDiagram3 extends UmlDiagram {
return CommandExecutionResult.ok();
}
- public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor) {
+ public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor, HtmlColor borderColor) {
manageSwimlaneStrategy();
- final InstructionGroup instructionGroup = new InstructionGroup(current(), name, backColor, titleColor);
+ final InstructionGroup instructionGroup = new InstructionGroup(current(), name, backColor, titleColor,
+ swinlanes.getCurrentSwimlane(), borderColor);
current().add(instructionGroup);
setCurrent(instructionGroup);
}
@@ -397,14 +365,18 @@ public class ActivityDiagram3 extends UmlDiagram {
}
private void setNextLinkRendererInternal(LinkRendering link) {
+ // System.err.println("setNextLinkRendererInternal=" + link);
swinlanes.setNextLinkRenderer(link);
}
private void setNextLink(LinkRendering linkRenderer) {
- if (current() instanceof InstructionList) {
- final Instruction last = ((InstructionList) current()).getLast();
+ // System.err.println("setNextLink=" + linkRenderer);
+ if (current() instanceof InstructionCollection) {
+ final Instruction last = ((InstructionCollection) current()).getLast();
if (last instanceof InstructionWhile) {
((InstructionWhile) last).afterEndwhile(linkRenderer);
+ } else if (last instanceof InstructionIf) {
+ ((InstructionIf) last).afterEndwhile(linkRenderer);
}
}
this.setNextLinkRendererInternal(linkRenderer);
@@ -413,6 +385,11 @@ public class ActivityDiagram3 extends UmlDiagram {
private final Rose rose = new Rose();
public void setLabelNextArrow(Display label) {
+ if (current() instanceof InstructionWhile && ((InstructionWhile) current()).getLast() == null) {
+ ((InstructionWhile) current()).overwriteYes(label);
+ return;
+ }
+
if (nextLinkRenderer() == null) {
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
this.setNextLink(new LinkRendering(arrowColor));
@@ -429,7 +406,10 @@ public class ActivityDiagram3 extends UmlDiagram {
}
public CommandExecutionResult addNote(Display note, NotePosition position) {
- current().addNote(note, position);
+ final boolean ok = current().addNote(note, position);
+ if (ok == false) {
+ return CommandExecutionResult.error("Cannot add note here");
+ }
manageHasUrl(note);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java
index 38c57b0..18e51cc 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.command.CommandArrowLong3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandElse3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandElseIf2;
import net.sourceforge.plantuml.activitydiagram3.command.CommandElseLegacy1;
+import net.sourceforge.plantuml.activitydiagram3.command.CommandEnd3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandEndPartition3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandEndif3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandFork3;
@@ -54,7 +55,6 @@ import net.sourceforge.plantuml.activitydiagram3.command.CommandGoto;
import net.sourceforge.plantuml.activitydiagram3.command.CommandGroup3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandGroupEnd3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandIf2;
-import net.sourceforge.plantuml.activitydiagram3.command.CommandIf2Multilines;
import net.sourceforge.plantuml.activitydiagram3.command.CommandIf4;
import net.sourceforge.plantuml.activitydiagram3.command.CommandIfLegacy1;
import net.sourceforge.plantuml.activitydiagram3.command.CommandKill3;
@@ -65,17 +65,18 @@ import net.sourceforge.plantuml.activitydiagram3.command.CommandNoteLong3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandPartition3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandRepeat3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandRepeatWhile3;
+import net.sourceforge.plantuml.activitydiagram3.command.CommandRepeatWhile3Multilines;
import net.sourceforge.plantuml.activitydiagram3.command.CommandSplit3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandSplitAgain3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandSplitEnd3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandStart3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandStop3;
-import net.sourceforge.plantuml.activitydiagram3.command.CommandStopLegacy1;
import net.sourceforge.plantuml.activitydiagram3.command.CommandSwimlane;
import net.sourceforge.plantuml.activitydiagram3.command.CommandSwimlane2;
import net.sourceforge.plantuml.activitydiagram3.command.CommandWhile3;
import net.sourceforge.plantuml.activitydiagram3.command.CommandWhileEnd3;
import net.sourceforge.plantuml.command.Command;
+import net.sourceforge.plantuml.command.CommandDecoratorMultine;
import net.sourceforge.plantuml.command.CommandFootboxIgnored;
import net.sourceforge.plantuml.command.UmlDiagramFactory;
@@ -99,14 +100,16 @@ public class ActivityDiagramFactory3 extends UmlDiagramFactory {
cmds.add(new CommandActivity3());
cmds.add(new CommandIf4());
cmds.add(new CommandIf2());
- cmds.add(new CommandIf2Multilines());
+ cmds.add(new CommandDecoratorMultine(new CommandIf2()));
cmds.add(new CommandIfLegacy1());
cmds.add(new CommandElseIf2());
cmds.add(new CommandElse3());
+ cmds.add(new CommandDecoratorMultine(new CommandElse3()));
cmds.add(new CommandElseLegacy1());
cmds.add(new CommandEndif3());
cmds.add(new CommandRepeat3());
cmds.add(new CommandRepeatWhile3());
+ cmds.add(new CommandRepeatWhile3Multilines());
cmds.add(new CommandWhile3());
cmds.add(new CommandWhileEnd3());
cmds.add(new CommandFork3());
@@ -115,11 +118,11 @@ public class ActivityDiagramFactory3 extends UmlDiagramFactory {
cmds.add(new CommandSplit3());
cmds.add(new CommandSplitAgain3());
cmds.add(new CommandSplitEnd3());
-// cmds.add(new CommandGroup3());
-// cmds.add(new CommandGroupEnd3());
+ // cmds.add(new CommandGroup3());
+ // cmds.add(new CommandGroupEnd3());
cmds.add(new CommandStart3());
cmds.add(new CommandStop3());
- cmds.add(new CommandStopLegacy1());
+ cmds.add(new CommandEnd3());
cmds.add(new CommandKill3());
cmds.add(new CommandLink3());
cmds.add(new CommandNote3());
@@ -130,7 +133,7 @@ public class ActivityDiagramFactory3 extends UmlDiagramFactory {
cmds.add(new CommandLabel());
cmds.add(new CommandGoto());
-
+ cmds.add(new CommandDecoratorMultine(new CommandElseIf2()));
return cmds;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
index ebf5cc4..118c0d0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,7 +49,6 @@ public class Branch {
private final Display labelTest;
private final Display labelPositive;
private final HtmlColor color;
-
private LinkRendering inlinkRendering;
private Ftile ftile;
@@ -59,6 +58,12 @@ public class Branch {
}
public Branch(Swimlane swimlane, Display labelPositive, Display labelTest, HtmlColor color) {
+ if (labelPositive == null) {
+ throw new IllegalArgumentException();
+ }
+ if (labelTest == null) {
+ throw new IllegalArgumentException();
+ }
this.list = new InstructionList(swimlane);
this.labelTest = labelTest;
this.labelPositive = labelPositive;
@@ -73,8 +78,8 @@ public class Branch {
return list.kill();
}
- public void addNote(Display note, NotePosition position) {
- list.addNote(note, position);
+ public boolean addNote(Display note, NotePosition position) {
+ return list.addNote(note, position);
}
public final void setInlinkRendering(LinkRendering inlinkRendering) {
@@ -91,7 +96,7 @@ public class Branch {
public final Display getLabelPositive() {
final LinkRendering in = ftile.getInLinkRendering();
- if (in != null && in.getDisplay() != null) {
+ if (in != null && Display.isNull(in.getDisplay()) == false) {
return in.getDisplay();
}
return labelPositive;
@@ -121,4 +126,8 @@ public class Branch {
return list.isEmpty();
}
+ public Instruction getLast() {
+ return list.getLast();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Instruction.java b/src/net/sourceforge/plantuml/activitydiagram3/Instruction.java
index 3b71f5c..2cbfb0c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/Instruction.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/Instruction.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,6 +50,6 @@ public interface Instruction extends Swimable {
public LinkRendering getInLinkRendering();
- public void addNote(Display note, NotePosition position);
+ public boolean addNote(Display note, NotePosition position);
}
diff --git a/src/net/sourceforge/plantuml/version/IteratorCounter.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionCollection.java
index 7ec069f..45618d7 100644
--- a/src/net/sourceforge/plantuml/version/IteratorCounter.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionCollection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,12 +32,10 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.version;
+package net.sourceforge.plantuml.activitydiagram3;
-import java.util.Iterator;
+public interface InstructionCollection extends Instruction {
-public interface IteratorCounter extends Iterator<String> {
-
- public int currentNum();
+ public Instruction getLast();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java
new file mode 100644
index 0000000..eb2b112
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionEnd.java
@@ -0,0 +1,72 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3;
+
+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.sequencediagram.NotePosition;
+
+public class InstructionEnd extends MonoSwimable implements Instruction {
+
+ private final LinkRendering inlinkRendering;
+
+ public InstructionEnd(Swimlane swimlane, LinkRendering inlinkRendering) {
+ super(swimlane);
+ this.inlinkRendering = inlinkRendering;
+ }
+
+ public Ftile createFtile(FtileFactory factory) {
+ return factory.end(getSwimlaneIn());
+ }
+
+ public void add(Instruction other) {
+ throw new UnsupportedOperationException();
+ }
+
+ final public boolean kill() {
+ return false;
+ }
+
+ public LinkRendering getInLinkRendering() {
+ return inlinkRendering;
+ }
+
+ public boolean addNote(Display note, NotePosition position) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java
index 6c44474..71d6226 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionFork.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -59,7 +59,6 @@ public class InstructionFork implements Instruction {
private InstructionList getLast() {
return forks.get(forks.size() - 1);
}
-
public void add(Instruction ins) {
getLast().add(ins);
@@ -89,10 +88,10 @@ public class InstructionFork implements Instruction {
return inlinkRendering;
}
- public void addNote(Display note, NotePosition position) {
- getLast().addNote(note, position);
+ public boolean addNote(Display note, NotePosition position) {
+ return getLast().addNote(note, position);
}
-
+
public Set<Swimlane> getSwimlanes() {
return InstructionList.getSwimlanes2(forks);
}
@@ -106,5 +105,11 @@ public class InstructionFork implements Instruction {
return getLast().getSwimlaneOut();
}
+ public void manageOutRendering(LinkRendering nextLinkRenderer) {
+ if (nextLinkRenderer == null) {
+ return;
+ }
+ getLast().setOutRendering(nextLinkRenderer);
+ }
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGoto.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGoto.java
index 5858a99..0baed29 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGoto.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGoto.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -66,7 +66,7 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
return null;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java
index 844b2c1..ebeeb24 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,19 +43,23 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
-public class InstructionGroup implements Instruction {
+public class InstructionGroup implements Instruction, InstructionCollection {
- private final InstructionList list = new InstructionList();
+ private final InstructionList list;
private final Instruction parent;
private final HtmlColor backColor;
+ private final HtmlColor borderColor;
private final HtmlColor titleColor;
private final Display test;
- private Display headerNote;
+ private Display headerNote = Display.NULL;
- public InstructionGroup(Instruction parent, Display test, HtmlColor backColor, HtmlColor titleColor) {
+ public InstructionGroup(Instruction parent, Display test, HtmlColor backColor, HtmlColor titleColor,
+ Swimlane swimlane, HtmlColor borderColor) {
+ this.list = new InstructionList(swimlane);
this.parent = parent;
this.test = test;
+ this.borderColor = borderColor;
this.backColor = backColor;
this.titleColor = titleColor;
}
@@ -65,7 +69,7 @@ public class InstructionGroup implements Instruction {
}
public Ftile createFtile(FtileFactory factory) {
- return factory.createGroup(list.createFtile(factory), test, backColor, titleColor, headerNote);
+ return factory.createGroup(list.createFtile(factory), test, backColor, titleColor, headerNote, borderColor);
}
public Instruction getParent() {
@@ -80,12 +84,12 @@ public class InstructionGroup implements Instruction {
return null;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
if (list.isEmpty()) {
this.headerNote = note;
- return;
+ return true;
}
- list.addNote(note, position);
+ return list.addNote(note, position);
}
public Set<Swimlane> getSwimlanes() {
@@ -100,4 +104,8 @@ public class InstructionGroup implements Instruction {
return list.getSwimlaneOut();
}
+ public Instruction getLast() {
+ return list.getLast();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java
index d2fb46a..cd132ba 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,7 +49,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
-public class InstructionIf implements Instruction {
+public class InstructionIf implements Instruction, InstructionCollection {
private final List<Branch> thens = new ArrayList<Branch>();
private Branch elseBranch;
@@ -58,7 +58,8 @@ public class InstructionIf implements Instruction {
private final Instruction parent;
private Branch current;
- private final LinkRendering inlinkRendering;
+ private final LinkRendering topInlinkRendering;
+ private LinkRendering afterEndwhile;
private final Swimlane swimlane;
@@ -66,8 +67,7 @@ public class InstructionIf implements Instruction {
LinkRendering inlinkRendering, HtmlColor color, ISkinParam skinParam) {
this.parent = parent;
this.skinParam = skinParam;
-
- this.inlinkRendering = inlinkRendering;
+ this.topInlinkRendering = inlinkRendering;
this.swimlane = swimlane;
this.thens.add(new Branch(swimlane, whenThen, labelTest, color));
this.current = this.thens.get(0);
@@ -85,10 +85,10 @@ public class InstructionIf implements Instruction {
branch.updateFtile(factory);
}
if (elseBranch == null) {
- this.elseBranch = new Branch(swimlane, null, null, null);
+ this.elseBranch = new Branch(swimlane, Display.NULL, Display.NULL, null);
}
elseBranch.updateFtile(factory);
- Ftile result = factory.createIf(swimlane, thens, elseBranch);
+ Ftile result = factory.createIf(swimlane, thens, elseBranch, afterEndwhile, topInlinkRendering);
if (note != null) {
result = new FtileWithNoteOpale(result, note, position, skinParam, false);
}
@@ -104,24 +104,25 @@ public class InstructionIf implements Instruction {
return false;
}
this.current.setInlinkRendering(nextLinkRenderer);
- this.elseBranch = new Branch(swimlane, whenElse, null, null);
+ this.elseBranch = new Branch(swimlane, whenElse, Display.NULL, null);
this.current = elseBranch;
return true;
}
- public void elseIf(Display test, Display whenThen, LinkRendering nextLinkRenderer, HtmlColor color) {
+ public boolean elseIf(Display test, Display whenThen, LinkRendering nextLinkRenderer, HtmlColor color) {
if (elseBranch != null) {
- throw new IllegalStateException();
+ return false;
}
this.current.setInlinkRendering(nextLinkRenderer);
this.current = new Branch(swimlane, whenThen, test, color);
this.thens.add(current);
+ return true;
}
public void endif(LinkRendering nextLinkRenderer) {
if (elseBranch == null) {
- this.elseBranch = new Branch(swimlane, null, null, null);
+ this.elseBranch = new Branch(swimlane, Display.NULL, Display.NULL, null);
}
this.current.setInlinkRendering(nextLinkRenderer);
}
@@ -131,15 +132,16 @@ public class InstructionIf implements Instruction {
}
public LinkRendering getInLinkRendering() {
- return inlinkRendering;
+ return topInlinkRendering;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
if (current.isEmpty()) {
this.note = note;
this.position = position;
+ return true;
} else {
- current.addNote(note, position);
+ return current.addNote(note, position);
}
}
@@ -163,4 +165,15 @@ public class InstructionIf implements Instruction {
return swimlane;
}
+ public Instruction getLast() {
+ if (elseBranch == null) {
+ return thens.get(thens.size() - 1).getLast();
+ }
+ return elseBranch.getLast();
+ }
+
+ public void afterEndwhile(LinkRendering linkRenderer) {
+ this.afterEndwhile = linkRenderer;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionLabel.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionLabel.java
index 4c9e3e5..71a0a1d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionLabel.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionLabel.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -66,7 +66,7 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
return null;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java
index ef77acf..92b8cce 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionList.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -47,7 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
-public class InstructionList implements Instruction {
+public class InstructionList implements Instruction, InstructionCollection {
private final List<Instruction> all = new ArrayList<Instruction>();
private final Swimlane defaultSwimlane;
@@ -119,8 +119,11 @@ public class InstructionList implements Instruction {
return all.get(all.size() - 1);
}
- public void addNote(Display note, NotePosition position) {
- getLast().addNote(note, position);
+ public boolean addNote(Display note, NotePosition position) {
+ if (getLast() == null) {
+ return false;
+ }
+ return getLast().addNote(note, position);
}
public Set<Swimlane> getSwimlanes() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionPartition.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionPartition.java
index 8a35bd4..efab9d3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionPartition.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionPartition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -83,7 +83,7 @@ public class InstructionPartition implements Instruction {
return list.getInLinkRendering();
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
index 97ee9f4..9b77ad2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -51,9 +51,9 @@ public class InstructionRepeat implements Instruction {
private final Swimlane swimlane;
private final HtmlColor color;
- private Display test;
- private Display yes;
- private Display out;
+ private Display test = Display.NULL;
+ private Display yes = Display.NULL;
+ private Display out = Display.NULL;
private LinkRendering endRepeatLinkRendering;
private LinkRendering backRepeatLinkRendering;
@@ -77,10 +77,20 @@ public class InstructionRepeat implements Instruction {
return parent;
}
- public void setTest(Display test, Display yes, Display out, LinkRendering endRepeatLinkRendering, LinkRendering backRepeatLinkRendering) {
+ public void setTest(Display test, Display yes, Display out, LinkRendering endRepeatLinkRendering,
+ LinkRendering backRepeatLinkRendering) {
this.test = test;
this.yes = yes;
this.out = out;
+ if (test == null) {
+ throw new IllegalArgumentException();
+ }
+ if (yes == null) {
+ throw new IllegalArgumentException();
+ }
+ if (out == null) {
+ throw new IllegalArgumentException();
+ }
this.endRepeatLinkRendering = endRepeatLinkRendering;
this.backRepeatLinkRendering = backRepeatLinkRendering;
}
@@ -93,8 +103,8 @@ public class InstructionRepeat implements Instruction {
return nextLinkRenderer;
}
- public void addNote(Display note, NotePosition position) {
- repeatList.addNote(note, position);
+ public boolean addNote(Display note, NotePosition position) {
+ return repeatList.addNote(note, position);
}
public Set<Swimlane> getSwimlanes() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java
index d08e2df..ea4be0c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,32 +41,35 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
public class InstructionSimple extends MonoSwimable implements Instruction {
private boolean killed = false;
private final Display label;
- private final HtmlColor color;
+ private final Colors colors;
private final LinkRendering inlinkRendering;
private Display note;
private NotePosition notePosition;
private final BoxStyle style;
private final Url url;
- public InstructionSimple(Display label, HtmlColor color, LinkRendering inlinkRendering, Swimlane swimlane,
- BoxStyle style, Url url) {
+ public InstructionSimple(Display label, LinkRendering inlinkRendering, Swimlane swimlane,
+ BoxStyle style, Url url, Colors colors) {
super(swimlane);
+ if (colors == null) {
+ throw new IllegalArgumentException();
+ }
this.url = url;
this.style = style;
this.label = label;
- this.color = color;
this.inlinkRendering = inlinkRendering;
+ this.colors = colors;
}
public Ftile createFtile(FtileFactory factory) {
- Ftile result = factory.activity(label, color, getSwimlaneIn(), style);
+ Ftile result = factory.activity(label, getSwimlaneIn(), style, colors);
if (url != null) {
result = factory.addUrl(result, url);
}
@@ -92,9 +95,10 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
return inlinkRendering;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
this.note = note;
this.notePosition = position;
+ return true;
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSplit.java
index f2c0eb2..09fa396 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSplit.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSplit.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -99,8 +99,8 @@ public class InstructionSplit implements Instruction {
return inlinkRendering;
}
- public void addNote(Display note, NotePosition position) {
- getLast().addNote(note, position);
+ public boolean addNote(Display note, NotePosition position) {
+ return getLast().addNote(note, position);
}
public Set<Swimlane> getSwimlanes() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java
index b75e654..9d634ed 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -62,7 +62,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
return null;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java
index 7f4eb3e..238e1d0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionStop.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,6 +43,8 @@ import net.sourceforge.plantuml.sequencediagram.NotePosition;
public class InstructionStop extends MonoSwimable implements Instruction {
private final LinkRendering inlinkRendering;
+ private Display note;
+ private NotePosition notePosition;
public InstructionStop(Swimlane swimlane, LinkRendering inlinkRendering) {
super(swimlane);
@@ -50,7 +52,11 @@ public class InstructionStop extends MonoSwimable implements Instruction {
}
public Ftile createFtile(FtileFactory factory) {
- return factory.stop(getSwimlaneIn());
+ Ftile result = factory.stop(getSwimlaneIn());
+ if (note != null) {
+ result = factory.addNote(result, note, notePosition);
+ }
+ return result;
}
public void add(Instruction other) {
@@ -65,8 +71,10 @@ public class InstructionStop extends MonoSwimable implements Instruction {
return inlinkRendering;
}
- public void addNote(Display note, NotePosition position) {
- throw new UnsupportedOperationException();
+ public boolean addNote(Display note, NotePosition position) {
+ this.note = note;
+ this.notePosition = position;
+ return true;
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java
index 28554eb..69e3948 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,7 +45,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
-public class InstructionWhile implements Instruction {
+public class InstructionWhile implements Instruction, InstructionCollection {
private final InstructionList repeatList = new InstructionList();
private final Instruction parent;
@@ -53,15 +53,25 @@ public class InstructionWhile implements Instruction {
private final HtmlColor color;
private final Display test;
- private final Display yes;
- private Display out;
+ private Display yes;
+ private Display out = Display.NULL;
private LinkRendering endInlinkRendering;
private LinkRendering afterEndwhile;
private final Swimlane swimlane;
private final ISkinParam skinParam;
+ public void overwriteYes(Display yes) {
+ this.yes = yes;
+ }
+
public InstructionWhile(Swimlane swimlane, Instruction parent, Display test, LinkRendering nextLinkRenderer,
Display yes, HtmlColor color, ISkinParam skinParam) {
+ if (test == null) {
+ throw new IllegalArgumentException();
+ }
+ if (yes == null) {
+ throw new IllegalArgumentException();
+ }
this.parent = parent;
this.test = test;
this.nextLinkRenderer = nextLinkRenderer;
@@ -84,7 +94,6 @@ public class InstructionWhile implements Instruction {
if (note != null) {
tmp = new FtileWithNoteOpale(tmp, note, position, skinParam, false);
}
- // tmp = factory.decorateOut(tmp, afterEndwhile);
return tmp;
}
@@ -103,18 +112,22 @@ public class InstructionWhile implements Instruction {
public void endwhile(LinkRendering nextLinkRenderer, Display out) {
this.endInlinkRendering = nextLinkRenderer;
this.out = out;
+ if (out == null) {
+ throw new IllegalArgumentException();
+ }
}
public void afterEndwhile(LinkRendering linkRenderer) {
this.afterEndwhile = linkRenderer;
}
- public void addNote(Display note, NotePosition position) {
+ public boolean addNote(Display note, NotePosition position) {
if (repeatList.isEmpty()) {
this.note = note;
this.position = position;
+ return true;
} else {
- repeatList.addNote(note, position);
+ return repeatList.addNote(note, position);
}
}
@@ -130,4 +143,9 @@ public class InstructionWhile implements Instruction {
return getSwimlaneIn();
}
+ public Instruction getLast() {
+ return repeatList.getLast();
+ }
+
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/LinkRendering.java b/src/net/sourceforge/plantuml/activitydiagram3/LinkRendering.java
index 8883338..1beae2b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/LinkRendering.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/LinkRendering.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,7 +40,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
public class LinkRendering {
private final HtmlColor color;
- private Display display;
+ private Display display = Display.NULL;
public LinkRendering(HtmlColor color) {
this.color = color;
@@ -79,7 +79,7 @@ public class LinkRendering {
public static Display getDisplay(LinkRendering linkRendering) {
if (linkRendering == null) {
- return null;
+ return Display.NULL;
}
return linkRendering.getDisplay();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java b/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java
index c6f49a3..adb116c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java
index 16d7b1f..add4a6f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,7 +46,9 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandActivity3 extends SingleLineCommand2<ActivityDiagram3> {
@@ -59,13 +61,18 @@ public class CommandActivity3 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
- new RegexLeaf("COLOR", "(?::?(" + HtmlColorUtils.COLOR_REGEXP + "))?"), //
+ color().getRegex(), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf(":"), //
new RegexLeaf("LABEL", "(.*)"), //
new RegexLeaf("STYLE", ENDING_GROUP), //
new RegexLeaf("$"));
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
@@ -77,9 +84,9 @@ public class CommandActivity3 extends SingleLineCommand2<ActivityDiagram3> {
url = urlBuilder.getUrl(arg.get("URL", 0));
}
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final BoxStyle style = BoxStyle.fromChar(arg.get("STYLE", 0).charAt(0));
- diagram.addActivity(Display.getWithNewlines(arg.get("LABEL", 0)), color, style, url);
+ diagram.addActivity(Display.getWithNewlines(arg.get("LABEL", 0)), style, url, colors);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java
index 1b3ea3f..57cb5c9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandActivityLegacy1 extends SingleLineCommand2<ActivityDiagram3> {
@@ -58,7 +59,7 @@ public class CommandActivityLegacy1 extends SingleLineCommand2<ActivityDiagram3>
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
- diagram.addActivity(Display.getWithNewlines(arg.get("LABEL", 0)), null, BoxStyle.PLAIN, null);
+ diagram.addActivity(Display.getWithNewlines(arg.get("LABEL", 0)), BoxStyle.PLAIN, null, Colors.empty());
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java
index 4f70a4b..225f8c5 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLong3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,20 +34,19 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandActivityLong3 extends CommandMultilines2<ActivityDiagram3> {
@@ -60,44 +59,26 @@ public class CommandActivityLong3 extends CommandMultilines2<ActivityDiagram3> {
return "^(.*)" + CommandActivity3.ENDING_GROUP + "$";
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?::?(" + HtmlColorUtils.COLOR_REGEXP + "))?"), //
+ color().getRegex(), //
new RegexLeaf(":"), //
new RegexLeaf("DATA", "(.*)"), //
new RegexLeaf("$"));
}
- public CommandExecutionResult executeNow(ActivityDiagram3 diagram, List<String> lines) {
- lines = StringUtils.removeEmptyColumns(lines);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
- final BoxStyle style = BoxStyle.fromChar(getLastChar(lines));
- removeStarting(lines, line0.get("DATA", 0));
- removeEnding(lines);
- diagram.addActivity(Display.create(lines), color, style, null);
+ public CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
+ lines = lines.removeEmptyColumns();
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
+ // final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
+ final BoxStyle style = BoxStyle.fromChar(lines.getLastChar());
+ lines = lines.removeStartingAndEnding2(line0.get("DATA", 0));
+ diagram.addActivity(lines.toDisplay(), style, null, colors);
return CommandExecutionResult.ok();
}
-
- private char getLastChar(List<String> lines) {
- final String s = lines.get(lines.size() - 1);
- return s.charAt(s.length() - 1);
- }
-
- private void removeStarting(List<String> lines, String data) {
- if (lines.size() == 0) {
- return;
- }
- lines.set(0, data);
- }
-
- private void removeEnding(List<String> lines) {
- if (lines.size() == 0) {
- return;
- }
- final int n = lines.size() - 1;
- final String s = lines.get(n);
- lines.set(n, s.substring(0, s.length() - 1));
- }
-
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java
index 5b9469e..3250171 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java
index a7b0789..cfec661 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrowLong3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,7 +36,9 @@ package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
@@ -46,7 +48,6 @@ import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.StringUtils;
public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
@@ -69,31 +70,30 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
new RegexLeaf("$"));
}
- public CommandExecutionResult executeNow(ActivityDiagram3 diagram, List<String> lines) {
- lines = StringUtils.removeEmptyColumns(lines);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
+ lines = lines.removeEmptyColumns();
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
diagram.setColorNextArrow(color);
- removeStarting(lines, line0.get("LABEL", 0));
- removeEnding(lines);
- diagram.setLabelNextArrow(Display.create(lines));
+ lines = lines.removeStartingAndEnding2(line0.get("LABEL", 0));
+ diagram.setLabelNextArrow(lines.toDisplay());
return CommandExecutionResult.ok();
}
- private void removeStarting(List<String> lines, String data) {
+ private <CS extends CharSequence> void removeStarting(List<CS> lines, String data) {
if (lines.size() == 0) {
return;
}
- lines.set(0, data);
+ lines.set(0, (CS)data);
}
- private void removeEnding(List<String> lines) {
+ private <CS extends CharSequence> void removeEnding(List<CS> lines) {
if (lines.size() == 0) {
return;
}
final int n = lines.size() - 1;
- final String s = lines.get(n);
- lines.set(n, s.substring(0, s.length() - 1));
+ final CharSequence s = lines.get(n);
+ lines.set(n, (CS)s.subSequence(0, s.length() - 1));
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElse3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElse3.java
index 2c2b9d3..74f6556 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElse3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElse3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java
index 0bc837e..3b86873 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,8 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandElseIf2 extends SingleLineCommand2<ActivityDiagram3> {
@@ -53,7 +52,7 @@ public class CommandElseIf2 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "):)?"), //
+ ColorParser.exp4(), //
new RegexLeaf("else[%s]*if"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("TEST", "\\((.*?)\\)"), //
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java
index 97f036e..c1c775f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStopLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEnd3.java
index afc103e..9634f91 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStopLegacy1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEnd3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,9 +41,9 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-public class CommandStopLegacy1 extends SingleLineCommand2<ActivityDiagram3> {
+public class CommandEnd3 extends SingleLineCommand2<ActivityDiagram3> {
- public CommandStopLegacy1() {
+ public CommandEnd3() {
super(getRegexConcat());
}
@@ -56,11 +56,7 @@ public class CommandStopLegacy1 extends SingleLineCommand2<ActivityDiagram3> {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
- // if (getSystem().getLastEntityConsulted() == null) {
- // return CommandExecutionResult.error("No if for this endif");
- // }
- diagram.stop();
-
+ diagram.end();
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndPartition3.java
index 26f2798..619ee1e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndPartition3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndPartition3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndif3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndif3.java
index b6cac84..098190d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndif3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandEndif3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandFork3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandFork3.java
index 1cdca1e..62ed049 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandFork3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandFork3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkAgain3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkAgain3.java
index 8026bec..6be04e0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkAgain3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkAgain3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkEnd3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkEnd3.java
index a25d215..265943d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkEnd3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandForkEnd3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGoto.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGoto.java
index 2a9658a..bc7d463 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGoto.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGoto.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java
index 0384587..80a25df 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -58,7 +58,7 @@ public class CommandGroup3 extends SingleLineCommand2<ActivityDiagram3> {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
- diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null);
+ diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null, null);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroupEnd3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroupEnd3.java
index 60947ff..7aa74db 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroupEnd3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroupEnd3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java
index 37e6ca7..ab47be8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandIf2 extends SingleLineCommand2<ActivityDiagram3> {
@@ -52,7 +52,7 @@ public class CommandIf2 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "):)?"), //
+ ColorParser.exp4(), //
new RegexLeaf("if"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("TEST", "\\((.*?)\\)"), //
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java
index a0d0d11..1a2bdd2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandIf4 extends SingleLineCommand2<ActivityDiagram3> {
@@ -52,7 +52,7 @@ public class CommandIf4 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "):)?"), //
+ ColorParser.exp4(), //
new RegexLeaf("if"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("TEST", "\\((.*?)\\)"), //
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java
index e14386e..2a50eec 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandKill3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandKill3.java
index 45432bf..257dac7 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandKill3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandKill3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLabel.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLabel.java
index 62171b6..8c59292 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLabel.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLabel.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java
index 15fc795..53aefba 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java
index a2f4e27..266b18c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java
index 9bb2691..7f2962e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java
index 34ee7bd..98fcab3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNoteLong3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,7 +36,9 @@ package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
@@ -45,7 +47,6 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
-import net.sourceforge.plantuml.StringUtils;
public class CommandNoteLong3 extends CommandMultilines2<ActivityDiagram3> {
@@ -57,12 +58,13 @@ public class CommandNoteLong3 extends CommandMultilines2<ActivityDiagram3> {
return "(?i)^end[%s]?note$";
}
- public CommandExecutionResult executeNow(final ActivityDiagram3 diagram, List<String> lines) {
- // final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- final List<String> in = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines) {
+ // final List<? extends CharSequence> in = StringUtils.removeEmptyColumns2(lines.subList(1, lines.size() - 1));
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
final NotePosition position = getPosition(line0.get("POSITION", 0));
- final Display note = Display.create(in);
+ final Display note = lines.toDisplay();
return diagram.addNote(note, position);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
index c86053e..8c7bd58 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,8 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@@ -42,7 +44,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
@@ -63,12 +65,26 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
final String partitionTitle = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("NAME", 0));
- final HtmlColor backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACKCOLOR", 0));
final HtmlColor titleColor = diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(arg.get("TITLECOLOR", 0));
- diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor);
+
+ final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBackground,
+ null, false);
+ final HtmlColor backColor;
+ if (backColorInSkinparam == null) {
+ backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACKCOLOR", 0));
+ } else {
+ backColor = backColorInSkinparam;
+
+ }
+
+ HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBorder, null, false);
+ if (borderColor == null) {
+ borderColor = HtmlColorUtils.BLACK;
+ }
+
+ diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor);
return CommandExecutionResult.ok();
}
-
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java
index c8c4c29..3d997db 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,7 +41,7 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandRepeat3 extends SingleLineCommand2<ActivityDiagram3> {
@@ -51,7 +51,7 @@ public class CommandRepeat3 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "):)?"), //
+ ColorParser.exp4(), //
new RegexLeaf("repeat"), //
new RegexLeaf(";?$"));
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java
index 916f41e..707d67d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2Multilines.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java
index cf0c812..d8298a7 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2Multilines.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,10 +35,13 @@
package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List;
+import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.CommandMultilines2;
+import net.sourceforge.plantuml.command.CommandMultilines3;
import net.sourceforge.plantuml.command.MultilinesStrategy;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@@ -46,50 +49,65 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
-public class CommandIf2Multilines extends CommandMultilines2<ActivityDiagram3> {
+public class CommandRepeatWhile3Multilines extends CommandMultilines3<ActivityDiagram3> {
- public CommandIf2Multilines() {
+ public CommandRepeatWhile3Multilines() {
super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
}
@Override
- public String getPatternEnd() {
- return "(?i)^(.*?)\\)[%s]*(?:then[%s]*(?:\\((.+?)\\))?)?;?$";
+ public RegexConcat getPatternEnd2() {
+ return new RegexConcat(//
+ new RegexLeaf("TEST1", "(.*)"), new RegexLeaf("\\)"), //
+ new RegexLeaf(";?$"));
}
static RegexConcat getRegexConcat() {
- return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "):)?"), //
- new RegexLeaf("if"), //
+ return new RegexConcat(//
+ new RegexLeaf("^"), //
+ new RegexLeaf("repeat[%s]?while"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("\\("), //
- new RegexLeaf("TEST", "([^)]*)$"));
+ new RegexLeaf("TEST1", "(.*)$"));
}
@Override
- public CommandExecutionResult executeNow(ActivityDiagram3 diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()),
- lines.get(lines.size() - 1));
+ public CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
+ lines = lines.trim(false);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ final RegexResult lineLast = getPatternEnd2().matcher(lines.getLast499().toString());
+
+ // System.err.println("line0=" + line0);
+ // System.err.println("linesLast=" + lineLast);
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
+ //
+ // final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
- final String test = line0.get("TEST", 0);
+ final String test = line0.get("TEST1", 0);
Display testDisplay = Display.getWithNewlines(test);
- for (int i = 1; i < lines.size() - 1; i++) {
- testDisplay = testDisplay.add(lines.get(i));
+ for (CharSequence s : lines.subExtract(1, 1)) {
+ testDisplay = testDisplay.add(s);
}
- final String trailTest = lineLast.get(0);
+ final String trailTest = lineLast.get("TEST1", 0);
if (StringUtils.isEmpty(trailTest) == false) {
testDisplay = testDisplay.add(trailTest);
}
- diagram.startIf(testDisplay, Display.getWithNewlines(lineLast.get(1)), color);
- return CommandExecutionResult.ok();
+ Display yes = Display.NULL;// Display.getWithNewlines("arg.getLazzy(\"WHEN\", 0)");
+ final Display out = Display.NULL; // Display.getWithNewlines("arg.getLazzy(\"OUT\", 0)");
+ final HtmlColor linkColor = null; // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR",
+ // 0));
+ final Display linkLabel = Display.NULL; // Display.getWithNewlines("arg.get(\"LABEL\", 0)");
+ final List<Display> splitted = testDisplay.splitMultiline(MyPattern.cmpile("\\)[%s]*(is|equals?)[%s]*\\(",
+ Pattern.CASE_INSENSITIVE));
+ if (splitted.size() == 2) {
+ testDisplay = splitted.get(0);
+ yes = splitted.get(1);
+
+ }
+
+ return diagram.repeatWhile(testDisplay, yes, out, linkLabel, linkColor);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplit3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplit3.java
index 7d95a9a..2b83326 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplit3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplit3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitAgain3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitAgain3.java
index ea73e9f..5993e14 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitAgain3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitAgain3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitEnd3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitEnd3.java
index 68b76e4..ecc991c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitEnd3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSplitEnd3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStart3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStart3.java
index cb81024..f4fc2cd 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStart3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStart3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStop3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStop3.java
index ae7c128..dacceca 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStop3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandStop3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -56,11 +56,7 @@ public class CommandStop3 extends SingleLineCommand2<ActivityDiagram3> {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
- // if (getSystem().getLastEntityConsulted() == null) {
- // return CommandExecutionResult.error("No if for this endif");
- // }
diagram.stop();
-
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java
index 0024161..758b7db 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandSwimlane extends SingleLineCommand2<ActivityDiagram3> {
@@ -53,7 +53,7 @@ public class CommandSwimlane extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf("\\|"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + ")\\|)?"), //
+ ColorParser.exp6(), //
new RegexLeaf("SWIMLANE", "([^|]+)"), //
new RegexLeaf("\\|"), //
new RegexLeaf("LABEL", "([^|]+)?"), //
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java
index 428b0eb..246d70c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandSwimlane2 extends SingleLineCommand2<ActivityDiagram3> {
@@ -53,7 +53,7 @@ public class CommandSwimlane2 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf("swimlane[%s]+"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "))?"), //
+ ColorParser.exp7(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("SWIMLANE", "([^|]+)"), //
new RegexLeaf("LABEL", "(?:[%s]+as[%s]+([^|]+))?"), //
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java
index 55c6395..8779fa4 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,8 +43,7 @@ import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandWhile3 extends SingleLineCommand2<ActivityDiagram3> {
@@ -55,7 +54,7 @@ public class CommandWhile3 extends SingleLineCommand2<ActivityDiagram3> {
static RegexConcat getRegexConcat() {
return new RegexConcat(//
new RegexLeaf("^"), //
- new RegexLeaf("COLOR", "(?:(" + HtmlColorUtils.COLOR_REGEXP + "):)?"), //
+ ColorParser.exp4(), //
new RegexLeaf("while"), //
new RegexLeaf("TEST", "[%s]*\\((.+?)\\)"), //
new RegexOptional(new RegexConcat(//
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java
index a406e13..a375b7f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractConnection.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractConnection.java
index 61b64cb..40bb974 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractConnection.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractConnection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
index 14fcb23..4b2540b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,10 +38,11 @@ import java.util.Collection;
import java.util.Collections;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public abstract class AbstractFtile implements Ftile {
+public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
private final boolean shadowing;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Arrows.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Arrows.java
index 3876ce0..e0f935e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Arrows.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Arrows.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java
index 81c552a..ebf08d8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
index 46fb126..a6070f7 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,8 +35,6 @@
package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.awt.geom.Line2D;
-import java.io.IOException;
-import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Connection.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Connection.java
index a2b3417..db78e30 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Connection.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Connection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionCross.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionCross.java
index 2ee0557..a6cd5f9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionCross.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionCross.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,10 +52,12 @@ public class ConnectionCross extends AbstractConnection {
final Swimlane swimlane1 = getFtile1().getSwimlaneOut();
final Swimlane swimlane2 = getFtile2().getSwimlaneIn();
if (swimlane1 == null) {
- throw new IllegalStateException("" + getFtile1().getClass());
+ return;
+ // throw new IllegalStateException("" + getFtile1().getClass());
}
if (swimlane2 == null) {
- throw new IllegalStateException("" + getFtile2().getClass());
+ return;
+ // throw new IllegalStateException("" + getFtile2().getClass());
}
conn.drawTranslate(ug, swimlane1.getTranslate(), swimlane2.getTranslate());
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionTranslatable.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionTranslatable.java
index 12e1153..5ed7a7e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionTranslatable.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ConnectionTranslatable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Diamond.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Diamond.java
index 965fe0b..dfa2bb3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Diamond.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Diamond.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java
index 9b78750..faddf54 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -50,12 +51,11 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class EntityImageLegend implements TextBlock {
+public class EntityImageLegend extends AbstractTextBlock implements TextBlock {
private final int cornersize = 10;
private final HtmlColor noteBackgroundColor;
@@ -71,13 +71,10 @@ public class EntityImageLegend implements TextBlock {
final Rose rose = new Rose();
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground);
-
borderColor = rose.getHtmlColor(skinParam, ColorParam.legendBorder);
- final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.LEGEND);
- final UFont fontNote = skinParam.getFont(FontParam.LEGEND, null, false);
- this.textBlock = TextBlockUtils.create(note, new FontConfiguration(fontNote, fontColor,
- skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink()), HorizontalAlignment.LEFT, skinParam);
+ this.textBlock = note.create(new FontConfiguration(skinParam, FontParam.LEGEND, null),
+ HorizontalAlignment.LEFT, skinParam);
}
public static TextBlock create(Display legend, ISkinParam skinParam) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java
index c58eebe..edd6b56 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Ftile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
index c9be210..00d24e5 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,11 +41,12 @@ import java.util.HashSet;
import java.util.Set;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class FtileAssemblySimple implements Ftile {
+public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
private final Ftile tile1;
private final Ftile tile2;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java
index fe9b71d..7dcca0f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.util.Collections;
+import java.util.HashSet;
import java.util.Set;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -89,7 +90,14 @@ public class FtileEmpty extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
- return Collections.emptySet();
+ final Set<Swimlane> result = new HashSet<Swimlane>();
+ if (swimlaneIn != null) {
+ result.add(swimlaneIn);
+ }
+ if (swimlaneOut != null) {
+ result.add(swimlaneOut);
+ }
+ return Collections.unmodifiableSet(result);
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
index 0be313e..fb656e8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
public interface FtileFactory extends ISkinSimple {
@@ -55,7 +56,9 @@ public interface FtileFactory extends ISkinSimple {
public Ftile stop(Swimlane swimlane);
- public Ftile activity(Display label, HtmlColor color, Swimlane swimlane, BoxStyle style);
+ public Ftile end(Swimlane swimlane);
+
+ public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors);
public Ftile addNote(Ftile ftile, Display note, NotePosition notePosition);
@@ -67,17 +70,20 @@ public interface FtileFactory extends ISkinSimple {
public Ftile assembly(Ftile tile1, Ftile tile2);
- public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering);
+ public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
+ LinkRendering backRepeatLinkRendering);
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
LinkRendering afterEndwhile, HtmlColor color);
- public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch);
+ public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
+ LinkRendering topInlinkRendering);
public Ftile createFork(Swimlane swimlane, List<Ftile> all);
public Ftile createSplit(List<Ftile> all);
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote);
+ public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
+ HtmlColor borderColor);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
index cd0de1f..93b73c3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,16 +37,23 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.util.List;
import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
-import net.sourceforge.plantuml.ugraphic.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class FtileFactoryDelegator implements FtileFactory {
@@ -65,10 +72,19 @@ public class FtileFactoryDelegator implements FtileFactory {
return color;
}
+ protected final TextBlock getTextBlock(Display display) {
+ if (Display.isNull(display)) {
+ return null;
+ }
+ final ISkinParam skinParam = getSkinParam();
+ final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.ACTIVITY_ARROW, null);
+ return display.create(fontConfiguration, HorizontalAlignment.LEFT, this, CreoleMode.SIMPLE_LINE);
+ }
+
protected Display getInLinkRenderingDisplay(Ftile tile) {
final LinkRendering linkRendering = tile.getInLinkRendering();
if (linkRendering == null) {
- return null;
+ return Display.NULL;
}
return linkRendering.getDisplay();
}
@@ -82,12 +98,16 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.start(swimlane);
}
+ public Ftile end(Swimlane swimlane) {
+ return factory.end(swimlane);
+ }
+
public Ftile stop(Swimlane swimlane) {
return factory.stop(swimlane);
}
- public Ftile activity(Display label, HtmlColor color, Swimlane swimlane, BoxStyle style) {
- return factory.activity(label, color, swimlane, style);
+ public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors) {
+ return factory.activity(label, swimlane, style, colors);
}
public Ftile addNote(Ftile ftile, Display note, NotePosition notePosition) {
@@ -110,7 +130,8 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.assembly(tile1, tile2);
}
- public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering) {
+ public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
+ LinkRendering backRepeatLinkRendering) {
return factory.repeat(swimlane, repeat, test, yes, out, color, backRepeatLinkRendering);
}
@@ -119,8 +140,9 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.createWhile(swimlane, whileBlock, test, yes, out, afterEndwhile, color);
}
- public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch) {
- return factory.createIf(swimlane, thens, elseBranch);
+ public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
+ LinkRendering topInlinkRendering) {
+ return factory.createIf(swimlane, thens, elseBranch, afterEndwhile, topInlinkRendering);
}
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
@@ -131,8 +153,9 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.createSplit(all);
}
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote) {
- return factory.createGroup(list, name, backColor, titleColor, headerNote);
+ public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
+ HtmlColor borderColor) {
+ return factory.createGroup(list, name, backColor, titleColor, headerNote, borderColor);
}
public StringBounder getStringBounder() {
@@ -171,4 +194,16 @@ public class FtileFactoryDelegator implements FtileFactory {
return skinParam.useGuillemet();
}
+ public String getMonospacedFamily() {
+ return skinParam.getMonospacedFamily();
+ }
+
+ public int getTabSize() {
+ return skinParam.getTabSize();
+ }
+
+ public IHtmlColorSet getIHtmlColorSet() {
+ return skinParam.getIHtmlColorSet();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometry.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometry.java
index 62c74da..6d557f9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometry.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometry.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -73,6 +73,10 @@ public class FtileGeometry extends Dimension2D {
this.height = height;
}
+ public FtileGeometry incHeight(double northHeight) {
+ return new FtileGeometry(width, height + northHeight, left, inY, outY);
+ }
+
public FtileGeometry(Dimension2D dim, double left, double inY, double outY) {
this(dim.getWidth(), dim.getHeight(), left, inY, outY);
}
@@ -133,6 +137,10 @@ public class FtileGeometry extends Dimension2D {
return new FtileGeometry(width + 2 * marginx, height, left + marginx, inY, outY);
}
+ public FtileGeometry addMarginX(double margin1, double margin2) {
+ return new FtileGeometry(width + margin1 + margin2, height, left + margin1, inY, outY);
+ }
+
public FtileGeometry fixedHeight(double fixedHeight) {
return new FtileGeometry(width, fixedHeight, left, inY, outY);
}
@@ -141,4 +149,20 @@ public class FtileGeometry extends Dimension2D {
return new FtileGeometryMerger(this, other).getResult();
}
+ public FtileGeometry ensureHeight(double newHeight) {
+ if (this.height > newHeight) {
+ return this;
+ }
+ return fixedHeight(newHeight);
+ }
+
+ private FtileGeometry ensureRightStrange(double newRight) {
+ final double right = this.width - this.left;
+ if (right > newRight) {
+ return this;
+ }
+ // return addMarginX(0, newRight - right);
+ return addMarginX(0, newRight);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometryMerger.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometryMerger.java
index 7acab23..e23db4f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometryMerger.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGeometryMerger.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java
index 8f1125f..7bd2a0d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileGoto.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
index 636b066..d8ebebf 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java
index 65529ac..b853f45 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileKilled.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileLabel.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileLabel.java
index c9d4110..f58d41d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileLabel.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileLabel.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
index aaa874c..a77f6e3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,12 +44,14 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class FtileMarged extends AbstractFtile {
private final Ftile tile;
- private final double margin;
+ private final double margin1;
+ private final double margin2;
- public FtileMarged(Ftile tile, double margin) {
+ public FtileMarged(Ftile tile, double margin1, double margin2) {
super(tile.shadowing());
this.tile = tile;
- this.margin = margin;
+ this.margin1 = margin1;
+ this.margin2 = margin2;
}
@Override
@@ -76,12 +78,12 @@ public class FtileMarged extends AbstractFtile {
public FtileGeometry calculateDimension(StringBounder stringBounder) {
final FtileGeometry orig = tile.calculateDimension(stringBounder);
- return new FtileGeometry(orig.getWidth() + 2 * margin, orig.getHeight(), orig.getLeft() + margin,
+ return new FtileGeometry(orig.getWidth() + margin1 + margin2, orig.getHeight(), orig.getLeft() + margin1,
orig.getInY(), orig.getOutY());
}
public void drawU(UGraphic ug) {
- ug.apply(new UTranslate(margin, 0)).draw(tile);
+ ug.apply(new UTranslate(margin1, 0)).draw(tile);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java
new file mode 100644
index 0000000..9956c16
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedRight.java
@@ -0,0 +1,88 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile;
+
+import java.util.Set;
+
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class FtileMargedRight extends AbstractFtile {
+
+ private final Ftile tile;
+ private final double maxX;
+
+ public FtileMargedRight(Ftile tile, double maxX) {
+ super(tile.shadowing());
+ this.tile = tile;
+ this.maxX = maxX;
+ }
+
+ @Override
+ public LinkRendering getInLinkRendering() {
+ return tile.getInLinkRendering();
+ }
+
+ @Override
+ public LinkRendering getOutLinkRendering() {
+ return tile.getOutLinkRendering();
+ }
+
+ public Set<Swimlane> getSwimlanes() {
+ return tile.getSwimlanes();
+ }
+
+ public Swimlane getSwimlaneIn() {
+ return tile.getSwimlaneIn();
+ }
+
+ public Swimlane getSwimlaneOut() {
+ return tile.getSwimlaneOut();
+ }
+
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final FtileGeometry orig = tile.calculateDimension(stringBounder);
+ if (orig.getWidth() > maxX) {
+ throw new IllegalStateException();
+ }
+ return new FtileGeometry(maxX, orig.getHeight(), orig.getLeft(), orig.getInY(), orig.getOutY());
+ }
+
+ public void drawU(UGraphic ug) {
+ ug.draw(tile);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
index 9b7fc54..0211651 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java
index 97a3569..478a280 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class FtileMinWidth extends FtileDecorate {
private final double minWidth;
+ private FtileGeometry calculateDimensionInternal;
public FtileMinWidth(Ftile tile, double minWidth) {
super(tile);
@@ -59,6 +60,13 @@ public class FtileMinWidth extends FtileDecorate {
@Override
public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ if (calculateDimensionInternal == null) {
+ calculateDimensionInternal = calculateDimensionSlow(stringBounder);
+ }
+ return calculateDimensionInternal;
+ }
+
+ private FtileGeometry calculateDimensionSlow(StringBounder stringBounder) {
final FtileGeometry geo = super.calculateDimension(stringBounder);
final double left = getPoint2(geo.getLeft(), stringBounder);
if (geo.hasPointOut() == false) {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BlockMember.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileOverpassing.java
index 404d652..6ad4a62 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/BlockMember.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileOverpassing.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,14 +32,12 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.cucadiagram;
+package net.sourceforge.plantuml.activitydiagram3.ftile;
-import net.sourceforge.plantuml.FontParam;
-import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.StringBounder;
-public interface BlockMember {
+public interface FtileOverpassing extends Ftile {
- public TextBlock asTextBlock(FontParam fontParam, ISkinParam skinParam);
+ public FtileGeometry getOverpassDimension(StringBounder stringBounder);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileUtils.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileUtils.java
index 8ef5fb4..b4abefb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileUtils.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -61,6 +61,24 @@ public class FtileUtils {
return new FtileMargedVertically(ftile, marginTop, marginBottom);
}
+ public static Ftile addHorizontalMargin(Ftile ftile, double margin1, double margin2) {
+ if (margin1 == 0 && margin2 == 0) {
+ return ftile;
+ }
+ return new FtileMarged(ftile, margin1, margin2);
+ }
+
+ public static Ftile addHorizontalMargin(Ftile ftile, double margin) {
+ if (margin == 0) {
+ return ftile;
+ }
+ return new FtileMarged(ftile, margin, margin);
+ }
+
+ // public static Ftile addHorizontalMargin(Ftile ftile, double margin) {
+ // return new FtileMarged(ftile, margin);
+ // }
+
private static Ftile neverNull(Ftile ftile) {
if (ftile == null) {
return new FtileEmpty(false);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithConnection.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithConnection.java
index a1b47cc..476fda1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithConnection.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithConnection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithSwimlanes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithSwimlanes.java
index 12e346d..a0a8491 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithSwimlanes.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithSwimlanes.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithUrl.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithUrl.java
index 87926d6..7b15529 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithUrl.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileWithUrl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/GotoInterceptor.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/GotoInterceptor.java
index 2b48832..c29c2d2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/GotoInterceptor.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/GotoInterceptor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,11 +37,12 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorGoto;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class GotoInterceptor implements TextBlock {
+public class GotoInterceptor extends AbstractTextBlock implements TextBlock {
private final TextBlock swinlanes;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
index 12cb49f..c578128 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,9 @@ import java.util.List;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.StringBounderUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.CompressionTransform;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -151,9 +153,12 @@ public class Snake implements UShape {
}
if (textBlock != null) {
final Point2D position = getTextBlockPosition(ug.getStringBounder());
- // double max = getMaxX(ug.getStringBounder());
- // ug.apply(new UChangeBackColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0,
- // position.getY())).draw(new URectangle(max, 10));
+ // final double max = getMaxX(ug.getStringBounder());
+ // ug.apply(new UChangeBackColor(HtmlColorUtils.LIGHT_GRAY))
+ // .apply(new UTranslate(position.getX(), position.getY()))
+ // .draw(new URectangle(textBlock.calculateDimension(ug.getStringBounder())));
+ // ug.apply(new UChangeBackColor(HtmlColorUtils.RED)).apply(new UTranslate(0, position.getY() + 10))
+ // .draw(new URectangle(max, 10));
textBlock.drawU(ug.apply(new UTranslate(position)));
}
}
@@ -210,6 +215,13 @@ public class Snake implements UShape {
if (mergeable == false || other.mergeable == false) {
return null;
}
+ if (TextBlockUtils.isEmpty(other.textBlock) == false) {
+ return null;
+ // System.err.println("merge other.textBlock="+other.textBlock+" "+other.textBlock.calculateDimension(TextBlockUtils.getDummyStringBounder()));
+ }
+ // if (other.textBlock != null) {
+ // return null;
+ // }
if (same(this.getLast(), other.getFirst())) {
final UPolygon oneOf = endDecoration == null ? other.endDecoration : endDecoration;
final Snake result = new Snake(color, oneOf);
@@ -356,7 +368,7 @@ public class Snake implements UShape {
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
final Point2D.Double p1 = points.get(i + 1);
final Point2D.Double p4 = points.get(i + 4);
- if (p4.x < p1.x) {
+ if (p4.x + 4 < p1.x) {
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
points.remove(i + 3);
points.remove(i + 2);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SnakeDirection.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SnakeDirection.java
index 78ca620..76591cc 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SnakeDirection.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SnakeDirection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimable.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimable.java
index fc45588..d4a6b46 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimable.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
index 4c472a0..863f961 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,15 +34,17 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile;
+import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class Swimlane implements SpecificBackcolorable {
private final String name;
- private HtmlColor color;
private Display display;
private UTranslate translate = new UTranslate();
@@ -80,16 +82,24 @@ public class Swimlane implements SpecificBackcolorable {
this.totalWidth = totalWidth;
}
- public HtmlColor getSpecificBackColor() {
- return color;
+ public Colors getColors(ISkinParam skinParam) {
+ return colors;
}
- public void setSpecificBackcolor(HtmlColor specificBackcolor) {
- this.color = specificBackcolor;
+ public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ if (color != null) {
+ this.colors = colors.add(type, color);
+ }
}
+ private Colors colors = Colors.empty();
+
public final double getTotalWidth() {
return totalWidth;
}
+ public void setColors(Colors colors) {
+ this.colors = colors;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java
index 0ec582a..67afd0f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlanes.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,9 +38,12 @@ import java.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.List;
+import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.OptionFlags;
+import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.activitydiagram3.Instruction;
import net.sourceforge.plantuml.activitydiagram3.InstructionList;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
@@ -56,6 +59,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileFactoryDele
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorOneSwimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.VCompactFactory;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -64,6 +68,8 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.UGraphicDelegator;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.UGraphicForSnake;
import net.sourceforge.plantuml.ugraphic.CompressionTransform;
import net.sourceforge.plantuml.ugraphic.LimitFinder;
@@ -73,7 +79,6 @@ import net.sourceforge.plantuml.ugraphic.SlotSet;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle;
@@ -81,12 +86,12 @@ import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class Swimlanes implements TextBlock {
+public class Swimlanes extends AbstractTextBlock implements TextBlock {
private final ISkinParam skinParam;;
+ private final Pragma pragma;
private final List<Swimlane> swimlanes = new ArrayList<Swimlane>();
- private final FontConfiguration fontConfiguration;
private Swimlane currentSwimlane = null;
private final Instruction root = new InstructionList();
@@ -94,19 +99,20 @@ public class Swimlanes implements TextBlock {
private LinkRendering nextLinkRenderer;
- public Swimlanes(ISkinParam skinParam) {
+ public Swimlanes(ISkinParam skinParam, Pragma pragma) {
this.skinParam = skinParam;
- final UFont font = skinParam.getFont(FontParam.TITLE, null, false);
- this.fontConfiguration = new FontConfiguration(font, HtmlColorUtils.BLACK, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
+ this.pragma = pragma;
+ }
+ private FontConfiguration getFontConfiguration() {
+ return new FontConfiguration(skinParam, FontParam.SWIMLANE_TITLE, null);
}
private FtileFactory getFtileFactory() {
FtileFactory factory = new VCompactFactory(skinParam, TextBlockUtils.getDummyStringBounder());
factory = new FtileFactoryDelegatorAddUrl(factory, skinParam);
factory = new FtileFactoryDelegatorAssembly(factory, skinParam);
- factory = new FtileFactoryDelegatorIf(factory, skinParam);
+ factory = new FtileFactoryDelegatorIf(factory, skinParam, pragma);
factory = new FtileFactoryDelegatorWhile(factory, skinParam);
factory = new FtileFactoryDelegatorRepeat(factory, skinParam);
factory = new FtileFactoryDelegatorCreateFork(factory, skinParam);
@@ -119,9 +125,9 @@ public class Swimlanes implements TextBlock {
public void swimlane(String name, HtmlColor color, Display label) {
currentSwimlane = getOrCreate(name);
if (color != null) {
- currentSwimlane.setSpecificBackcolor(color);
+ currentSwimlane.setSpecificColorTOBEREMOVED(ColorType.BACK, color);
}
- if (label != null) {
+ if (Display.isNull(label) == false) {
currentSwimlane.setDisplay(label);
}
}
@@ -241,15 +247,16 @@ public class Swimlanes implements TextBlock {
double x2 = 0;
for (Swimlane swimlane : swimlanes) {
- if (swimlane.getSpecificBackColor() != null) {
- final UGraphic background = ug.apply(new UChangeBackColor(swimlane.getSpecificBackColor()))
- .apply(new UChangeColor(swimlane.getSpecificBackColor())).apply(new UTranslate(x2, 0));
+ final HtmlColor back = swimlane.getColors(skinParam).getColor(ColorType.BACK);
+ if (back != null) {
+ final UGraphic background = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(back))
+ .apply(new UTranslate(x2, 0));
background.draw(new URectangle(swimlane.getTotalWidth(), dimensionFull.getHeight()
+ titleHeightTranslate.getDy()));
}
if (OptionFlags.SWI2 == false) {
- final TextBlock swTitle = TextBlockUtils.create(swimlane.getDisplay(), fontConfiguration,
+ final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(),
HorizontalAlignment.LEFT, skinParam);
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
final double posTitle = x2 + (swimlane.getTotalWidth() - titleWidth) / 2;
@@ -282,8 +289,8 @@ public class Swimlanes implements TextBlock {
final MinMax minMax = limitFinder.getMinMax();
final double drawingWidth = minMax.getWidth() + 2 * separationMargin;
- final TextBlock swTitle = TextBlockUtils.create(swimlane.getDisplay(), fontConfiguration,
- HorizontalAlignment.LEFT, skinParam);
+ final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
+ skinParam);
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
final double totalWidth = Math.max(drawingWidth, titleWidth + 2 * separationMargin);
@@ -298,8 +305,8 @@ public class Swimlanes implements TextBlock {
private UTranslate getTitleHeightTranslate(final StringBounder stringBounder) {
double titlesHeight = 0;
for (Swimlane swimlane : swimlanes) {
- final TextBlock swTitle = TextBlockUtils.create(swimlane.getDisplay(), fontConfiguration,
- HorizontalAlignment.LEFT, skinParam);
+ final TextBlock swTitle = swimlane.getDisplay().create(getFontConfiguration(), HorizontalAlignment.LEFT,
+ skinParam);
titlesHeight = Math.max(titlesHeight, swTitle.calculateDimension(stringBounder).getHeight());
}
@@ -328,7 +335,9 @@ public class Swimlanes implements TextBlock {
}
private void drawSeparation(UGraphic ug, double height) {
- ug.apply(new UStroke(2)).apply(new UChangeColor(HtmlColorUtils.BLACK)).draw(new ULine(0, height));
+ final HtmlColor color = skinParam.getHtmlColor(ColorParam.swimlaneBorder, null, false);
+ final UStroke thickness = Rose.getStroke(skinParam, LineParam.swimlaneBorder, 2);
+ ug.apply(thickness).apply(new UChangeColor(color)).draw(new ULine(0, height));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java
index a4d24cb..f8366c1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,13 +37,14 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.awt.geom.Dimension2D;
import java.util.HashMap;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TextBlockInterceptorUDrawable implements TextBlock {
+public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java
index fe284fe..80ab401 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java
index 1690fee..a4787c9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ConnectionVerticalDown.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java
index afaf69b..0f234be 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,12 +39,14 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.CreoleParser;
import net.sourceforge.plantuml.creole.Sheet;
import net.sourceforge.plantuml.creole.SheetBlock1;
import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -56,24 +58,24 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public class FloatingNote implements Stencil, TextBlock {
+public class FloatingNote extends AbstractTextBlock implements Stencil, TextBlock {
private final Opale opale;
public FloatingNote(Display note, ISkinParam skinParam) {
final Rose rose = new Rose();
- final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
- final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
final HtmlColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
final HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
- final FontConfiguration fc = new FontConfiguration(fontNote, fontColor, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
+ final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
- final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, false).createSheet(note);
- final SheetBlock2 sheetBlock2 = new SheetBlock2(new SheetBlock1(sheet, 0, skinParam.getPadding()), this, new UStroke(1));
- this.opale = new Opale(borderColor, noteBackgroundColor, sheetBlock2, skinParam.shadowing(), false);
+ final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
+ .createSheet(note);
+ final SheetBlock2 sheetBlock2 = new SheetBlock2(new SheetBlock1(sheet, 0, skinParam.getPadding()), this,
+ new UStroke(1));
+ this.opale = new Opale(borderColor, noteBackgroundColor, sheetBlock2, skinParam.shadowing(), false);
// this.text = sheetBlock2;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java
index 5cdbd52..23fd56a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddUrl.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddUrl.java
index 8dcdb8f..876a878 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddUrl.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAddUrl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAssembly.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAssembly.java
index 29bf617..ffa1595 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAssembly.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorAssembly.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,16 +42,15 @@ 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.FtileGeometry;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedVertically;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidth;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedRight;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -87,30 +86,24 @@ public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
final ConnectionVerticalDown connection = new ConnectionVerticalDown(tile1, tile2, p1, p2, color, textBlock);
result = FtileUtils.addConnection(result, connection);
if (textBlock != null) {
- final double width = result.calculateDimension(stringBounder).getWidth();
+ final FtileGeometry dim = result.calculateDimension(stringBounder);
+ final double width = dim.getWidth();
// System.err.println("width=" + width);
// System.err.println("p1=" + p1);
// System.err.println("p2=" + p2);
final double maxX = connection.getMaxX(stringBounder);
+ // System.err.println("FtileFactoryDelegatorAssembly dim=" + dim);
// System.err.println("maxX=" + maxX);
final double needed = (maxX - width) * 2;
- result = new FtileMinWidth(result, needed);
+ // result = new FtileMinWidth(result, needed);
+ if (width < maxX) {
+ result = new FtileMargedRight(result, maxX);
+ }
+ // System.err.println("FtileFactoryDelegatorAssembly result=" + result.calculateDimension(stringBounder));
}
return result;
}
private final Rose rose = new Rose();
- private TextBlock getTextBlock(Display display) {
- // DUP1433
- if (display == null) {
- return null;
- }
- final ISkinParam skinParam = getSkinParam();
- final UFont font = skinParam.getFont(FontParam.ACTIVITY_ARROW, null, false);
- final HtmlColor color = rose.getFontColor(skinParam, FontParam.ACTIVITY_ARROW);
- final FontConfiguration fontConfiguration = new FontConfiguration(font, color, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
- return TextBlockUtils.create(display, fontConfiguration, HorizontalAlignment.LEFT, null, true);
- }
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateFork.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateFork.java
index 1686e73..31eec8c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateFork.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateFork.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
@@ -56,6 +57,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -83,7 +85,7 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
final List<Ftile> list = new ArrayList<Ftile>();
for (Ftile tmp : all) {
- list.add(new FtileHeightFixed(new FtileMarged(tmp, xMargin), height1));
+ list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
}
Ftile inner = super.createFork(swimlane, list);
@@ -109,9 +111,11 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
private final double x;
private final HtmlColor arrowColor;
+ private final Display label;
public ConnectionIn(Ftile ftile1, Ftile ftile2, double x, HtmlColor arrowColor) {
super(ftile1, ftile2);
+ label = LinkRendering.getDisplay(ftile2.getInLinkRendering());
this.x = x;
this.arrowColor = arrowColor;
}
@@ -119,10 +123,13 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
public void drawU(UGraphic ug) {
ug = ug.apply(new UTranslate(x, 0));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
- final Snake s = new Snake(arrowColor, Arrows.asToDown());
- s.addPoint(geo.getLeft(), 0);
- s.addPoint(geo.getLeft(), geo.getInY());
- ug.draw(s);
+ final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ if (Display.isNull(label) == false) {
+ snake.setLabel(getTextBlock(label));
+ }
+ snake.addPoint(geo.getLeft(), 0);
+ snake.addPoint(geo.getLeft(), geo.getInY());
+ ug.draw(snake);
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
@@ -132,6 +139,9 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ if (Display.isNull(label) == false) {
+ snake.setLabel(getTextBlock(label));
+ }
final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp1a.getY() + 4;
@@ -148,9 +158,11 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
private final double x;
private final HtmlColor arrowColor;
private final double height;
+ private final Display label;
public ConnectionOut(Ftile ftile1, Ftile ftile2, double x, HtmlColor arrowColor, double height) {
super(ftile1, ftile2);
+ label = LinkRendering.getDisplay(ftile1.getOutLinkRendering());
this.x = x;
this.arrowColor = arrowColor;
this.height = height;
@@ -162,10 +174,13 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
if (geo.hasPointOut() == false) {
return;
}
- final Snake s = new Snake(arrowColor, Arrows.asToDown());
- s.addPoint(geo.getLeft(), geo.getOutY());
- s.addPoint(geo.getLeft(), height);
- ug.draw(s);
+ final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ if (Display.isNull(label) == false) {
+ snake.setLabel(getTextBlock(label));
+ }
+ snake.addPoint(geo.getLeft(), geo.getOutY());
+ snake.addPoint(geo.getLeft(), height);
+ ug.draw(snake);
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
@@ -178,6 +193,9 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
final Point2D p2 = new Point2D.Double(geo.getLeft(), height);
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ if (Display.isNull(label) == false) {
+ snake.setLabel(getTextBlock(label));
+ }
final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2);
final double middle = mp2b.getY() - 14;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java
index 65f9132..212726e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,9 +52,10 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
}
@Override
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote) {
+ public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
+ HtmlColor borderColor) {
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
- return new FtileGroup(list, name, headerNote, arrowColor, backColor, titleColor, getSkinParam());
+ return new FtileGroup(list, name, headerNote, arrowColor, backColor, titleColor, getSkinParam(), borderColor);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateSplit.java
index 4d55d09..f1de613 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateSplit.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateSplit.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,7 +41,6 @@ import java.util.List;
import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
-import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
@@ -60,15 +59,11 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -135,7 +130,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
final List<Ftile> list = new ArrayList<Ftile>();
for (Ftile tmp : all) {
- list.add(new FtileHeightFixed(new FtileMarged(tmp, xMargin), height1));
+ list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
}
Ftile inner = super.createSplit(list);
@@ -210,16 +205,10 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
private TextBlock getTextBlock(LinkRendering linkRendering) {
// DUP1433
final Display display = LinkRendering.getDisplay(linkRendering);
- if (display == null) {
- return null;
- }
- final ISkinParam skinParam = getSkinParam();
- final UFont font = skinParam.getFont(FontParam.ACTIVITY_ARROW, null, false);
- final HtmlColor color = rose.getFontColor(skinParam, FontParam.ACTIVITY_ARROW);
- final FontConfiguration fontConfiguration = new FontConfiguration(font, color, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
- return TextBlockUtils.create(display, fontConfiguration, HorizontalAlignment.LEFT, null, true);
+ return getTextBlock(display);
}
+
+
private Ftile simpleSwimlanes(List<Ftile> all) {
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
@@ -229,7 +218,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
final List<Ftile> list = new ArrayList<Ftile>();
for (Ftile tmp : all) {
- list.add(new FtileHeightFixed(new FtileMarged(tmp, xMargin), height1));
+ list.add(new FtileHeightFixed(FtileUtils.addHorizontalMargin(tmp, xMargin), height1));
}
Ftile inner = new FtileSplit1(list);
@@ -282,6 +271,18 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
public void drawU(UGraphic ug) {
double minX = Double.MAX_VALUE;
double maxX = 0;
+ if (y == 0 && ug instanceof UGraphicInterceptorOneSwimlane) {
+ final Swimlane intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane();
+ boolean found = false;
+ for (Ftile tmp : list) {
+ if (tmp.getSwimlaneIn() == intoSw) {
+ found = true;
+ }
+ }
+ if (found == false) {
+ return;
+ }
+ }
final StringBounder stringBounder = ug.getStringBounder();
for (Ftile tmp : list) {
if (y > 0 && tmp.calculateDimension(stringBounder).hasPointOut() == false) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java
index 9de99a1..922ce27 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,28 +39,32 @@ import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.activitydiagram3.Branch;
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
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.activitydiagram3.ftile.vcompact.cond.ConditionalBuilder;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
- public FtileFactoryDelegatorIf(FtileFactory factory, ISkinParam skinParam) {
+ private final Pragma pragma;
+
+ public FtileFactoryDelegatorIf(FtileFactory factory, ISkinParam skinParam, Pragma pragma) {
super(factory, skinParam);
+ this.pragma = pragma;
}
@Override
- public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch) {
+ public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
+ LinkRendering topInlinkRendering) {
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
- final UFont fontArrow = getSkinParam().getFont(FontParam.ACTIVITY_ARROW, null, false);
- final UFont fontTest = getSkinParam().getFont(
- conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND : FontParam.ACTIVITY_ARROW, null, false);
final Branch branch0 = thens.get(0);
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
@@ -68,12 +72,26 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
ColorParam.activityBackground) : branch0.getColor();
final HtmlColor arrowColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityArrow);
+ final FontConfiguration fcArrow = new FontConfiguration(getSkinParam(), FontParam.ACTIVITY_ARROW, null);
+ // .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
if (thens.size() > 1) {
- return FtileIfLong2.create(swimlane, borderColor, backColor, fontArrow, arrowColor, getFactory(),
- conditionStyle, thens, elseBranch, getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink());
+ if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */)
+ return FtileIfLongVertical.create(swimlane, borderColor, backColor, arrowColor, getFactory(),
+ conditionStyle, thens, elseBranch, fcArrow, topInlinkRendering, afterEndwhile);
+ return FtileIfLongHorizontal.create(swimlane, borderColor, backColor, arrowColor, getFactory(),
+ conditionStyle, thens, elseBranch, fcArrow, topInlinkRendering, afterEndwhile);
}
- return FtileIf.create(swimlane, borderColor, backColor, fontArrow, fontTest, arrowColor, getFactory(),
- conditionStyle, thens.get(0), elseBranch, getSkinParam(), getStringBounder());
+ final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
+ : FontParam.ACTIVITY_ARROW;
+ final FontConfiguration fcTest = new FontConfiguration(getSkinParam(), testParam, null)
+ .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
+
+ return ConditionalBuilder.create(swimlane, borderColor, backColor, arrowColor, getFactory(), conditionStyle,
+ thens.get(0), elseBranch, getSkinParam(), getStringBounder(), fcArrow, fcTest);
+ }
+
+ private HtmlColor fontColor(FontParam param) {
+ return getSkinParam().getFontHtmlColor(null, param);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
index f0467cb..f79d028 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,9 +43,9 @@ 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.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
@@ -57,9 +57,6 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
LinkRendering backRepeatLinkRendering) {
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
- final UFont font = getSkinParam().getFont(
- conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND : FontParam.ACTIVITY_ARROW, null,
- false);
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
@@ -69,9 +66,11 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
final HtmlColor endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getColor();
- return FtileRepeat.create(backRepeatLinkRendering, swimlane, repeat, test, yes, out, borderColor, backColor, font, arrowColor,
- endRepeatLinkColor, conditionStyle, this, getSkinParam().getHyperlinkColor(), getSkinParam()
- .useUnderlineForHyperlink());
- }
+ final FontParam fontParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
+ : FontParam.ACTIVITY_ARROW;
+ final FontConfiguration fc = new FontConfiguration(getSkinParam(), fontParam, null);
+ return FtileRepeat.create(backRepeatLinkRendering, swimlane, repeat, test, yes, out, borderColor, backColor,
+ arrowColor, endRepeatLinkColor, conditionStyle, this, fc);
+ }
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
index a1bd72c..f3e40d4 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,9 +43,9 @@ 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.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
@@ -62,14 +62,17 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
final HtmlColor arrowColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityArrow);
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
- final UFont fontArrow = getSkinParam().getFont(FontParam.ACTIVITY_ARROW, null, false);
- final UFont fontTest = getSkinParam().getFont(
- conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND : FontParam.ACTIVITY_ARROW, null, false);
+ final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
+ : FontParam.ACTIVITY_ARROW;
+ final FontConfiguration fcTest = new FontConfiguration(getSkinParam(), testParam, null);
final LinkRendering endInlinkRendering = whileBlock.getOutLinkRendering();
final HtmlColor endInlinkColor = endInlinkRendering == null ? arrowColor : endInlinkRendering.getColor();
+
+ final FontConfiguration fontArrow = new FontConfiguration(getSkinParam(), FontParam.ACTIVITY_ARROW, null);
+
return FtileWhile.create(swimlane, whileBlock, test, borderColor, backColor, arrowColor, yes, out,
- fontArrow, endInlinkColor, afterEndwhile, getFactory(), conditionStyle, fontTest, getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink());
+ endInlinkColor, afterEndwhile, fontArrow, getFactory(), conditionStyle, fcTest);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
index 0a37e68..6b4a4a7 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
index c46dbcc..74b229f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,12 +38,15 @@ import java.awt.Font;
import java.awt.geom.Dimension2D;
import java.util.Set;
+import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
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.FtileMarged;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -54,7 +57,11 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.UGraphicInterceptorUDrawable;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.svek.UGraphicForSnake;
+import net.sourceforge.plantuml.ugraphic.LimitFinder;
+import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
@@ -67,32 +74,41 @@ public class FtileGroup extends AbstractFtile {
private final Ftile inner;
private final TextBlock name;
private final TextBlock headerNote;
- private final HtmlColor color;
+ private final HtmlColor arrowColor;
+ private final HtmlColor borderColor;
private final HtmlColor backColor;
private final HtmlColor titleColor;
+ private final UStroke stroke;
- public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor color, HtmlColor backColor,
- HtmlColor titleColor, ISkinParam skinParam) {
+ public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor arrowColor, HtmlColor backColor,
+ HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor) {
super(inner.shadowing());
this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
- this.inner = new FtileMarged(inner, 10);
- this.color = color;
+ this.inner = FtileUtils.addHorizontalMargin(inner, 10);
+ this.arrowColor = arrowColor;
this.titleColor = titleColor;
- final UFont font = new UFont("Serif", Font.PLAIN, 14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
+ this.borderColor = backColor == null ? HtmlColorUtils.BLACK : borderColor;
+ final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
+ // final UFont font = new UFont("Serif", Font.PLAIN, 14);
+ // final HtmlColor fontColor = HtmlColorUtils.BLACK;
+ final HtmlColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
+ final FontConfiguration fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(),
+ skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
if (title == null) {
this.name = TextBlockUtils.empty(0, 0);
} else {
- this.name = TextBlockUtils.create(title, fc, HorizontalAlignment.LEFT, skinParam);
+ this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam);
}
- if (displayNote == null) {
+ if (Display.isNull(displayNote)) {
this.headerNote = TextBlockUtils.empty(0, 0);
} else {
this.headerNote = new FloatingNote(displayNote, skinParam);
}
+
+ final UStroke thickness = skinParam.getThickness(LineParam.partitionBorder, null);
+ this.stroke = thickness == null ? new UStroke(2) : thickness;
}
-
+
@Override
public LinkRendering getInLinkRendering() {
return inner.getInLinkRendering();
@@ -120,8 +136,18 @@ public class FtileGroup extends AbstractFtile {
return new UTranslate(suppWidth / 2, diffHeightTitle(stringBounder) + headerNoteHeight(stringBounder));
}
+ private static MinMax getMinMax(TextBlock tb, StringBounder stringBounder) {
+ final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
+ final UGraphicForSnake interceptor = new UGraphicForSnake(limitFinder);
+ final UGraphicInterceptorUDrawable interceptor2 = new UGraphicInterceptorUDrawable(interceptor);
+
+ tb.drawU(interceptor2);
+ interceptor2.flushUg();
+ return limitFinder.getMinMax();
+ }
+
public double suppWidth(StringBounder stringBounder) {
- final FtileGeometry orig = inner.calculateDimension(stringBounder);
+ final FtileGeometry orig = getInnerDimension(stringBounder);
final Dimension2D dimTitle = name.calculateDimension(stringBounder);
final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
final double suppWidth = MathUtils
@@ -129,8 +155,18 @@ public class FtileGroup extends AbstractFtile {
return suppWidth;
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ private FtileGeometry getInnerDimension(StringBounder stringBounder) {
final FtileGeometry orig = inner.calculateDimension(stringBounder);
+ final MinMax minMax = getMinMax(inner, stringBounder);
+ final double missingWidth = minMax.getMaxX() - orig.getWidth();
+ if (missingWidth > 0) {
+ return orig.addDim(missingWidth + 5, 0);
+ }
+ return orig;
+ }
+
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final FtileGeometry orig = getInnerDimension(stringBounder);
final double suppWidth = suppWidth(stringBounder);
final double width = orig.getWidth() + suppWidth;
final double height = orig.getHeight() + diffHeightTitle(stringBounder) + diffYY2
@@ -152,8 +188,8 @@ public class FtileGroup extends AbstractFtile {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimTotal = calculateDimension(stringBounder);
- final SymbolContext symbolContext = new SymbolContext(backColor, HtmlColorUtils.BLACK).withShadow(shadowing())
- .withStroke(new UStroke(2));
+ final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(shadowing())
+ .withStroke(stroke);
USymbol.FRAME.asBig(name, TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext)
.drawU(ug);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
index 9579bdd..f96a72a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -58,6 +58,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.creole.CreoleMode;
import net.sourceforge.plantuml.creole.CreoleParser;
import net.sourceforge.plantuml.creole.Sheet;
import net.sourceforge.plantuml.creole.SheetBlock1;
@@ -66,11 +67,9 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -110,30 +109,26 @@ class FtileIfAndStop extends AbstractFtile {
return getSwimlaneIn();
}
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, UFont fontArrow, UFont fontTest,
- HtmlColor arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop,
- ISkinParam skinParam, StringBounder stringBounder, Display labelTest) {
+ static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
+ FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop, ISkinParam skinParam,
+ StringBounder stringBounder, Display labelTest) {
- backColor = HtmlColorUtils.BLUE;
+ // backColor = HtmlColorUtils.BLUE;
// final Ftile tileNonStop = new FtileMinWidth(nonStop.getFtile(), 30);
final Ftile tileNonStop = nonStop.getFtile();
- final HtmlColor fontColor = skinParam.getFontHtmlColor(FontParam.ACTIVITY_DIAMOND, null);
-
- final FontConfiguration fcArrow = new FontConfiguration(fontArrow, fontColor, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
- final FontConfiguration fcTest = new FontConfiguration(fontTest, fontColor, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
+ final FontConfiguration fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null);
final Ftile stopFtile = ftileFactory.stop(swimlane);
- // final TextBlock tb1 = TextBlockUtils.create(branch1.getLabelPositive(), fcArrow, HorizontalAlignment.LEFT,
+ // final TextBlock tb1 = Display.create(branch1.getLabelPositive(), fcArrow, HorizontalAlignment.LEFT,
// ftileFactory);
- // final TextBlock tb2 = TextBlockUtils.create(branch2.getLabelPositive(), fcArrow, HorizontalAlignment.LEFT,
+ // final TextBlock tb2 = Display.create(branch2.getLabelPositive(), fcArrow, HorizontalAlignment.LEFT,
// ftileFactory);
- final Sheet sheet = new CreoleParser(fcTest, HorizontalAlignment.LEFT, skinParam, false).createSheet(labelTest);
+ final Sheet sheet = new CreoleParser(fcTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
+ .createSheet(labelTest);
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), new UStroke(1.5));
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong.java
deleted file mode 100644
index 26b0ead..0000000
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2014, Arnaud Roques
- *
- * Project Info: http://plantuml.sourceforge.net
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
-
-import java.awt.geom.Dimension2D;
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.activitydiagram3.Branch;
-import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
-import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidth;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
-import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
-import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
-import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UTranslate;
-
-class FtileIfLong extends AbstractFtile {
-
- private final double xSeparation = 20;
-
- private final List<Ftile> tiles;
- private final Ftile tile2;
- private final List<Ftile> diamonds;
-
- private final HtmlColor arrowColor;
-
- private FtileIfLong(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, HtmlColor arrowColor) {
- super(tiles.get(0).shadowing() || tile2.shadowing());
- this.diamonds = diamonds;
- this.tiles = tiles;
- this.tile2 = tile2;
-
- this.arrowColor = arrowColor;
-
- }
-
- public Set<Swimlane> getSwimlanes() {
- final Set<Swimlane> result = new HashSet<Swimlane>();
- if (getSwimlaneIn() != null) {
- result.add(getSwimlaneIn());
- }
- for (Ftile tile : tiles) {
- result.addAll(tile.getSwimlanes());
- }
- result.addAll(tile2.getSwimlanes());
- return Collections.unmodifiableSet(result);
- }
-
- public Swimlane getSwimlaneIn() {
- return diamonds.get(0).getSwimlaneIn();
- }
-
- public Swimlane getSwimlaneOut() {
- return getSwimlaneIn();
- }
-
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, UFont font,
- HtmlColor arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens,
- Branch branch2, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
-
- final List<Ftile> tiles = new ArrayList<Ftile>();
-
- for (Branch branch : thens) {
- tiles.add(new FtileMinWidth(branch.getFtile(), 30));
- }
-
- final Ftile tile2 = new FtileMinWidth(branch2.getFtile(), 30);
-
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, hyperlinkColor,
- useUnderlineForHyperlink);
-
- final List<Ftile> diamonds = new ArrayList<Ftile>();
- final List<Connection> conns = new ArrayList<Connection>();
- for (Branch branch : thens) {
- final TextBlock tb1 = TextBlockUtils.create(branch.getLabelPositive(), fc, HorizontalAlignment.LEFT,
- ftileFactory);
- final TextBlock tbTest = TextBlockUtils.create(branch.getLabelTest(), fc, HorizontalAlignment.LEFT,
- ftileFactory);
- FtileDiamondInside diamond = new FtileDiamondInside(branch.shadowing(), backColor, borderColor, swimlane,
- tbTest);
- diamond = diamond.withNorth(tb1);
- diamonds.add(diamond);
- }
-
- final TextBlock tb2 = TextBlockUtils.create(branch2.getLabelPositive(), fc, HorizontalAlignment.LEFT,
- ftileFactory);
- final int last = diamonds.size() - 1;
- diamonds.set(last, ((FtileDiamondInside) diamonds.get(last)).withEast(tb2));
-
- final FtileIfLong result = new FtileIfLong(diamonds, tiles, tile2, arrowColor);
-
- for (int i = 0; i < thens.size(); i++) {
- final Ftile ftile = tiles.get(i);
- final Ftile diam = diamonds.get(i);
-
- final HtmlColor color = thens.get(i).getInlinkRenderingColor();
- conns.add(result.new ConnectionVerticalIn(diam, ftile, color == null ? arrowColor : color));
- conns.add(result.new ConnectionVerticalOut(ftile, arrowColor));
- }
-
- for (int i = 0; i < diamonds.size() - 1; i++) {
- final Ftile diam1 = diamonds.get(i);
- final Ftile diam2 = diamonds.get(i + 1);
- conns.add(result.new ConnectionHorizontal(diam1, diam2, arrowColor));
- }
- conns.add(result.new ConnectionIn(arrowColor));
- conns.add(result.new ConnectionLastElseIn(arrowColor));
- conns.add(result.new ConnectionLastElseOut(arrowColor));
- conns.add(result.new ConnectionHline(arrowColor));
-
- return FtileUtils.addConnection(result, conns);
- }
-
- class ConnectionHorizontal extends AbstractConnection {
-
- private final HtmlColor color;
-
- public ConnectionHorizontal(Ftile diam1, Ftile diam2, HtmlColor color) {
- super(diam1, diam2);
- this.color = color;
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final Point2D p1 = getP1(stringBounder);
- final Point2D p2 = getP2(stringBounder);
-
- final Snake snake = new Snake(color, Arrows.asToRight());
- snake.addPoint(p1);
- snake.addPoint(p2);
- ug.draw(snake);
- }
-
- private Point2D getP1(StringBounder stringBounder) {
- final FtileGeometry dimDiamond1 = getFtile1().calculateDimension(stringBounder);
- final Point2D p = new Point2D.Double(dimDiamond1.getWidth(), dimDiamond1.getOutY() / 2);
-
- return getTranslateDiamond1(getFtile1(), stringBounder).getTranslated(p);
- }
-
- private Point2D getP2(StringBounder stringBounder) {
- final FtileGeometry dimDiamond1 = getFtile2().calculateDimension(stringBounder);
- final Point2D p = new Point2D.Double(0, dimDiamond1.getOutY() / 2);
- return getTranslateDiamond1(getFtile2(), stringBounder).getTranslated(p);
- }
-
- }
-
- class ConnectionIn extends AbstractConnection {
-
- private final HtmlColor arrowColor;
-
- public ConnectionIn(HtmlColor arrowColor) {
- super(null, diamonds.get(0));
- this.arrowColor = arrowColor;
- }
-
- public void drawU(UGraphic ug) {
- final UTranslate tr = getTranslateDiamond1(getFtile2(), ug.getStringBounder());
- final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
- final Snake snake = new Snake(arrowColor, Arrows.asToDown());
- final Point2D p1 = calculateDimension(ug.getStringBounder()).getPointIn();
-
- snake.addPoint(p1);
- snake.addPoint(p2.getX(), p1.getY());
- snake.addPoint(p2);
- ug.draw(snake);
- }
-
- }
-
- class ConnectionLastElseIn extends AbstractConnection {
-
- private final HtmlColor arrowColor;
-
- public ConnectionLastElseIn(HtmlColor arrowColor) {
- super(diamonds.get(diamonds.size() - 1), tile2);
- this.arrowColor = arrowColor;
- }
-
- public void drawU(UGraphic ug) {
- final Point2D p1 = getP1(ug.getStringBounder());
- final UTranslate tr2 = getTranslate2(ug.getStringBounder());
- final Point2D p2 = tr2.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
- final Snake snake = new Snake(arrowColor, Arrows.asToDown());
- snake.addPoint(p1);
- snake.addPoint(p2.getX(), p1.getY());
- snake.addPoint(p2);
- ug.draw(snake);
- }
-
- private Point2D getP1(StringBounder stringBounder) {
- final FtileGeometry dimDiamond1 = getFtile1().calculateDimension(stringBounder);
- final Point2D p = new Point2D.Double(dimDiamond1.getWidth(), dimDiamond1.getOutY() / 2);
- return getTranslateDiamond1(getFtile1(), stringBounder).getTranslated(p);
- }
-
- }
-
- class ConnectionLastElseOut extends AbstractConnection {
-
- private final HtmlColor arrowColor;
-
- public ConnectionLastElseOut(HtmlColor arrowColor) {
- super(tile2, null);
- this.arrowColor = arrowColor;
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final UTranslate tr1 = getTranslate2(stringBounder);
- final FtileGeometry dim = getFtile1().calculateDimension(stringBounder);
- if (dim.hasPointOut() == false) {
- return;
- }
- final Point2D p1 = tr1.getTranslated(dim.getPointOut());
- final double totalHeight = calculateDimensionInternal(stringBounder).getHeight();
- final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
-
- final Snake snake = new Snake(arrowColor, Arrows.asToDown());
- snake.addPoint(p1);
- snake.addPoint(p2);
- ug.draw(snake);
- }
-
- }
-
- class ConnectionVerticalIn extends AbstractConnection {
-
- private final HtmlColor color;
-
- public ConnectionVerticalIn(Ftile diamond, Ftile tile, HtmlColor color) {
- super(diamond, tile);
- this.color = color;
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final Point2D p1 = getP1(stringBounder);
- final Point2D p2 = getP2(stringBounder);
-
- final Snake snake = new Snake(color, Arrows.asToDown());
- snake.addPoint(p1);
- snake.addPoint(p2);
- ug.draw(snake);
- }
-
- private Point2D getP1(StringBounder stringBounder) {
- final Point2D p = getFtile1().calculateDimension(stringBounder).getPointOut();
- return getTranslateDiamond1(getFtile1(), stringBounder).getTranslated(p);
- }
-
- private Point2D getP2(StringBounder stringBounder) {
- final Point2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
- return getTranslate1(getFtile2(), stringBounder).getTranslated(p);
- }
-
- }
-
- class ConnectionVerticalOut extends AbstractConnection {
-
- private final HtmlColor color;
-
- public ConnectionVerticalOut(Ftile tile, HtmlColor color) {
- super(tile, null);
- this.color = color;
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final double totalHeight = calculateDimensionInternal(stringBounder).getHeight();
- final Point2D p1 = getP1(stringBounder);
- if (p1 == null) {
- return;
- }
- final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
-
- final Snake snake = new Snake(color, Arrows.asToDown());
- snake.addPoint(p1);
- snake.addPoint(p2);
- ug.draw(snake);
- }
-
- private Point2D getP1(StringBounder stringBounder) {
- final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);
- if (geo.hasPointOut() == false) {
- return null;
- }
- final Point2D p = geo.getPointOut();
- return getTranslate1(getFtile1(), stringBounder).getTranslated(p);
- }
-
- }
-
- class ConnectionHline extends AbstractConnection {
-
- private final HtmlColor arrowColor;
-
- public ConnectionHline(HtmlColor arrowColor) {
- super(null, null);
- this.arrowColor = arrowColor;
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
-
- final List<Ftile> all = new ArrayList<Ftile>(tiles);
- all.add(tile2);
- double minX = totalDim.getWidth() / 2;
- double maxX = totalDim.getWidth() / 2;
- for (Ftile tmp : all) {
- if (tmp.calculateDimension(stringBounder).hasPointOut() == false) {
- continue;
- }
- final UTranslate ut = getTranslateFor(tmp, stringBounder);
- final double out = tmp.calculateDimension(stringBounder).translate(ut).getLeft();
- minX = Math.min(minX, out);
- maxX = Math.max(maxX, out);
- }
-
- final Snake s = new Snake(arrowColor);
- s.goUnmergeable();
- final double height = totalDim.getHeight();
- s.addPoint(minX, height);
- s.addPoint(maxX, height);
- ug.draw(s);
- }
- }
-
- @Override
- public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
- if (child == tile2) {
- return getTranslate2(stringBounder);
- }
- if (tiles.contains(child)) {
- return getTranslate1(child, stringBounder);
- }
- throw new UnsupportedOperationException();
- }
-
- private UTranslate getTranslate2(StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
- final Dimension2D dim2 = tile2.calculateDimension(stringBounder);
-
- final double x2 = dimTotal.getWidth() - dim2.getWidth();
-
- final double h = getAllDiamondsHeight(stringBounder);
- final double y2 = (dimTotal.getHeight() - h * 2 - dim2.getHeight()) / 2 + h;
-
- return new UTranslate(x2, y2);
-
- }
-
- private UTranslate getTranslateDiamond1(Ftile diamond1, StringBounder stringBounder) {
- double x1 = 0;
-
- for (Ftile diamond : diamonds) {
- final FtileGeometry dim1 = dimDiamondAndTile(stringBounder, diamond);
- if (diamond == diamond1) {
- final FtileGeometry dimDiamond = diamond.calculateDimension(stringBounder);
- double xresult = x1 + dim1.getLeft() - dimDiamond.getLeft();
- return new UTranslate(xresult, 25);
- }
- x1 += dim1.getWidth() + xSeparation;
- }
- throw new IllegalArgumentException();
-
- }
-
- private UTranslate getTranslate1(Ftile tile1, StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
- double x1 = 0;
-
- for (Ftile tile : tiles) {
- final Dimension2D dim1 = dimDiamondAndTile(stringBounder, tile);
- if (tile == tile1) {
- final Dimension2D dimTile = tile.calculateDimension(stringBounder);
- final double h = getAllDiamondsHeight(stringBounder);
- final double y1 = (dimTotal.getHeight() - 2 * h - dimTile.getHeight()) / 2 + h;
- return new UTranslate(x1 + (dim1.getWidth() - dimTile.getWidth()) / 2, y1);
- }
- x1 += dim1.getWidth() + xSeparation;
- }
- throw new IllegalArgumentException();
-
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- for (Ftile tile : tiles) {
- ug.apply(getTranslate1(tile, stringBounder)).draw(tile);
- }
- for (Ftile diamond : diamonds) {
- ug.apply(getTranslateDiamond1(diamond, stringBounder)).draw(diamond);
- }
-
- ug.apply(getTranslate2(stringBounder)).draw(tile2);
- }
-
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
-
- final List<Ftile> all = new ArrayList<Ftile>(tiles);
- all.add(tile2);
- for (Ftile tmp : all) {
- if (tmp.calculateDimension(stringBounder).hasPointOut()) {
- return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
- }
- }
- return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0);
-
- }
-
- private FtileGeometry dimDiamondAndTile(StringBounder stringBounder, Ftile tileOrDiamond) {
- for (int i = 0; i < tiles.size(); i++) {
- final Ftile tile = tiles.get(i);
- final Ftile diamond = diamonds.get(i);
- if (tile != tileOrDiamond && diamond != tileOrDiamond) {
- continue;
- }
- final FtileGeometry dimTile = tile.calculateDimension(stringBounder);
- final FtileGeometry dimDiamond = diamond.calculateDimension(stringBounder);
- return dimDiamond.appendBottom(dimTile);
- }
- throw new UnsupportedOperationException();
-
- }
-
- private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
- Dimension2D dimOnlyTiles = new Dimension2DDouble(0, 0);
- Dimension2D dimOnlyDiamond = new Dimension2DDouble(0, 0);
- Dimension2D dimBoth = new Dimension2DDouble(0, 0);
- for (int i = 0; i < tiles.size(); i++) {
- final Ftile tile = tiles.get(i);
- final Ftile diamond = diamonds.get(i);
- final FtileGeometry dimTile = tile.calculateDimension(stringBounder);
- final FtileGeometry dimDiamond = diamond.calculateDimension(stringBounder);
- final FtileGeometry both = dimDiamond.appendBottom(dimTile);
- dimOnlyTiles = Dimension2DDouble.mergeLR(dimOnlyTiles, dimTile);
- dimOnlyDiamond = Dimension2DDouble.mergeLR(dimOnlyDiamond, dimDiamond);
- dimBoth = Dimension2DDouble.mergeLR(dimBoth, both);
- }
- final FtileGeometry dimTile2 = tile2.calculateDimension(stringBounder);
- dimOnlyTiles = Dimension2DDouble.mergeLR(dimOnlyTiles, dimTile2);
- dimBoth = Dimension2DDouble.mergeLR(dimBoth, dimTile2);
-
- final Dimension2D result = new Dimension2DDouble(dimBoth.getWidth(), dimOnlyDiamond.getHeight() * 4
- + dimOnlyTiles.getHeight());
- return Dimension2DDouble.delta(result, xSeparation * tiles.size(), 40);
- }
-
- private double getAllDiamondsHeight(StringBounder stringBounder) {
- Dimension2D dimOnlyDiamond = new Dimension2DDouble(0, 0);
- for (Ftile diamond : diamonds) {
- final Dimension2D dimDiamond = diamond.calculateDimension(stringBounder);
- dimOnlyDiamond = Dimension2DDouble.mergeLR(dimOnlyDiamond, dimDiamond);
- }
- return dimOnlyDiamond.getHeight();
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
index 1aaecbc..5186b4d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLong2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,10 +44,12 @@ import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.Branch;
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
+import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
@@ -56,20 +58,20 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidth;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.FtileIfWithLinks;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class FtileIfLong2 extends AbstractFtile {
+class FtileIfLongHorizontal extends AbstractFtile {
private final double xSeparation = 20;
@@ -80,7 +82,7 @@ class FtileIfLong2 extends AbstractFtile {
private final HtmlColor arrowColor;
- private FtileIfLong2(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, HtmlColor arrowColor) {
+ private FtileIfLongHorizontal(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, HtmlColor arrowColor) {
super(tiles.get(0).shadowing() || tile2.shadowing());
if (diamonds.size() != tiles.size()) {
throw new IllegalArgumentException();
@@ -132,10 +134,9 @@ class FtileIfLong2 extends AbstractFtile {
return getSwimlaneIn();
}
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, UFont font,
- HtmlColor arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens,
- Branch branch2, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
-
+ static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
+ FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, Branch branch2,
+ FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
final List<Ftile> tiles = new ArrayList<Ftile>();
for (Branch branch : thens) {
@@ -144,49 +145,46 @@ class FtileIfLong2 extends AbstractFtile {
final Ftile tile2 = new FtileMinWidth(branch2.getFtile(), 30);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, hyperlinkColor,
- useUnderlineForHyperlink);
-
List<Ftile> diamonds = new ArrayList<Ftile>();
- final List<Connection> conns = new ArrayList<Connection>();
for (Branch branch : thens) {
- final TextBlock tb1 = TextBlockUtils.create(branch.getLabelPositive(), fc, HorizontalAlignment.LEFT,
- ftileFactory);
- final TextBlock tbTest = TextBlockUtils.create(branch.getLabelTest(), fc, HorizontalAlignment.LEFT,
- ftileFactory);
+ final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
+ final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory);
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.shadowing(), backColor, borderColor, swimlane,
tbTest);
diamond = diamond.withNorth(tb1);
diamonds.add(diamond);
}
- final TextBlock tb2 = TextBlockUtils.create(branch2.getLabelPositive(), fc, HorizontalAlignment.LEFT,
- ftileFactory);
+ final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
final int last = diamonds.size() - 1;
diamonds.set(last, ((FtileDiamondInside2) diamonds.get(last)).withEast(tb2));
diamonds = alignDiamonds(diamonds, ftileFactory.getStringBounder());
- final FtileIfLong2 result = new FtileIfLong2(diamonds, tiles, tile2, arrowColor);
+ final FtileIfLongHorizontal result = new FtileIfLongHorizontal(diamonds, tiles, tile2, arrowColor);
+ final List<Connection> conns = new ArrayList<Connection>();
for (int i = 0; i < thens.size(); i++) {
final Ftile ftile = tiles.get(i);
final Ftile diam = diamonds.get(i);
- final HtmlColor color = thens.get(i).getInlinkRenderingColor();
+ final HtmlColor color = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
conns.add(result.new ConnectionVerticalIn(diam, ftile, color == null ? arrowColor : color));
conns.add(result.new ConnectionVerticalOut(ftile, arrowColor));
}
+ final HtmlColor topInColor = LinkRendering.getColor(topInlinkRendering, arrowColor);
for (int i = 0; i < diamonds.size() - 1; i++) {
final Ftile diam1 = diamonds.get(i);
final Ftile diam2 = diamonds.get(i + 1);
- conns.add(result.new ConnectionHorizontal(diam1, diam2, arrowColor));
+ conns.add(result.new ConnectionHorizontal(diam1, diam2, topInColor));
}
- conns.add(result.new ConnectionIn(arrowColor));
- conns.add(result.new ConnectionLastElseIn(arrowColor));
+ conns.add(result.new ConnectionIn(topInColor));
+ conns.add(result.new ConnectionLastElseIn(FtileIfWithLinks.getInColor(branch2, arrowColor)));
conns.add(result.new ConnectionLastElseOut(arrowColor));
- conns.add(result.new ConnectionHline(arrowColor));
+ final HtmlColor horizontalOutColor = LinkRendering.getColor(afterEndwhile, arrowColor);
+ conns.add(result.new ConnectionHline(horizontalOutColor));
+ // conns.add(result.new ConnectionHline(HtmlColorUtils.BLUE));
return FtileUtils.addConnection(result, conns);
}
@@ -311,7 +309,7 @@ class FtileIfLong2 extends AbstractFtile {
}
- class ConnectionVerticalIn extends AbstractConnection {
+ class ConnectionVerticalIn extends AbstractConnection implements ConnectionTranslatable {
private final HtmlColor color;
@@ -341,6 +339,22 @@ class FtileIfLong2 extends AbstractFtile {
return getTranslate1(getFtile2(), stringBounder).getTranslated(p);
}
+ public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
+ final Point2D p1 = getP1(ug.getStringBounder());
+ final Point2D p2 = getP2(ug.getStringBounder());
+
+ final Snake snake = new Snake(color, Arrows.asToDown());
+
+ final Point2D mp1a = translate1.getTranslated(p1);
+ final Point2D mp2b = translate2.getTranslated(p2);
+ final double middle = mp1a.getY() + 4;
+ snake.addPoint(mp1a);
+ snake.addPoint(mp1a.getX(), middle);
+ snake.addPoint(mp2b.getX(), middle);
+ snake.addPoint(mp2b);
+ ug.draw(snake);
+ }
+
}
class ConnectionVerticalOut extends AbstractConnection {
@@ -391,19 +405,37 @@ class FtileIfLong2 extends AbstractFtile {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
+ final Swimlane intoSw;
+ if (ug instanceof UGraphicInterceptorOneSwimlane) {
+ intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane();
+ } else {
+ intoSw = null;
+ }
+
final List<Ftile> all = new ArrayList<Ftile>(couples);
all.add(tile2);
double minX = totalDim.getWidth() / 2;
double maxX = totalDim.getWidth() / 2;
+ boolean atLeastOne = false;
for (Ftile tmp : all) {
if (tmp.calculateDimension(stringBounder).hasPointOut() == false) {
continue;
}
+ if (intoSw != null && tmp.getSwimlanes().contains(intoSw) == false) {
+ continue;
+ }
+ if (intoSw != null && tmp.getSwimlaneOut() != intoSw) {
+ continue;
+ }
+ atLeastOne = true;
final UTranslate ut = getTranslateFor(tmp, stringBounder);
final double out = tmp.calculateDimension(stringBounder).translate(ut).getLeft();
minX = Math.min(minX, out);
maxX = Math.max(maxX, out);
}
+ if (atLeastOne == false) {
+ return;
+ }
final Snake s = new Snake(arrowColor);
s.goUnmergeable();
@@ -507,5 +539,4 @@ class FtileIfLong2 extends AbstractFtile {
}
-
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
new file mode 100644
index 0000000..a691f8e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
@@ -0,0 +1,587 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.activitydiagram3.Branch;
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
+import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidth;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileOverpassing;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.FtileIfWithLinks;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside3;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.svek.ConditionStyle;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+class FtileIfLongVertical extends AbstractFtile {
+
+ private final double ySeparation = 20;
+
+ private final double marginy1 = 30;
+
+ private final List<Ftile> tiles;
+ private final Ftile tile2;
+ private final List<Ftile> diamonds;
+ private final Ftile lastDiamond;
+ // private final List<Ftile> couples = new ArrayList<Ftile>();
+
+ private final HtmlColor arrowColor;
+
+ private FtileIfLongVertical(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, HtmlColor arrowColor,
+ Ftile lastDiamond) {
+ super(tiles.get(0).shadowing() || tile2.shadowing());
+ if (diamonds.size() != tiles.size()) {
+ throw new IllegalArgumentException();
+ }
+ this.lastDiamond = lastDiamond;
+ // for (int i = 0; i < diamonds.size(); i++) {
+ // couples.add(new FtileAssemblySimple(diamonds.get(i), tiles.get(i)));
+ // }
+ this.tile2 = tile2;
+ this.diamonds = new ArrayList<Ftile>(diamonds);
+ this.tiles = new ArrayList<Ftile>(tiles);
+
+ this.arrowColor = arrowColor;
+
+ }
+
+ // private static List<Ftile> alignDiamonds(List<Ftile> diamonds, StringBounder stringBounder) {
+ // double maxOutY = 0;
+ // for (Ftile diamond : diamonds) {
+ // maxOutY = Math.max(maxOutY, diamond.calculateDimension(stringBounder).getOutY());
+ // }
+ // final List<Ftile> result = new ArrayList<Ftile>();
+ // for (int i = 0; i < diamonds.size(); i++) {
+ // Ftile diamond = diamonds.get(i);
+ // final double missing = maxOutY - diamond.calculateDimension(stringBounder).getOutY();
+ // assert missing >= 0;
+ // diamond = FtileUtils.addVerticalMargin(diamond, missing / 2, 20);
+ // result.add(diamond);
+ // }
+ // return result;
+ // }
+
+ public Set<Swimlane> getSwimlanes() {
+ final Set<Swimlane> result = new HashSet<Swimlane>();
+ if (getSwimlaneIn() != null) {
+ result.add(getSwimlaneIn());
+ }
+ for (Ftile tile : tiles) {
+ result.addAll(tile.getSwimlanes());
+ }
+ result.addAll(tile2.getSwimlanes());
+ return Collections.unmodifiableSet(result);
+ }
+
+ public Swimlane getSwimlaneIn() {
+ return tiles.get(0).getSwimlaneIn();
+ }
+
+ public Swimlane getSwimlaneOut() {
+ return getSwimlaneIn();
+ }
+
+ static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
+ FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, Branch branch2,
+ FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
+ final List<Ftile> tiles = new ArrayList<Ftile>();
+
+ for (Branch branch : thens) {
+ tiles.add(new FtileMinWidth(branch.getFtile(), 30));
+ }
+
+ final Ftile tile2 = new FtileMinWidth(branch2.getFtile(), 30);
+
+ List<Ftile> diamonds = new ArrayList<Ftile>();
+ for (Branch branch : thens) {
+ final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
+ final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT, ftileFactory);
+ FtileDiamondInside3 diamond = new FtileDiamondInside3(branch.shadowing(), backColor, borderColor, swimlane,
+ tbTest);
+ diamond = diamond.withEast(tb1);
+ diamonds.add(diamond);
+ }
+
+ final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory);
+ final int last = diamonds.size() - 1;
+ diamonds.set(last, ((FtileDiamondInside3) diamonds.get(last)).withSouth(tb2));
+
+ // diamonds = alignDiamonds(diamonds, ftileFactory.getStringBounder());
+
+ final Ftile lastDiamond = new FtileDiamond(tiles.get(0).shadowing(), backColor, borderColor, swimlane);
+
+ final FtileIfLongVertical result = new FtileIfLongVertical(diamonds, tiles, tile2, arrowColor, lastDiamond);
+
+ final List<Connection> conns = new ArrayList<Connection>();
+ for (int i = 0; i < thens.size(); i++) {
+ final Ftile ftile = tiles.get(i);
+ final Ftile diam = diamonds.get(i);
+
+ final HtmlColor color = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
+ conns.add(result.new ConnectionVerticalIn(diam, ftile, color == null ? arrowColor : color));
+ // conns.add(result.new ConnectionVerticalOut(ftile, arrowColor));
+ }
+
+ for (int i = 0; i < diamonds.size() - 1; i++) {
+ conns.add(result.new ConnectionVertical(diamonds.get(i), diamonds.get(i + 1), arrowColor));
+ }
+ conns.add(result.new ConnectionThenOut(tiles.get(0), arrowColor));
+ for (int i = 1; i < tiles.size(); i++) {
+ conns.add(result.new ConnectionThenOutConnect(tiles.get(i), arrowColor));
+ }
+
+ final HtmlColor topInColor = LinkRendering.getColor(topInlinkRendering, arrowColor);
+ // for (int i = 0; i < diamonds.size() - 1; i++) {
+ // final Ftile diam1 = diamonds.get(i);
+ // final Ftile diam2 = diamonds.get(i + 1);
+ // conns.add(result.new ConnectionHorizontal(diam1, diam2, topInColor));
+ // }
+ conns.add(result.new ConnectionIn(topInColor));
+ // conns.add(result.new ConnectionLastElseIn(FtileIfWithLinks.getInColor(branch2, arrowColor)));
+ // conns.add(result.new ConnectionLastElseOut(arrowColor));
+ // final HtmlColor horizontalOutColor = LinkRendering.getColor(afterEndwhile, arrowColor);
+ // conns.add(result.new ConnectionHline(horizontalOutColor));
+ conns.add(result.new ConnectionLastElse(topInColor));
+ conns.add(result.new ConnectionLastElseOut(arrowColor));
+
+ return FtileUtils.addConnection(result, conns);
+ }
+
+ static private double getYdiamontOutToLeft(FtileGeometry dimDiamond1, StringBounder stringBounder) {
+ return (dimDiamond1.getInY() + dimDiamond1.getOutY()) / 2;
+ }
+
+ class ConnectionIn extends AbstractConnection {
+
+ private final HtmlColor arrowColor;
+
+ public ConnectionIn(HtmlColor arrowColor) {
+ super(null, diamonds.get(0));
+ this.arrowColor = arrowColor;
+ }
+
+ public void drawU(UGraphic ug) {
+ final UTranslate tr = getTranslateDiamond(getFtile2(), ug.getStringBounder());
+ final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
+ final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
+
+ snake.addPoint(p1);
+ snake.addPoint(p1.getX(), (p1.getY() + p2.getY()) / 2);
+ snake.addPoint(p2.getX(), (p1.getY() + p2.getY()) / 2);
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+
+ }
+
+ class ConnectionVerticalIn extends AbstractConnection {
+
+ private final HtmlColor color;
+
+ public ConnectionVerticalIn(Ftile diamond, Ftile tile, HtmlColor color) {
+ super(diamond, tile);
+ this.color = color;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Point2D p1 = getP1(stringBounder);
+ final Point2D p2 = getP2(stringBounder);
+
+ final Snake snake = new Snake(color, Arrows.asToDown());
+ snake.addPoint(p1);
+ snake.addPoint(p2.getX(), p1.getY());
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+
+ private Point2D getP1(StringBounder stringBounder) {
+ final Dimension2D dimDiamond1 = getFtile1().calculateDimension(stringBounder);
+ final double diamondWidth = dimDiamond1.getWidth();
+ return getTranslateDiamond(getFtile1(), stringBounder).getTranslated(
+ new Point2D.Double(diamondWidth, dimDiamond1.getHeight() / 2));
+ }
+
+ private Point2D getP2(StringBounder stringBounder) {
+ final Point2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
+ return getTranslate1(getFtile2(), stringBounder).getTranslated(p);
+ }
+
+ }
+
+ class ConnectionVertical extends AbstractConnection {
+
+ private final HtmlColor color;
+
+ public ConnectionVertical(Ftile diamond1, Ftile diamond2, HtmlColor color) {
+ super(diamond1, diamond2);
+ this.color = color;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Point2D p1 = getP1(stringBounder);
+ final Point2D p2 = getP2(stringBounder);
+
+ final Snake snake = new Snake(color, Arrows.asToDown());
+ snake.addPoint(p1);
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+
+ private Point2D getP1(StringBounder stringBounder) {
+ final Point2D p = getFtile1().calculateDimension(stringBounder).getPointOut();
+ return getTranslateFor(getFtile1(), stringBounder).getTranslated(p);
+ }
+
+ private Point2D getP2(StringBounder stringBounder) {
+ final Point2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
+ return getTranslateFor(getFtile2(), stringBounder).getTranslated(p);
+ }
+
+ }
+
+ class ConnectionLastElse extends AbstractConnection {
+
+ private final HtmlColor arrowColor;
+
+ public ConnectionLastElse(HtmlColor arrowColor) {
+ super(diamonds.get(diamonds.size() - 1), tile2);
+ this.arrowColor = arrowColor;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final UTranslate tr1 = getTranslateDiamond(getFtile1(), stringBounder);
+ final FtileGeometry dimDiamond = getFtile1().calculateDimension(stringBounder);
+ final Point2D p1 = tr1.getTranslated(dimDiamond.getPointOut());
+
+ final Point2D p2 = getTranslate2(stringBounder).getTranslated(
+ getFtile2().calculateDimension(stringBounder).getPointIn());
+
+ final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ snake.addPoint(p1);
+ snake.addPoint(p1.getX(), p2.getY() - 15);
+ snake.addPoint(p2.getX(), p2.getY() - 15);
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+
+ }
+
+ class ConnectionLastElseOut extends AbstractConnection {
+
+ private final HtmlColor arrowColor;
+
+ public ConnectionLastElseOut(HtmlColor arrowColor) {
+ super(tile2, lastDiamond);
+ this.arrowColor = arrowColor;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final FtileGeometry dim1 = getFtile1().calculateDimension(stringBounder);
+ if (dim1.hasPointOut() == false) {
+ return;
+ }
+ final Point2D p1 = getTranslate2(stringBounder).getTranslated(dim1.getPointOut());
+ final Point2D p2 = getTranslateLastDiamond(stringBounder).getTranslated(
+ getFtile2().calculateDimension(stringBounder).getPointIn());
+
+ final Snake snake = new Snake(arrowColor, Arrows.asToDown());
+ snake.addPoint(p1);
+ snake.addPoint(p1.getX(), p2.getY() - 15);
+ snake.addPoint(p2.getX(), p2.getY() - 15);
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+
+ }
+
+ class ConnectionThenOut extends AbstractConnection {
+
+ private final HtmlColor arrowColor;
+
+ public ConnectionThenOut(Ftile tile1, HtmlColor arrowColor) {
+ super(tile1, lastDiamond);
+ this.arrowColor = arrowColor;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final FtileGeometry dim1 = getFtile1().calculateDimension(stringBounder);
+ if (dim1.hasPointOut() == false) {
+ return;
+ }
+ final Point2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());
+
+ final FtileGeometry dimLastDiamond = getFtile2().calculateDimension(stringBounder);
+ Point2D p2 = getTranslateLastDiamond(stringBounder).getTranslated(
+ getFtile2().calculateDimension(stringBounder).getPointIn());
+ p2 = new UTranslate(dimLastDiamond.getWidth() / 2, dimLastDiamond.getHeight() / 2).getTranslated(p2);
+
+ final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+
+ final Snake snake = new Snake(arrowColor, Arrows.asToLeft());
+ snake.addPoint(p1);
+ snake.addPoint(p1.getX(), p1.getY() + 15);
+ snake.addPoint(dimTotal.getWidth(), p1.getY() + 15);
+ snake.addPoint(dimTotal.getWidth(), p2.getY());
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+ }
+
+ class ConnectionThenOutConnect extends AbstractConnection {
+
+ private final HtmlColor arrowColor;
+
+ public ConnectionThenOutConnect(Ftile tile1, HtmlColor arrowColor) {
+ super(tile1, lastDiamond);
+ this.arrowColor = arrowColor;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final FtileGeometry dim1 = getFtile1().calculateDimension(stringBounder);
+ if (dim1.hasPointOut() == false) {
+ return;
+ }
+ final Point2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());
+
+ final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+
+ final Point2D p2 = new Point2D.Double(dimTotal.getWidth(), p1.getY() + 15);
+
+ final Snake snake = new Snake(arrowColor, Arrows.asToRight());
+ snake.addPoint(p1);
+ snake.addPoint(p1.getX(), p2.getY());
+ snake.addPoint(p2);
+ ug.draw(snake);
+ }
+
+ }
+
+ @Override
+ public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
+ if (child == tile2) {
+ return getTranslate2(stringBounder);
+ }
+ if (child == lastDiamond) {
+ return getTranslateLastDiamond(stringBounder);
+ }
+ if (tiles.contains(child)) {
+ return getTranslate1(child, stringBounder);
+ }
+ if (diamonds.contains(child)) {
+ return getTranslateDiamond(child, stringBounder);
+ }
+ throw new UnsupportedOperationException();
+ }
+
+ private UTranslate getTranslateDiamond(Ftile diamond, StringBounder stringBounder) {
+ final double allDiamondsWidth = allDiamondsWidth(stringBounder);
+
+ final int idx = diamonds.indexOf(diamond);
+ if (idx == -1) {
+ throw new IllegalArgumentException();
+ }
+ final double y1 = getTranslateDy(idx, stringBounder);
+ return new UTranslate((allDiamondsWidth - diamond.calculateDimension(stringBounder).getWidth()) / 2, y1);
+ }
+
+ private UTranslate getTranslateLastDiamond(StringBounder stringBounder) {
+ final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ final FtileGeometry dimLast = lastDiamond.calculateDimension(stringBounder);
+ final double x = (dimTotal.getWidth() - dimLast.getWidth()) / 2;
+ return new UTranslate(x, dimTotal.getHeight() - dimLast.getHeight());
+ }
+
+ private UTranslate getTranslate1(Ftile candidat, StringBounder stringBounder) {
+ final int idx = tiles.indexOf(candidat);
+ if (idx == -1) {
+ throw new IllegalArgumentException();
+ }
+ final double y1 = getTranslateDy(idx, stringBounder);
+ final FtileGeometry diam = diamonds.get(idx).calculateDimension(stringBounder);
+ final FtileGeometry dim1 = candidat.calculateDimension(stringBounder);
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
+ final double allDiamondsWidth = allDiamondsWidth(stringBounder);
+ final double x = allDiamondsWidth + (dimTotal.getWidth() - allDiamondsWidth - dim1.getWidth()) / 2;
+ return new UTranslate(x, y1 + diam.getHeight());
+ }
+
+ private double getTranslateDy(int idx, StringBounder stringBounder) {
+ double y1 = marginy1;
+
+ for (int i = 0; i < idx; i++) {
+ final FtileGeometry dim1 = tiles.get(i).calculateDimension(stringBounder);
+ final FtileGeometry diam = diamonds.get(i).calculateDimension(stringBounder);
+ y1 += dim1.getHeight() + diam.getHeight() + ySeparation;
+ }
+ return y1;
+ }
+
+ private UTranslate getTranslate2(StringBounder stringBounder) {
+ final double y1 = getTranslateDy(tiles.size(), stringBounder);
+ final FtileGeometry dim2 = tile2.calculateDimension(stringBounder);
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
+ final double x = (dimTotal.getWidth() - dim2.getWidth()) / 2;
+ return new UTranslate(x, y1);
+
+ // final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ // final Dimension2D dim2 = tile2.calculateDimension(stringBounder);
+ //
+ // final double x2 = dimTotal.getWidth() - dim2.getWidth();
+ //
+ // final double h = 0; // getAllDiamondsHeight(stringBounder);
+ // final double y2 = (dimTotal.getHeight() - h * 2 - dim2.getHeight()) / 2 + h;
+ //
+ // return new UTranslate(x2, y2);
+
+ }
+
+ // private UTranslate getTranslateCouple1(Ftile candidat, StringBounder stringBounder) {
+ // double x1 = 0;
+ //
+ // for (Ftile couple : couples) {
+ // final FtileGeometry dim1 = couple.calculateDimension(stringBounder);
+ // if (couple == candidat) {
+ // return new UTranslate(x1, 25);
+ // }
+ // x1 += dim1.getWidth() + xSeparation;
+ // }
+ // throw new IllegalArgumentException();
+ //
+ // }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ for (Ftile tile1 : tiles) {
+ ug.apply(getTranslate1(tile1, stringBounder)).draw(tile1);
+ }
+ for (Ftile diam : diamonds) {
+ ug.apply(getTranslateDiamond(diam, stringBounder)).draw(diam);
+ }
+
+ ug.apply(getTranslate2(stringBounder)).draw(tile2);
+ ug.apply(getTranslateLastDiamond(stringBounder)).draw(lastDiamond);
+ }
+
+ private FtileGeometry calculateDimensionInternal(StringBounder stringBounder) {
+ // FtileGeometry result = new FtileGeometry(0, marginy1, 0, 0);
+ double col1 = 0;
+ double col1overpass = 0;
+ double col2 = 0;
+ double height = marginy1;
+ for (int i = 0; i < tiles.size(); i++) {
+ final FtileGeometry dim1 = tiles.get(i).calculateDimension(stringBounder);
+ final FtileGeometry diamondOverpassing = ((FtileOverpassing) diamonds.get(i))
+ .getOverpassDimension(stringBounder);
+ final FtileGeometry diamondDim = diamonds.get(i).calculateDimension(stringBounder);
+
+ height += diamondDim.getHeight() + dim1.getHeight();
+ col1 = Math.max(col1, diamondDim.getWidth());
+ col1overpass = Math.max(col1overpass, diamondOverpassing.getWidth());
+ col2 = Math.max(col2, dim1.getWidth());
+ }
+ final double width = Math.max(col1 + col2, col1overpass);
+ FtileGeometry result = new FtileGeometry(width, height, width / 2, 0);
+
+ final FtileGeometry dimTile2 = tile2.calculateDimension(stringBounder);
+ result = result.appendBottom(dimTile2);
+ final FtileGeometry dimLastDiamond = lastDiamond.calculateDimension(stringBounder);
+ final double lastElseArrowHeight = 40;
+ result = result.addDim(0, ySeparation * tiles.size() + lastElseArrowHeight + dimLastDiamond.getHeight());
+
+ return new FtileGeometry(result, result.getWidth() / 2, 0);
+ }
+
+ private double allDiamondsWidth(StringBounder stringBounder) {
+ double width = 0;
+ for (Ftile diam : diamonds) {
+ width = Math.max(width, diam.calculateDimension(stringBounder).getWidth());
+ }
+ return width;
+ }
+
+ private double allTile1Width(StringBounder stringBounder) {
+ double width = 0;
+ for (Ftile tile1 : tiles) {
+ width = Math.max(width, tile1.calculateDimension(stringBounder).getWidth());
+ }
+ return width;
+ }
+
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+
+ final List<Ftile> all = new ArrayList<Ftile>(tiles);
+ all.add(tile2);
+ for (Ftile tmp : all) {
+ if (tmp.calculateDimension(stringBounder).hasPointOut()) {
+ return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
+ }
+ }
+ return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0);
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
index c98280f..a593726 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -58,18 +58,15 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondFoo1;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
-import net.sourceforge.plantuml.ugraphic.UChangeColor;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -101,15 +98,16 @@ class FtileRepeat extends AbstractFtile {
}
public static Ftile create(LinkRendering backRepeatLinkRendering, Swimlane swimlane, Ftile repeat, Display test,
- Display yes, Display out, HtmlColor borderColor, HtmlColor backColor, UFont fontTest, HtmlColor arrowColor,
+ Display yes, Display out, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
HtmlColor endRepeatLinkColor, ConditionStyle conditionStyle, ISkinSimple spriteContainer,
- HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
+ FontConfiguration fontConfiguration) {
- final FontConfiguration fc = new FontConfiguration(fontTest, HtmlColorUtils.BLACK, hyperlinkColor,
- useUnderlineForHyperlink);
- final TextBlock tbTest = TextBlockUtils.create(test, fc, HorizontalAlignment.LEFT, spriteContainer);
- final TextBlock yesTb = TextBlockUtils.create(yes, fc, HorizontalAlignment.LEFT, spriteContainer);
- final TextBlock outTb = TextBlockUtils.create(out, fc, HorizontalAlignment.LEFT, spriteContainer);
+ // final FontConfiguration fc = new FontConfiguration(fontTest, HtmlColorUtils.BLACK, hyperlinkColor,
+ // useUnderlineForHyperlink);
+ final TextBlock tbTest = (Display.isNull(test) || test.isWhite()) ? TextBlockUtils.empty(0, 0) : test.create(
+ fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
+ final TextBlock yesTb = yes.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
+ final TextBlock outTb = out.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
final Ftile diamond1 = new FtileDiamond(repeat.shadowing(), backColor, borderColor, swimlane);
final FtileRepeat result;
@@ -130,18 +128,19 @@ class FtileRepeat extends AbstractFtile {
final List<Connection> conns = new ArrayList<Connection>();
final Display in1 = LinkRendering.getDisplay(repeat.getInLinkRendering());
- final TextBlock tbin1 = in1 == null ? null : TextBlockUtils.create(in1, fc, HorizontalAlignment.LEFT,
- spriteContainer, true);
+ final TextBlock tbin1 = in1 == null ? null : in1.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer,
+ CreoleMode.SIMPLE_LINE);
conns.add(result.new ConnectionIn(LinkRendering.getColor(repeat.getInLinkRendering(), arrowColor), tbin1));
final Display backLink1 = LinkRendering.getDisplay(backRepeatLinkRendering);
- final TextBlock tbbackLink1 = backLink1 == null ? null : TextBlockUtils.create(backLink1, fc,
- HorizontalAlignment.LEFT, spriteContainer, true);
+ final TextBlock tbbackLink1 = backLink1 == null ? null : backLink1.create(fontConfiguration, HorizontalAlignment.LEFT,
+ spriteContainer, CreoleMode.SIMPLE_LINE);
conns.add(result.new ConnectionBack(LinkRendering.getColor(backRepeatLinkRendering, arrowColor), tbbackLink1));
-
+
final Display out1 = LinkRendering.getDisplay(repeat.getOutLinkRendering());
- final TextBlock tbout1 = out1 == null ? null : TextBlockUtils.create(out1, fc, HorizontalAlignment.LEFT,
- spriteContainer, true);
+ final TextBlock tbout1 = out1 == null ? null : out1.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer,
+ CreoleMode.SIMPLE_LINE);
+
conns.add(result.new ConnectionOut(LinkRendering.getColor(endRepeatLinkColor, arrowColor), tbout1));
return FtileUtils.addConnection(result, conns);
}
@@ -200,6 +199,9 @@ class FtileRepeat extends AbstractFtile {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
+ if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false) {
+ return;
+ }
final Snake snake = new Snake(arrowColor, Arrows.asToDown());
snake.setLabel(tbout);
@@ -211,6 +213,9 @@ class FtileRepeat extends AbstractFtile {
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
final StringBounder stringBounder = ug.getStringBounder();
+ if (getFtile1().calculateDimension(stringBounder).hasPointOut() == false) {
+ return;
+ }
final Snake snake = new Snake(arrowColor);
snake.setLabel(tbout);
final Point2D mp1a = translate1.getTranslated(getP1(stringBounder));
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
index 84c81c5..4a4c612 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
index 1ccc403..513ca50 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,6 @@ import java.util.List;
import java.util.Set;
import net.sourceforge.plantuml.Direction;
-import net.sourceforge.plantuml.FileGroup;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
@@ -64,7 +63,6 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -72,7 +70,6 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEmpty;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -103,30 +100,23 @@ class FtileWhile extends AbstractFtile {
this.supplementarySouthText = supplementarySouthText;
}
- private static TextBlock createLabel1(Display test, Display yes, UFont font, ISkinSimple spriteContainer,
- HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, hyperlinkColor,
- useUnderlineForHyperlink);
- final TextBlock tmpb = TextBlockUtils.create(yes, fc, HorizontalAlignment.LEFT, spriteContainer);
+ private static TextBlock createLabel1(Display test, Display yes, ISkinSimple spriteContainer, FontConfiguration fc) {
+ final TextBlock tmpb = yes.create(fc, HorizontalAlignment.LEFT, spriteContainer);
if (test == null) {
return tmpb;
}
- return TextBlockUtils.mergeTB(TextBlockUtils.create(test, fc, HorizontalAlignment.LEFT, spriteContainer), tmpb,
+ return TextBlockUtils.mergeTB(test.create(fc, HorizontalAlignment.LEFT, spriteContainer), tmpb,
HorizontalAlignment.CENTER);
}
public static Ftile create(Swimlane swimlane, Ftile whileBlock, Display test, HtmlColor borderColor,
- HtmlColor backColor, HtmlColor arrowColor, Display yes, Display out2, UFont fontArrow,
- HtmlColor endInlinkColor, LinkRendering afterEndwhile, FtileFactory ftileFactory,
- ConditionStyle conditionStyle, UFont fontTest, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
-
- final FontConfiguration fcArrow = new FontConfiguration(fontArrow, HtmlColorUtils.BLACK, hyperlinkColor,
- useUnderlineForHyperlink);
- final FontConfiguration fcTest = new FontConfiguration(fontTest, HtmlColorUtils.BLACK, hyperlinkColor,
- useUnderlineForHyperlink);
- final TextBlock yesTb = TextBlockUtils.create(yes, fcArrow, HorizontalAlignment.LEFT, ftileFactory);
- final TextBlock testTb = TextBlockUtils.create(test, fcTest, HorizontalAlignment.LEFT, ftileFactory);
- final TextBlock out = TextBlockUtils.create(out2, fcArrow, HorizontalAlignment.LEFT, ftileFactory);
+ HtmlColor backColor, HtmlColor arrowColor, Display yes, Display out2, HtmlColor endInlinkColor,
+ LinkRendering afterEndwhile, FontConfiguration fontArrow, FtileFactory ftileFactory,
+ ConditionStyle conditionStyle, FontConfiguration fcTest) {
+
+ final TextBlock yesTb = yes.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory);
+ final TextBlock testTb = test.create(fcTest, HorizontalAlignment.LEFT, ftileFactory);
+ final TextBlock out = out2.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory);
final Ftile diamond1;
final TextBlock supplementarySouthText;
@@ -139,8 +129,7 @@ class FtileWhile extends AbstractFtile {
diamond1 = new FtileDiamondFoo1(whileBlock.shadowing(), backColor, borderColor, swimlane, testTb)
.withNorth(yesTb).withWest(out);
} else if (conditionStyle == ConditionStyle.DIAMOND) {
- supplementarySouthText = createLabel1(test, yes, fontArrow, ftileFactory, hyperlinkColor,
- useUnderlineForHyperlink);
+ supplementarySouthText = createLabel1(test, yes, ftileFactory, fontArrow);
diamond1 = new FtileDiamond(whileBlock.shadowing(), backColor, borderColor, swimlane).withWest(out)
.withSouth(supplementarySouthText);
} else {
@@ -220,6 +209,11 @@ class FtileWhile extends AbstractFtile {
return getTranslateForWhile(stringBounder).getTranslated(geo.getPointOut());
}
+ private double getBottom(final StringBounder stringBounder) {
+ final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
+ return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
+ }
+
private Point2D getP2(final StringBounder stringBounder) {
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
}
@@ -242,16 +236,17 @@ class FtileWhile extends AbstractFtile {
final double y2 = p2.getY() + dimDiamond1.getOutY() / 2;
snake.addPoint(x1, y1);
- snake.addPoint(x1, y1 + Diamond.diamondHalfSize);
+ final double y1bis = Math.max(y1, getBottom(stringBounder)) + Diamond.diamondHalfSize;
+ snake.addPoint(x1, y1bis);
final double xx = dimTotal.getWidth();
- snake.addPoint(xx, y1 + Diamond.diamondHalfSize);
+ snake.addPoint(xx, y1bis);
snake.addPoint(xx, y2);
snake.addPoint(x2, y2);
snake.emphasizeDirection(Direction.UP);
ug.draw(snake);
- ug.apply(new UTranslate(x1, y1 + Diamond.diamondHalfSize)).draw(new UEmpty(5, Diamond.diamondHalfSize));
+ ug.apply(new UTranslate(x1, y1bis)).draw(new UEmpty(5, Diamond.diamondHalfSize));
// ug = ug.apply(new UChangeColor(endInlinkColor)).apply(new UChangeBackColor(endInlinkColor));
// ug.apply(new UTranslate(xx, (y1 + y2) / 2)).draw(Arrows.asToUp());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
index 1b3eceb..c50052b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -47,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.creole.CreoleMode;
import net.sourceforge.plantuml.creole.CreoleParser;
import net.sourceforge.plantuml.creole.Sheet;
import net.sourceforge.plantuml.creole.SheetBlock1;
@@ -95,15 +96,18 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil {
// this.arrowColor = arrowColor;
final Rose rose = new Rose();
- final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
- final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
+ // final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
+ // final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
final HtmlColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
final HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
- final FontConfiguration fc = new FontConfiguration(fontNote, fontColor, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
+ // final FontConfiguration fc = new FontConfiguration(fontNote, fontColor, skinParam.getHyperlinkColor(),
+ // skinParam.useUnderlineForHyperlink());
+ final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
- final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, false).createSheet(note);
+ final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
+ .createSheet(note);
final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, 0, skinParam.getPadding()), this, new UStroke(1));
opale = new Opale(borderColor, noteBackgroundColor, text, skinParam.shadowing(), withLink);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorGoto.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorGoto.java
index 4f7f853..13ddb97 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorGoto.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorGoto.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java
index 26d213f..f750c19 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -96,4 +96,8 @@ public class UGraphicInterceptorOneSwimlane extends UGraphicDelegator {
return new UGraphicInterceptorOneSwimlane(getUg().apply(change), swimlane);
}
+ public final Swimlane getSwimlane() {
+ return swimlane;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
index bbbeecc..72acd66 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,17 +49,20 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBox;
+import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleEnd;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStart;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStop;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateIn;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOut;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
-import net.sourceforge.plantuml.ugraphic.Sprite;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class VCompactFactory implements FtileFactory {
@@ -86,12 +89,18 @@ public class VCompactFactory implements FtileFactory {
return new FtileCircleStop(shadowing(), color, swimlane);
}
- public Ftile activity(Display label, final HtmlColor color, Swimlane swimlane, BoxStyle style) {
- final HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.activityBorder);
- final HtmlColor backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityBackground) : color;
- final UFont font = skinParam.getFont(FontParam.ACTIVITY, null, false);
+ public Ftile end(Swimlane swimlane) {
+ final HtmlColor color = rose.getHtmlColor(skinParam, ColorParam.activityEnd);
+ return new FtileCircleEnd(shadowing(), color, swimlane);
+ }
+
+ public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors) {
+ // final HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.activityBorder);
+ // final HtmlColor backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityBackground) :
+ // color;
+ final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
final HtmlColor arrowColor = rose.getHtmlColor(skinParam, ColorParam.activityArrow);
- return new FtileBox(shadowing(), label, borderColor, backColor, font, arrowColor, swimlane, style, skinParam);
+ return new FtileBox(shadowing(), label, font, arrowColor, swimlane, style, colors.mute(skinParam));
}
public Ftile addNote(Ftile ftile, Display note, NotePosition notePosition) {
@@ -116,7 +125,8 @@ public class VCompactFactory implements FtileFactory {
return whileBlock;
}
- public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch) {
+ public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
+ LinkRendering topInlinkRendering) {
final List<Ftile> ftiles = new ArrayList<Ftile>();
for (Branch branch : thens) {
ftiles.add(branch.getFtile());
@@ -133,7 +143,7 @@ public class VCompactFactory implements FtileFactory {
return new FtileForkInner(all);
}
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote) {
+ public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote, HtmlColor borderColor) {
return list;
}
@@ -171,4 +181,16 @@ public class VCompactFactory implements FtileFactory {
return skinParam.useGuillemet();
}
+ public String getMonospacedFamily() {
+ return skinParam.getMonospacedFamily();
+ }
+
+ public int getTabSize() {
+ return skinParam.getTabSize();
+ }
+
+ public IHtmlColorSet getIHtmlColorSet() {
+ return skinParam.getIHtmlColorSet();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
new file mode 100644
index 0000000..5d41a9e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
@@ -0,0 +1,218 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.activitydiagram3.Branch;
+import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidth;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
+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.creole.CreoleMode;
+import net.sourceforge.plantuml.creole.CreoleParser;
+import net.sourceforge.plantuml.creole.Sheet;
+import net.sourceforge.plantuml.creole.SheetBlock1;
+import net.sourceforge.plantuml.creole.SheetBlock2;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.svek.ConditionStyle;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+
+public class ConditionalBuilder {
+
+ private final Swimlane swimlane;
+ private final HtmlColor borderColor;
+ private final HtmlColor backColor;
+ private final HtmlColor arrowColor;
+ private final FtileFactory ftileFactory;
+ private final ConditionStyle conditionStyle;
+ private final Branch branch1;
+ private final Branch branch2;
+ private final ISkinParam skinParam;
+ private final StringBounder stringBounder;
+ private final FontConfiguration fontArrow;
+ private final FontConfiguration fontTest;
+
+ private final Ftile tile1;
+ private final Ftile tile2;
+
+ public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
+ FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
+ ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow, FontConfiguration fontTest) {
+ this.swimlane = swimlane;
+ this.borderColor = borderColor;
+ this.backColor = backColor;
+ this.arrowColor = arrowColor;
+ this.ftileFactory = ftileFactory;
+ this.conditionStyle = conditionStyle;
+ this.branch1 = branch1;
+ this.branch2 = branch2;
+ this.skinParam = skinParam;
+ this.stringBounder = stringBounder;
+ this.fontArrow = fontArrow;
+ this.fontTest = fontTest;
+
+ this.tile1 = new FtileMinWidth(branch1.getFtile(), 30);
+ this.tile2 = new FtileMinWidth(branch2.getFtile(), 30);
+
+ }
+
+ static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
+ FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
+ ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow, FontConfiguration fcTest) {
+ final ConditionalBuilder builder = new ConditionalBuilder(swimlane, borderColor, backColor, arrowColor,
+ ftileFactory, conditionStyle, branch1, branch2, skinParam, stringBounder, fcArrow, fcTest);
+ return builder.createWithLinks();
+ // return builder.createWithDiamonds();
+ // return builder.createNude();
+
+ }
+
+ private Ftile createNude() {
+ return new FtileIfNude(tile1, tile2, swimlane);
+
+ }
+
+ private Ftile createWithDiamonds() {
+ final Ftile diamond1 = getDiamond1();
+ final Ftile diamond2 = getDiamond2();
+ final FtileIfWithDiamonds ftile = new FtileIfWithDiamonds(diamond1, tile1, tile2, diamond2, swimlane,
+ stringBounder);
+ final Dimension2D label1 = getLabelBranch1().calculateDimension(stringBounder);
+ final Dimension2D label2 = getLabelBranch2().calculateDimension(stringBounder);
+ final double diff1 = ftile.computeMarginNeedForBranchLabe1(stringBounder, label1);
+ final double diff2 = ftile.computeMarginNeedForBranchLabe2(stringBounder, label2);
+ Ftile result = FtileUtils.addHorizontalMargin(ftile, diff1, diff2);
+ final double suppHeight = ftile.computeVerticalMarginNeedForBranchs(stringBounder, label1, label2);
+ result = FtileUtils.addVerticalMargin(result, suppHeight, 0);
+ return result;
+ }
+
+ private Ftile createWithLinks() {
+ final Ftile diamond1 = getDiamond1();
+ final Ftile diamond2 = getDiamond2();
+ final Ftile tmp1 = FtileUtils.addHorizontalMargin(tile1, 10);
+ final Ftile tmp2 = FtileUtils.addHorizontalMargin(tile2, 10);
+ final FtileIfWithLinks ftile = new FtileIfWithLinks(diamond1, tmp1, tmp2, diamond2, swimlane, arrowColor,
+ stringBounder);
+ final Dimension2D label1 = getLabelBranch1().calculateDimension(stringBounder);
+ final Dimension2D label2 = getLabelBranch2().calculateDimension(stringBounder);
+ final double diff1 = ftile.computeMarginNeedForBranchLabe1(stringBounder, label1);
+ final double diff2 = ftile.computeMarginNeedForBranchLabe2(stringBounder, label2);
+ final double suppHeight = ftile.computeVerticalMarginNeedForBranchs(stringBounder, label1, label2);
+ Ftile result = ftile.addLinks(branch1, branch2, stringBounder);
+ result = FtileUtils.addHorizontalMargin(result, diff1, diff2);
+ result = FtileUtils.addVerticalMargin(result, suppHeight, 0);
+ return result;
+ }
+
+ private Ftile getDiamond1() {
+ final Display labelTest = branch1.getLabelTest();
+ final TextBlock tb1 = getLabelBranch1();
+ final TextBlock tb2 = getLabelBranch2();
+
+ final Sheet sheet = new CreoleParser(fontTest, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
+ .createSheet(labelTest);
+ final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
+ final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), new UStroke(1.5));
+
+ final Ftile diamond1;
+ if (conditionStyle == ConditionStyle.INSIDE) {
+ diamond1 = new FtileDiamondInside(tile1.shadowing(), backColor, borderColor, swimlane, tbTest)
+ .withWestAndEast(tb1, tb2);
+ } else if (conditionStyle == ConditionStyle.DIAMOND) {
+ diamond1 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withNorth(tbTest)
+ .withWestAndEast(tb1, tb2);
+ } else {
+ throw new IllegalStateException();
+ }
+ return diamond1;
+ }
+
+ private TextBlock getLabelBranch2() {
+ final TextBlock tb2 = branch2.getLabelPositive().create(fontArrow, HorizontalAlignment.LEFT, ftileFactory,
+ CreoleMode.SIMPLE_LINE);
+ return tb2;
+ }
+
+ private TextBlock getLabelBranch1() {
+ final TextBlock tb1 = branch1.getLabelPositive().create(fontArrow, HorizontalAlignment.LEFT, ftileFactory,
+ CreoleMode.SIMPLE_LINE);
+ return tb1;
+ }
+
+ private Ftile getDiamond2() {
+ final Ftile diamond2;
+ if (hasTwoBranches()) {
+ final Display out1 = LinkRendering.getDisplay(branch1.getFtile().getOutLinkRendering());
+ final TextBlock tbout1 = out1 == null ? null : out1.create(fontArrow, HorizontalAlignment.LEFT,
+ ftileFactory, CreoleMode.SIMPLE_LINE);
+ final Display out2 = LinkRendering.getDisplay(branch2.getFtile().getOutLinkRendering());
+ final TextBlock tbout2 = out2 == null ? null : out2.create(fontArrow, HorizontalAlignment.LEFT,
+ ftileFactory, CreoleMode.SIMPLE_LINE);
+ diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
+ tbout2);
+ } else {
+ // diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2,
+ // swimlane, swimlane);
+ diamond2 = new FtileEmpty(tile1.shadowing(), 0, Diamond.diamondHalfSize / 2, swimlane, swimlane);
+ }
+ return diamond2;
+ }
+
+ public boolean hasTwoBranches() {
+ return tile1.calculateDimension(stringBounder).hasPointOut()
+ && tile2.calculateDimension(stringBounder).hasPointOut();
+ }
+
+ // private HtmlColor fontColor() {
+ // return skinParam.getFontHtmlColor(FontParam.ACTIVITY_DIAMOND, null);
+ // }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileDimensionMemoize.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileDimensionMemoize.java
new file mode 100644
index 0000000..80316ec
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileDimensionMemoize.java
@@ -0,0 +1,57 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
+
+import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
+import net.sourceforge.plantuml.graphic.StringBounder;
+
+public abstract class FtileDimensionMemoize extends AbstractFtile {
+
+ public FtileDimensionMemoize(boolean shadowing) {
+ super(shadowing);
+ }
+
+ private FtileGeometry calculateDimensionInternal;
+
+ protected final FtileGeometry calculateDimensionInternal(StringBounder stringBounder) {
+ if (calculateDimensionInternal == null) {
+ calculateDimensionInternal = calculateDimensionInternalSlow(stringBounder);
+ }
+ return calculateDimensionInternal;
+ }
+
+ abstract protected FtileGeometry calculateDimensionInternalSlow(StringBounder stringBounder);
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java
new file mode 100644
index 0000000..6393443
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfNude.java
@@ -0,0 +1,157 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
+
+import java.awt.geom.Dimension2D;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+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.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class FtileIfNude extends FtileDimensionMemoize {
+
+ protected final Ftile tile1;
+ protected final Ftile tile2;
+ private final Swimlane in;
+
+ FtileIfNude(Ftile tile1, Ftile tile2, Swimlane in) {
+ super(tile1.shadowing() || tile2.shadowing());
+ this.tile1 = tile1;
+ this.tile2 = tile2;
+ this.in = in;
+ }
+
+ public boolean hasTwoBranches(StringBounder stringBounder) {
+ return tile1.calculateDimension(stringBounder).hasPointOut()
+ && tile2.calculateDimension(stringBounder).hasPointOut();
+ }
+
+ public Set<Swimlane> getSwimlanes() {
+ final Set<Swimlane> result = new HashSet<Swimlane>();
+ if (getSwimlaneIn() != null) {
+ result.add(getSwimlaneIn());
+ }
+ result.addAll(tile1.getSwimlanes());
+ result.addAll(tile2.getSwimlanes());
+ return Collections.unmodifiableSet(result);
+ }
+
+ public Swimlane getSwimlaneIn() {
+ return in;
+ }
+
+ public Swimlane getSwimlaneOut() {
+ return getSwimlaneIn();
+ }
+
+ protected UTranslate getTranslate1(StringBounder stringBounder) {
+ final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ final Dimension2D dim1 = tile1.calculateDimension(stringBounder);
+
+ final double x1 = 0;
+ final double y1 = 0;
+ return new UTranslate(x1, y1);
+ }
+
+ protected UTranslate getTranslate2(StringBounder stringBounder) {
+ final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ final Dimension2D dim2 = tile2.calculateDimension(stringBounder);
+
+ final double x2 = dimTotal.getWidth() - dim2.getWidth();
+ final double y2 = 0;
+ return new UTranslate(x2, y2);
+
+ }
+
+ @Override
+ public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
+ if (child == tile1) {
+ return getTranslate1(stringBounder);
+ }
+ if (child == tile2) {
+ return getTranslate2(stringBounder);
+ }
+ throw new UnsupportedOperationException();
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+
+ ug.apply(getTranslate1(stringBounder)).draw(tile1);
+ ug.apply(getTranslate2(stringBounder)).draw(tile2);
+ }
+
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
+ if (tile1.calculateDimension(stringBounder).hasPointOut()
+ || tile2.calculateDimension(stringBounder).hasPointOut()) {
+ return dimTotal;
+ }
+ return dimTotal.withoutPointOut();
+ }
+
+ @Override
+ protected FtileGeometry calculateDimensionInternalSlow(StringBounder stringBounder) {
+ final FtileGeometry dim1 = tile1.calculateDimension(stringBounder);
+ final FtileGeometry dim2 = tile2.calculateDimension(stringBounder);
+
+ final double innerMargin = withInner(stringBounder);
+ final double width = dim1.getLeft() + innerMargin + (dim2.getWidth() - dim2.getLeft());
+
+ final Dimension2D dim12 = Dimension2DDouble.mergeLR(dim1, dim2);
+
+ return new FtileGeometry(width, dim12.getHeight(), dim1.getLeft() + innerMargin / 2, 0);
+ }
+
+ protected double withInner(StringBounder stringBounder) {
+ final FtileGeometry dim1 = tile1.calculateDimension(stringBounder);
+ final FtileGeometry dim2 = tile2.calculateDimension(stringBounder);
+ return (dim1.getWidth() - dim1.getLeft()) + dim2.getLeft();
+ }
+
+// protected double getLeft(StringBounder stringBounder) {
+// final double left1 = tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft();
+// final double left2 = tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft();
+// return (left1 + left2) / 2;
+// }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java
new file mode 100644
index 0000000..aa74d22
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java
@@ -0,0 +1,171 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
+
+import java.awt.geom.Dimension2D;
+
+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.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class FtileIfWithDiamonds extends FtileIfNude {
+
+ private final double SUPP_WITH = 20;
+ protected final Ftile diamond1;
+ protected final Ftile diamond2;
+
+ public FtileIfWithDiamonds(Ftile diamond1, Ftile tile1, Ftile tile2, Ftile diamond2, Swimlane in,
+ StringBounder stringBounder) {
+ super(tile1, tile2, in);
+ this.diamond1 = diamond1;
+ this.diamond2 = diamond2;
+ }
+
+ public int getYdelta1a(StringBounder stringBounder) {
+ // if (getSwimlanes().size() > 1 && hasTwoBranches(stringBounder)) {
+ if (getSwimlanes().size() > 1) {
+ return 20;
+ }
+ return 10;
+ // return hasTwoBranches(stringBounder) ? 6 : 6;
+ }
+
+ public int getYdelta1b(StringBounder stringBounder) {
+ // if (getSwimlanes().size() > 1 && hasTwoBranches(stringBounder)) {
+ if (getSwimlanes().size() > 1) {
+ return 10;
+ }
+ return hasTwoBranches(stringBounder) ? 6 : 0;
+ }
+
+ @Override
+ protected double withInner(StringBounder stringBounder) {
+ final FtileGeometry dim1 = diamond1.calculateDimension(stringBounder);
+ return Math.max(super.withInner(stringBounder), dim1.getWidth() + SUPP_WITH);
+ }
+
+ @Override
+ protected FtileGeometry calculateDimensionInternalSlow(StringBounder stringBounder) {
+ final FtileGeometry dim1 = diamond1.calculateDimension(stringBounder);
+ final FtileGeometry dim2 = diamond2.calculateDimension(stringBounder);
+
+ final FtileGeometry dimNude = super.calculateDimensionInternalSlow(stringBounder);
+
+ final FtileGeometry all = dim1.appendBottom(dimNude).appendBottom(dim2);
+
+ return all.addDim(0, getYdelta1a(stringBounder) + getYdelta1b(stringBounder));
+
+ // final double height = dimNude.getHeight() + dim1.getHeight() + dim2.getHeight() + getYdelta1a(stringBounder)
+ // + getYdelta1b(stringBounder);
+ // return new Dimension2DDouble(width, height);
+ }
+
+ @Override
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+
+ ug.apply(getTranslateDiamond1(stringBounder)).draw(diamond1);
+ super.drawU(ug);
+ ug.apply(getTranslateDiamond2(stringBounder)).draw(diamond2);
+ }
+
+ @Override
+ protected UTranslate getTranslate1(StringBounder stringBounder) {
+ final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
+ return super.getTranslate1(stringBounder).compose(
+ new UTranslate(0, dimDiamond1.getHeight() + getYdelta1a(stringBounder)));
+ }
+
+ @Override
+ protected UTranslate getTranslate2(StringBounder stringBounder) {
+ final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
+ return super.getTranslate2(stringBounder).compose(
+ new UTranslate(0, dimDiamond1.getHeight() + getYdelta1a(stringBounder)));
+ }
+
+ protected UTranslate getTranslateDiamond1(StringBounder stringBounder) {
+ final double y1 = 0;
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
+ final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
+ // final double x1 = getLeft(stringBounder) - dimDiamond1.getWidth() / 2;
+ final double x1 = dimTotal.getLeft() - dimDiamond1.getLeft();
+ return new UTranslate(x1, y1);
+ }
+
+ protected UTranslate getTranslateDiamond2(StringBounder stringBounder) {
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
+ final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
+ final double y2 = dimTotal.getHeight() - dimDiamond2.getHeight();
+ final double x2 = dimTotal.getLeft() - dimDiamond2.getWidth() / 2;
+ return new UTranslate(x2, y2);
+ }
+
+ public double computeMarginNeedForBranchLabe1(StringBounder stringBounder, Dimension2D label1) {
+ final double widthLabelBranch1 = label1.getWidth();
+ final double dxDiamond = getTranslateDiamond1(stringBounder).getDx();
+ final double diff = widthLabelBranch1 - dxDiamond;
+ if (diff > 0) {
+ return diff;
+ }
+ return 0;
+ }
+
+ public double computeMarginNeedForBranchLabe2(StringBounder stringBounder, Dimension2D label2) {
+ final double widthLabelBranch2 = label2.getWidth();
+ final double theoricalEndNeeded = getTranslateDiamond1(stringBounder).getDx()
+ + diamond1.calculateDimension(stringBounder).getWidth() + widthLabelBranch2;
+ final double diff = theoricalEndNeeded - calculateDimension(stringBounder).getWidth();
+ if (diff > 0) {
+ return diff;
+ }
+ return 0;
+ }
+
+ public double computeVerticalMarginNeedForBranchs(StringBounder stringBounder, Dimension2D label1,
+ Dimension2D label2) {
+ final double heightLabels = Math.max(label1.getHeight(), label2.getHeight());
+ final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
+ final double dyDiamond = dimDiamond1.getHeight();
+ final double diff = heightLabels - dyDiamond;
+ if (diff > 0) {
+ return diff;
+ }
+ return 0;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIf.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java
index 58fee9a..ac4bdb1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIf.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithLinks.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,175 +32,43 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
+package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
-import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction;
-import net.sourceforge.plantuml.FontParam;
-import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
-import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
-import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidth;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
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.creole.CreoleParser;
-import net.sourceforge.plantuml.creole.Sheet;
-import net.sourceforge.plantuml.creole.SheetBlock1;
-import net.sourceforge.plantuml.creole.SheetBlock2;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
-import net.sourceforge.plantuml.svek.ConditionStyle;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
-import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class FtileIf extends AbstractFtile {
-
- private final Ftile tile1;
- private final Ftile tile2;
- private final Ftile diamond1;
- private final Ftile diamond2;
+public class FtileIfWithLinks extends FtileIfWithDiamonds {
private final HtmlColor arrowColor;
- private FtileIf(Ftile diamond1, Ftile tile1, Ftile tile2, Ftile diamond2, HtmlColor arrowColor) {
- super(tile1.shadowing() || tile2.shadowing());
- this.diamond1 = diamond1;
- this.diamond2 = diamond2;
- this.tile1 = tile1;
- this.tile2 = tile2;
-
+ public FtileIfWithLinks(Ftile diamond1, Ftile tile1, Ftile tile2, Ftile diamond2, Swimlane in,
+ HtmlColor arrowColor, StringBounder stringBounder) {
+ super(diamond1, tile1, tile2, diamond2, in, stringBounder);
this.arrowColor = arrowColor;
-
- }
-
- public Set<Swimlane> getSwimlanes() {
- final Set<Swimlane> result = new HashSet<Swimlane>();
- if (getSwimlaneIn() != null) {
- result.add(getSwimlaneIn());
- }
- result.addAll(tile1.getSwimlanes());
- result.addAll(tile2.getSwimlanes());
- return Collections.unmodifiableSet(result);
}
- public Swimlane getSwimlaneIn() {
- return diamond1.getSwimlaneIn();
- }
-
- public Swimlane getSwimlaneOut() {
- return getSwimlaneIn();
- }
-
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, UFont fontArrow, UFont fontTest,
- HtmlColor arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
- Branch branch2, ISkinParam skinParam, StringBounder stringBounder) {
-
- final Display labelTest = branch1.getLabelTest();
- // if (branch1.isOnlySingleStop() || branch2.isOnlySingleStop()) {
- // final Branch nonStop = branch1.isOnlySingleStop() ? branch2 : branch1;
- // return FtileIfAndStop.create(swimlane, borderColor, backColor, fontArrow, fontTest, arrowColor,
- // ftileFactory, conditionStyle, nonStop, skinParam, stringBounder, labelTest);
- // }
-
- final Ftile tile1 = new FtileMinWidth(branch1.getFtile(), 30);
- final Ftile tile2 = new FtileMinWidth(branch2.getFtile(), 30);
-
- final HtmlColor fontColor = skinParam.getFontHtmlColor(FontParam.ACTIVITY_DIAMOND, null);
-
- final FontConfiguration fcArrow = new FontConfiguration(fontArrow, fontColor, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
- final FontConfiguration fcTest = new FontConfiguration(fontTest, fontColor, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
-
- final TextBlock tb1 = TextBlockUtils.create(branch1.getLabelPositive(), fcArrow, HorizontalAlignment.LEFT,
- ftileFactory, true);
- final TextBlock tb2 = TextBlockUtils.create(branch2.getLabelPositive(), fcArrow, HorizontalAlignment.LEFT,
- ftileFactory, true);
-
- final Sheet sheet = new CreoleParser(fcTest, HorizontalAlignment.LEFT, skinParam, false).createSheet(labelTest);
- final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, 0, skinParam.getPadding());
- final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), new UStroke(1.5));
-
- final Ftile diamond1;
- if (conditionStyle == ConditionStyle.INSIDE) {
- diamond1 = new FtileDiamondInside(tile1.shadowing(), backColor, borderColor, swimlane, tbTest)
- .withWest(tb1).withEast(tb2);
- } else if (conditionStyle == ConditionStyle.DIAMOND) {
- diamond1 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withWest(tb1)
- .withEast(tb2).withNorth(tbTest);
- } else {
- throw new IllegalStateException();
- }
-
- final Ftile diamond2;
- if (tile1.calculateDimension(stringBounder).hasPointOut()
- && tile2.calculateDimension(stringBounder).hasPointOut()) {
- final Display out1 = LinkRendering.getDisplay(branch1.getFtile().getOutLinkRendering());
- final TextBlock tbout1 = out1 == null ? null : TextBlockUtils.create(out1, fcArrow,
- HorizontalAlignment.LEFT, ftileFactory, true);
- final Display out2 = LinkRendering.getDisplay(branch2.getFtile().getOutLinkRendering());
- final TextBlock tbout2 = out2 == null ? null : TextBlockUtils.create(out2, fcArrow,
- HorizontalAlignment.LEFT, ftileFactory, true);
- diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
- tbout2);
- } else {
- diamond2 = new FtileEmpty(tile1.shadowing(), Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2,
- swimlane, swimlane);
- }
- final FtileIf result = new FtileIf(diamond1, tile1, tile2, diamond2, arrowColor);
-
- final List<Connection> conns = new ArrayList<Connection>();
- conns.add(result.new ConnectionHorizontalThenVertical(tile1, branch1));
- conns.add(result.new ConnectionHorizontalThenVertical(tile2, branch2));
- if (tile1.calculateDimension(stringBounder).hasPointOut()
- && tile2.calculateDimension(stringBounder).hasPointOut()) {
- conns.add(result.new ConnectionVerticalThenHorizontal(tile1, branch1.getInlinkRenderingColor(), branch1
- .isEmpty()));
- conns.add(result.new ConnectionVerticalThenHorizontal(tile2, branch2.getInlinkRenderingColor(), branch2
- .isEmpty()));
- } else if (tile1.calculateDimension(stringBounder).hasPointOut()
- && tile2.calculateDimension(stringBounder).hasPointOut() == false) {
- conns.add(result.new ConnectionVerticalThenHorizontalDirect(tile1, branch1.getInlinkRenderingColor(),
- branch1.isEmpty()));
- } else if (tile1.calculateDimension(stringBounder).hasPointOut() == false
- && tile2.calculateDimension(stringBounder).hasPointOut()) {
- conns.add(result.new ConnectionVerticalThenHorizontalDirect(tile2, branch2.getInlinkRenderingColor(),
- branch2.isEmpty()));
- }
- // return result;
- return FtileUtils.addConnection(result, conns);
- }
-
- private HtmlColor getInColor(Branch branch) {
+ public static HtmlColor getInColor(Branch branch, HtmlColor arrowColor) {
if (branch.isEmpty()) {
return LinkRendering.getColor(branch.getFtile().getOutLinkRendering(), arrowColor);
}
@@ -217,10 +85,10 @@ class FtileIf extends AbstractFtile {
public ConnectionHorizontalThenVertical(Ftile tile, Branch branch) {
super(diamond1, tile);
- color = getInColor(branch);
+ color = getInColor(branch, arrowColor);
usingArrow = branch.isEmpty() ? null : Arrows.asToDown();
}
-
+
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Point2D p1 = getP1(stringBounder);
@@ -238,32 +106,6 @@ class FtileIf extends AbstractFtile {
ug.draw(snake);
}
- public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
- final StringBounder stringBounder = ug.getStringBounder();
- Point2D p1 = getP1(stringBounder);
- Point2D p2 = getP2(stringBounder);
- final Direction originalDirection = Direction.leftOrRight(p1, p2);
- p1 = translate1.getTranslated(p1);
- p2 = translate2.getTranslated(p2);
- final Direction newDirection = Direction.leftOrRight(p1, p2);
- if (originalDirection != newDirection) {
- final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Diamond.diamondHalfSize;
- final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
- final Snake small = new Snake(color);
- small.addPoint(p1);
- small.addPoint(p1.getX() + delta, p1.getY());
- small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75);
- ug.draw(small);
- p1 = small.getLast();
- }
- final Snake snake = new Snake(color, usingArrow);
- snake.addPoint(p1);
- snake.addPoint(p2.getX(), p1.getY());
- snake.addPoint(p2);
- ug.draw(snake);
-
- }
-
private Point2D getP1(StringBounder stringBounder) {
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
final double diamondWidth = dimDiamond1.getWidth();
@@ -292,6 +134,33 @@ class FtileIf extends AbstractFtile {
}
throw new IllegalStateException();
}
+
+ public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ Point2D p1 = getP1(stringBounder);
+ Point2D p2 = getP2(stringBounder);
+ final Direction originalDirection = Direction.leftOrRight(p1, p2);
+ p1 = translate1.getTranslated(p1);
+ p2 = translate2.getTranslated(p2);
+ final Direction newDirection = Direction.leftOrRight(p1, p2);
+ if (originalDirection != newDirection) {
+ final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Diamond.diamondHalfSize;
+ final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
+ final Snake small = new Snake(color);
+ small.addPoint(p1);
+ small.addPoint(p1.getX() + delta, p1.getY());
+ small.addPoint(p1.getX() + delta, p1.getY() + dimDiamond1.getHeight() * .75);
+ ug.draw(small);
+ p1 = small.getLast();
+ }
+ final Snake snake = new Snake(color, usingArrow);
+ snake.addPoint(p1);
+ snake.addPoint(p2.getX(), p1.getY());
+ snake.addPoint(p2);
+ ug.draw(snake);
+
+ }
+
}
class ConnectionVerticalThenHorizontal extends AbstractConnection implements ConnectionTranslatable {
@@ -303,7 +172,7 @@ class FtileIf extends AbstractFtile {
this.myArrowColor = myArrowColor == null ? arrowColor : myArrowColor;
this.branchEmpty = branchEmpty;
}
-
+
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
@@ -331,6 +200,31 @@ class FtileIf extends AbstractFtile {
ug.draw(snake);
}
+ private Point2D getP2(StringBounder stringBounder) {
+ final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
+ final double diamondWidth = dimDiamond2.getWidth();
+ final double x;
+ if (getFtile1() == tile1) {
+ x = 0;
+ } else if (getFtile1() == tile2) {
+ x = diamondWidth;
+ } else {
+ throw new IllegalStateException();
+ }
+ return getTranslateDiamond2(stringBounder)
+ .getTranslated(new Point2D.Double(x, dimDiamond2.getHeight() / 2));
+ }
+
+ private UTranslate translate(StringBounder stringBounder) {
+ if (getFtile1() == tile1) {
+ return getTranslate1(stringBounder);
+ }
+ if (getFtile1() == tile2) {
+ return getTranslate2(stringBounder);
+ }
+ throw new IllegalStateException();
+ }
+
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
final StringBounder stringBounder = ug.getStringBounder();
final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);
@@ -364,7 +258,8 @@ class FtileIf extends AbstractFtile {
ug.draw(small);
} else {
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Diamond.diamondHalfSize;
- final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 3 * Diamond.diamondHalfSize);
+ final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5
+ * Diamond.diamondHalfSize);
final Snake snake = new Snake(myArrowColor);
snake.addPoint(mp1a);
snake.addPoint(mp1a.getX(), mp2bb.getY());
@@ -379,31 +274,6 @@ class FtileIf extends AbstractFtile {
}
}
-
- private Point2D getP2(StringBounder stringBounder) {
- final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
- final double diamondWidth = dimDiamond2.getWidth();
- final double x;
- if (getFtile1() == tile1) {
- x = 0;
- } else if (getFtile1() == tile2) {
- x = diamondWidth;
- } else {
- throw new IllegalStateException();
- }
- return getTranslateDiamond2(stringBounder)
- .getTranslated(new Point2D.Double(x, dimDiamond2.getHeight() / 2));
- }
-
- private UTranslate translate(StringBounder stringBounder) {
- if (getFtile1() == tile1) {
- return getTranslate1(stringBounder);
- }
- if (getFtile1() == tile2) {
- return getTranslate2(stringBounder);
- }
- throw new IllegalStateException();
- }
}
class ConnectionVerticalThenHorizontalDirect extends AbstractConnection implements ConnectionTranslatable {
@@ -419,15 +289,14 @@ class FtileIf extends AbstractFtile {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);
if (geo.hasPointOut() == false) {
return;
}
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
- final Point2D p2 = new Point2D.Double(getLeft(stringBounder), dimTotal.getHeight()
- - Diamond.diamondHalfSize);
+ final Point2D p2 = new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight());
final double x1 = p1.getX();
final double y1 = p1.getY();
@@ -446,27 +315,16 @@ class FtileIf extends AbstractFtile {
ug.draw(snake);
}
- private UTranslate translate(StringBounder stringBounder) {
- if (getFtile1() == tile1) {
- return getTranslate1(stringBounder);
- }
- if (getFtile1() == tile2) {
- return getTranslate2(stringBounder);
- }
- throw new IllegalStateException();
- }
-
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
final StringBounder stringBounder = ug.getStringBounder();
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);
if (geo.hasPointOut() == false) {
return;
}
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
- final Point2D p2 = new Point2D.Double(getLeft(stringBounder), dimTotal.getHeight()
- - Diamond.diamondHalfSize);
+ final Point2D p2 = new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight() - Diamond.diamondHalfSize);
final Point2D mp1a = translate1.getTranslated(p1);
final Point2D mp2b = translate2.getTranslated(p2);
@@ -485,111 +343,38 @@ class FtileIf extends AbstractFtile {
ug.draw(snake);
}
- }
-
- private UTranslate getTranslate1(StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
- final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
- final Dimension2D dim1 = tile1.calculateDimension(stringBounder);
-
- final double x1 = 0;
- final double h = dimDiamond1.getHeight();
- // final double y1 = (dimTotal.getHeight() - 2 * h - dim1.getHeight()) / 2 + h;
- final double y1 = h * 1.9;
- return new UTranslate(x1, y1);
- }
-
- private UTranslate getTranslate2(StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
- final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
- final Dimension2D dim2 = tile2.calculateDimension(stringBounder);
-
- final double x2 = dimTotal.getWidth() - dim2.getWidth();
- final double h = dimDiamond1.getHeight();
- // final double y2 = (dimTotal.getHeight() - 2 * h - dim2.getHeight()) / 2 + h;
- final double y2 = h * 1.9;
- return new UTranslate(x2, y2);
-
- }
-
- private UTranslate getTranslateDiamond1(StringBounder stringBounder) {
- final double y1 = 0;
- final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
- final double x1 = getLeft(stringBounder) - dimDiamond1.getWidth() / 2;
- return new UTranslate(x1, y1);
- }
-
- private UTranslate getTranslateDiamond2(StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
- final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
- final double y2 = dimTotal.getHeight() - dimDiamond2.getHeight();
- final double x2 = getLeft(stringBounder) - dimDiamond2.getWidth() / 2;
- return new UTranslate(x2, y2);
- }
- @Override
- public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
- if (child == diamond1) {
- return getTranslateDiamond1(stringBounder);
- }
- if (child == tile1) {
- return getTranslate1(stringBounder);
- }
- if (child == tile2) {
- return getTranslate2(stringBounder);
- }
- if (child == diamond2) {
- return getTranslateDiamond2(stringBounder);
+ private UTranslate translate(StringBounder stringBounder) {
+ if (getFtile1() == tile1) {
+ return getTranslate1(stringBounder);
+ }
+ if (getFtile1() == tile2) {
+ return getTranslate2(stringBounder);
+ }
+ throw new IllegalStateException();
}
- throw new UnsupportedOperationException();
- }
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
-
- ug.apply(getTranslateDiamond1(stringBounder)).draw(diamond1);
- ug.apply(getTranslate1(stringBounder)).draw(tile1);
- ug.apply(getTranslate2(stringBounder)).draw(tile2);
- ug.apply(getTranslateDiamond2(stringBounder)).draw(diamond2);
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
- final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
+ public Ftile addLinks(Branch branch1, Branch branch2, StringBounder stringBounder) {
+ final List<Connection> conns = new ArrayList<Connection>();
+ conns.add(new ConnectionHorizontalThenVertical(tile1, branch1));
+ conns.add(new ConnectionHorizontalThenVertical(tile2, branch2));
if (tile1.calculateDimension(stringBounder).hasPointOut()
- || tile2.calculateDimension(stringBounder).hasPointOut()) {
- return new FtileGeometry(dimTotal, getLeft(stringBounder), 0, dimTotal.getHeight());
- }
- return new FtileGeometry(dimTotal, getLeft(stringBounder), 0);
- }
-
- private Dimension2D calculateDimensionInternal;
-
- private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
- if (calculateDimensionInternal == null) {
- calculateDimensionInternal = calculateDimensionInternalSlow(stringBounder);
+ && tile2.calculateDimension(stringBounder).hasPointOut()) {
+ conns.add(new ConnectionVerticalThenHorizontal(tile1, branch1.getInlinkRenderingColor(), branch1.isEmpty()));
+ conns.add(new ConnectionVerticalThenHorizontal(tile2, branch2.getInlinkRenderingColor(), branch2.isEmpty()));
+ } else if (tile1.calculateDimension(stringBounder).hasPointOut()
+ && tile2.calculateDimension(stringBounder).hasPointOut() == false) {
+ conns.add(new ConnectionVerticalThenHorizontalDirect(tile1, branch1.getInlinkRenderingColor(), branch1
+ .isEmpty()));
+ } else if (tile1.calculateDimension(stringBounder).hasPointOut() == false
+ && tile2.calculateDimension(stringBounder).hasPointOut()) {
+ conns.add(new ConnectionVerticalThenHorizontalDirect(tile2, branch2.getInlinkRenderingColor(), branch2
+ .isEmpty()));
}
- return calculateDimensionInternal;
- }
-
- private Dimension2D calculateDimensionInternalSlow(StringBounder stringBounder) {
- final FtileGeometry dim1 = tile1.calculateDimension(stringBounder);
- final FtileGeometry dim2 = tile2.calculateDimension(stringBounder);
-
- final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
-
- final double withInner = Math.max(dimDiamond1.getWidth(), (dim1.getWidth() - dim1.getLeft()) + dim2.getLeft()
- + 10);
- final double width = dim1.getLeft() + withInner + (dim2.getWidth() - dim2.getLeft());
-
- final Dimension2D dim12 = Dimension2DDouble.mergeLR(dim1, dim2);
-
- return new Dimension2DDouble(width + 30, dim12.getHeight() + dimDiamond1.getHeight() * 3 + 30);
- }
- private double getLeft(StringBounder stringBounder) {
- final double left1 = tile1.calculateDimension(stringBounder).translate(getTranslate1(stringBounder)).getLeft();
- final double left2 = tile2.calculateDimension(stringBounder).translate(getTranslate2(stringBounder)).getLeft();
- return (left1 + left2) / 2;
+ return FtileUtils.addConnection(this, conns);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
index 65cd93e..0fa9bf5 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
index ebae0c7..1eba69c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,16 +38,17 @@ import java.awt.geom.Dimension2D;
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.SkinParamUtils;
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.FtileEmpty;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.CreoleParser;
import net.sourceforge.plantuml.creole.Sheet;
import net.sourceforge.plantuml.creole.SheetBlock1;
@@ -73,11 +74,10 @@ public class FtileBox extends AbstractFtile {
private final TextBlock tb;
- private final HtmlColor borderColor;
- private final HtmlColor backColor;
private final LinkRendering inRenreding;
private final Swimlane swimlane;
private final BoxStyle style;
+ private final ISkinParam skinParam;
final public LinkRendering getInLinkRendering() {
return inRenreding;
@@ -111,19 +111,16 @@ public class FtileBox extends AbstractFtile {
}
- public FtileBox(boolean shadowing, Display label, HtmlColor color, HtmlColor backColor, UFont font,
- HtmlColor arrowColor, Swimlane swimlane, BoxStyle style, ISkinParam skinParam) {
+ public FtileBox(boolean shadowing, Display label, UFont font, HtmlColor arrowColor, Swimlane swimlane,
+ BoxStyle style, ISkinParam skinParam) {
super(shadowing);
this.style = style;
- this.borderColor = color;
+ this.skinParam = skinParam;
this.swimlane = swimlane;
- this.backColor = backColor;
this.inRenreding = new LinkRendering(arrowColor);
- final HtmlColor fontColor = skinParam.getFontHtmlColor(FontParam.ACTIVITY, null);
- final FontConfiguration fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink());
-
- final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, false).createSheet(label);
+ final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
+ final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
+ .createSheet(label);
this.tb = new SheetBlock2(new SheetBlock1(sheet, 0, skinParam.getPadding()), new MyStencil(), new UStroke(1));
this.print = label.toString();
}
@@ -141,6 +138,9 @@ public class FtileBox extends AbstractFtile {
final double heightTotal = dimTotal.getHeight();
final UDrawable rect = style.getUDrawable(widthTotal, heightTotal, shadowing());
+ final HtmlColor borderColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBorder, null);
+ final HtmlColor backColor = SkinParamUtils.getColor(skinParam, ColorParam.activityBackground, null);
+
ug = ug.apply(new UChangeColor(borderColor)).apply(new UChangeBackColor(backColor)).apply(new UStroke(1.5));
rect.drawU(ug);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
new file mode 100644
index 0000000..723522b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
@@ -0,0 +1,109 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
+
+import java.util.Collections;
+import java.util.Set;
+
+import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UEllipse;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.ULine;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class FtileCircleEnd extends AbstractFtile {
+
+ private static final int SIZE = 20;
+
+ private final HtmlColor backColor;
+ private final Swimlane swimlane;
+
+ public FtileCircleEnd(boolean shadowing, HtmlColor backColor, Swimlane swimlane) {
+ super(shadowing);
+ this.backColor = backColor;
+ this.swimlane = swimlane;
+ }
+
+ public Set<Swimlane> getSwimlanes() {
+ if (swimlane == null) {
+ return Collections.emptySet();
+ }
+ return Collections.singleton(swimlane);
+ }
+
+ public Swimlane getSwimlaneIn() {
+ return swimlane;
+ }
+
+ public Swimlane getSwimlaneOut() {
+ return swimlane;
+ }
+
+ public void drawU(UGraphic ug) {
+ double xTheoricalPosition = 0;
+ double yTheoricalPosition = 0;
+ xTheoricalPosition = Math.round(xTheoricalPosition);
+ yTheoricalPosition = Math.round(yTheoricalPosition);
+
+ final UEllipse circle = new UEllipse(SIZE, SIZE);
+ if (shadowing()) {
+ circle.setDeltaShadow(3);
+ }
+ ug = ug.apply(new UChangeColor(backColor));
+ final double thickness = 2.5;
+ ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE)).apply(new UStroke(1.5))
+ .apply(new UTranslate(xTheoricalPosition, yTheoricalPosition)).draw(circle);
+
+ final double size2 = (SIZE - thickness) / Math.sqrt(2);
+ final double delta = (SIZE - size2) / 2;
+ ug = ug.apply(new UStroke(thickness));
+ ug.apply(new UTranslate(delta, delta)).draw(new ULine(size2, size2));
+ ug.apply(new UTranslate(delta, SIZE - delta)).draw(new ULine(size2, -size2));
+
+ }
+
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ return new FtileGeometry(SIZE, SIZE, SIZE / 2, 0);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
index 9da8a6b..c798d36 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
index abf58f3..75f24e6 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java
index 4b6e3ca..acb0724 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,11 +42,12 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
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.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public abstract class FtileDecorate implements Ftile {
+public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
final private Ftile ftile;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateIn.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateIn.java
index 9448ad8..32dd97a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateIn.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateIn.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOut.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOut.java
index 64593dd..02d9182 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOut.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecorateOut.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecoratePointOut.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecoratePointOut.java
index 7bda33d..5ab695d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecoratePointOut.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDecoratePointOut.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
index eb3a91b..7a5766c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
+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.graphic.HtmlColor;
@@ -142,4 +143,8 @@ public class FtileDiamond extends AbstractFtile {
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
+ public Ftile withWestAndEast(TextBlock tb1, TextBlock tb2) {
+ return withWest(tb1).withEast(tb2);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
index 6e9ad81..abe4529 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
index 7374653..54c8073 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
+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.graphic.HtmlColor;
@@ -82,6 +83,10 @@ public class FtileDiamondInside extends AbstractFtile {
return new FtileDiamondInside(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
}
+ public Ftile withWestAndEast(TextBlock tb1, TextBlock tb2) {
+ return withWest(tb1).withEast(tb2);
+ }
+
public FtileDiamondInside withSouth(TextBlock south) {
return new FtileDiamondInside(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
}
@@ -128,23 +133,14 @@ public class FtileDiamondInside extends AbstractFtile {
final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;
label.drawU(ug.apply(new UTranslate(lx, ly)));
- final Dimension2D dimWeat = west.calculateDimension(stringBounder);
- west.drawU(ug.apply(new UTranslate(-dimWeat.getWidth(), -dimWeat.getHeight() + dimTotal.getHeight() / 2)));
+ final Dimension2D dimWest = west.calculateDimension(stringBounder);
+ west.drawU(ug.apply(new UTranslate(-dimWest.getWidth(), -dimWest.getHeight() + dimTotal.getHeight() / 2)));
final Dimension2D dimEast = east.calculateDimension(stringBounder);
east.drawU(ug.apply(new UTranslate(dimTotal.getWidth(), -dimEast.getHeight() + dimTotal.getHeight() / 2)));
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
- Dimension2D dim = calculateDimensionAlone(stringBounder);
- final Dimension2D dimNorth = north.calculateDimension(stringBounder);
- final double northHeight = dimNorth.getHeight();
- final double northWidth = dimNorth.getWidth();
- dim = Dimension2DDouble.delta(dim, 0, northHeight);
- return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight() - northHeight);
- }
-
private FtileGeometry calculateDimensionAlone(StringBounder stringBounder) {
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dim;
@@ -158,4 +154,13 @@ public class FtileDiamondInside extends AbstractFtile {
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final FtileGeometry dimDiamonAlone = calculateDimensionAlone(stringBounder);
+ final Dimension2D dimWest = west.calculateDimension(stringBounder);
+ final Dimension2D dimEast = east.calculateDimension(stringBounder);
+ final double northHeight = north.calculateDimension(stringBounder).getHeight();
+ return dimDiamonAlone.incHeight(northHeight);
+ // return dimDiamonAlone.incHeight(northHeight).addMarginX(dimWest.getWidth(), dimEast.getWidth());
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
index 4affeed..ff47619 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -136,15 +136,6 @@ public class FtileDiamondInside2 extends AbstractFtile {
}
- public FtileGeometry calculateDimension(StringBounder stringBounder) {
- final Dimension2D diamond = calculateDimensionAlone(stringBounder);
- final Dimension2D north = this.north.calculateDimension(stringBounder);
- final double height = diamond.getHeight() + north.getHeight();
- final double left = diamond.getWidth() / 2;
- final double width = north.getWidth() > left ? left + north.getWidth() : diamond.getWidth();
- return new FtileGeometry(width, height, left, 0, diamond.getHeight());
- }
-
private FtileGeometry calculateDimensionAlone(StringBounder stringBounder) {
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dim;
@@ -158,4 +149,13 @@ public class FtileDiamondInside2 extends AbstractFtile {
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
}
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final Dimension2D diamond = calculateDimensionAlone(stringBounder);
+ final Dimension2D north = this.north.calculateDimension(stringBounder);
+ final double height = diamond.getHeight() + north.getHeight();
+ final double left = diamond.getWidth() / 2;
+ final double width = north.getWidth() > left ? left + north.getWidth() : diamond.getWidth();
+ return new FtileGeometry(width, height, left, 0, diamond.getHeight());
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
new file mode 100644
index 0000000..629b926
--- /dev/null
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
@@ -0,0 +1,177 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
+
+import java.awt.geom.Dimension2D;
+import java.util.Collections;
+import java.util.Set;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
+import net.sourceforge.plantuml.activitydiagram3.ftile.FtileOverpassing;
+import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.utils.MathUtils;
+
+public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassing {
+
+ private final HtmlColor backColor;
+ private final HtmlColor borderColor;
+ private final Swimlane swimlane;
+ private final TextBlock label;
+ private final TextBlock west;
+ private final TextBlock east;
+ private final TextBlock north;
+ private final TextBlock south;
+
+ public FtileDiamondInside3(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ TextBlock label) {
+ this(shadowing, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
+ TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
+ }
+
+ public FtileDiamondInside3 withNorth(TextBlock north) {
+ return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
+ }
+
+ public FtileDiamondInside3 withWest(TextBlock west) {
+ return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
+ }
+
+ public FtileDiamondInside3 withEast(TextBlock east) {
+ return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
+ }
+
+ public FtileDiamondInside3 withSouth(TextBlock south) {
+ return new FtileDiamondInside3(shadowing(), backColor, borderColor, swimlane, label, north, south, west, east);
+ }
+
+ private FtileDiamondInside3(boolean shadowing, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
+ super(shadowing);
+ this.backColor = backColor;
+ this.swimlane = swimlane;
+ this.borderColor = borderColor;
+ this.label = label;
+ this.west = west;
+ this.east = east;
+ this.north = north;
+ this.south = south;
+ }
+
+ public Set<Swimlane> getSwimlanes() {
+ if (swimlane == null) {
+ return Collections.emptySet();
+ }
+ return Collections.singleton(swimlane);
+ }
+
+ public Swimlane getSwimlaneIn() {
+ return swimlane;
+ }
+
+ public Swimlane getSwimlaneOut() {
+ return swimlane;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimLabel = label.calculateDimension(stringBounder);
+ final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
+ ug = ug.apply(new UChangeColor(borderColor)).apply(new UStroke(1.5)).apply(new UChangeBackColor(backColor));
+ ug.draw(Diamond.asPolygon(shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
+
+ north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
+ south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
+
+ final double lx = (dimTotal.getWidth() - dimLabel.getWidth()) / 2;
+ final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;
+ label.drawU(ug.apply(new UTranslate(lx, ly)));
+
+ final Dimension2D dimWeat = west.calculateDimension(stringBounder);
+ west.drawU(ug.apply(new UTranslate(-dimWeat.getWidth(), -dimWeat.getHeight() + dimTotal.getHeight() / 2)));
+
+ final Dimension2D dimEast = east.calculateDimension(stringBounder);
+ east.drawU(ug.apply(new UTranslate(dimTotal.getWidth(), -dimEast.getHeight() + dimTotal.getHeight() / 2)));
+
+ }
+
+ private FtileGeometry calculateDimensionAlone(StringBounder stringBounder) {
+ final Dimension2D dimLabel = label.calculateDimension(stringBounder);
+ final Dimension2D dim;
+ if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0) {
+ dim = new Dimension2DDouble(Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2);
+ } else {
+ dim = Dimension2DDouble.delta(
+ Dimension2DDouble.atLeast(dimLabel, Diamond.diamondHalfSize * 2, Diamond.diamondHalfSize * 2),
+ Diamond.diamondHalfSize * 2, 0);
+ }
+ return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
+ }
+
+ public FtileGeometry calculateDimension(StringBounder stringBounder) {
+ final Dimension2D diamond = calculateDimensionAlone(stringBounder);
+ final Dimension2D north = this.north.calculateDimension(stringBounder);
+ final double height = diamond.getHeight() + north.getHeight();
+ final double left = diamond.getWidth() / 2;
+ // final double width = north.getWidth() > left ? left + north.getWidth() : diamond.getWidth();
+ final double width = diamond.getWidth();
+ return new FtileGeometry(width, height, left, 0, diamond.getHeight());
+ }
+
+ public FtileGeometry getOverpassDimension(StringBounder stringBounder) {
+ final Dimension2D total = calculateDimension(stringBounder);
+ final Dimension2D north = this.north.calculateDimension(stringBounder);
+ final Dimension2D east = this.east.calculateDimension(stringBounder);
+ final Dimension2D west = this.west.calculateDimension(stringBounder);
+ final double height = total.getHeight(); // + north.getHeight();
+ final double left = total.getWidth() / 2;
+ final double supp = MathUtils.max(north.getWidth(), east.getWidth(), west.getWidth());
+ // final double width = supp > left ? left + supp : diamond.getWidth();
+ final double width = total.getWidth() + supp;
+ return new FtileGeometry(width, height, left, 0, total.getHeight());
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/anim/AffineTransformation.java b/src/net/sourceforge/plantuml/anim/AffineTransformation.java
index 3a8cdfb..8a383c0 100644
--- a/src/net/sourceforge/plantuml/anim/AffineTransformation.java
+++ b/src/net/sourceforge/plantuml/anim/AffineTransformation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.ugraphic.MinMax;
public class AffineTransformation {
@@ -89,7 +90,7 @@ public class AffineTransformation {
}
private static AffineTransformation createSimple(String value) {
- Matcher m = rotate.matcher(value.trim());
+ Matcher m = rotate.matcher(StringUtils.trin(value));
if (m.find()) {
final double angle = Double.parseDouble(m.group(1));
return new AffineTransformation(AffineTransform.getRotateInstance(angle * Math.PI / 180.0));
diff --git a/src/net/sourceforge/plantuml/anim/Animation.java b/src/net/sourceforge/plantuml/anim/Animation.java
index bbefe32..2fc804d 100644
--- a/src/net/sourceforge/plantuml/anim/Animation.java
+++ b/src/net/sourceforge/plantuml/anim/Animation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/anim/AnimationDecoder.java b/src/net/sourceforge/plantuml/anim/AnimationDecoder.java
index 61273cc..fc93ba5 100644
--- a/src/net/sourceforge/plantuml/anim/AnimationDecoder.java
+++ b/src/net/sourceforge/plantuml/anim/AnimationDecoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.anim;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
@@ -45,14 +46,14 @@ public class AnimationDecoder {
private final List<String> result = new ArrayList<String>();
- public AnimationDecoder(List<String> data) throws ScriptException {
- for (int i = 0; i < data.size(); i++) {
- String line = data.get(i);
+ public AnimationDecoder(Iterable<CharSequence> data) throws ScriptException {
+
+ for (final Iterator<CharSequence> it = data.iterator(); it.hasNext();) {
+ String line = it.next().toString();
if (line.matches("^\\s*\\[script\\]\\s*$")) {
final StringBuilder scriptText = new StringBuilder();
while (true) {
- i++;
- line = data.get(i);
+ line = it.next().toString();
if (line.matches("^\\s*\\[/script\\]\\s*$")) {
final AnimationScript script = new AnimationScript();
final String out = script.eval(scriptText.toString());
diff --git a/src/net/sourceforge/plantuml/anim/AnimationScript.java b/src/net/sourceforge/plantuml/anim/AnimationScript.java
index 04e712c..7c63c26 100644
--- a/src/net/sourceforge/plantuml/anim/AnimationScript.java
+++ b/src/net/sourceforge/plantuml/anim/AnimationScript.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
index a68cfbd..4c0afad 100644
--- a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
+++ b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/CountRate.java b/src/net/sourceforge/plantuml/api/CountRate.java
index cc2ac43..7838708 100644
--- a/src/net/sourceforge/plantuml/api/CountRate.java
+++ b/src/net/sourceforge/plantuml/api/CountRate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/INumberAnalyzed.java b/src/net/sourceforge/plantuml/api/INumberAnalyzed.java
index 93370be..bdd4a65 100644
--- a/src/net/sourceforge/plantuml/api/INumberAnalyzed.java
+++ b/src/net/sourceforge/plantuml/api/INumberAnalyzed.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/ImageDataComplex.java b/src/net/sourceforge/plantuml/api/ImageDataComplex.java
index 612ce03..e57d6ce 100644
--- a/src/net/sourceforge/plantuml/api/ImageDataComplex.java
+++ b/src/net/sourceforge/plantuml/api/ImageDataComplex.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/ImageDataSimple.java b/src/net/sourceforge/plantuml/api/ImageDataSimple.java
index 6c556ce..72767d1 100644
--- a/src/net/sourceforge/plantuml/api/ImageDataSimple.java
+++ b/src/net/sourceforge/plantuml/api/ImageDataSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/MagicArray.java b/src/net/sourceforge/plantuml/api/MagicArray.java
index d2f4437..d43c1b4 100644
--- a/src/net/sourceforge/plantuml/api/MagicArray.java
+++ b/src/net/sourceforge/plantuml/api/MagicArray.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/MyRunnable.java b/src/net/sourceforge/plantuml/api/MyRunnable.java
index a8d3111..3c045e9 100644
--- a/src/net/sourceforge/plantuml/api/MyRunnable.java
+++ b/src/net/sourceforge/plantuml/api/MyRunnable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/NiceNumber.java b/src/net/sourceforge/plantuml/api/NiceNumber.java
index 5b0a23a..88a54a1 100644
--- a/src/net/sourceforge/plantuml/api/NiceNumber.java
+++ b/src/net/sourceforge/plantuml/api/NiceNumber.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
index 9ad2692..1827366 100644
--- a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
+++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/PSystemFactory.java b/src/net/sourceforge/plantuml/api/PSystemFactory.java
index 9b919e9..55ae4ab 100644
--- a/src/net/sourceforge/plantuml/api/PSystemFactory.java
+++ b/src/net/sourceforge/plantuml/api/PSystemFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/PlantumlUtils.java b/src/net/sourceforge/plantuml/api/PlantumlUtils.java
index 832cced..e6689ab 100644
--- a/src/net/sourceforge/plantuml/api/PlantumlUtils.java
+++ b/src/net/sourceforge/plantuml/api/PlantumlUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/TimeoutExecutor.java b/src/net/sourceforge/plantuml/api/TimeoutExecutor.java
index 69393eb..c4127df 100644
--- a/src/net/sourceforge/plantuml/api/TimeoutExecutor.java
+++ b/src/net/sourceforge/plantuml/api/TimeoutExecutor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java b/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java
index 733a2b6..9773150 100644
--- a/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java
+++ b/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java b/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java
index c1a7bce..a78d4cd 100644
--- a/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java
+++ b/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java b/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java
index 6c83901..a7d2d31 100644
--- a/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java
+++ b/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java b/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java
index e3b5bcc..5b2e551 100644
--- a/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java
+++ b/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java b/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java
index aa85dd3..5a14f67 100644
--- a/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java
+++ b/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/applet/VersionApplet.java b/src/net/sourceforge/plantuml/applet/VersionApplet.java
index 69be09d..4891091 100644
--- a/src/net/sourceforge/plantuml/applet/VersionApplet.java
+++ b/src/net/sourceforge/plantuml/applet/VersionApplet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java b/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java
index 2c8dd4a..c39aac8 100644
--- a/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java
+++ b/src/net/sourceforge/plantuml/asciiart/AbstractComponentText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/BasicCharArea.java b/src/net/sourceforge/plantuml/asciiart/BasicCharArea.java
index d6b4649..2486210 100644
--- a/src/net/sourceforge/plantuml/asciiart/BasicCharArea.java
+++ b/src/net/sourceforge/plantuml/asciiart/BasicCharArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java b/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java
index 1970aa4..a0f3ede 100644
--- a/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java
+++ b/src/net/sourceforge/plantuml/asciiart/BasicCharAreaImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextActiveLine.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextActiveLine.java
index 7ecd0ab..9f23d8e 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextActiveLine.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextActiveLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java
index 188fa0d..d082a61 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextActor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java
index 2eb5403..f13b3e5 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,18 +37,17 @@ package net.sourceforge.plantuml.asciiart;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.MessageNumber;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDirection;
-import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
-import net.sourceforge.plantuml.StringUtils;
public class ComponentTextArrow extends AbstractComponentText {
@@ -56,9 +55,11 @@ public class ComponentTextArrow extends AbstractComponentText {
private final Display stringsToDisplay;
private final FileFormat fileFormat;
private final ArrowConfiguration config;
+ private final int maxAsciiMessageLength;
public ComponentTextArrow(ComponentType type, ArrowConfiguration config, Display stringsToDisplay,
- FileFormat fileFormat) {
+ FileFormat fileFormat, int maxAsciiMessageLength) {
+ this.maxAsciiMessageLength = maxAsciiMessageLength;
this.type = type;
this.config = config;
this.stringsToDisplay = clean(stringsToDisplay);
@@ -108,6 +109,7 @@ public class ComponentTextArrow extends AbstractComponentText {
} else {
throw new UnsupportedOperationException();
}
+ // final int position = Math.max(0, (width - textWidth) / 2);
charArea.drawStringsLR(stringsToDisplay.as(), (width - textWidth) / 2, 0);
}
@@ -116,7 +118,11 @@ public class ComponentTextArrow extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
- return StringUtils.getWidth(stringsToDisplay) + 2;
+ final int width = StringUtils.getWidth(stringsToDisplay) + 2;
+ if (maxAsciiMessageLength > 0) {
+ return Math.min(maxAsciiMessageLength, width);
+ }
+ return width;
}
}
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java
index 575f04e..f122be2 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextDivider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingBody.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingBody.java
index 49acc30..df7dd2f 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingBody.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingBody.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingElse.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingElse.java
index 16a0419..01bd23c 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingElse.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingElse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java
index 66fe9c6..ac9a1d2 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingTail.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingTail.java
index 072705e..b388da5 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingTail.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextGroupingTail.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextLine.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextLine.java
index e710473..d071f87 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextLine.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextNewpage.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextNewpage.java
index 5859b51..0e849f0 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextNewpage.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java
index 2c9efe7..52387ab 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java
index 7ade477..6a2dd96 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextParticipant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java
index 71634d0..6bffa54 100644
--- a/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java
+++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextSelfArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/TextSkin.java b/src/net/sourceforge/plantuml/asciiart/TextSkin.java
index 72e3e7b..2f06458 100644
--- a/src/net/sourceforge/plantuml/asciiart/TextSkin.java
+++ b/src/net/sourceforge/plantuml/asciiart/TextSkin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -62,7 +62,7 @@ public class TextSkin implements Skin {
}
if (type.isArrow()
&& ((config.getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) || (config.getArrowDirection() == ArrowDirection.RIGHT_TO_LEFT_REVERSE))) {
- return new ComponentTextArrow(type, config, stringsToDisplay, fileFormat);
+ return new ComponentTextArrow(type, config, stringsToDisplay, fileFormat, param.maxAsciiMessageLength());
}
if (type.isArrow() && config.isSelfArrow()) {
return new ComponentTextSelfArrow(type, config, stringsToDisplay, fileFormat);
diff --git a/src/net/sourceforge/plantuml/asciiart/TextStringBounder.java b/src/net/sourceforge/plantuml/asciiart/TextStringBounder.java
index 6cb22d7..68b2303 100644
--- a/src/net/sourceforge/plantuml/asciiart/TextStringBounder.java
+++ b/src/net/sourceforge/plantuml/asciiart/TextStringBounder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/TranslatedCharArea.java b/src/net/sourceforge/plantuml/asciiart/TranslatedCharArea.java
index 4a4ae7f..4212e0a 100644
--- a/src/net/sourceforge/plantuml/asciiart/TranslatedCharArea.java
+++ b/src/net/sourceforge/plantuml/asciiart/TranslatedCharArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/UmlCharArea.java b/src/net/sourceforge/plantuml/asciiart/UmlCharArea.java
index afe52e2..c7b2be9 100644
--- a/src/net/sourceforge/plantuml/asciiart/UmlCharArea.java
+++ b/src/net/sourceforge/plantuml/asciiart/UmlCharArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/asciiart/UmlCharAreaImpl.java b/src/net/sourceforge/plantuml/asciiart/UmlCharAreaImpl.java
index ef519dd..b69837a 100644
--- a/src/net/sourceforge/plantuml/asciiart/UmlCharAreaImpl.java
+++ b/src/net/sourceforge/plantuml/asciiart/UmlCharAreaImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -85,6 +85,9 @@ public class UmlCharAreaImpl extends BasicCharAreaImpl implements UmlCharArea {
public void drawStringsLR(Collection<? extends CharSequence> strings, int x, int y) {
int i = 0;
+ if (x < 0) {
+ x = 0;
+ }
for (CharSequence s : strings) {
this.drawStringLR(s.toString(), x, y + i);
i++;
diff --git a/src/net/sourceforge/plantuml/braille/BrailleUtils.java b/src/net/sourceforge/plantuml/braille/BrailleUtils.java
index fb2422a..183d1c0 100644
--- a/src/net/sourceforge/plantuml/braille/BrailleUtils.java
+++ b/src/net/sourceforge/plantuml/braille/BrailleUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/AbstractEntityDiagram.java b/src/net/sourceforge/plantuml/classdiagram/AbstractEntityDiagram.java
index c1cb367..c02fd34 100644
--- a/src/net/sourceforge/plantuml/classdiagram/AbstractEntityDiagram.java
+++ b/src/net/sourceforge/plantuml/classdiagram/AbstractEntityDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java
index 4dfc7e4..6665202 100644
--- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java
+++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,6 +40,7 @@ import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.ImageData;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityUtils;
@@ -139,9 +140,10 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
group = getOrCreateNamespaceInternal(namespace2, Display.getWithNewlines(namespace), GroupType.PACKAGE,
getRootGroup());
}
- return createLeafInternal(fullyCode,
- display == null ? Display.getWithNewlines(fullyCode.getShortName(getLeafs())) : display, type, group,
- symbol);
+ return createLeafInternal(
+ fullyCode,
+ Display.isNull(display) ? Display.getWithNewlines(fullyCode.getShortName(getLeafs())).withCreoleMode(
+ CreoleMode.SIMPLE_LINE) : display, type, group, symbol);
}
private final String getNamespace(Code fullyCode) {
@@ -214,7 +216,7 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
final ImageBuilder imageBuilder = new ImageBuilder(getSkinParam().getColorMapper(), 1, HtmlColorUtils.WHITE,
null, null, 0, 10, null, getSkinParam().handwritten());
imageBuilder.addUDrawable(fullLayout);
- return imageBuilder.writeImageTOBEMOVED(fileFormatOption.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormatOption, os);
}
private RowLayout getRawLayout(int raw) {
diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
index fc9ba75..197ae67 100644
--- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.NewpagedDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.classdiagram.command.CommandAddMethod;
import net.sourceforge.plantuml.classdiagram.command.CommandAllowMixing;
@@ -51,7 +52,6 @@ import net.sourceforge.plantuml.classdiagram.command.CommandImport;
import net.sourceforge.plantuml.classdiagram.command.CommandLayoutNewLine;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkLollipop;
-import net.sourceforge.plantuml.classdiagram.command.CommandMouseOver;
import net.sourceforge.plantuml.classdiagram.command.CommandNamespaceSeparator;
import net.sourceforge.plantuml.classdiagram.command.CommandStereotype;
import net.sourceforge.plantuml.classdiagram.command.CommandUrl;
@@ -67,8 +67,13 @@ import net.sourceforge.plantuml.command.UmlDiagramFactory;
import net.sourceforge.plantuml.command.note.FactoryNoteCommand;
import net.sourceforge.plantuml.command.note.FactoryNoteOnEntityCommand;
import net.sourceforge.plantuml.command.note.FactoryNoteOnLinkCommand;
+import net.sourceforge.plantuml.command.note.FactoryTipOnEntityCommand;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.cucadiagram.Link;
+import net.sourceforge.plantuml.descdiagram.command.CommandNewpage;
+import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObject;
+import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObjectMultilines;
public class ClassDiagramFactory extends UmlDiagramFactory {
@@ -85,10 +90,13 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
addCommonCommands(cmds);
cmds.add(new CommandRankDir());
+ cmds.add(new CommandNewpage(this));
cmds.add(new CommandPage());
cmds.add(new CommandAddMethod());
cmds.add(new CommandCreateClass());
+ cmds.add(new CommandCreateEntityObject());
+
cmds.add(new CommandAllowMixing());
cmds.add(new CommandLayoutNewLine());
@@ -108,21 +116,29 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandLinkLollipop(UmlDiagramType.CLASS));
cmds.add(new CommandImport());
+
+ final FactoryTipOnEntityCommand factoryTipOnEntityCommand = new FactoryTipOnEntityCommand(new RegexLeaf(
+ "ENTITY", "(" + CommandCreateClass.CODE_NO_DOTDOT + "|[%g][^%g]+[%g])::([^%s]+)"));
+ cmds.add(factoryTipOnEntityCommand.createMultiLine(true));
+ cmds.add(factoryTipOnEntityCommand.createMultiLine(false));
+
final FactoryNoteOnEntityCommand factoryNoteOnEntityCommand = new FactoryNoteOnEntityCommand(new RegexLeaf(
"ENTITY", "(" + CommandCreateClass.CODE + "|[%g][^%g]+[%g])"));
cmds.add(factoryNoteOnEntityCommand.createSingleLine());
cmds.add(new CommandUrl());
- cmds.add(factoryNoteOnEntityCommand.createMultiLine());
- cmds.add(factoryNoteCommand.createMultiLine());
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(true));
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(false));
+ cmds.add(factoryNoteCommand.createMultiLine(false));
+
cmds.add(new CommandCreateClassMultilines());
+ cmds.add(new CommandCreateEntityObjectMultilines());
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
- cmds.add(factoryNoteOnLinkCommand.createMultiLine());
+ cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
cmds.add(new CommandDiamondAssociation());
- cmds.add(new CommandMouseOver());
cmds.add(new CommandHideShowSpecificClass());
@@ -133,8 +149,18 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
@Override
public String checkFinalError(AbstractPSystem sys) {
- final ClassDiagram system = (ClassDiagram) sys;
+ if (sys instanceof NewpagedDiagram) {
+ for (Diagram p : ((NewpagedDiagram) sys).getDiagrams()) {
+ checkFinal((ClassDiagram) p);
+ }
+ } else {
+ final ClassDiagram system = (ClassDiagram) sys;
+ checkFinal(system);
+ }
+ return super.checkFinalError(sys);
+ }
+ private void checkFinal(final ClassDiagram system) {
for (Link link : system.getLinks()) {
final int len = link.getLength();
if (len == 1) {
@@ -145,23 +171,7 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
}
}
}
-
system.applySingleStrategy();
-
- // for (IGroup g : system.getGroups(true)) {
- // final List<ILeaf> standalones = new ArrayList<ILeaf>();
- // for (ILeaf ent : g.getLeafsDirect()) {
- // if (system.isStandalone(ent)) {
- // standalones.add(ent);
- // }
- // }
- // if (standalones.size() < 3) {
- // continue;
- // }
- // final Magma magma = new Magma(system, standalones);
- // magma.putInSquare();
- // }
- return super.checkFinalError(system);
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/FullLayout.java b/src/net/sourceforge/plantuml/classdiagram/FullLayout.java
index 470c350..c3b6462 100644
--- a/src/net/sourceforge/plantuml/classdiagram/FullLayout.java
+++ b/src/net/sourceforge/plantuml/classdiagram/FullLayout.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/RowLayout.java b/src/net/sourceforge/plantuml/classdiagram/RowLayout.java
index b8038d0..4312e3d 100644
--- a/src/net/sourceforge/plantuml/classdiagram/RowLayout.java
+++ b/src/net/sourceforge/plantuml/classdiagram/RowLayout.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java
index 09adfb7..0d53039 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandAddMethod.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -57,7 +57,7 @@ public class CommandAddMethod extends SingleLineCommand<ClassDiagram> {
if (field.length() > 0 && VisibilityModifier.isVisibilityCharacter(field.charAt(0))) {
system.setVisibilityModifierPresent(true);
}
- entity.addFieldOrMethod(field);
+ entity.getBodier().addFieldOrMethod(field);
return CommandExecutionResult.ok();
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandAllowMixing.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandAllowMixing.java
index 7f635dc..2dd6d3d 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandAllowMixing.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandAllowMixing.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
index 84eed42..d9cd85f 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,8 +34,6 @@
*/
package net.sourceforge.plantuml.classdiagram.command;
-import java.util.Locale;
-
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
@@ -53,11 +51,15 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
public static final String CODE = "[^%s{}%g<>]+";
+ public static final String CODE_NO_DOTDOT = "[^%s{}%g<>:]+";
enum Mode {
EXTENDS, IMPLEMENTS
@@ -73,13 +75,13 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
"(interface|enum|annotation|abstract[%s]+class|abstract|class)[%s]+"), //
new RegexOr(//
new RegexConcat(//
- new RegexLeaf("DISPLAY1", "[%g]([^%g]+)[%g]"), //
+ new RegexLeaf("DISPLAY1", "[%g](.+)[%g]"), //
new RegexLeaf("[%s]+as[%s]+"), //
new RegexLeaf("CODE1", "(" + CODE + ")")), //
new RegexConcat(//
new RegexLeaf("CODE2", "(" + CODE + ")"), //
new RegexLeaf("[%s]+as[%s]+"), // //
- new RegexLeaf("DISPLAY2", "[%g]([^%g]+)[%g]")), //
+ new RegexLeaf("DISPLAY2", "[%g](.+)[%g]")), //
new RegexLeaf("CODE3", "(" + CODE + ")"), //
new RegexLeaf("CODE4", "[%g]([^%g]+)[%g]")), //
new RegexLeaf("GENERIC", "(?:[%s]*\\<(" + GenericRegexProducer.PATTERN + ")\\>)?"), //
@@ -88,7 +90,7 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("LINECOLOR", "(?:##(?:\\[(dotted|dashed|bold)\\])?(\\w+)?)?"), //
new RegexLeaf("EXTENDS", "([%s]+(extends)[%s]+(" + CommandCreateClassMultilines.CODES + "))?"), //
@@ -96,6 +98,10 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
new RegexLeaf("$"));
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
@Override
protected CommandExecutionResult executeArg(ClassDiagram diagram, RegexResult arg) {
final LeafType type = LeafType.getLeafType(StringUtils.goUpperCase(arg.get("TYPE", 0)));
@@ -113,7 +119,7 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
}
if (stereotype != null) {
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
if (generic != null) {
@@ -127,9 +133,27 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
entity.addUrl(url);
}
- entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
- entity.setSpecificLineColor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
- CommandCreateClassMultilines.applyStroke(entity, arg.get("LINECOLOR", 0));
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
+ if (lineColor != null) {
+ colors = colors.add(ColorType.LINE, lineColor);
+ }
+ if (arg.get("LINECOLOR", 0) != null) {
+ colors = colors.addLegacyStroke(arg.get("LINECOLOR", 0));
+ }
+ entity.setColors(colors);
+
+ // entity.setSpecificColorTOBEREMOVED(ColorType.LINE, lineColor);
+ // entity.setSpecificColorTOBEREMOVED(ColorType.HEADER, colors.getColor(ColorType.HEADER));
+ //
+ // if (colors.getLineStyle() != null) {
+ // entity.setSpecificLineStroke(LinkStyle.getStroke(colors.getLineStyle()));
+ // }
+ //
+ // if (arg.get("LINECOLOR", 0) != null) {
+ // entity.applyStroke(arg.get("LINECOLOR", 0));
+ // }
// manageExtends(diagram, arg, entity);
CommandCreateClassMultilines.manageExtends("EXTENDS", diagram, arg, entity);
@@ -137,7 +161,6 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
return CommandExecutionResult.ok();
}
-
// public static void manageExtends(ClassDiagram system, RegexResult arg, final IEntity entity) {
// if (arg.get("EXTENDS", 1) != null) {
// final Mode mode = arg.get("EXTENDS", 1).equalsIgnoreCase("extends") ? Mode.EXTENDS : Mode.IMPLEMENTS;
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
index 9dd87cf..1a932ed 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,13 +34,13 @@
*/
package net.sourceforge.plantuml.classdiagram.command;
-import java.util.List;
-
import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
@@ -55,18 +55,18 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
-import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.VisibilityModifier;
-import net.sourceforge.plantuml.ugraphic.UStroke;
-import net.sourceforge.plantuml.StringUtils;
public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagram> {
- private static final String CODE = "(?:\\.|::)?[\\p{L}0-9_]+(?:(?:\\.|::)[\\p{L}0-9_]+)*";
+ private static final String CODE = CommandLinkClass.getSeparator() + "?[\\p{L}0-9_]+" + "(?:"
+ + CommandLinkClass.getSeparator() + "[\\p{L}0-9_]+)*";
public static final String CODES = CODE + "(?:\\s*,\\s*" + CODE + ")*";
enum Mode {
@@ -87,13 +87,13 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
new RegexLeaf("TYPE", "(interface|enum|abstract[%s]+class|abstract|class)[%s]+"), //
new RegexOr(//
new RegexConcat(//
- new RegexLeaf("DISPLAY1", "[%g]([^%g]+)[%g]"), //
+ new RegexLeaf("DISPLAY1", "[%g](.+)[%g]"), //
new RegexLeaf("[%s]+as[%s]+"), //
new RegexLeaf("CODE1", "(" + CommandCreateClass.CODE + ")")), //
new RegexConcat(//
new RegexLeaf("CODE2", "(" + CommandCreateClass.CODE + ")"), //
new RegexLeaf("[%s]+as[%s]+"), // //
- new RegexLeaf("DISPLAY2", "[%g]([^%g]+)[%g]")), //
+ new RegexLeaf("DISPLAY2", "[%g](.+)[%g]")), //
new RegexLeaf("CODE3", "(" + CommandCreateClass.CODE + ")"), //
new RegexLeaf("CODE4", "[%g]([^%g]+)[%g]")), //
new RegexLeaf("GENERIC", "(?:[%s]*\\<(" + GenericRegexProducer.PATTERN + ")\\>)?"), //
@@ -102,7 +102,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("LINECOLOR", "(?:##(?:\\[(dotted|dashed|bold)\\])?(\\w+)?)?"), //
new RegexLeaf("EXTENDS", "([%s]+(extends)[%s]+(" + CODES + "))?"), //
@@ -110,32 +110,39 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
new RegexLeaf("[%s]*\\{[%s]*$"));
}
- public CommandExecutionResult executeNow(ClassDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
+ public CommandExecutionResult executeNow(ClassDiagram diagram, BlocLines lines) {
+ lines = lines.trimSmart(1);
+ lines = lines.removeComments();
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final IEntity entity = executeArg0(diagram, line0);
if (entity == null) {
return CommandExecutionResult.error("No such entity");
}
- lines = lines.subList(1, lines.size() - 1);
- final Url url;
- if (lines.size() > 0) {
- final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- url = urlBuilder.getUrl(lines.get(0).toString());
- } else {
- url = null;
- }
- if (url != null) {
- lines = lines.subList(1, lines.size());
- }
- for (String s : lines) {
- if (s.length() > 0 && VisibilityModifier.isVisibilityCharacter(s.charAt(0))) {
- diagram.setVisibilityModifierPresent(true);
+ if (lines.size() > 1) {
+ lines = lines.subExtract(1, 1);
+ final Url url;
+ if (lines.size() > 0) {
+ final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
+ url = urlBuilder.getUrl(lines.getFirst499().toString());
+ } else {
+ url = null;
+ }
+ if (url != null) {
+ lines = lines.subExtract(1, 0);
+ }
+ for (CharSequence s : lines) {
+ if (s.length() > 0 && VisibilityModifier.isVisibilityCharacter(s.charAt(0))) {
+ diagram.setVisibilityModifierPresent(true);
+ }
+ entity.getBodier().addFieldOrMethod(s.toString());
+ }
+ if (url != null) {
+ entity.addUrl(url);
}
- entity.addFieldOrMethod(s);
- }
- if (url != null) {
- entity.addUrl(url);
}
manageExtends("EXTENDS", diagram, line0, entity);
@@ -156,14 +163,14 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
}
final String codes = arg.get(keyword, 2);
for (String s : codes.split(",")) {
- final Code other = Code.of(s.trim());
+ final Code other = Code.of(StringUtils.trin(s));
final IEntity cl2 = system.getOrCreateLeaf(other, type2, null);
LinkType typeLink = new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS);
if (type2 == LeafType.INTERFACE && entity.getEntityType() != LeafType.INTERFACE) {
typeLink = typeLink.getDashed();
}
- final Link link = new Link(cl2, entity, typeLink, null, 2, null, null, system.getLabeldistance(),
- system.getLabelangle());
+ final Link link = new Link(cl2, entity, typeLink, Display.NULL, 2, null, null,
+ system.getLabeldistance(), system.getLabelangle());
system.addLink(link);
}
}
@@ -188,7 +195,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
}
if (stereotype != null) {
result.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
@@ -199,36 +206,27 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
result.addUrl(url);
}
- result.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
- result.setSpecificLineColor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
- applyStroke(result, arg.get("LINECOLOR", 0));
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
- if (generic != null) {
- result.setGeneric(generic);
- }
- return result;
- }
-
- public static UStroke getStroke(LinkStyle style) {
- if (style == LinkStyle.DASHED) {
- return new UStroke(6, 6, 1);
- }
- if (style == LinkStyle.DOTTED) {
- return new UStroke(1, 3, 1);
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
+ if (lineColor != null) {
+ colors = colors.add(ColorType.LINE, lineColor);
}
- if (style == LinkStyle.BOLD) {
- return new UStroke(2.5);
+ if (arg.get("LINECOLOR", 0) != null) {
+ colors = colors.addLegacyStroke(arg.get("LINECOLOR", 0));
}
- return new UStroke();
- }
+ result.setColors(colors);
- public static void applyStroke(IEntity entity, String s) {
- if (s == null) {
- return;
- }
- final LinkStyle style = LinkStyle.valueOf(StringUtils.goUpperCase(s));
- entity.setSpecificLineStroke(getStroke(style));
+ // result.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ // result.setSpecificColorTOBEREMOVED(ColorType.LINE,
+ // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
+ // result.applyStroke(arg.get("LINECOLOR", 0));
+ if (generic != null) {
+ result.setGeneric(generic);
+ }
+ return result;
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java
index 62e7782..1fabff5 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
@@ -50,9 +51,9 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.USymbol;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram> {
@@ -83,7 +84,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
@@ -96,8 +97,8 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
private static final String DISPLAY_WITHOUT_QUOTE = "(" + DISPLAY_CORE + "|[\\p{L}0-9_.]+)";
@Override
- final protected boolean isForbidden(String line) {
- if (line.matches("^[\\p{L}0-9_.]+$")) {
+ final protected boolean isForbidden(CharSequence line) {
+ if (line.toString().matches("^[\\p{L}0-9_.]+$")) {
return true;
}
return false;
@@ -116,7 +117,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
final String symbol;
if (codeRaw.startsWith("()")) {
symbol = "interface";
- codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw.substring(2).trim());
+ codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils.trin(codeRaw.substring(2)));
} else if (codeChar == '(' || codeDisplay == '(') {
symbol = "usecase";
} else if (codeChar == ':' || codeDisplay == ':') {
@@ -203,7 +204,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
entity.setUSymbol(usymbol);
if (stereotype != null) {
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
@@ -214,7 +215,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
entity.addUrl(url);
}
- entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java
index 7ceaca7..55a38ca 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
import net.sourceforge.plantuml.cucadiagram.Code;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.LeafType;
public class CommandDiamondAssociation extends SingleLineCommand<ClassDiagram> {
@@ -54,7 +55,7 @@ public class CommandDiamondAssociation extends SingleLineCommand<ClassDiagram> {
if (diagram.leafExist(code)) {
return CommandExecutionResult.error("Already existing : "+code.getFullName());
}
- diagram.createLeaf(code, null, LeafType.ASSOCIATION, null);
+ diagram.createLeaf(code, Display.NULL, LeafType.ASSOCIATION, null);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow.java
index 921ec32..45fed88 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow3.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow3.java
index c3f4685..9d8fbb4 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow3.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShow3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java
index 48cb52a..86eebf2 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandHideShowSpecificClass.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,17 +34,17 @@
*/
package net.sourceforge.plantuml.classdiagram.command;
-import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Code;
+import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
-public class CommandHideShowSpecificClass extends SingleLineCommand2<ClassDiagram> {
+public class CommandHideShowSpecificClass extends SingleLineCommand2<CucaDiagram> {
public CommandHideShowSpecificClass() {
super(getRegexConcat());
@@ -59,20 +59,20 @@ public class CommandHideShowSpecificClass extends SingleLineCommand2<ClassDiagra
}
@Override
- protected CommandExecutionResult executeArg(ClassDiagram classDiagram, RegexResult arg) {
+ protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
final String codeString = arg.get("CODE", 0);
if (codeString.equals("class")) {
- classDiagram.hideOrShow(LeafType.CLASS, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+ diagram.hideOrShow(LeafType.CLASS, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
} else if (codeString.equals("interface")) {
- classDiagram.hideOrShow(LeafType.INTERFACE, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+ diagram.hideOrShow(LeafType.INTERFACE, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
} else {
final Code code = Code.of(codeString);
- final ILeaf leaf = classDiagram.getEntityFactory().getLeafs().get(code);
+ final ILeaf leaf = diagram.getEntityFactory().getLeafs().get(code);
if (leaf == null) {
return CommandExecutionResult.error("Class does not exist : " + code.getFullName());
}
- classDiagram.hideOrShow(leaf, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
+ diagram.hideOrShow(leaf, arg.get("COMMAND", 0).equalsIgnoreCase("show"));
}
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandImport.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandImport.java
index 34e8993..1f6e412 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandImport.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandImport.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
import net.sourceforge.plantuml.cucadiagram.Code;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
@@ -97,7 +98,7 @@ public class CommandImport extends SingleLineCommand<ClassDiagram> {
for (String p : cl.getParents()) {
final IEntity ent2 = classDiagram.getOrCreateLeaf(Code.of(p), cl.getParentType(), null);
- final Link link = new Link(ent2, ent1, new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS), null, 2);
+ final Link link = new Link(ent2, ent1, new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS), Display.NULL, 2);
classDiagram.addLink(link);
}
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLayoutNewLine.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLayoutNewLine.java
index fc5db07..7209ed5 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLayoutNewLine.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLayoutNewLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
index f475f44..6fe820f 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,7 +39,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.Direction;
-import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@@ -57,9 +57,11 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkArrow;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
-import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.HtmlColorSet;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
-import net.sourceforge.plantuml.StringUtils;
final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrObjectDiagram> {
@@ -101,22 +103,27 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
new RegexLeaf("COUPLE2",
"\\([%s]*(\\.?[\\p{L}0-9_]+(?:\\.[\\p{L}0-9_]+)*)[%s]*,[%s]*(\\.?[\\p{L}0-9_]+(?:\\.[\\p{L}0-9_]+)*)[%s]*\\)")),
new RegexLeaf("[%s]*"), //
+ color().getRegex(), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("LABEL_LINK", "(?::[%s]*(.+))?"), //
new RegexLeaf("$"));
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.LINE);
+ }
+
private static String getClassIdentifier() {
- return "(" + getSeparator() + "?[\\p{L}0-9_]+(?:" + getSeparator()
- + "[\\p{L}0-9_]+)*|[%g][^%g]+[%g])[%s]*(\\<\\<.*\\>\\>)?";
+ return "(" + getSeparator() + "?[\\p{L}0-9_$]+(?:" + getSeparator() + "[\\p{L}0-9_$]+)*|[%g][^%g]+[%g])";
}
- private static String getSeparator() {
- return "(?:\\.|::)";
+ public static String getSeparator() {
+ return "(?:\\.|::|\\\\|\\\\\\\\)";
}
private static String optionalKeywords(UmlDiagramType type) {
if (type == UmlDiagramType.CLASS) {
- return "(interface|enum|annotation|abstract[%s]+class|abstract|class)";
+ return "(interface|enum|annotation|abstract[%s]+class|abstract|class|object)";
}
if (type == UmlDiagramType.OBJECT) {
return "(object)";
@@ -124,10 +131,18 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
throw new IllegalArgumentException();
}
+ private LeafType getTypeIfObject(String type) {
+ if ("object".equalsIgnoreCase(type)) {
+ return LeafType.OBJECT;
+ }
+ return null;
+ }
+
@Override
protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
Code ent1 = Code.of(arg.get("ENT1", 1));
Code ent2 = Code.of(arg.get("ENT2", 1));
+
if (ent1 == null) {
return executeArgSpecial1(diagram, arg);
}
@@ -140,12 +155,22 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return executePackageLink(diagram, arg);
}
+ final String type1 = arg.get("ENT1", 0);
+ final LeafType typeIfObject1 = getTypeIfObject(type1);
+
final IEntity cl1 = diagram.isGroup(ent1) ? diagram.getGroup(Code.of(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 1), "\""))) : diagram.getOrCreateLeaf(
- ent1, null, null);
+ ent1, typeIfObject1, null);
+
+ final String type2 = arg.get("ENT2", 0);
+ LeafType typeIfObject2 = getTypeIfObject(type2);
+ if (diagram.leafExist(ent2) == false && cl1.getEntityType() == LeafType.OBJECT && typeIfObject2 == null) {
+ typeIfObject2 = LeafType.OBJECT;
+ }
+
final IEntity cl2 = diagram.isGroup(ent2) ? diagram.getGroup(Code.of(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 1), "\""))) : diagram.getOrCreateLeaf(
- ent2, null, null);
+ ent2, typeIfObject2, null);
if (arg.get("ENT1", 0) != null) {
final LeafType type = LeafType.getLeafType(arg.get("ENT1", 0));
@@ -159,16 +184,18 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
((ILeaf) cl2).muteToType(type, null);
}
}
- if (arg.get("ENT1", 2) != null) {
- cl1.setStereotype(new Stereotype(arg.get("ENT1", 2), diagram.getSkinParam().getCircledCharacterRadius(),
- diagram.getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
- .getIHtmlColorSet()));
- }
- if (arg.get("ENT2", 2) != null) {
- cl2.setStereotype(new Stereotype(arg.get("ENT2", 2), diagram.getSkinParam().getCircledCharacterRadius(),
- diagram.getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
- .getIHtmlColorSet()));
- }
+ // if (arg.get("ENT1", 2) != null) {
+ // cl1.setStereotype(new Stereotype(arg.get("ENT1", 2), diagram.getSkinParam().getCircledCharacterRadius(),
+ // diagram.getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ // .getIHtmlColorSet()));
+ // }
+ // if (arg.get("ENT2", 2) != null) {
+ // cl2.setStereotype(new Stereotype(arg.get("ENT2", 2), diagram.getSkinParam().getCircledCharacterRadius(),
+ // diagram.getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ // .getIHtmlColorSet()));
+ // }
+
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg);
@@ -191,24 +218,24 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Matcher m1 = p1.matcher(labelLink);
if (m1.matches()) {
firstLabel = m1.group(1);
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m1.group(2).trim(), "\"")
- .trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(
+ StringUtils.trin(m1.group(2)), "\""));
secondLabel = m1.group(3);
} else {
final Pattern p2 = MyPattern.cmpile("^[%g]([^%g]+)[%g]([^%g]+)$");
final Matcher m2 = p2.matcher(labelLink);
if (m2.matches()) {
firstLabel = m2.group(1);
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m2.group(2).trim(), "\"")
- .trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(
+ StringUtils.trin(m2.group(2)), "\""));
secondLabel = null;
} else {
final Pattern p3 = MyPattern.cmpile("^([^%g]+)[%g]([^%g]+)[%g]$");
final Matcher m3 = p3.matcher(labelLink);
if (m3.matches()) {
firstLabel = null;
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m3.group(1).trim(),
- "\"").trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(
+ StringUtils.trin(m3.group(1)), "\""));
secondLabel = m3.group(2);
}
}
@@ -226,16 +253,16 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
labelLink = null;
} else if (labelLink != null && labelLink.startsWith("< ")) {
linkArrow = LinkArrow.BACKWARD;
- labelLink = labelLink.substring(2).trim();
+ labelLink = StringUtils.trin(labelLink.substring(2));
} else if (labelLink != null && labelLink.startsWith("> ")) {
linkArrow = LinkArrow.DIRECT_NORMAL;
- labelLink = labelLink.substring(2).trim();
+ labelLink = StringUtils.trin(labelLink.substring(2));
} else if (labelLink != null && labelLink.endsWith(" >")) {
linkArrow = LinkArrow.DIRECT_NORMAL;
- labelLink = labelLink.substring(0, labelLink.length() - 2).trim();
+ labelLink = StringUtils.trin(labelLink.substring(0, labelLink.length() - 2));
} else if (labelLink != null && labelLink.endsWith(" <")) {
linkArrow = LinkArrow.BACKWARD;
- labelLink = labelLink.substring(0, labelLink.length() - 2).trim();
+ labelLink = StringUtils.trin(labelLink.substring(0, labelLink.length() - 2));
}
Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(labelLink), queue, firstLabel, secondLabel,
@@ -245,7 +272,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
link = link.getInv();
}
link.setLinkArrow(linkArrow);
- applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
+ colors = applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
+ link.setColors(colors);
addLink(diagram, link, arg.get("HEADER", 0));
@@ -289,6 +317,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
queue = getQueueLength(arg);
}
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+
final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final String firstLabel = arg.get("FIRST_LABEL", 0);
final String secondLabel = arg.get("SECOND_LABEL", 0);
@@ -296,6 +326,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
diagram.getLabeldistance(), diagram.getLabelangle());
diagram.resetPragmaLabel();
+
+ colors = applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
+ link.setColors(colors);
+
addLink(diagram, link, arg.get("HEADER", 0));
return CommandExecutionResult.ok();
}
@@ -356,7 +390,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
if (s == null) {
return LinkDecor.NONE;
}
- s = s.trim();
+ s = StringUtils.trin(s);
if ("<|".equals(s)) {
return LinkDecor.EXTENDS;
}
@@ -385,7 +419,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
if (s == null) {
return LinkDecor.NONE;
}
- s = s.trim();
+ s = StringUtils.trin(s);
if ("|>".equals(s)) {
return LinkDecor.EXTENDS;
}
@@ -471,9 +505,14 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return s;
}
- public static void applyStyle(String arrowStyle, Link link) {
+ @Deprecated
+ public static Colors applyStyle(String arrowStyle, Link link) {
+ return applyStyle(arrowStyle, link, null);
+ }
+
+ public static Colors applyStyle(String arrowStyle, Link link, Colors colors) {
if (arrowStyle == null) {
- return;
+ return colors;
}
final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
while (st.hasMoreTokens()) {
@@ -490,8 +529,12 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
link.goNorank();
} else {
link.setSpecificColor(s);
+ if (colors != null) {
+ colors = colors.add(ColorType.LINE, HtmlColorSet.getInstance().getColorIfValid(s));
+ }
}
}
+ return colors;
}
private boolean isInversed(LinkDecor decors1, LinkDecor decors2) {
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java
index ee926e3..25192ac 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.classdiagram.command;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@@ -53,7 +54,6 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
-import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.utils.UniqueSequence;
final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassOrObjectDiagram> {
@@ -105,11 +105,13 @@ final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassO
if (arg.get("LOL_THEN_ENT", 0) == null) {
assert arg.get("ENT_THEN_LOL", 0) != null;
cl1 = diagram.getOrCreateLeaf(ent1, null, null);
- cl2 = diagram.createLeaf(cl1.getCode().addSuffix(suffix), Display.getWithNewlines(ent2), LeafType.LOLLIPOP, null);
+ cl2 = diagram.createLeaf(cl1.getCode().addSuffix(suffix), Display.getWithNewlines(ent2), LeafType.LOLLIPOP,
+ null);
normalEntity = cl1;
} else {
cl2 = diagram.getOrCreateLeaf(ent2, null, null);
- cl1 = diagram.createLeaf(cl2.getCode().addSuffix(suffix), Display.getWithNewlines(ent1), LeafType.LOLLIPOP, null);
+ cl1 = diagram.createLeaf(cl2.getCode().addSuffix(suffix), Display.getWithNewlines(ent1), LeafType.LOLLIPOP,
+ null);
normalEntity = cl2;
}
@@ -133,22 +135,24 @@ final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassO
final Matcher m1 = p1.matcher(labelLink);
if (m1.matches()) {
firstLabel = m1.group(1);
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m1.group(2).trim()).trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils
+ .trin(m1.group(2))));
secondLabel = m1.group(3);
} else {
final Pattern p2 = MyPattern.cmpile("^\"([^\"]+)\"([^\"]+)$");
final Matcher m2 = p2.matcher(labelLink);
if (m2.matches()) {
firstLabel = m2.group(1);
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m2.group(2).trim()).trim();
+ labelLink = StringUtils.trin(StringUtils
+ .eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils.trin(m2.group(2))));
secondLabel = null;
} else {
final Pattern p3 = MyPattern.cmpile("^([^\"]+)\"([^\"]+)\"$");
final Matcher m3 = p3.matcher(labelLink);
if (m3.matches()) {
firstLabel = null;
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m3.group(1).trim())
- .trim();
+ labelLink = StringUtils.trin(StringUtils
+ .eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils.trin(m3.group(1))));
secondLabel = m3.group(2);
}
}
@@ -213,10 +217,10 @@ final public class CommandLinkLollipop extends SingleLineCommand2<AbstractClassO
private String getQueue(RegexResult arg) {
if (arg.get("LOL_THEN_ENT", 0) != null) {
- return arg.get("LOL_THEN_ENT", 0).trim();
+ return StringUtils.trin(arg.get("LOL_THEN_ENT", 0));
}
if (arg.get("ENT_THEN_LOL", 0) != null) {
- return arg.get("ENT_THEN_LOL", 0).trim();
+ return StringUtils.trin(arg.get("ENT_THEN_LOL", 0));
}
throw new IllegalArgumentException();
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandMouseOver.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandMouseOver.java
deleted file mode 100644
index 342bdba..0000000
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandMouseOver.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2014, Arnaud Roques
- *
- * Project Info: http://plantuml.sourceforge.net
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.classdiagram.command;
-
-import java.util.List;
-
-import net.sourceforge.plantuml.classdiagram.ClassDiagram;
-import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.CommandMultilines2;
-import net.sourceforge.plantuml.command.MultilinesStrategy;
-import net.sourceforge.plantuml.command.regex.RegexConcat;
-import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.command.regex.RegexOr;
-import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.cucadiagram.Code;
-import net.sourceforge.plantuml.cucadiagram.IEntity;
-import net.sourceforge.plantuml.StringUtils;
-
-public class CommandMouseOver extends CommandMultilines2<ClassDiagram> {
-
- public CommandMouseOver() {
- super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
- }
-
- @Override
- public String getPatternEnd() {
- return "(?i)^[%s]*\\}[%s]*$";
- }
-
- private static RegexConcat getRegexConcat() {
- return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("mouseover[%s]+"), //
- new RegexOr(//
- new RegexLeaf("NAME1", "(\\.?[\\p{L}0-9_]+(?:\\.[\\p{L}0-9_]+)*)"), //
- new RegexLeaf("NAME3", "[%g]([^%g]+)[%g]")), //
- new RegexLeaf("[%s]*\\{[%s]*$"));
- }
-
- public CommandExecutionResult executeNow(ClassDiagram system, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- Code code = Code.of(line0.get("NAME1", 0));
- if (code == null) {
- code = Code.of(line0.get("NAME3", 0));
- }
- if (system.leafExist(code) == false) {
- return CommandExecutionResult.error("No such entity");
- }
- final IEntity entity = system.getLeafsget(code);
- for (String s : lines.subList(1, lines.size() - 1)) {
- entity.mouseOver(s);
- }
-
- return CommandExecutionResult.ok();
- }
-
- // private Entity executeArg0(Map<String, RegexPartialMatch> arg) {
- //
- // final EntityType type = EntityType.getEntityType(arg.get("TYPE").get(0).goUpperCase());
- // final String code;
- // final String display;
- // if (arg.get("NAME1").get(1) != null) {
- // code = arg.get("NAME1").get(1);
- // display = arg.get("NAME1").get(0);
- // } else if (arg.get("NAME3").get(0) != null) {
- // code = arg.get("NAME3").get(0);
- // display = arg.get("NAME3").get(0);
- // } else {
- // code = arg.get("NAME2").get(0);
- // display = arg.get("NAME2").get(1);
- // }
- // final String stereotype = arg.get("STEREO").get(0);
- // final String generic = arg.get("GENERIC").get(0);
- //
- // if (system.entityExist(code)) {
- // final Entity result = (Entity) system.getOrCreateClass(code);
- // result.muteToType(type);
- // return result;
- // }
- // final Entity entity = system.createEntity(code, display, type);
- // if (stereotype != null) {
- // entity.setStereotype(new Stereotype(stereotype, system.getSkinParam().getCircledCharacterRadius(),
- // system.getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null)));
- // }
- // if (generic != null) {
- // entity.setGeneric(generic);
- // }
- // return entity;
- // }
-
-}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandNamespaceSeparator.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandNamespaceSeparator.java
index e34e545..8a4db0f 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandNamespaceSeparator.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandNamespaceSeparator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java
index 1119154..a094a2b 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandStereotype.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -56,7 +56,7 @@ public class CommandStereotype extends SingleLineCommand<ClassDiagram> {
final String stereotype = arg.get(1);
final IEntity entity = diagram.getOrCreateLeaf(code, null, null);
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam().getIHtmlColorSet()));
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet()));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java
index 8253358..3c5e186 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandUrl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/GenericRegexProducer.java b/src/net/sourceforge/plantuml/classdiagram/command/GenericRegexProducer.java
index e01708e..d73eb05 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/GenericRegexProducer.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/GenericRegexProducer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/JavaClass.java b/src/net/sourceforge/plantuml/classdiagram/command/JavaClass.java
index 9a74912..cf051d6 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/JavaClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/JavaClass.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.LeafType;
class JavaClass {
@@ -55,9 +56,9 @@ class JavaClass {
if (p == null) {
p = "";
}
- final StringTokenizer st = new StringTokenizer(p.trim(), ",");
+ final StringTokenizer st = new StringTokenizer(StringUtils.trin(p), ",");
while (st.hasMoreTokens()) {
- this.parents.add(st.nextToken().trim().replaceAll("\\<.*", ""));
+ this.parents.add(StringUtils.trin(st.nextToken()).replaceAll("\\<.*", ""));
}
this.type = type;
this.parentType = parentType;
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/JavaFile.java b/src/net/sourceforge/plantuml/classdiagram/command/JavaFile.java
index 727d9b0..c4d21c5 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/JavaFile.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/JavaFile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -73,7 +73,7 @@ class JavaFile {
String javaPackage = null;
String s;
while ((s = br.readLine()) != null) {
- s = s.trim();
+ s = StringUtils.trin(s);
final Matcher matchPackage = packageDefinition.matcher(s);
if (matchPackage.find()) {
javaPackage = matchPackage.group(1);
diff --git a/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java b/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java
index 6acd628..f77421d 100644
--- a/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java
+++ b/src/net/sourceforge/plantuml/code/ArobaseStringCompressor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,8 @@ import java.io.StringReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.preproc.ReadLine;
import net.sourceforge.plantuml.preproc.ReadLineReader;
@@ -49,16 +51,16 @@ public class ArobaseStringCompressor implements StringCompressor {
private final static Pattern p = MyPattern.cmpile("(?s)(?i)^[%s]*(@startuml[^\\n\\r]*)?[%s]*(.*?)[%s]*(@enduml)?[%s]*$");
public String compress(final String data) throws IOException {
- final ReadLine r = new UncommentReadLine(new ReadLineReader(new StringReader(data)));
+ final ReadLine r = new UncommentReadLine(new ReadLineReader(new StringReader(data), "COMPRESS"));
final StringBuilder sb = new StringBuilder();
final StringBuilder full = new StringBuilder();
- String s = null;
+ CharSequence2 s = null;
boolean startDone = false;
while ((s = r.readLine()) != null) {
append(full, s);
- if (s.startsWith("@startuml")) {
+ if (s.toString2().startsWith("@startuml")) {
startDone = true;
- } else if (s.startsWith("@enduml")) {
+ } else if (s.toString2().startsWith("@enduml")) {
return sb.toString();
} else if (startDone) {
append(sb, s);
@@ -70,11 +72,11 @@ public class ArobaseStringCompressor implements StringCompressor {
return sb.toString();
}
- private void append(final StringBuilder sb, String s) {
+ private void append(final StringBuilder sb, CharSequence2 s) {
if (sb.length() > 0) {
sb.append('\n');
}
- sb.append(s);
+ sb.append(s.toString2());
}
private String compressOld(String s) throws IOException {
@@ -99,11 +101,11 @@ public class ArobaseStringCompressor implements StringCompressor {
}
private String clean(String s) {
- s = s.trim();
+ s = StringUtils.trin(s);
s = clean1(s);
s = s.replaceAll("@enduml[^\\n\\r]*", "");
s = s.replaceAll("@startuml[^\\n\\r]*", "");
- s = s.trim();
+ s = StringUtils.trin(s);
return s;
}
diff --git a/src/net/sourceforge/plantuml/code/AsciiEncoder.java b/src/net/sourceforge/plantuml/code/AsciiEncoder.java
index 4ae50a9..ed51f5d 100644
--- a/src/net/sourceforge/plantuml/code/AsciiEncoder.java
+++ b/src/net/sourceforge/plantuml/code/AsciiEncoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/Base64Coder.java b/src/net/sourceforge/plantuml/code/Base64Coder.java
index 259fbd2..a948bd0 100644
--- a/src/net/sourceforge/plantuml/code/Base64Coder.java
+++ b/src/net/sourceforge/plantuml/code/Base64Coder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/Compression.java b/src/net/sourceforge/plantuml/code/Compression.java
index 755753d..614c488 100644
--- a/src/net/sourceforge/plantuml/code/Compression.java
+++ b/src/net/sourceforge/plantuml/code/Compression.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/CompressionGZip.java b/src/net/sourceforge/plantuml/code/CompressionGZip.java
index 8bf964f..e8b6b08 100644
--- a/src/net/sourceforge/plantuml/code/CompressionGZip.java
+++ b/src/net/sourceforge/plantuml/code/CompressionGZip.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/CompressionHuffman.java b/src/net/sourceforge/plantuml/code/CompressionHuffman.java
index d7687c3..c8acf68 100644
--- a/src/net/sourceforge/plantuml/code/CompressionHuffman.java
+++ b/src/net/sourceforge/plantuml/code/CompressionHuffman.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/CompressionNone.java b/src/net/sourceforge/plantuml/code/CompressionNone.java
index ec57e82..8558b84 100644
--- a/src/net/sourceforge/plantuml/code/CompressionNone.java
+++ b/src/net/sourceforge/plantuml/code/CompressionNone.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/CompressionZlib.java b/src/net/sourceforge/plantuml/code/CompressionZlib.java
index 440ef10..985a008 100644
--- a/src/net/sourceforge/plantuml/code/CompressionZlib.java
+++ b/src/net/sourceforge/plantuml/code/CompressionZlib.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/StringCompressor.java b/src/net/sourceforge/plantuml/code/StringCompressor.java
index a24f49f..0b6a49e 100644
--- a/src/net/sourceforge/plantuml/code/StringCompressor.java
+++ b/src/net/sourceforge/plantuml/code/StringCompressor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/StringCompressorNone.java b/src/net/sourceforge/plantuml/code/StringCompressorNone.java
index 3d958f0..a224436 100644
--- a/src/net/sourceforge/plantuml/code/StringCompressorNone.java
+++ b/src/net/sourceforge/plantuml/code/StringCompressorNone.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/Transcoder.java b/src/net/sourceforge/plantuml/code/Transcoder.java
index a5445f5..a737f3b 100644
--- a/src/net/sourceforge/plantuml/code/Transcoder.java
+++ b/src/net/sourceforge/plantuml/code/Transcoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/TranscoderImpl.java b/src/net/sourceforge/plantuml/code/TranscoderImpl.java
index 16ddfb4..ae1740c 100644
--- a/src/net/sourceforge/plantuml/code/TranscoderImpl.java
+++ b/src/net/sourceforge/plantuml/code/TranscoderImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/TranscoderSmart.java b/src/net/sourceforge/plantuml/code/TranscoderSmart.java
index 00e3c63..abd9d1a 100644
--- a/src/net/sourceforge/plantuml/code/TranscoderSmart.java
+++ b/src/net/sourceforge/plantuml/code/TranscoderSmart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/TranscoderUtil.java b/src/net/sourceforge/plantuml/code/TranscoderUtil.java
index f984e79..9437ede 100644
--- a/src/net/sourceforge/plantuml/code/TranscoderUtil.java
+++ b/src/net/sourceforge/plantuml/code/TranscoderUtil.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/code/URLEncoder.java b/src/net/sourceforge/plantuml/code/URLEncoder.java
index b250cde..621dfeb 100644
--- a/src/net/sourceforge/plantuml/code/URLEncoder.java
+++ b/src/net/sourceforge/plantuml/code/URLEncoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/BlocLines.java b/src/net/sourceforge/plantuml/command/BlocLines.java
new file mode 100644
index 0000000..3733900
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/BlocLines.java
@@ -0,0 +1,260 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.cucadiagram.Display;
+
+public class BlocLines implements Iterable<CharSequence> {
+
+ private List<CharSequence> lines;
+
+ @Override
+ public String toString() {
+ return lines.toString();
+ }
+
+ private BlocLines(List<? extends CharSequence> lines) {
+ this.lines = (List<CharSequence>) Collections.unmodifiableList(lines);
+ }
+
+ public Display toDisplay() {
+ return Display.create(lines);
+ }
+
+ public static BlocLines single(CharSequence single) {
+ return new BlocLines(Arrays.asList(single));
+ }
+
+ public static BlocLines getWithNewlines(CharSequence s) {
+ return new BlocLines(StringUtils.getWithNewlines(s));
+ }
+
+ public BlocLines() {
+ this(new ArrayList<CharSequence>());
+ }
+
+ public BlocLines add2(CharSequence s) {
+ final List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ copy.add(s);
+ return new BlocLines(copy);
+ }
+
+ public List<CharSequence> getLines() {
+ return lines;
+ }
+
+ public int size() {
+ return lines.size();
+ }
+
+ public CharSequence get499(int i) {
+ return lines.get(i);
+ }
+
+ public CharSequence getFirst499() {
+ return lines.get(0);
+ }
+
+ public CharSequence getLast499() {
+ return lines.get(lines.size() - 1);
+ }
+
+ public BlocLines cleanList2(MultilinesStrategy strategy) {
+ final List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ strategy.cleanList(copy);
+ return new BlocLines(copy);
+ }
+
+ public BlocLines trim(boolean removeEmptyLines) {
+ final List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ for (int i = 0; i < copy.size(); i++) {
+ final CharSequence s = copy.get(i);
+ copy.set(i, StringUtils.trin(s));
+ }
+ if (removeEmptyLines) {
+ for (final Iterator<CharSequence> it = copy.iterator(); it.hasNext();) {
+ if (it.next().length() == 0) {
+ it.remove();
+ }
+ }
+ }
+ return new BlocLines(copy);
+ }
+
+ public BlocLines removeEmptyColumns() {
+ if (firstColumnRemovable(lines) == false) {
+ return this;
+ }
+ final List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ do {
+ for (int i = 0; i < copy.size(); i++) {
+ final CharSequence s = copy.get(i);
+ if (s.length() > 0) {
+ copy.set(i, s.subSequence(1, s.length()));
+ }
+ }
+ } while (firstColumnRemovable(copy));
+ return new BlocLines(copy);
+ }
+
+ private static boolean firstColumnRemovable(List<CharSequence> data) {
+ boolean allEmpty = true;
+ for (CharSequence s : data) {
+ if (s.length() == 0) {
+ continue;
+ }
+ allEmpty = false;
+ final char c = s.charAt(0);
+ if (c != ' ' && c != '\t') {
+ return false;
+ }
+ }
+ return allEmpty == false;
+ }
+
+ public char getLastChar() {
+ final CharSequence s = lines.get(lines.size() - 1);
+ return s.charAt(s.length() - 1);
+ }
+
+ public BlocLines removeStartingAndEnding2(String data) {
+ if (lines.size() == 0) {
+ return this;
+ }
+ final List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ copy.set(0, data);
+ final int n = copy.size() - 1;
+ final CharSequence s = copy.get(n);
+ copy.set(n, s.subSequence(0, s.length() - 1));
+ return new BlocLines(copy);
+ }
+
+ public BlocLines concat2() {
+ final StringBuilder sb = new StringBuilder();
+ for (CharSequence line : lines) {
+ sb.append(line);
+ sb.append(StringUtils.hiddenNewLine());
+ }
+ return single(sb.substring(0, sb.length() - 1));
+ }
+
+ public BlocLines trimSmart(int referenceLine) {
+ if (lines.size() <= referenceLine) {
+ return this;
+ }
+ final List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ final int nbStartingSpace = nbStartingSpace(copy.get(referenceLine));
+ for (int i = referenceLine; i < copy.size(); i++) {
+ final CharSequence s = copy.get(i);
+ copy.set(i, removeStartingSpaces(s, nbStartingSpace));
+ }
+ return new BlocLines(copy);
+ }
+
+ private static int nbStartingSpace(CharSequence s) {
+ int nb = 0;
+ while (nb < s.length() && isSpaceOrTab(s.charAt(nb))) {
+ nb++;
+ }
+ return nb;
+ }
+
+ private static boolean isSpaceOrTab(char c) {
+ return c == ' ' || c == '\t';
+ }
+
+ private static CharSequence removeStartingSpaces(CharSequence arg, int nbStartingSpace) {
+ if (arg.length() == 0) {
+ return arg;
+ }
+ int i = 0;
+ while (i < nbStartingSpace && i < arg.length() && isSpaceOrTab(arg.charAt(i))) {
+ i++;
+ }
+ if (i == 0) {
+ return arg;
+ }
+ return arg.subSequence(i, arg.length());
+ }
+
+ public BlocLines subExtract(int start, int end) {
+ List<CharSequence> copy = new ArrayList<CharSequence>(lines);
+ copy = copy.subList(start, copy.size() - end);
+ return new BlocLines(copy);
+ }
+
+ public Iterator<CharSequence> iterator() {
+ return lines.iterator();
+ }
+
+ public BlocLines removeComments() {
+ final List<CharSequence> copy = new ArrayList<CharSequence>();
+ boolean inComment = false;
+ for (CharSequence cs : lines) {
+ if (inComment == false && MyPattern.mtches(cs, CommandMultilinesComment.COMMENT_SINGLE_LINE)) {
+ continue;
+ }
+ if (inComment == false && MyPattern.mtches(cs, CommandMultilinesComment.COMMENT_MULTILINE_START)) {
+ inComment = true;
+ continue;
+ }
+ if (inComment && MyPattern.mtches(cs, CommandMultilinesComment.COMMENT_MULTILINE_END)) {
+ inComment = false;
+ continue;
+ }
+ if (inComment == false) {
+ copy.add(cs);
+ }
+ }
+ return new BlocLines(copy);
+ }
+
+ public BlocLines removeInnerComments() {
+ final List<CharSequence> copy = new ArrayList<CharSequence>();
+ for (CharSequence cs : lines) {
+ copy.add(MyPattern.removeAll(cs, CommandMultilinesComment.INNER_COMMENT));
+ }
+ return new BlocLines(copy);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/Command.java b/src/net/sourceforge/plantuml/command/Command.java
index 83bb005..988734d 100644
--- a/src/net/sourceforge/plantuml/command/Command.java
+++ b/src/net/sourceforge/plantuml/command/Command.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,15 +34,13 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
-
import net.sourceforge.plantuml.core.Diagram;
public interface Command<D extends Diagram> {
- CommandExecutionResult execute(D diagram, List<String> lines);
+ CommandExecutionResult execute(D diagram, BlocLines lines);
- CommandControl isValid(List<String> lines);
+ CommandControl isValid(BlocLines lines);
String[] getDescription();
diff --git a/src/net/sourceforge/plantuml/command/CommandAffineTransform.java b/src/net/sourceforge/plantuml/command/CommandAffineTransform.java
index 09fe16f..8272d9a 100644
--- a/src/net/sourceforge/plantuml/command/CommandAffineTransform.java
+++ b/src/net/sourceforge/plantuml/command/CommandAffineTransform.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -47,7 +47,7 @@ public class CommandAffineTransform extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
- final String value = arg.get(0);
+ final CharSequence value = arg.get(0);
diagram.setAnimation(Collections.singletonList(value));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java b/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java
index 79ee9ac..67a3c5a 100644
--- a/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java
+++ b/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,8 +34,6 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
-
import net.sourceforge.plantuml.UmlDiagram;
public class CommandAffineTransformMultiline extends CommandMultilines<UmlDiagram> {
@@ -49,9 +47,9 @@ public class CommandAffineTransformMultiline extends CommandMultilines<UmlDiagra
return "(?i)^[%s]*!\\}[%s]*$";
}
- public CommandExecutionResult execute(final UmlDiagram diagram, List<String> lines) {
- final List<String> data = lines.subList(1, lines.size() - 1);
- diagram.setAnimation(data);
+ public CommandExecutionResult execute(final UmlDiagram diagram, BlocLines lines) {
+ lines = lines.subExtract(1, 1);
+ diagram.setAnimation(lines);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/CommandCaption.java b/src/net/sourceforge/plantuml/command/CommandCaption.java
new file mode 100644
index 0000000..fd1e0c8
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandCaption.java
@@ -0,0 +1,58 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.UmlDiagram;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
+
+public class CommandCaption extends SingleLineCommand<UmlDiagram> {
+
+ public CommandCaption() {
+ super("(?i)^caption(?:[%s]*:[%s]*|[%s]+)(.*[\\p{L}0-9_.].*)$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ diagram.setCaption(new DisplayPositionned(Display.getWithNewlines(arg.get(0)), HorizontalAlignment.CENTER,
+ VerticalAlignment.BOTTOM));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandComment.java b/src/net/sourceforge/plantuml/command/CommandComment.java
index 62c8757..a4ad22f 100644
--- a/src/net/sourceforge/plantuml/command/CommandComment.java
+++ b/src/net/sourceforge/plantuml/command/CommandComment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,8 +40,9 @@ import net.sourceforge.plantuml.core.Diagram;
public class CommandComment extends SingleLineCommand<Diagram> {
+
public CommandComment() {
- super("(?i)^[%s]*([%q].*||/[%q].*[%q]/[%s]*)$");
+ super(CommandMultilinesComment.COMMENT_SINGLE_LINE);
}
@Override
diff --git a/src/net/sourceforge/plantuml/command/CommandControl.java b/src/net/sourceforge/plantuml/command/CommandControl.java
index 40de1ef..02aa214 100644
--- a/src/net/sourceforge/plantuml/command/CommandControl.java
+++ b/src/net/sourceforge/plantuml/command/CommandControl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandDecoratorMultine.java b/src/net/sourceforge/plantuml/command/CommandDecoratorMultine.java
new file mode 100644
index 0000000..e34812b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandDecoratorMultine.java
@@ -0,0 +1,83 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import net.sourceforge.plantuml.core.Diagram;
+
+public class CommandDecoratorMultine<D extends Diagram> implements Command<D> {
+
+ private final SingleLineCommand2<D> cmd;
+ private final boolean removeEmptyColumn;
+
+ public CommandDecoratorMultine(SingleLineCommand2<D> cmd) {
+ this(cmd, false);
+ }
+
+ public CommandDecoratorMultine(SingleLineCommand2<D> cmd, boolean removeEmptyColumn) {
+ this.cmd = cmd;
+ this.removeEmptyColumn = removeEmptyColumn;
+ }
+
+ public CommandExecutionResult execute(D diagram, BlocLines lines) {
+ if (removeEmptyColumn) {
+ lines = lines.removeEmptyColumns();
+ }
+ lines = lines.concat2();
+ return cmd.execute(diagram, lines);
+ }
+
+ public CommandControl isValid(BlocLines lines) {
+ if (cmd.isCommandForbidden()) {
+ return CommandControl.NOT_OK;
+ }
+ lines = lines.concat2();
+ if (cmd.isForbidden(lines.getFirst499())) {
+ return CommandControl.NOT_OK;
+ }
+ final CommandControl tmp = cmd.isValid(lines);
+ if (tmp == CommandControl.OK_PARTIAL) {
+ throw new IllegalStateException();
+ }
+ if (tmp == CommandControl.OK) {
+ return tmp;
+ }
+ return CommandControl.OK_PARTIAL;
+ }
+
+ public String[] getDescription() {
+ return cmd.getDescription();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandEndPackage.java b/src/net/sourceforge/plantuml/command/CommandEndPackage.java
index c7f40dd..3c2936e 100644
--- a/src/net/sourceforge/plantuml/command/CommandEndPackage.java
+++ b/src/net/sourceforge/plantuml/command/CommandEndPackage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandExecutionResult.java b/src/net/sourceforge/plantuml/command/CommandExecutionResult.java
index e3c4ecc..5602ea0 100644
--- a/src/net/sourceforge/plantuml/command/CommandExecutionResult.java
+++ b/src/net/sourceforge/plantuml/command/CommandExecutionResult.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,20 +34,25 @@
*/
package net.sourceforge.plantuml.command;
+import java.util.ArrayList;
+import java.util.List;
+
import net.sourceforge.plantuml.AbstractPSystem;
public class CommandExecutionResult {
private final String error;
private final AbstractPSystem newDiagram;
+ private final List<String> debugLines;
- private CommandExecutionResult(String error, AbstractPSystem newDiagram) {
+ private CommandExecutionResult(String error, AbstractPSystem newDiagram, List<String> debugLines) {
this.error = error;
this.newDiagram = newDiagram;
+ this.debugLines = debugLines;
}
public CommandExecutionResult withDiagram(AbstractPSystem newDiagram) {
- return new CommandExecutionResult(error, newDiagram);
+ return new CommandExecutionResult(error, newDiagram, null);
}
@Override
@@ -56,15 +61,37 @@ public class CommandExecutionResult {
}
public static CommandExecutionResult newDiagram(AbstractPSystem result) {
- return new CommandExecutionResult(null, result);
+ return new CommandExecutionResult(null, result, null);
}
public static CommandExecutionResult ok() {
- return new CommandExecutionResult(null, null);
+ return new CommandExecutionResult(null, null, null);
}
public static CommandExecutionResult error(String error) {
- return new CommandExecutionResult(error, null);
+ return new CommandExecutionResult(error, null, null);
+ }
+
+ public static CommandExecutionResult error(String error, Throwable t) {
+ return new CommandExecutionResult(error, null, getStackTrace(t));
+ }
+
+ public static List<String> getStackTrace(Throwable exception) {
+ final List<String> result = new ArrayList<String>();
+ result.add(exception.toString());
+ for (StackTraceElement ste : exception.getStackTrace()) {
+ result.add(" " + ste.toString());
+ }
+ if (exception.getCause() != null) {
+ final Throwable cause = exception.getCause();
+ result.add(" ");
+ result.add("Caused by " + cause.toString());
+ for (StackTraceElement ste : cause.getStackTrace()) {
+ result.add(" " + ste.toString());
+ }
+
+ }
+ return result;
}
public boolean isOk() {
@@ -82,4 +109,8 @@ public class CommandExecutionResult {
return newDiagram;
}
+ public List<String> getDebugLines() {
+ return debugLines;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/command/CommandFootboxIgnored.java b/src/net/sourceforge/plantuml/command/CommandFootboxIgnored.java
index 57254a7..7e3df8e 100644
--- a/src/net/sourceforge/plantuml/command/CommandFootboxIgnored.java
+++ b/src/net/sourceforge/plantuml/command/CommandFootboxIgnored.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandFooter.java b/src/net/sourceforge/plantuml/command/CommandFooter.java
index 80e4058..3df0210 100644
--- a/src/net/sourceforge/plantuml/command/CommandFooter.java
+++ b/src/net/sourceforge/plantuml/command/CommandFooter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,7 +39,9 @@ import java.util.List;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandFooter extends SingleLineCommand<UmlDiagram> {
@@ -50,11 +52,8 @@ public class CommandFooter extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
final String align = arg.get(0);
- if (align != null) {
- diagram.setFooterAlignment(HorizontalAlignment.valueOf(StringUtils.goUpperCase(align)));
- }
- diagram.setFooter(Display.getWithNewlines(arg.get(1)));
+ diagram.setFooter(new DisplayPositionned(Display.getWithNewlines(arg.get(1)), HorizontalAlignment.fromString(
+ align, HorizontalAlignment.CENTER), VerticalAlignment.BOTTOM));
return CommandExecutionResult.ok();
}
-
}
diff --git a/src/net/sourceforge/plantuml/command/CommandHeader.java b/src/net/sourceforge/plantuml/command/CommandHeader.java
index ad4bf3f..a68b47b 100644
--- a/src/net/sourceforge/plantuml/command/CommandHeader.java
+++ b/src/net/sourceforge/plantuml/command/CommandHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,10 +36,11 @@ package net.sourceforge.plantuml.command;
import java.util.List;
-import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandHeader extends SingleLineCommand<UmlDiagram> {
@@ -50,11 +51,8 @@ public class CommandHeader extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
final String align = arg.get(0);
- if (align != null) {
- diagram.setHeaderAlignment(HorizontalAlignment.valueOf(StringUtils.goUpperCase(align)));
- }
- diagram.setHeader(Display.getWithNewlines(arg.get(1)));
+ diagram.setHeader(new DisplayPositionned(Display.getWithNewlines(arg.get(1)), HorizontalAlignment.fromString(
+ align, HorizontalAlignment.RIGHT), VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
-
}
diff --git a/src/net/sourceforge/plantuml/command/CommandHideUnlinked.java b/src/net/sourceforge/plantuml/command/CommandHideUnlinked.java
index 202e1f7..3b034b7 100644
--- a/src/net/sourceforge/plantuml/command/CommandHideUnlinked.java
+++ b/src/net/sourceforge/plantuml/command/CommandHideUnlinked.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandMinwidth.java b/src/net/sourceforge/plantuml/command/CommandMinwidth.java
index 30eddf9..89bfbcc 100644
--- a/src/net/sourceforge/plantuml/command/CommandMinwidth.java
+++ b/src/net/sourceforge/plantuml/command/CommandMinwidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilines.java b/src/net/sourceforge/plantuml/command/CommandMultilines.java
index 9bfc582..ab44b9f 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilines.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,10 +34,10 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.core.Diagram;
@@ -58,11 +58,11 @@ public abstract class CommandMultilines<S extends Diagram> implements Command<S>
return new String[] { "START: " + starting.pattern(), "END: " + getPatternEnd() };
}
- final public CommandControl isValid(List<String> lines) {
+ final public CommandControl isValid(BlocLines lines) {
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- Matcher m1 = starting.matcher(lines.get(0).trim());
+ Matcher m1 = starting.matcher(StringUtils.trin(lines.getFirst499()));
if (m1.matches() == false) {
return CommandControl.NOT_OK;
}
@@ -70,7 +70,7 @@ public abstract class CommandMultilines<S extends Diagram> implements Command<S>
return CommandControl.OK_PARTIAL;
}
- m1 = MyPattern.cmpile(getPatternEnd()).matcher(lines.get(lines.size() - 1).trim());
+ m1 = MyPattern.cmpile(getPatternEnd()).matcher(StringUtils.trin(lines.getLast499()));
if (m1.matches() == false) {
return CommandControl.OK_PARTIAL;
}
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilines2.java b/src/net/sourceforge/plantuml/command/CommandMultilines2.java
index 8f6866a..2ea745b 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilines2.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilines2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.command;
import java.util.List;
import java.util.regex.Matcher;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.core.Diagram;
@@ -61,12 +62,12 @@ public abstract class CommandMultilines2<S extends Diagram> implements Command<S
return new String[] { "START: " + starting.getPattern(), "END: " + getPatternEnd() };
}
- final public CommandControl isValid(List<String> lines) {
- lines = strategy.filter(lines);
+ final public CommandControl isValid(BlocLines lines) {
+ lines = lines.cleanList2(strategy);
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- final boolean result1 = starting.match(lines.get(0).trim());
+ final boolean result1 = starting.match(StringUtils.trin(lines.getFirst499()));
if (result1 == false) {
return CommandControl.NOT_OK;
}
@@ -74,7 +75,7 @@ public abstract class CommandMultilines2<S extends Diagram> implements Command<S
return CommandControl.OK_PARTIAL;
}
- final Matcher m1 = MyPattern.cmpile(getPatternEnd()).matcher(lines.get(lines.size() - 1).trim());
+ final Matcher m1 = MyPattern.cmpile(getPatternEnd()).matcher(StringUtils.trinNoTrace(lines.getLast499()));
if (m1.matches() == false) {
return CommandControl.OK_PARTIAL;
}
@@ -83,11 +84,12 @@ public abstract class CommandMultilines2<S extends Diagram> implements Command<S
return CommandControl.OK;
}
- public final CommandExecutionResult execute(S system, List<String> lines) {
- return executeNow(system, strategy.filter(lines));
+ public final CommandExecutionResult execute(S system, BlocLines lines) {
+ lines = lines.cleanList2(strategy);
+ return executeNow(system, lines);
}
- public abstract CommandExecutionResult executeNow(S system, List<String> lines);
+ public abstract CommandExecutionResult executeNow(S system, BlocLines lines);
protected boolean isCommandForbidden() {
return false;
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilines3.java b/src/net/sourceforge/plantuml/command/CommandMultilines3.java
new file mode 100644
index 0000000..2e628ac
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandMultilines3.java
@@ -0,0 +1,102 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.core.Diagram;
+
+public abstract class CommandMultilines3<S extends Diagram> implements Command<S> {
+
+ private final RegexConcat starting;
+
+ private final MultilinesStrategy strategy;
+
+ public CommandMultilines3(RegexConcat patternStart, MultilinesStrategy strategy) {
+ if (patternStart.getPattern().startsWith("^") == false || patternStart.getPattern().endsWith("$") == false) {
+ throw new IllegalArgumentException("Bad pattern " + patternStart.getPattern());
+ }
+ this.strategy = strategy;
+ this.starting = patternStart;
+ }
+
+ public abstract RegexConcat getPatternEnd2();
+
+ public String[] getDescription() {
+ return new String[] { "START: " + starting.getPattern(), "END: " + getPatternEnd2().getPattern() };
+ }
+
+ final public CommandControl isValid(BlocLines lines) {
+ lines = lines.cleanList2(strategy);
+ if (isCommandForbidden()) {
+ return CommandControl.NOT_OK;
+ }
+ final boolean result1 = starting.match(StringUtils.trin(lines.getFirst499()));
+ if (result1 == false) {
+ return CommandControl.NOT_OK;
+ }
+ if (lines.size() == 1) {
+ return CommandControl.OK_PARTIAL;
+ }
+
+ final String potentialLast = StringUtils.trinNoTrace(lines.getLast499());
+ final boolean m1 = getPatternEnd2().match(potentialLast);
+ if (m1 == false) {
+ return CommandControl.OK_PARTIAL;
+ }
+
+ actionIfCommandValid();
+ return CommandControl.OK;
+ }
+
+ public final CommandExecutionResult execute(S system, BlocLines lines) {
+ lines = lines.cleanList2(strategy);
+ return executeNow(system, lines);
+ }
+
+ public abstract CommandExecutionResult executeNow(S system, BlocLines lines);
+
+ protected boolean isCommandForbidden() {
+ return false;
+ }
+
+ protected void actionIfCommandValid() {
+ }
+
+ protected final RegexConcat getStartingPattern() {
+ return starting;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesBracket.java b/src/net/sourceforge/plantuml/command/CommandMultilinesBracket.java
index 3449bd3..eed5e91 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesBracket.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesBracket.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,10 +34,10 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.core.Diagram;
@@ -67,11 +67,11 @@ public abstract class CommandMultilinesBracket<S extends Diagram> implements Com
return starting;
}
- final public CommandControl isValid(List<String> lines) {
+ final public CommandControl isValid(BlocLines lines) {
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- final Matcher m1 = starting.matcher(lines.get(0).trim());
+ final Matcher m1 = starting.matcher(StringUtils.trin(lines.getFirst499()));
if (m1.matches() == false) {
return CommandControl.NOT_OK;
}
@@ -80,8 +80,8 @@ public abstract class CommandMultilinesBracket<S extends Diagram> implements Com
}
int level = 1;
- for (int i = 1; i < lines.size(); i++) {
- final String s = lines.get(i).trim();
+ for (CharSequence cs : lines.subExtract(1, 0)) {
+ final String s = StringUtils.trin(cs);
if (isLineConsistent(s, level) == false) {
return CommandControl.NOT_OK;
}
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java b/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java
index 95fc0af..bebce0f 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesComment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,22 +34,25 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
-
import net.sourceforge.plantuml.core.Diagram;
public class CommandMultilinesComment extends CommandMultilines<Diagram> {
+ public static final String COMMENT_MULTILINE_START = "(?i)^[%s]*/[%q]([^%q]|[%q][^/])*$";
+ public static final String COMMENT_MULTILINE_END = "(?i)^([^%q]|[%q][^/])*[%q]/[%s]*$";
+ public static final String COMMENT_SINGLE_LINE = "(?i)^[%s]*([%q].*||/[%q].*[%q]/[%s]*)$";
+ public static final String INNER_COMMENT = "/[%q].*?[%q]/";
+
public CommandMultilinesComment() {
- super("(?i)^[%s]*/[%q].*$");
+ super(COMMENT_MULTILINE_START);
}
@Override
public String getPatternEnd() {
- return "(?i)^.*[%q]/[%s]*$";
+ return COMMENT_MULTILINE_END;
}
- public CommandExecutionResult execute(final Diagram diagram, List<String> lines) {
+ public CommandExecutionResult execute(final Diagram diagram, BlocLines lines) {
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
index 52ff984..1cc7154 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesFooter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,13 +34,14 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
import java.util.regex.Matcher;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandMultilinesFooter extends CommandMultilines<UmlDiagram> {
@@ -53,19 +54,18 @@ public class CommandMultilinesFooter extends CommandMultilines<UmlDiagram> {
return "(?i)^end[%s]?footer$";
}
- public CommandExecutionResult execute(final UmlDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final Matcher m = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult execute(final UmlDiagram diagram, BlocLines lines) {
+ lines = lines.trim(false);
+ final Matcher m = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
if (m.find() == false) {
throw new IllegalStateException();
}
final String align = m.group(1);
- if (align != null) {
- diagram.setFooterAlignment(HorizontalAlignment.valueOf(StringUtils.goUpperCase(align)));
- }
- final Display strings = Display.create(lines.subList(1, lines.size() - 1));
+ lines = lines.subExtract(1, 1);
+ final Display strings = lines.toDisplay();
if (strings.size() > 0) {
- diagram.setFooter(strings);
+ diagram.setFooter(new DisplayPositionned(strings, HorizontalAlignment.fromString(align,
+ HorizontalAlignment.CENTER), VerticalAlignment.BOTTOM));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Empty footer");
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
index 598618b..5361a8d 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,39 +34,38 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
import java.util.regex.Matcher;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandMultilinesHeader extends CommandMultilines<UmlDiagram> {
public CommandMultilinesHeader() {
super("(?i)^(?:(left|right|center)?[%s]*)header$");
}
-
+
@Override
public String getPatternEnd() {
return "(?i)^end[%s]?header$";
}
-
- public CommandExecutionResult execute(final UmlDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final Matcher m = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult execute(final UmlDiagram diagram, BlocLines lines) {
+ lines = lines.trim(false);
+ final Matcher m = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
if (m.find() == false) {
throw new IllegalStateException();
}
final String align = m.group(1);
- if (align != null) {
- diagram.setHeaderAlignment(HorizontalAlignment.valueOf(StringUtils.goUpperCase(align)));
- }
- final Display strings = Display.create(lines.subList(1, lines.size() - 1));
+ lines = lines.subExtract(1, 1);
+ final Display strings = lines.toDisplay();
if (strings.size() > 0) {
- diagram.setHeader(strings);
+ diagram.setHeader(new DisplayPositionned(strings, HorizontalAlignment.fromString(align,
+ HorizontalAlignment.RIGHT), VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Empty header");
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java b/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java
index 79225b5..8606efc 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesLegend.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,14 +34,13 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
-
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
@@ -65,19 +64,21 @@ public class CommandMultilinesLegend extends CommandMultilines2<UmlDiagram> {
}
@Override
- public CommandExecutionResult executeNow(UmlDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(UmlDiagram diagram, BlocLines lines) {
+ lines = lines.trimSmart(1);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final String align = line0.get("ALIGN", 0);
final String valign = line0.get("VALIGN", 0);
- final Display strings = Display.create(lines.subList(1, lines.size() - 1)).removeEmptyColumns();
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ final Display strings = lines.toDisplay();
if (strings.size() > 0) {
final VerticalAlignment valignment = VerticalAlignment.fromString(valign);
HorizontalAlignment alignment = HorizontalAlignment.fromString(align);
if (alignment == null) {
alignment = HorizontalAlignment.CENTER;
}
- diagram.setLegend(strings, alignment, valignment);
+ diagram.setLegend(new DisplayPositionned(strings, alignment, valignment));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("No legend defined");
diff --git a/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java b/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java
index 9741906..5a92a0f 100644
--- a/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java
+++ b/src/net/sourceforge/plantuml/command/CommandMultilinesTitle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,11 +34,11 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
-
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandMultilinesTitle extends CommandMultilines<UmlDiagram> {
@@ -51,10 +51,12 @@ public class CommandMultilinesTitle extends CommandMultilines<UmlDiagram> {
return "(?i)^end[%s]?title$";
}
- public CommandExecutionResult execute(final UmlDiagram diagram, List<String> lines) {
- final Display strings = Display.create(lines.subList(1, lines.size() - 1)).removeEmptyColumns();
+ public CommandExecutionResult execute(final UmlDiagram diagram, BlocLines lines) {
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ final Display strings = lines.toDisplay();
if (strings.size() > 0) {
- diagram.setTitle(strings);
+ diagram.setTitle(new DisplayPositionned(strings, HorizontalAlignment.CENTER, VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("No title defined");
diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace.java b/src/net/sourceforge/plantuml/command/CommandNamespace.java
index fa72a6f..fb8123d 100644
--- a/src/net/sourceforge/plantuml/command/CommandNamespace.java
+++ b/src/net/sourceforge/plantuml/command/CommandNamespace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,8 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
@@ -54,11 +55,11 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
private static RegexConcat getRegexConcat() {
return new RegexConcat(new RegexLeaf("^namespace[%s]+"), //
- new RegexLeaf("NAME", "([\\p{L}0-9_][\\p{L}0-9_.:]*)"), //
+ new RegexLeaf("NAME", "([\\p{L}0-9_][\\p{L}0-9_.:\\\\]*)"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("[%s]*\\{$"));
}
@@ -74,7 +75,7 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
}
final String color = arg.get("COLOR", 0);
if (color != null) {
- p.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+ p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
}
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/CommandNope.java b/src/net/sourceforge/plantuml/command/CommandNope.java
index 5d5e9cf..f7d3002 100644
--- a/src/net/sourceforge/plantuml/command/CommandNope.java
+++ b/src/net/sourceforge/plantuml/command/CommandNope.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandPackage.java b/src/net/sourceforge/plantuml/command/CommandPackage.java
index 41f4fe8..ae66c19 100644
--- a/src/net/sourceforge/plantuml/command/CommandPackage.java
+++ b/src/net/sourceforge/plantuml/command/CommandPackage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.command;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
@@ -47,8 +48,10 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.utils.UniqueSequence;
public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
@@ -66,9 +69,13 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*\\{$"));
}
+
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
@Override
protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, RegexResult arg) {
@@ -92,7 +99,12 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
currentPackage);
final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null) {
- p.setStereotype(new Stereotype(stereotype));
+ final USymbol usymbol = USymbol.getFromString(stereotype);
+ if (usymbol == null) {
+ p.setStereotype(new Stereotype(stereotype));
+ } else {
+ p.setUSymbol(usymbol);
+ }
}
final String urlString = arg.get("URL", 0);
@@ -102,10 +114,13 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
p.addUrl(url);
}
- final String color = arg.get("COLOR", 0);
- if (color != null) {
- p.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
- }
+ final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ p.setColors(colors);
+
+// final String color = arg.get("COLOR", 0);
+// if (color != null) {
+// p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+// }
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java
index 3a00526..a509e0e 100644
--- a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java
+++ b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,13 +36,14 @@ package net.sourceforge.plantuml.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.utils.UniqueSequence;
public class CommandPackageEmpty extends SingleLineCommand<AbstractEntityDiagram> {
@@ -73,7 +74,7 @@ public class CommandPackageEmpty extends SingleLineCommand<AbstractEntityDiagram
currentPackage);
final String color = arg.get(2);
if (color != null) {
- p.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+ p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
}
diagram.endGroup();
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/command/CommandPage.java b/src/net/sourceforge/plantuml/command/CommandPage.java
index 51fef9f..4c43a24 100644
--- a/src/net/sourceforge/plantuml/command/CommandPage.java
+++ b/src/net/sourceforge/plantuml/command/CommandPage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandPragma.java b/src/net/sourceforge/plantuml/command/CommandPragma.java
index ff088ba..c19ff1c 100644
--- a/src/net/sourceforge/plantuml/command/CommandPragma.java
+++ b/src/net/sourceforge/plantuml/command/CommandPragma.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandRankDir.java b/src/net/sourceforge/plantuml/command/CommandRankDir.java
index 43788ab..e70745e 100644
--- a/src/net/sourceforge/plantuml/command/CommandRankDir.java
+++ b/src/net/sourceforge/plantuml/command/CommandRankDir.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandRotate.java b/src/net/sourceforge/plantuml/command/CommandRotate.java
index 727b26e..91cddbd 100644
--- a/src/net/sourceforge/plantuml/command/CommandRotate.java
+++ b/src/net/sourceforge/plantuml/command/CommandRotate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandScale.java b/src/net/sourceforge/plantuml/command/CommandScale.java
index 0cc2841..7974488 100644
--- a/src/net/sourceforge/plantuml/command/CommandScale.java
+++ b/src/net/sourceforge/plantuml/command/CommandScale.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java
new file mode 100644
index 0000000..0047d05
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandScaleMaxHeight.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.ScaleMaxHeight;
+import net.sourceforge.plantuml.UmlDiagram;
+
+public class CommandScaleMaxHeight extends SingleLineCommand<UmlDiagram> {
+
+ public CommandScaleMaxHeight() {
+ super("(?i)^scale[%s]+max[%s]+([0-9.]+)[%s]+height$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ final double height = Double.parseDouble(arg.get(0));
+ diagram.setScale(new ScaleMaxHeight(height));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java
new file mode 100644
index 0000000..c1c4d30
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidth.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.ScaleMaxWidth;
+import net.sourceforge.plantuml.UmlDiagram;
+
+public class CommandScaleMaxWidth extends SingleLineCommand<UmlDiagram> {
+
+ public CommandScaleMaxWidth() {
+ super("(?i)^scale[%s]+max[%s]+([0-9.]+)[%s]+width$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ final double width = Double.parseDouble(arg.get(0));
+ diagram.setScale(new ScaleMaxWidth(width));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java
new file mode 100644
index 0000000..338a2a9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/CommandScaleMaxWidthAndHeight.java
@@ -0,0 +1,56 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.ScaleMaxWidthAndHeight;
+import net.sourceforge.plantuml.UmlDiagram;
+
+public class CommandScaleMaxWidthAndHeight extends SingleLineCommand<UmlDiagram> {
+
+ public CommandScaleMaxWidthAndHeight() {
+ super("(?i)^scale[%s]+max[%s]+([0-9.]+)[%s]*[*x][%s]*([0-9.]+)$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
+ final double width = Double.parseDouble(arg.get(0));
+ final double height = Double.parseDouble(arg.get(1));
+ diagram.setScale(new ScaleMaxWidthAndHeight(width, height));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java
index 48b42e4..d133c0d 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleWidthAndHeight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java b/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java
index 35b2cdb..df34f28 100644
--- a/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java
+++ b/src/net/sourceforge/plantuml/command/CommandScaleWidthOrHeight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandSkinParam.java b/src/net/sourceforge/plantuml/command/CommandSkinParam.java
index b68cdcd..3cb18e0 100644
--- a/src/net/sourceforge/plantuml/command/CommandSkinParam.java
+++ b/src/net/sourceforge/plantuml/command/CommandSkinParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java b/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java
index 18445eb..9f1921e 100644
--- a/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java
+++ b/src/net/sourceforge/plantuml/command/CommandSkinParamMultilines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,9 +39,9 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.command.regex.MyPattern;
-import net.sourceforge.plantuml.StringUtils;
public class CommandSkinParamMultilines extends CommandMultilinesBracket<UmlDiagram> {
@@ -65,7 +65,8 @@ public class CommandSkinParamMultilines extends CommandMultilinesBracket<UmlDiag
}
}
- private final static Pattern p1 = MyPattern.cmpile("^([\\w.]*(?:\\<\\<.*\\>\\>)?[\\w.]*)[%s]+(?:(\\{)|(.*))$|^\\}?$");
+ private final static Pattern p1 = MyPattern
+ .cmpile("^([\\w.]*(?:\\<\\<.*\\>\\>)?[\\w.]*)[%s]+(?:(\\{)|(.*))$|^\\}?$");
public CommandSkinParamMultilines() {
super("(?i)^skinparam[%s]*(?:[%s]+([\\w.]*(?:\\<\\<.*\\>\\>)?[\\w.]*))?[%s]*\\{$");
@@ -73,13 +74,21 @@ public class CommandSkinParamMultilines extends CommandMultilinesBracket<UmlDiag
@Override
protected boolean isLineConsistent(String line, int level) {
- line = line.trim();
+ line = StringUtils.trin(line);
+ if (hasStartingQuote(line)) {
+ return true;
+ }
return p1.matcher(line).matches();
}
- public CommandExecutionResult execute(UmlDiagram diagram, List<String> lines) {
+ private boolean hasStartingQuote(CharSequence line) {
+ // return MyPattern.mtches(line, "[%s]*[%q].*");
+ return MyPattern.mtches(line, CommandMultilinesComment.COMMENT_SINGLE_LINE);
+ }
+
+ public CommandExecutionResult execute(UmlDiagram diagram, BlocLines lines) {
final Context context = new Context();
- final Matcher mStart = getStartingPattern().matcher(lines.get(0).trim());
+ final Matcher mStart = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
if (mStart.find() == false) {
throw new IllegalStateException();
}
@@ -87,12 +96,16 @@ public class CommandSkinParamMultilines extends CommandMultilinesBracket<UmlDiag
context.push(mStart.group(1));
}
- lines = new ArrayList<String>(lines.subList(1, lines.size() - 1));
- StringUtils.trim(lines, true);
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeComments();
+ lines = lines.trim(true);
- for (String s : lines) {
+ for (CharSequence s : lines) {
assert s.length() > 0;
- if (s.equals("}")) {
+// if (hasStartingQuote(s)) {
+// continue;
+// }
+ if (s.toString().equals("}")) {
context.pop();
continue;
}
@@ -106,7 +119,7 @@ public class CommandSkinParamMultilines extends CommandMultilinesBracket<UmlDiag
final String key = context.getFullParam() + m.group(1);
diagram.setParam(key, m.group(3));
} else {
- throw new IllegalStateException();
+ throw new IllegalStateException("." + s.toString() + ".");
}
}
diff --git a/src/net/sourceforge/plantuml/command/CommandSpriteFile.java b/src/net/sourceforge/plantuml/command/CommandSpriteFile.java
index 1481cc7..e7f8ecf 100644
--- a/src/net/sourceforge/plantuml/command/CommandSpriteFile.java
+++ b/src/net/sourceforge/plantuml/command/CommandSpriteFile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.command;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import javax.imageio.ImageIO;
@@ -46,7 +47,8 @@ import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.ugraphic.SpriteImage;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteImage;
+import net.sourceforge.plantuml.version.PSystemVersion;
public class CommandSpriteFile extends SingleLineCommand2<UmlDiagram> {
@@ -68,11 +70,20 @@ public class CommandSpriteFile extends SingleLineCommand2<UmlDiagram> {
final String src = arg.get("FILE", 0);
final BufferedImage im;
try {
- final File f = FileSystem.getInstance().getFile(src);
- if (f.exists() == false) {
- return CommandExecutionResult.error("File does not exist: " + src);
+ if (src.startsWith("jar:")) {
+ final String inner = src.substring(4) + ".png";
+ final InputStream is = SpriteImage.getInternalSprite(inner);
+ if (is == null) {
+ return CommandExecutionResult.error("No such internal sprite: " + inner);
+ }
+ im = ImageIO.read(is);
+ } else {
+ final File f = FileSystem.getInstance().getFile(src);
+ if (f.exists() == false) {
+ return CommandExecutionResult.error("File does not exist: " + src);
+ }
+ im = ImageIO.read(f);
}
- im = ImageIO.read(f);
} catch (IOException e) {
Log.error("Error reading " + src + " " + e);
return CommandExecutionResult.error("Cannot read: " + src);
diff --git a/src/net/sourceforge/plantuml/command/CommandTitle.java b/src/net/sourceforge/plantuml/command/CommandTitle.java
index 36c268b..f26d64a 100644
--- a/src/net/sourceforge/plantuml/command/CommandTitle.java
+++ b/src/net/sourceforge/plantuml/command/CommandTitle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,9 @@ import java.util.List;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
public class CommandTitle extends SingleLineCommand<UmlDiagram> {
@@ -47,7 +50,8 @@ public class CommandTitle extends SingleLineCommand<UmlDiagram> {
@Override
protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
- diagram.setTitle(Display.getWithNewlines(arg.get(0)));
+ diagram.setTitle(new DisplayPositionned(Display.getWithNewlines(arg.get(0)), HorizontalAlignment.CENTER,
+ VerticalAlignment.TOP));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java b/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java
index 14673f1..602d9da 100644
--- a/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java
+++ b/src/net/sourceforge/plantuml/command/FactorySpriteCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,14 +38,14 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.ugraphic.Sprite;
-import net.sourceforge.plantuml.ugraphic.SpriteGrayLevel;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel;
public final class FactorySpriteCommand implements SingleMultiFactoryCommand<UmlDiagram> {
@@ -73,13 +73,13 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
@Override
protected CommandExecutionResult executeArg(final UmlDiagram system, RegexResult arg) {
- return executeInternal(system, arg, Arrays.asList(arg.get("DATA", 0)));
+ return executeInternal(system, arg, Arrays.asList((CharSequence) arg.get("DATA", 0)));
}
};
}
- public Command<UmlDiagram> createMultiLine() {
+ public Command<UmlDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<UmlDiagram>(getRegexConcatMultiLine(), MultilinesStrategy.REMOVE_STARTING_QUOTE) {
@Override
@@ -87,22 +87,23 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
return "(?i)^end[%s]?sprite|\\}$";
}
- public CommandExecutionResult executeNow(final UmlDiagram system, List<String> lines) {
- StringUtils.trim(lines, true);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(final UmlDiagram system, BlocLines lines) {
+ lines = lines.trim(true);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
- final List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
- if (strings.size() == 0) {
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ if (lines.size() == 0) {
return CommandExecutionResult.error("No sprite defined.");
}
- return executeInternal(system, line0, strings);
+ return executeInternal(system, line0, lines.getLines());
}
};
}
private CommandExecutionResult executeInternal(UmlDiagram system, RegexResult line0,
- final List<String> strings) {
+ final List<CharSequence> strings) {
try {
final Sprite sprite;
if (line0.get("DIM", 0) == null) {
@@ -128,10 +129,10 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
}
}
- private String concat(final List<String> strings) {
+ private String concat(final List<? extends CharSequence> strings) {
final StringBuilder sb = new StringBuilder();
- for (String s : strings) {
- sb.append(s.trim());
+ for (CharSequence s : strings) {
+ sb.append(StringUtils.trin(s));
}
return sb.toString();
}
diff --git a/src/net/sourceforge/plantuml/command/MultilinesStrategy.java b/src/net/sourceforge/plantuml/command/MultilinesStrategy.java
index af492b7..ec8565d 100644
--- a/src/net/sourceforge/plantuml/command/MultilinesStrategy.java
+++ b/src/net/sourceforge/plantuml/command/MultilinesStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,26 +37,27 @@ package net.sourceforge.plantuml.command;
import java.util.Iterator;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
+
public enum MultilinesStrategy {
REMOVE_STARTING_QUOTE, KEEP_STARTING_QUOTE;
- public List<String> filter(List<String> lines) {
+ public void cleanList(List<? extends CharSequence> lines) {
if (this == REMOVE_STARTING_QUOTE) {
filterQuote(lines);
}
- return lines;
}
- private void filterQuote(List<String> lines) {
- for (final Iterator<String> it = lines.iterator(); it.hasNext();) {
- final String s = it.next();
+ private void filterQuote(List<? extends CharSequence> lines) {
+ for (final Iterator<? extends CharSequence> it = lines.iterator(); it.hasNext();) {
+ final CharSequence s = it.next();
if (hasStartingQuote(s)) {
it.remove();
}
}
}
- private boolean hasStartingQuote(String s) {
- return s.trim().startsWith("\'");
+ private boolean hasStartingQuote(CharSequence s) {
+ return StringUtils.trinNoTrace(s).startsWith("\'");
}
}
diff --git a/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java b/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java
index 2c6d3dc..03a530b 100644
--- a/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java
+++ b/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.ErrorUml;
import net.sourceforge.plantuml.ErrorUmlType;
+import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.PSystemError;
import net.sourceforge.plantuml.api.PSystemFactory;
import net.sourceforge.plantuml.core.DiagramType;
@@ -50,15 +51,15 @@ public abstract class PSystemAbstractFactory implements PSystemFactory {
this.type = type;
}
- final protected AbstractPSystem buildEmptyError(UmlSource source) {
+ final protected AbstractPSystem buildEmptyError(UmlSource source, LineLocation lineLocation) {
final PSystemError result = new PSystemError(source, new ErrorUml(ErrorUmlType.SYNTAX_ERROR,
- "Empty description", 1));
+ "Empty description", 1, lineLocation), null);
result.setSource(source);
return result;
}
- final protected PSystemError buildEmptyError(UmlSource source, String err) {
- final PSystemError result = new PSystemError(source, new ErrorUml(ErrorUmlType.EXECUTION_ERROR, err, 1));
+ final protected PSystemError buildEmptyError(UmlSource source, String err, LineLocation lineLocation) {
+ final PSystemError result = new PSystemError(source, new ErrorUml(ErrorUmlType.EXECUTION_ERROR, err, 1, lineLocation), null);
result.setSource(source);
return result;
}
diff --git a/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java b/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java
index 5977a6d..1186b75 100644
--- a/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java
+++ b/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.ErrorUml;
import net.sourceforge.plantuml.ErrorUmlType;
import net.sourceforge.plantuml.PSystemError;
@@ -42,7 +43,7 @@ import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.utils.StartUtils;
-import net.sourceforge.plantuml.version.IteratorCounter;
+import net.sourceforge.plantuml.version.IteratorCounter2;
public abstract class PSystemBasicFactory<P extends AbstractPSystem> extends PSystemAbstractFactory {
@@ -62,24 +63,24 @@ public abstract class PSystemBasicFactory<P extends AbstractPSystem> extends PSy
final public Diagram createSystem(UmlSource source) {
- final IteratorCounter it = source.iterator();
- final String startLine = it.next();
- P system = init(startLine);
+ final IteratorCounter2 it = source.iterator2();
+ final CharSequence2 startLine = it.next();
+ P system = init(startLine.toString2());
while (it.hasNext()) {
- final String s = it.next();
+ final CharSequence2 s = it.next();
if (StartUtils.isArobaseEndDiagram(s)) {
if (source.getTotalLineCount() == 2) {
- return buildEmptyError(source);
+ return buildEmptyError(source, s.getLocation());
}
if (system != null) {
system.setSource(source);
}
return system;
}
- system = executeLine(system, s);
+ system = executeLine(system, s.toString2());
if (system == null) {
return new PSystemError(source, new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?",
- it.currentNum() - 1));
+ it.currentNum() - 1, s.getLocation()), null);
}
}
if (system != null) {
diff --git a/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java b/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java
index 8273af6..a412c55 100644
--- a/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java
+++ b/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.ErrorUml;
import net.sourceforge.plantuml.ErrorUmlType;
import net.sourceforge.plantuml.PSystemError;
@@ -42,7 +43,7 @@ import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.utils.StartUtils;
-import net.sourceforge.plantuml.version.IteratorCounter;
+import net.sourceforge.plantuml.version.IteratorCounter2;
public abstract class PSystemSingleLineFactory extends PSystemAbstractFactory {
@@ -54,27 +55,27 @@ public abstract class PSystemSingleLineFactory extends PSystemAbstractFactory {
final public Diagram createSystem(UmlSource source) {
+ final IteratorCounter2 it = source.iterator2();
if (source.isEmpty()) {
- return buildEmptyError(source);
+ return buildEmptyError(source, it.peek().getLocation());
}
- final IteratorCounter it = source.iterator();
- final String startLine = it.next();
+ final CharSequence2 startLine = it.next();
if (StartUtils.isArobaseStartDiagram(startLine) == false) {
throw new UnsupportedOperationException();
}
if (it.hasNext() == false) {
- return buildEmptyError(source);
+ return buildEmptyError(source, startLine.getLocation());
}
- final String s = it.next();
+ final CharSequence2 s = it.next();
if (StartUtils.isArobaseEndDiagram(s)) {
- return buildEmptyError(source);
+ return buildEmptyError(source, s.getLocation());
}
- final AbstractPSystem sys = executeLine(s);
+ final AbstractPSystem sys = executeLine(s.toString2());
if (sys == null) {
return new PSystemError(source, new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?",
- it.currentNum() - 1));
+ it.currentNum() - 1, s.getLocation()), null);
}
sys.setSource(source);
return sys;
diff --git a/src/net/sourceforge/plantuml/command/Position.java b/src/net/sourceforge/plantuml/command/Position.java
index 00b03f3..1a07317 100644
--- a/src/net/sourceforge/plantuml/command/Position.java
+++ b/src/net/sourceforge/plantuml/command/Position.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.command;
+import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.cucadiagram.Rankdir;
public enum Position {
@@ -61,4 +62,14 @@ public enum Position {
}
throw new IllegalStateException();
}
+
+ public Direction reverseDirection() {
+ if (this == LEFT) {
+ return Direction.RIGHT;
+ }
+ if (this == RIGHT) {
+ return Direction.LEFT;
+ }
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/src/net/sourceforge/plantuml/command/ProtectedCommand.java b/src/net/sourceforge/plantuml/command/ProtectedCommand.java
index d21a512..89bc420 100644
--- a/src/net/sourceforge/plantuml/command/ProtectedCommand.java
+++ b/src/net/sourceforge/plantuml/command/ProtectedCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,10 +34,6 @@
*/
package net.sourceforge.plantuml.command;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintWriter;
-import java.util.List;
-
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.version.Version;
@@ -50,29 +46,26 @@ public class ProtectedCommand<S extends Diagram> implements Command<S> {
this.cmd = cmd;
}
- public CommandExecutionResult execute(S system, List<String> lines) {
+ public CommandExecutionResult execute(S system, BlocLines lines) {
try {
final CommandExecutionResult result = cmd.execute(system, lines);
-// if (result.isOk()) {
-// // TRACECOMMAND
-// System.err.println("CMD = " + cmd.getClass());
-// }
+ // if (result.isOk()) {
+ // // TRACECOMMAND
+ // System.err.println("CMD = " + cmd.getClass());
+ // }
return result;
} catch (Throwable t) {
- t.printStackTrace();
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final PrintWriter pw = new PrintWriter(baos);
- t.printStackTrace(pw);
Log.error("Error " + t);
+ t.printStackTrace();
String msg = "You should send a mail to plantuml@gmail.com with this log (V" + Version.versionString()
+ ")";
Log.error(msg);
- msg += " " + new String(baos.toByteArray());
- return CommandExecutionResult.error(msg);
+ msg += " " + t.toString();
+ return CommandExecutionResult.error(msg, t);
}
}
- public CommandControl isValid(List<String> lines) {
+ public CommandControl isValid(BlocLines lines) {
return cmd.isValid(lines);
}
diff --git a/src/net/sourceforge/plantuml/command/SingleLineCommand.java b/src/net/sourceforge/plantuml/command/SingleLineCommand.java
index 328e7ec..69dc8a5 100644
--- a/src/net/sourceforge/plantuml/command/SingleLineCommand.java
+++ b/src/net/sourceforge/plantuml/command/SingleLineCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,9 +38,9 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.core.Diagram;
-import net.sourceforge.plantuml.StringUtils;
public abstract class SingleLineCommand<S extends Diagram> implements Command<S> {
@@ -61,14 +61,15 @@ public abstract class SingleLineCommand<S extends Diagram> implements Command<S>
return new String[] { pattern.pattern() };
}
- final public CommandControl isValid(List<String> lines) {
+ final public CommandControl isValid(BlocLines lines) {
if (lines.size() != 1) {
return CommandControl.NOT_OK;
}
+ lines = lines.removeInnerComments();
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- final String line = lines.get(0).trim();
+ final String line = StringUtils.trin(lines.getFirst499());
final Matcher m = pattern.matcher(line);
final boolean result = m.find();
if (result) {
@@ -84,11 +85,12 @@ public abstract class SingleLineCommand<S extends Diagram> implements Command<S>
protected void actionIfCommandValid() {
}
- public final CommandExecutionResult execute(S system, List<String> lines) {
+ public final CommandExecutionResult execute(S system, BlocLines lines) {
if (lines.size() != 1) {
throw new IllegalArgumentException();
}
- final String line = lines.get(0).trim();
+ lines = lines.removeInnerComments();
+ final String line = StringUtils.trin(lines.getFirst499());
if (isForbidden(line)) {
return CommandExecutionResult.error("Forbidden line " + line);
}
diff --git a/src/net/sourceforge/plantuml/command/SingleLineCommand2.java b/src/net/sourceforge/plantuml/command/SingleLineCommand2.java
index 685d913..83ab056 100644
--- a/src/net/sourceforge/plantuml/command/SingleLineCommand2.java
+++ b/src/net/sourceforge/plantuml/command/SingleLineCommand2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,9 +34,8 @@
*/
package net.sourceforge.plantuml.command;
-import java.util.List;
-
import net.sourceforge.plantuml.PSystemError;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.core.Diagram;
@@ -60,14 +59,15 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
return new String[] { pattern.getPattern() };
}
- final public CommandControl isValid(List<String> lines) {
+ final public CommandControl isValid(BlocLines lines) {
if (lines.size() != 1) {
return CommandControl.NOT_OK;
}
+ lines = lines.removeInnerComments();
if (isCommandForbidden()) {
return CommandControl.NOT_OK;
}
- final String line = lines.get(0).trim();
+ final String line = StringUtils.trin(lines.getFirst499());
final boolean result = pattern.match(line);
if (result) {
actionIfCommandValid();
@@ -82,11 +82,12 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
protected void actionIfCommandValid() {
}
- public final CommandExecutionResult execute(S system, List<String> lines) {
+ public final CommandExecutionResult execute(S system, BlocLines lines) {
if (lines.size() != 1) {
throw new IllegalArgumentException();
}
- final String line = lines.get(0).trim();
+ lines = lines.removeInnerComments();
+ final String line = StringUtils.trin(lines.getFirst499());
if (isForbidden(line)) {
return CommandExecutionResult.error("Forbidden line " + line);
}
@@ -103,7 +104,7 @@ public abstract class SingleLineCommand2<S extends Diagram> implements Command<S
return executeArg(system, arg);
}
- protected boolean isForbidden(String line) {
+ protected boolean isForbidden(CharSequence line) {
return false;
}
diff --git a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
index 8cda6c5..5d3affb 100644
--- a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,10 +40,13 @@ import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.ErrorUml;
import net.sourceforge.plantuml.ErrorUmlType;
+import net.sourceforge.plantuml.NewpagedDiagram;
import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.PSystemError;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.command.CommandHideShow;
import net.sourceforge.plantuml.classdiagram.command.CommandHideShow3;
import net.sourceforge.plantuml.core.Diagram;
@@ -53,7 +56,7 @@ import net.sourceforge.plantuml.suggest.SuggestEngine;
import net.sourceforge.plantuml.suggest.SuggestEngineResult;
import net.sourceforge.plantuml.suggest.SuggestEngineStatus;
import net.sourceforge.plantuml.utils.StartUtils;
-import net.sourceforge.plantuml.version.IteratorCounter;
+import net.sourceforge.plantuml.version.IteratorCounter2;
public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
@@ -69,26 +72,25 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
}
final public Diagram createSystem(UmlSource source) {
- final IteratorCounter it = source.iterator();
- final String startLine = it.next();
+ final IteratorCounter2 it = source.iterator2();
+ final CharSequence2 startLine = it.next();
if (StartUtils.isArobaseStartDiagram(startLine) == false) {
throw new UnsupportedOperationException();
}
if (source.isEmpty()) {
- return buildEmptyError(source);
+ return buildEmptyError(source, startLine.getLocation());
}
AbstractPSystem sys = createEmptyDiagram();
while (it.hasNext()) {
- final String line = it.next();
- if (StartUtils.isArobaseEndDiagram(line)) {
+ if (StartUtils.isArobaseEndDiagram(it.peek())) {
final String err = checkFinalError(sys);
if (err != null) {
- return buildEmptyError(source, err);
+ return buildEmptyError(source, err, it.peek().getLocation());
}
if (source.getTotalLineCount() == 2) {
- return buildEmptyError(source);
+ return buildEmptyError(source, it.peek().getLocation());
}
if (sys == null) {
return null;
@@ -100,7 +102,7 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
sys.setSource(source);
return sys;
}
- sys = executeOneLine(sys, source, it, line);
+ sys = executeOneLine(sys, source, it);
if (sys instanceof PSystemError) {
return sys;
}
@@ -110,11 +112,11 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
}
- private AbstractPSystem executeOneLine(AbstractPSystem sys, UmlSource source, final IteratorCounter it,
- final String line) {
- final CommandControl commandControl = isValid(Arrays.asList(line));
+ private AbstractPSystem executeOneLine(AbstractPSystem sys, UmlSource source, final IteratorCounter2 it) {
+ final CommandControl commandControl = isValid2(it);
if (commandControl == CommandControl.NOT_OK) {
- final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", it.currentNum() - 1);
+ final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", it.currentNum(), it.peek()
+ .getLocation());
if (OptionFlags.getInstance().isUseSuggestEngine()) {
final SuggestEngine engine = new SuggestEngine(source, this);
final SuggestEngineResult result = engine.tryToSuggest(sys);
@@ -122,20 +124,23 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
err.setSuggest(result);
}
}
- sys = new PSystemError(source, err);
+ sys = new PSystemError(source, err, null);
} else if (commandControl == CommandControl.OK_PARTIAL) {
- final boolean ok = manageMultiline(sys, line, it);
- if (ok == false) {
- sys = new PSystemError(source, new ErrorUml(ErrorUmlType.EXECUTION_ERROR, "Syntax Error?",
- it.currentNum() - 1));
+ final IteratorCounter2 saved = it.cloneMe();
+ final CommandExecutionResult result = manageMultiline2(it, sys);
+ if (result.isOk() == false) {
+ sys = new PSystemError(source, new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
+ it.currentNum() - 1, saved.next().getLocation()), null);
}
} else if (commandControl == CommandControl.OK) {
- Command cmd = createCommand(Arrays.asList(line));
- final CommandExecutionResult result = sys.executeCommand(cmd, Arrays.asList(line));
+ final CharSequence line = it.next();
+ final BlocLines lines = BlocLines.single(line);
+ Command cmd = getFirstCommandOkForLines(lines);
+ final CommandExecutionResult result = sys.executeCommand(cmd, lines);
if (result.isOk() == false) {
sys = new PSystemError(source, new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(),
- it.currentNum() - 1));
+ it.currentNum() - 1, ((CharSequence2) line).getLocation()), result.getDebugLines());
}
if (result.getNewDiagram() != null) {
sys = result.getNewDiagram();
@@ -146,41 +151,78 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
return sys;
}
- private boolean manageMultiline(AbstractPSystem system, final String init, IteratorCounter it) {
- final List<String> lines = new ArrayList<String>();
- addOneSingleLineManageEmbedded(lines, init, it);
- while (it.hasNext()) {
- final String s = it.next();
- if (StartUtils.isArobaseEndDiagram(s)) {
- return false;
+ public CommandControl isValid2(final IteratorCounter2 it) {
+ final BlocLines lines = BlocLines.single(it.peek());
+ for (Command cmd : cmds) {
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.OK) {
+ return result;
}
- addOneSingleLineManageEmbedded(lines, s, it);
- final CommandControl commandControl = isValid(lines);
- if (commandControl == CommandControl.NOT_OK) {
- // throw new IllegalStateException();
- return false;
+ if (result == CommandControl.OK_PARTIAL && isMultilineCommandOk(it.cloneMe(), cmd) != null) {
+ return result;
}
- if (commandControl == CommandControl.OK) {
- final Command cmd = createCommand(lines);
- final CommandExecutionResult result = system.executeCommand(cmd, lines);
- return result.isOk();
+ }
+ return CommandControl.NOT_OK;
+ }
+
+ public CommandControl goForwardMultiline(final IteratorCounter2 it) {
+ final BlocLines lines = BlocLines.single(it.peek());
+ for (Command cmd : cmds) {
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.OK) {
+ throw new IllegalStateException();
+ }
+ if (result == CommandControl.OK_PARTIAL && isMultilineCommandOk(it, cmd) != null) {
+ return result;
}
}
- return false;
+ return CommandControl.NOT_OK;
+ // throw new IllegalStateException();
+ }
+ private CommandExecutionResult manageMultiline2(IteratorCounter2 it, AbstractPSystem system) {
+ for (Command cmd : cmds) {
+ if (isMultilineCommandOk(it.cloneMe(), cmd) != null) {
+ final BlocLines lines = isMultilineCommandOk(it, cmd);
+ if (system instanceof NewpagedDiagram) {
+ final NewpagedDiagram newpagedDiagram = (NewpagedDiagram) system;
+ return cmd.execute(newpagedDiagram.getLastDiagram(), lines);
+
+ }
+ return cmd.execute(system, lines);
+ }
+ }
+ return CommandExecutionResult.ok();
+ }
+
+ private BlocLines isMultilineCommandOk(IteratorCounter2 it, Command cmd) {
+ BlocLines lines = new BlocLines();
+ while (it.hasNext()) {
+ lines = addOneSingleLineManageEmbedded2(it, lines);
+ final CommandControl result = cmd.isValid(lines);
+ if (result == CommandControl.NOT_OK) {
+ return null;
+ }
+ if (result == CommandControl.OK) {
+ return lines;
+ }
+ }
+ return null;
}
- private void addOneSingleLineManageEmbedded(final List<String> lines, final String linetoBeAdded, IteratorCounter it) {
- lines.add(linetoBeAdded);
- if (linetoBeAdded.trim().equals("{{")) {
+ private BlocLines addOneSingleLineManageEmbedded2(IteratorCounter2 it, BlocLines lines) {
+ final CharSequence linetoBeAdded = it.next();
+ lines = lines.add2(linetoBeAdded);
+ if (StringUtils.trinNoTrace(linetoBeAdded).equals("{{")) {
while (it.hasNext()) {
- final String s = it.next();
- lines.add(s);
- if (s.trim().equals("}}")) {
- return;
+ final CharSequence s = it.next();
+ lines = lines.add2(s);
+ if (StringUtils.trinNoTrace(s).equals("}}")) {
+ return lines;
}
}
}
+ return lines;
}
// -----------------------------------
@@ -189,10 +231,13 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
return null;
}
- final public CommandControl isValid(List<String> lines) {
+ final public CommandControl isValid(BlocLines lines) {
for (Command cmd : cmds) {
final CommandControl result = cmd.isValid(lines);
- if (result == CommandControl.OK || result == CommandControl.OK_PARTIAL) {
+ if (result == CommandControl.OK) {
+ return result;
+ }
+ if (result == CommandControl.OK_PARTIAL) {
return result;
}
}
@@ -200,13 +245,11 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
}
- final public Command createCommand(List<String> lines) {
+ private Command getFirstCommandOkForLines(BlocLines lines) {
for (Command cmd : cmds) {
final CommandControl result = cmd.isValid(lines);
if (result == CommandControl.OK) {
return cmd;
- } else if (result == CommandControl.OK_PARTIAL) {
- throw new IllegalArgumentException();
}
}
throw new IllegalArgumentException();
@@ -222,6 +265,7 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
cmds.add(new CommandMultilinesComment());
cmds.add(new CommandPragma());
cmds.add(new CommandTitle());
+ cmds.add(new CommandCaption());
cmds.add(new CommandMultilinesTitle());
cmds.add(new CommandMultilinesLegend());
@@ -238,18 +282,20 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
cmds.add(new CommandScale());
cmds.add(new CommandScaleWidthAndHeight());
cmds.add(new CommandScaleWidthOrHeight());
+ cmds.add(new CommandScaleMaxWidth());
+ cmds.add(new CommandScaleMaxHeight());
+ cmds.add(new CommandScaleMaxWidthAndHeight());
cmds.add(new CommandAffineTransform());
cmds.add(new CommandAffineTransformMultiline());
cmds.add(new CommandHideUnlinked());
final FactorySpriteCommand factorySpriteCommand = new FactorySpriteCommand();
- cmds.add(factorySpriteCommand.createMultiLine());
+ cmds.add(factorySpriteCommand.createMultiLine(false));
cmds.add(factorySpriteCommand.createSingleLine());
cmds.add(new CommandSpriteFile());
-
+
cmds.add(new CommandHideShow3());
cmds.add(new CommandHideShow());
-
}
final public List<String> getDescription() {
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java
index a004c68..a330440 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteActivityCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,12 +34,12 @@
*/
package net.sourceforge.plantuml.command.note;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -55,42 +55,45 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.utils.UniqueSequence;
public final class FactoryNoteActivityCommand implements SingleMultiFactoryCommand<ActivityDiagram> {
private RegexConcat getRegexConcatMultiLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left|top|bottom)[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("$"));
}
private RegexConcat getRegexConcatSingleLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left|top|bottom)[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("[%s]*:[%s]*"), //
new RegexLeaf("NOTE", "(.*)"), //
new RegexLeaf("$"));
}
- public Command<ActivityDiagram> createMultiLine() {
+ public Command<ActivityDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<ActivityDiagram>(getRegexConcatMultiLine(),
MultilinesStrategy.KEEP_STARTING_QUOTE) {
@Override
public String getPatternEnd() {
- return "(?i)^end[%s]?note$";
+ return "(?i)^[%s]*end[%s]?note$";
}
- public final CommandExecutionResult executeNow(final ActivityDiagram system, List<String> lines) {
+ public final CommandExecutionResult executeNow(final ActivityDiagram system, BlocLines lines) {
// StringUtils.trim(lines, true);
- final RegexResult arg = getStartingPattern().matcher(lines.get(0).trim());
- Display strings = Display.create(StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1)));
+ final RegexResult arg = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+
+ Display strings = lines.toDisplay();
Url url = null;
if (strings.size() > 0) {
@@ -127,7 +130,7 @@ public final class FactoryNoteActivityCommand implements SingleMultiFactoryComma
private CommandExecutionResult executeInternal(ActivityDiagram diagram, RegexResult arg, IEntity note) {
- note.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ note.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
IEntity activity = diagram.getLastEntityConsulted();
if (activity == null) {
@@ -142,13 +145,13 @@ public final class FactoryNoteActivityCommand implements SingleMultiFactoryComma
final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
if (position == Position.RIGHT) {
- link = new Link(activity, note, type, null, 1);
+ link = new Link(activity, note, type, Display.NULL, 1);
} else if (position == Position.LEFT) {
- link = new Link(note, activity, type, null, 1);
+ link = new Link(note, activity, type, Display.NULL, 1);
} else if (position == Position.BOTTOM) {
- link = new Link(activity, note, type, null, 2);
+ link = new Link(activity, note, type, Display.NULL, 2);
} else if (position == Position.TOP) {
- link = new Link(note, activity, type, null, 2);
+ link = new Link(note, activity, type, Display.NULL, 2);
} else {
throw new IllegalArgumentException();
}
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java
index 32964b3..35f4eb7 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,9 +34,9 @@
*/
package net.sourceforge.plantuml.command.note;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -46,29 +46,27 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Code;
-import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public final class FactoryNoteCommand implements SingleMultiFactoryCommand<AbstractEntityDiagram> {
private RegexConcat getRegexConcatMultiLine() {
- return new RegexConcat(new RegexLeaf("^(note)[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*(note)[%s]+"), //
new RegexLeaf("CODE", "as[%s]+([\\p{L}0-9_.]+)"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$") //
);
}
private RegexConcat getRegexConcatSingleLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("DISPLAY", "[%g]([^%g]+)[%g][%s]+as[%s]+"), //
new RegexLeaf("CODE", "([\\p{L}0-9_.]+)[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$") //
);
@@ -80,41 +78,39 @@ public final class FactoryNoteCommand implements SingleMultiFactoryCommand<Abstr
@Override
protected CommandExecutionResult executeArg(final AbstractEntityDiagram system, RegexResult arg) {
final String display = arg.get("DISPLAY", 0);
- return executeInternal(system, arg, StringUtils.getWithNewlines2(display));
+ return executeInternal(system, arg, BlocLines.getWithNewlines(display));
}
};
}
- public Command<AbstractEntityDiagram> createMultiLine() {
+ public Command<AbstractEntityDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<AbstractEntityDiagram>(getRegexConcatMultiLine(),
MultilinesStrategy.KEEP_STARTING_QUOTE) {
@Override
public String getPatternEnd() {
- return "(?i)^end[%s]?note$";
+ return "(?i)^[%s]*end[%s]?note$";
}
- public CommandExecutionResult executeNow(final AbstractEntityDiagram system, List<String> lines) {
+ public CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
// StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
-
- final List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
-
- return executeInternal(system, line0, strings);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ return executeInternal(system, line0, lines);
}
};
}
- private CommandExecutionResult executeInternal(AbstractEntityDiagram diagram, RegexResult arg,
- final List<? extends CharSequence> display) {
+ private CommandExecutionResult executeInternal(AbstractEntityDiagram diagram, RegexResult arg, BlocLines display) {
final Code code = Code.of(arg.get("CODE", 0));
if (diagram.leafExist(code)) {
return CommandExecutionResult.error("Note already created: " + code.getFullName());
}
- final IEntity entity = diagram.createLeaf(code, Display.create(display), LeafType.NOTE, null);
+ final IEntity entity = diagram.createLeaf(code, display.toDisplay(), LeafType.NOTE, null);
assert entity != null;
- entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java
index c2d34ea..d9aa5bd 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnEntityCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,12 +34,12 @@
*/
package net.sourceforge.plantuml.command.note;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -58,41 +58,49 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.utils.UniqueSequence;
public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryCommand<AbstractEntityDiagram> {
private final IRegex partialPattern;
- public FactoryNoteOnEntityCommand(IRegex partialPattern) {
+ // private final boolean withBracket;
+
+ public FactoryNoteOnEntityCommand(IRegex partialPattern/* , boolean withBracket */) {
this.partialPattern = partialPattern;
+ // this.withBracket = withBracket;
}
private RegexConcat getRegexConcatSingleLine(IRegex partialPattern) {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left|top|bottom)"), //
new RegexOr(//
new RegexConcat(new RegexLeaf("[%s]+of[%s]+"), partialPattern), //
new RegexLeaf("")), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*:[%s]*"), //
new RegexLeaf("NOTE", "(.*)"), //
new RegexLeaf("$") //
);
}
- private RegexConcat getRegexConcatMultiLine(IRegex partialPattern) {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
+ private RegexConcat getRegexConcatMultiLine(IRegex partialPattern, final boolean withBracket) {
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left|top|bottom)"), //
new RegexOr(//
new RegexConcat(new RegexLeaf("[%s]+of[%s]+"), partialPattern), //
new RegexLeaf("")), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
- new RegexLeaf("[%s]*\\{?"), //
+ color().getRegex(), //
+ new RegexLeaf(withBracket ? "[%s]*\\{" : "[%s]*"), //
new RegexLeaf("$") //
);
}
@@ -103,42 +111,46 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
@Override
protected CommandExecutionResult executeArg(final AbstractEntityDiagram system, RegexResult arg) {
final String s = arg.get("NOTE", 0);
- return executeInternal(arg, system, null, StringUtils.getWithNewlines2(s));
+ return executeInternal(arg, system, null, BlocLines.getWithNewlines(s));
}
};
}
- public Command<AbstractEntityDiagram> createMultiLine() {
- return new CommandMultilines2<AbstractEntityDiagram>(getRegexConcatMultiLine(partialPattern),
+ public Command<AbstractEntityDiagram> createMultiLine(final boolean withBracket) {
+ return new CommandMultilines2<AbstractEntityDiagram>(getRegexConcatMultiLine(partialPattern, withBracket),
MultilinesStrategy.KEEP_STARTING_QUOTE) {
@Override
public String getPatternEnd() {
- return "(?i)^(end[%s]?note|\\})$";
+ if (withBracket) {
+ return "(?i)^(\\})$";
+ }
+ return "(?i)^[%s]*(end[%s]?note)$";
}
- public CommandExecutionResult executeNow(final AbstractEntityDiagram system, List<String> lines) {
+ public CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
// StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
- List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
Url url = null;
- if (strings.size() > 0) {
+ if (lines.size() > 0) {
final UrlBuilder urlBuilder = new UrlBuilder(system.getSkinParam().getValue("topurl"),
ModeUrl.STRICT);
- url = urlBuilder.getUrl(strings.get(0));
+ url = urlBuilder.getUrl(lines.getFirst499().toString());
}
if (url != null) {
- strings = strings.subList(1, strings.size());
+ lines = lines.subExtract(1, 0);
}
- return executeInternal(line0, system, url, strings);
+ return executeInternal(line0, system, url, lines);
}
};
}
private CommandExecutionResult executeInternal(RegexResult line0, AbstractEntityDiagram diagram, Url url,
- List<? extends CharSequence> s) {
+ BlocLines strings) {
final String pos = line0.get("POSITION", 0);
@@ -149,30 +161,36 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
if (cl1 == null) {
return CommandExecutionResult.error("Nothing to note to");
}
+ } else if (diagram.isGroup(code)) {
+ cl1 = diagram.getGroup(code);
} else {
cl1 = diagram.getOrCreateLeaf(code, null, null);
}
- final IEntity note = diagram.createLeaf(UniqueSequence.getCode("GMN"), Display.create(s), LeafType.NOTE, null);
- note.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
+ final IEntity note = diagram
+ .createLeaf(UniqueSequence.getCode("GMN"), strings.toDisplay(), LeafType.NOTE, null);
+
+ final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
+ note.setColors(colors);
if (url != null) {
note.addUrl(url);
}
- final Position position = Position.valueOf(StringUtils.goUpperCase(pos)).withRankdir(diagram.getSkinParam().getRankdir());
+ final Position position = Position.valueOf(StringUtils.goUpperCase(pos)).withRankdir(
+ diagram.getSkinParam().getRankdir());
final Link link;
final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
if (position == Position.RIGHT) {
- link = new Link(cl1, note, type, null, 1);
+ link = new Link(cl1, note, type, Display.NULL, 1);
link.setHorizontalSolitary(true);
} else if (position == Position.LEFT) {
- link = new Link(note, cl1, type, null, 1);
+ link = new Link(note, cl1, type, Display.NULL, 1);
link.setHorizontalSolitary(true);
} else if (position == Position.BOTTOM) {
- link = new Link(cl1, note, type, null, 2);
+ link = new Link(cl1, note, type, Display.NULL, 2);
} else if (position == Position.TOP) {
- link = new Link(note, cl1, type, null, 2);
+ link = new Link(note, cl1, type, Display.NULL, 2);
} else {
throw new IllegalArgumentException();
}
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java
index f1fabe5..f078cfe 100644
--- a/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/FactoryNoteOnLinkCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,11 +34,11 @@
*/
package net.sourceforge.plantuml.command.note;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -49,44 +49,50 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
-import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Link;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public final class FactoryNoteOnLinkCommand implements SingleMultiFactoryCommand<CucaDiagram> {
private RegexConcat getRegexConcatSingleLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left|top|bottom)?[%s]*on[%s]+link"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*:[%s]*"), //
new RegexLeaf("NOTE", "(.*)"), //
new RegexLeaf("$"));
}
private RegexConcat getRegexConcatMultiLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left|top|bottom)?[%s]*on[%s]+link"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("$"));
}
- public Command<CucaDiagram> createMultiLine() {
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
+ public Command<CucaDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<CucaDiagram>(getRegexConcatMultiLine(), MultilinesStrategy.KEEP_STARTING_QUOTE) {
@Override
public String getPatternEnd() {
- return "(?i)^end[%s]?note$";
+ return "(?i)^[%s]*end[%s]?note$";
}
- public CommandExecutionResult executeNow(final CucaDiagram system, List<String> lines) {
- final List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
- if (strings.size() > 0) {
- final RegexResult arg = getStartingPattern().matcher(lines.get(0));
- return executeInternal(system, strings, arg);
+ public CommandExecutionResult executeNow(final CucaDiagram system, BlocLines lines) {
+ final String line0 = lines.getFirst499().toString();
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ if (lines.size() > 0) {
+ final RegexResult arg = getStartingPattern().matcher(line0);
+ return executeInternal(system, lines, arg);
}
return CommandExecutionResult.error("No note defined");
}
@@ -99,14 +105,13 @@ public final class FactoryNoteOnLinkCommand implements SingleMultiFactoryCommand
@Override
protected CommandExecutionResult executeArg(final CucaDiagram system, RegexResult arg) {
- final List<String> note = StringUtils.getWithNewlines2(arg.get("NOTE", 0));
+ final BlocLines note = BlocLines.getWithNewlines(arg.get("NOTE", 0));
return executeInternal(system, note, arg);
}
};
}
- private CommandExecutionResult executeInternal(CucaDiagram diagram, List<? extends CharSequence> note,
- final RegexResult arg) {
+ private CommandExecutionResult executeInternal(CucaDiagram diagram, BlocLines note, final RegexResult arg) {
final Link link = diagram.getLastLink();
if (link == null) {
return CommandExecutionResult.error("No link defined");
@@ -118,13 +123,13 @@ public final class FactoryNoteOnLinkCommand implements SingleMultiFactoryCommand
Url url = null;
if (note.size() > 0) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- url = urlBuilder.getUrl(note.get(0).toString());
+ url = urlBuilder.getUrl(note.getFirst499().toString());
}
if (url != null) {
- note = note.subList(1, note.size());
+ note = note.subExtract(1, 0);
}
- link.addNote(Display.create(note), position,
- diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ link.addNote(note.toDisplay(), position, colors);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java b/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java
new file mode 100644
index 0000000..b145934
--- /dev/null
+++ b/src/net/sourceforge/plantuml/command/note/FactoryTipOnEntityCommand.java
@@ -0,0 +1,178 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.command.note;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.UrlBuilder;
+import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
+import net.sourceforge.plantuml.command.BlocLines;
+import net.sourceforge.plantuml.command.Command;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.CommandMultilines2;
+import net.sourceforge.plantuml.command.MultilinesStrategy;
+import net.sourceforge.plantuml.command.Position;
+import net.sourceforge.plantuml.command.regex.IRegex;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.cucadiagram.Code;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.IEntity;
+import net.sourceforge.plantuml.cucadiagram.LeafType;
+import net.sourceforge.plantuml.cucadiagram.Link;
+import net.sourceforge.plantuml.cucadiagram.LinkDecor;
+import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+
+public final class FactoryTipOnEntityCommand implements SingleMultiFactoryCommand<AbstractEntityDiagram> {
+
+ private final IRegex partialPattern;
+
+ // private final boolean withBracket;
+
+ public FactoryTipOnEntityCommand(IRegex partialPattern/* , boolean withBracket */) {
+ this.partialPattern = partialPattern;
+ // this.withBracket = withBracket;
+ }
+
+ private RegexConcat getRegexConcatMultiLine(IRegex partialPattern, final boolean withBracket) {
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
+ new RegexLeaf("POSITION", "(right|left)"), //
+ new RegexLeaf("[%s]+of[%s]+"), partialPattern, //
+ new RegexLeaf("[%s]*"), //
+ ColorParser.exp1(), //
+ new RegexLeaf(withBracket ? "[%s]*\\{" : "[%s]*"), //
+ new RegexLeaf("$") //
+ );
+ }
+
+ public Command<AbstractEntityDiagram> createSingleLine() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Command<AbstractEntityDiagram> createMultiLine(final boolean withBracket) {
+ return new CommandMultilines2<AbstractEntityDiagram>(getRegexConcatMultiLine(partialPattern, withBracket),
+ MultilinesStrategy.KEEP_STARTING_QUOTE) {
+
+ @Override
+ public String getPatternEnd() {
+ if (withBracket) {
+ return "(?i)^(\\})$";
+ }
+ return "(?i)^[%s]*(end[%s]?note)$";
+ }
+
+ public CommandExecutionResult executeNow(final AbstractEntityDiagram system, BlocLines lines) {
+ // StringUtils.trim(lines, false);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+
+ Url url = null;
+ if (lines.size() > 0) {
+ final UrlBuilder urlBuilder = new UrlBuilder(system.getSkinParam().getValue("topurl"),
+ ModeUrl.STRICT);
+ url = urlBuilder.getUrl(lines.getFirst499().toString());
+ }
+ if (url != null) {
+ lines = lines.subExtract(1, 0);
+ }
+
+ return executeInternal(line0, system, url, lines);
+ }
+ };
+ }
+
+ private CommandExecutionResult executeInternal(RegexResult line0, AbstractEntityDiagram diagram, Url url,
+ BlocLines lines) {
+
+ final String pos = line0.get("POSITION", 0);
+
+ final Code code = Code.of(line0.get("ENTITY", 0));
+ final String member = line0.get("ENTITY", 1);
+ if (code == null) {
+ return CommandExecutionResult.error("Nothing to note to");
+ }
+ final IEntity cl1 = diagram.getOrCreateLeaf(code, null, null);
+ final Position position = Position.valueOf(StringUtils.goUpperCase(pos)).withRankdir(
+ diagram.getSkinParam().getRankdir());
+
+ final Code codeTip = code.addSuffix("$$$" + position.name());
+ IEntity tips = diagram.getLeafsget(codeTip);
+ if (tips == null) {
+ tips = diagram.getOrCreateLeaf(codeTip, LeafType.TIPS, null);
+ final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getInvisible();
+ final Link link;
+ if (position == Position.RIGHT) {
+ link = new Link(cl1, (IEntity) tips, type, Display.NULL, 1);
+ } else {
+ link = new Link((IEntity) tips, cl1, type, Display.NULL, 1);
+ }
+ diagram.addLink(link);
+ }
+ tips.putTip(member, lines.toDisplay());
+
+ // final IEntity note = diagram.createLeaf(UniqueSequence.getCode("GMN"), Display.create(s), LeafType.NOTE,
+ // null);
+ // note.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
+ // if (url != null) {
+ // note.addUrl(url);
+ // }
+ //
+ // final Position position = Position.valueOf(StringUtils.goUpperCase(pos)).withRankdir(
+ // diagram.getSkinParam().getRankdir());
+ // final Link link;
+ //
+ // final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
+ // if (position == Position.RIGHT) {
+ // link = new Link(cl1, note, type, null, 1);
+ // link.setHorizontalSolitary(true);
+ // } else if (position == Position.LEFT) {
+ // link = new Link(note, cl1, type, null, 1);
+ // link.setHorizontalSolitary(true);
+ // } else if (position == Position.BOTTOM) {
+ // link = new Link(cl1, note, type, null, 2);
+ // } else if (position == Position.TOP) {
+ // link = new Link(note, cl1, type, null, 2);
+ // } else {
+ // throw new IllegalArgumentException();
+ // }
+ // diagram.addLink(link);
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/command/note/SingleMultiFactoryCommand.java b/src/net/sourceforge/plantuml/command/note/SingleMultiFactoryCommand.java
index 69c0851..a31f119 100644
--- a/src/net/sourceforge/plantuml/command/note/SingleMultiFactoryCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/SingleMultiFactoryCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,6 @@ public interface SingleMultiFactoryCommand<D extends Diagram> {
public Command<D> createSingleLine();
- public Command<D> createMultiLine();
+ public Command<D> createMultiLine(boolean withBracket);
}
diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java
index af502ba..0fa77d3 100644
--- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,8 +34,10 @@
*/
package net.sourceforge.plantuml.command.note.sequence;
-import java.util.List;
-
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -45,15 +47,15 @@ import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteStyle;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-import net.sourceforge.plantuml.StringUtils;
public final class FactorySequenceNoteCommand implements SingleMultiFactoryCommand<SequenceDiagram> {
@@ -61,10 +63,13 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
return new RegexConcat(//
new RegexLeaf("^"), //
new RegexLeaf("VMERGE", "(/)?[%s]*"), //
- new RegexLeaf("STYLE", "(note|hnote|rnote)[%s]+"), //
+ new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("POSITION", "(right|left|over)[%s]+"), //
new RegexLeaf("PARTICIPANT", "(?:of[%s]+)?([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("$"));
}
@@ -72,16 +77,23 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
return new RegexConcat(//
new RegexLeaf("^"), //
new RegexLeaf("VMERGE", "(/)?[%s]*"), //
- new RegexLeaf("STYLE", "(note|hnote|rnote)[%s]+"), //
+ new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("POSITION", "(right|left|over)[%s]+"), //
new RegexLeaf("PARTICIPANT", "(?:of[%s])?([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*:[%s]*"), //
new RegexLeaf("NOTE", "(.*)"), //
new RegexLeaf("$"));
}
- public Command<SequenceDiagram> createMultiLine() {
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
+ public Command<SequenceDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<SequenceDiagram>(getRegexConcatMultiLine(),
MultilinesStrategy.KEEP_STARTING_QUOTE) {
@@ -90,10 +102,11 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
return "(?i)^end[%s]?(note|hnote|rnote)$";
}
- public CommandExecutionResult executeNow(final SequenceDiagram system, List<String> lines) {
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- final List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
- return executeInternal(system, line0, strings);
+ public CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ return executeInternal(system, line0, lines);
}
};
}
@@ -103,14 +116,13 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
@Override
protected CommandExecutionResult executeArg(final SequenceDiagram system, RegexResult arg) {
- final List<String> strings = StringUtils.getWithNewlines2(arg.get("NOTE", 0));
- return executeInternal(system, arg, strings);
+ return executeInternal(system, arg, BlocLines.getWithNewlines(arg.get("NOTE", 0)));
}
};
}
- private CommandExecutionResult executeInternal(SequenceDiagram diagram, RegexResult arg, final List<String> strings) {
+ private CommandExecutionResult executeInternal(SequenceDiagram diagram, RegexResult arg, BlocLines strings) {
final Participant p = diagram.getOrCreateParticipant(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("PARTICIPANT", 0)));
@@ -118,8 +130,16 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
if (strings.size() > 0) {
final boolean tryMerge = arg.get("VMERGE", 0) != null;
- final Note note = new Note(p, position, Display.create(strings));
- note.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ final Note note = new Note(p, position, strings.toDisplay());
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ final String stereotypeString = arg.get("STEREO", 0);
+ if (stereotypeString != null) {
+ final Stereotype stereotype = new Stereotype(stereotypeString);
+ note.setStereotype(stereotype);
+ colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE,
+ ColorParam.noteBackground, ColorParam.noteBorder);
+ }
+ note.setColors(colors);
note.setStyle(NoteStyle.getNoteStyle(arg.get("STYLE", 0)));
diagram.addNote(note, tryMerge);
}
diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java
index ea1cf43..4e4e9b7 100644
--- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,11 +34,11 @@
*/
package net.sourceforge.plantuml.command.note.sequence;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -48,27 +48,25 @@ import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-import net.sourceforge.plantuml.StringUtils;
public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFactoryCommand<SequenceDiagram> {
private RegexConcat getRegexConcatMultiLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left)[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
private RegexConcat getRegexConcatSingleLine() {
- return new RegexConcat(new RegexLeaf("^note[%s]+"), //
+ return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), //
new RegexLeaf("POSITION", "(right|left)[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("[%s]*:[%s]*"), //
new RegexLeaf("NOTE", "(.*)"), //
new RegexLeaf("$"));
@@ -79,48 +77,47 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
@Override
protected CommandExecutionResult executeArg(final SequenceDiagram system, RegexResult arg) {
- final List<String> strings = StringUtils.getWithNewlines2(arg.get("NOTE", 0));
- return executeInternal(system, arg, strings);
+ return executeInternal(system, arg, BlocLines.getWithNewlines(arg.get("NOTE", 0)));
}
};
}
- public Command<SequenceDiagram> createMultiLine() {
+ public Command<SequenceDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<SequenceDiagram>(getRegexConcatMultiLine(),
MultilinesStrategy.KEEP_STARTING_QUOTE) {
@Override
public String getPatternEnd() {
- return "(?i)^end[%s]?note$";
+ return "(?i)^[%s]*end[%s]?note$";
}
- public CommandExecutionResult executeNow(final SequenceDiagram system, List<String> lines) {
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- final List<String> in = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
-
- return executeInternal(system, line0, in);
+ public CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ return executeInternal(system, line0, lines);
}
};
}
- private CommandExecutionResult executeInternal(SequenceDiagram system, final RegexResult line0, List<String> in) {
+ private CommandExecutionResult executeInternal(SequenceDiagram system, final RegexResult line0, BlocLines lines) {
final EventWithDeactivate m = system.getLastEventWithDeactivate();
if (m instanceof AbstractMessage) {
final NotePosition position = NotePosition.valueOf(StringUtils.goUpperCase(line0.get("POSITION", 0)));
final Url url;
- if (in.size() > 0) {
+ if (lines.size() > 0) {
final UrlBuilder urlBuilder = new UrlBuilder(system.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
- url = urlBuilder.getUrl(in.get(0).toString());
+ url = urlBuilder.getUrl(lines.getFirst499().toString());
} else {
url = null;
}
if (url != null) {
- in = in.subList(1, in.size());
+ lines = lines.subExtract(1, 0);
}
- ((AbstractMessage) m).setNote(Display.create(in), position, line0.get("COLOR", 0), url);
+ ((AbstractMessage) m).setNote(lines.toDisplay(), position, line0.get("COLOR", 0), url);
}
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java
index dc1aa3d..d34d912 100644
--- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java
+++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOverSeveralCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,8 +34,8 @@
*/
package net.sourceforge.plantuml.command.note.sequence;
-import java.util.List;
-
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@@ -45,13 +45,13 @@ import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NoteStyle;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-import net.sourceforge.plantuml.StringUtils;
public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiFactoryCommand<SequenceDiagram> {
@@ -62,7 +62,7 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
new RegexLeaf("STYLE", "(note|hnote|rnote)[%s]+over[%s]+"), //
new RegexLeaf("P1", "([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*\\,[%s]*"), //
new RegexLeaf("P2", "([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("$") //
);
}
@@ -74,18 +74,23 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
new RegexLeaf("STYLE", "(note|hnote|rnote)[%s]+over[%s]+"), //
new RegexLeaf("P1", "([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*\\,[%s]*"), //
new RegexLeaf("P2", "([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*:[%s]*"), //
new RegexLeaf("NOTE", "(.*)"), //
new RegexLeaf("$"));
}
+
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
public Command<SequenceDiagram> createSingleLine() {
return new SingleLineCommand2<SequenceDiagram>(getRegexConcatSingleLine()) {
@Override
protected CommandExecutionResult executeArg(final SequenceDiagram system, RegexResult arg) {
- final List<String> strings = StringUtils.getWithNewlines2(arg.get("NOTE", 0));
+ final BlocLines strings = BlocLines.getWithNewlines(arg.get("NOTE", 0));
return executeInternal(system, arg, strings);
}
@@ -93,7 +98,7 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
};
}
- public Command<SequenceDiagram> createMultiLine() {
+ public Command<SequenceDiagram> createMultiLine(boolean withBracket) {
return new CommandMultilines2<SequenceDiagram>(getRegexConcatMultiLine(),
MultilinesStrategy.KEEP_STARTING_QUOTE) {
@@ -102,27 +107,28 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
return "(?i)^end[%s]?(note|hnote|rnote)$";
}
- public CommandExecutionResult executeNow(final SequenceDiagram system, List<String> lines) {
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
- final List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1));
-
- return executeInternal(system, line0, strings);
+ public CommandExecutionResult executeNow(final SequenceDiagram system, BlocLines lines) {
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ return executeInternal(system, line0, lines);
}
};
}
- private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0,
- final List<String> strings) {
+ private CommandExecutionResult executeInternal(SequenceDiagram diagram, final RegexResult line0, BlocLines lines) {
final Participant p1 = diagram.getOrCreateParticipant(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P1", 0)));
final Participant p2 = diagram.getOrCreateParticipant(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(line0.get("P2", 0)));
- if (strings.size() > 0) {
+ if (lines.size() > 0) {
final boolean tryMerge = line0.get("VMERGE", 0) != null;
- final Note note = new Note(p1, p2, Display.create(strings));
- note.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
+ final Note note = new Note(p1, p2, lines.toDisplay());
+ final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
+ note.setColors(colors);
+ // note.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
note.setStyle(NoteStyle.getNoteStyle(line0.get("STYLE", 0)));
diagram.addNote(note, tryMerge);
}
diff --git a/src/net/sourceforge/plantuml/command/regex/IRegex.java b/src/net/sourceforge/plantuml/command/regex/IRegex.java
index 788ea6f..717d3c5 100644
--- a/src/net/sourceforge/plantuml/command/regex/IRegex.java
+++ b/src/net/sourceforge/plantuml/command/regex/IRegex.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/MatcherIterator.java b/src/net/sourceforge/plantuml/command/regex/MatcherIterator.java
index 217994d..248600d 100644
--- a/src/net/sourceforge/plantuml/command/regex/MatcherIterator.java
+++ b/src/net/sourceforge/plantuml/command/regex/MatcherIterator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/MyPattern.java b/src/net/sourceforge/plantuml/command/regex/MyPattern.java
index 5edb14e..325a1fa 100644
--- a/src/net/sourceforge/plantuml/command/regex/MyPattern.java
+++ b/src/net/sourceforge/plantuml/command/regex/MyPattern.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -92,8 +92,16 @@ public abstract class MyPattern {
return p;
}
- public static boolean mtches(String input, String regex) {
+ // public static boolean mtches(String input, String regex) {
+ // return cmpile(regex).matcher(input).matches();
+ // }
+ //
+ public static boolean mtches(CharSequence input, String regex) {
return cmpile(regex).matcher(input).matches();
}
+ public static CharSequence removeAll(CharSequence src, String regex) {
+ return src.toString().replaceAll(transform(regex), "");
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexComposed.java b/src/net/sourceforge/plantuml/command/regex/RegexComposed.java
index 7ee181d..051abbf 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexComposed.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexComposed.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexConcat.java b/src/net/sourceforge/plantuml/command/regex/RegexConcat.java
index c122787..51ebfc9 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexConcat.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexConcat.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexLeaf.java b/src/net/sourceforge/plantuml/command/regex/RegexLeaf.java
index af196ff..b45bbe2 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexLeaf.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexLeaf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -55,6 +55,11 @@ public class RegexLeaf implements IRegex {
this.name = name;
}
+ @Override
+ public String toString() {
+ return super.toString() + " " + name + " " + pattern;
+ }
+
public String getName() {
return name;
}
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexOptional.java b/src/net/sourceforge/plantuml/command/regex/RegexOptional.java
index 801917f..7fef9d3 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexOptional.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexOptional.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexOr.java b/src/net/sourceforge/plantuml/command/regex/RegexOr.java
index 15fc139..94fcd4a 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexOr.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexOr.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexPartialMatch.java b/src/net/sourceforge/plantuml/command/regex/RegexPartialMatch.java
index e0a5725..cae96d9 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexPartialMatch.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexPartialMatch.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/command/regex/RegexResult.java b/src/net/sourceforge/plantuml/command/regex/RegexResult.java
index d3b3f8a..7f51519 100644
--- a/src/net/sourceforge/plantuml/command/regex/RegexResult.java
+++ b/src/net/sourceforge/plantuml/command/regex/RegexResult.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/compositediagram/CompositeDiagram.java b/src/net/sourceforge/plantuml/compositediagram/CompositeDiagram.java
index 064dfe4..07f7883 100644
--- a/src/net/sourceforge/plantuml/compositediagram/CompositeDiagram.java
+++ b/src/net/sourceforge/plantuml/compositediagram/CompositeDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java b/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java
index 3115e93..0af8220 100644
--- a/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java
index 20a89d2..a1652ed 100644
--- a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java
+++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreateBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java
index aa0214a..722a1f2 100644
--- a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java
+++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandEndPackageBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandEndPackageBlock.java
index 7fcd3af..e92f74d 100644
--- a/src/net/sourceforge/plantuml/compositediagram/command/CommandEndPackageBlock.java
+++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandEndPackageBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java
index f492f6c..0971dbf 100644
--- a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java
+++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/core/Diagram.java b/src/net/sourceforge/plantuml/core/Diagram.java
index 95193cf..eabe59f 100644
--- a/src/net/sourceforge/plantuml/core/Diagram.java
+++ b/src/net/sourceforge/plantuml/core/Diagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/core/DiagramDescription.java b/src/net/sourceforge/plantuml/core/DiagramDescription.java
index 0cc6f6b..9284d1c 100644
--- a/src/net/sourceforge/plantuml/core/DiagramDescription.java
+++ b/src/net/sourceforge/plantuml/core/DiagramDescription.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/core/DiagramDescriptionImpl.java b/src/net/sourceforge/plantuml/core/DiagramDescriptionImpl.java
index d8715d8..a8f52d5 100644
--- a/src/net/sourceforge/plantuml/core/DiagramDescriptionImpl.java
+++ b/src/net/sourceforge/plantuml/core/DiagramDescriptionImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/core/DiagramType.java b/src/net/sourceforge/plantuml/core/DiagramType.java
index 73a2c57..f30460d 100644
--- a/src/net/sourceforge/plantuml/core/DiagramType.java
+++ b/src/net/sourceforge/plantuml/core/DiagramType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ public enum DiagramType {
UML, DITAA, DOT, PROJECT, JCCKIT, SALT, TURING, FLOW, CREOLE, JUNGLE, CUTE, UNKNOWN;
static public DiagramType getTypeFromArobaseStart(String s) {
+ s = s.toLowerCase();
// if (s.startsWith("@startuml2")) {
// return UML2;
// }
diff --git a/src/net/sourceforge/plantuml/core/ImageData.java b/src/net/sourceforge/plantuml/core/ImageData.java
index c9ffc25..bc1ac3f 100644
--- a/src/net/sourceforge/plantuml/core/ImageData.java
+++ b/src/net/sourceforge/plantuml/core/ImageData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/core/UmlSource.java b/src/net/sourceforge/plantuml/core/UmlSource.java
index 9bbc7ea..21eb592 100644
--- a/src/net/sourceforge/plantuml/core/UmlSource.java
+++ b/src/net/sourceforge/plantuml/core/UmlSource.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,16 +40,18 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.utils.StartUtils;
-import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.version.IteratorCounter;
-import net.sourceforge.plantuml.version.IteratorCounterImpl;
+import net.sourceforge.plantuml.version.IteratorCounter2;
+import net.sourceforge.plantuml.version.IteratorCounter2Impl;
/**
- * Represents the textual source of some diagram.
- * The source should start with a <code>@startfoo</code> and end with <code>@endfoo</code>.
+ * Represents the textual source of some diagram. The source should start with a <code>@startfoo</code> and end with
+ * <code>@endfoo</code>.
* <p>
* So the diagram does not have to be a UML one.
*
@@ -59,42 +61,45 @@ import net.sourceforge.plantuml.version.IteratorCounterImpl;
final public class UmlSource {
final private List<String> source;
+ final private List<CharSequence2> source2;
/**
* Build the source from a text.
*
- * @param source the source of the diagram
- * @param checkEndingBackslash <code>true</code> if an ending backslash means that a line has
- * to be collapsed with the following one.
+ * @param source
+ * the source of the diagram
+ * @param checkEndingBackslash
+ * <code>true</code> if an ending backslash means that a line has to be collapsed with the following one.
*/
- public UmlSource(List<? extends CharSequence> source, boolean checkEndingBackslash) {
+ public UmlSource(List<CharSequence2> source, boolean checkEndingBackslash) {
final List<String> tmp = new ArrayList<String>();
- // final DiagramType type =
- // DiagramType.getTypeFromArobaseStart(source.get(0).toString());
+ final List<CharSequence2> tmp2 = new ArrayList<CharSequence2>();
+
if (checkEndingBackslash) {
final StringBuilder pending = new StringBuilder();
- for (CharSequence cs : source) {
- final String s = cs.toString();
+ for (CharSequence2 cs : source) {
+ final String s = cs.toString2();
if (StringUtils.endsWithBackslash(s)) {
pending.append(s.substring(0, s.length() - 1));
} else {
pending.append(s);
tmp.add(pending.toString());
+ tmp2.add(new CharSequence2Impl(pending.toString(), cs.getLocation()));
pending.setLength(0);
}
}
} else {
- for (CharSequence s : source) {
- tmp.add(s.toString());
+ for (CharSequence2 s : source) {
+ tmp.add(s.toString2());
+ tmp2.add(s);
}
}
this.source = Collections.unmodifiableList(tmp);
+ this.source2 = Collections.unmodifiableList(tmp2);
}
-
/**
- * Retrieve the type of the diagram.
- * This is based on the first line <code>@startfoo</code>.
+ * Retrieve the type of the diagram. This is based on the first line <code>@startfoo</code>.
*
* @return the type of the diagram.
*/
@@ -107,8 +112,8 @@ final public class UmlSource {
*
* @return a iterator that allow counting line number.
*/
- public IteratorCounter iterator() {
- return new IteratorCounterImpl(source.iterator());
+ public IteratorCounter2 iterator2() {
+ return new IteratorCounter2Impl(source2);
}
/**
@@ -129,7 +134,8 @@ final public class UmlSource {
/**
* Return a specific line of the diagram description.
*
- * @param n line number, starting at 0
+ * @param n
+ * line number, starting at 0
* @return
*/
public String getLine(int n) {
@@ -146,8 +152,7 @@ final public class UmlSource {
}
/**
- * Check if a source diagram description is empty.
- * Does not take comment line into account.
+ * Check if a source diagram description is empty. Does not take comment line into account.
*
* @return <code>true<code> if the diagram does not contain information.
*/
@@ -162,7 +167,7 @@ final public class UmlSource {
if (s.matches("\\s*'.*")) {
continue;
}
- if (s.trim().length() != 0) {
+ if (StringUtils.trin(s).length() != 0) {
return false;
}
}
@@ -170,8 +175,8 @@ final public class UmlSource {
}
/**
- * Retrieve the title, if defined in the diagram source.
- * Never return <code>null</code>.
+ * Retrieve the title, if defined in the diagram source. Never return <code>null</code>.
+ *
* @return
*/
public Display getTitle() {
diff --git a/src/net/sourceforge/plantuml/creole/Atom.java b/src/net/sourceforge/plantuml/creole/Atom.java
index 8a5ea86..53c1a05 100644
--- a/src/net/sourceforge/plantuml/creole/Atom.java
+++ b/src/net/sourceforge/plantuml/creole/Atom.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -47,5 +47,5 @@ interface Atom extends UShape {
public double getStartingAltitude(StringBounder stringBounder);
public void drawU(UGraphic ug);
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java b/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java
index 83dcfa7..e4ec53a 100644
--- a/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java
+++ b/src/net/sourceforge/plantuml/creole/AtomEmbededSystem.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,7 @@ import java.util.List;
import javax.imageio.ImageIO;
import net.sourceforge.plantuml.BlockUml;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmbededDiagram;
import net.sourceforge.plantuml.FileFormat;
@@ -56,10 +57,10 @@ import net.sourceforge.plantuml.ugraphic.UShape;
class AtomEmbededSystem implements Atom {
- final private List<? extends CharSequence> lines;
+ final private List<CharSequence2> lines2;
public AtomEmbededSystem(EmbededDiagram sys) {
- this.lines = sys.getLines().as();
+ this.lines2 = sys.getLines().as2();
}
public double getStartingAltitude(StringBounder stringBounder) {
@@ -107,8 +108,8 @@ class AtomEmbededSystem implements Atom {
// }
//
private Diagram getSystem() throws IOException, InterruptedException {
- final BlockUml blockUml = new BlockUml(lines, 0);
+ final BlockUml blockUml = new BlockUml(lines2, 0);
return blockUml.getDiagram();
-
}
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomImg.java b/src/net/sourceforge/plantuml/creole/AtomImg.java
index 4e7c255..7ab4d2c 100644
--- a/src/net/sourceforge/plantuml/creole/AtomImg.java
+++ b/src/net/sourceforge/plantuml/creole/AtomImg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,8 +49,8 @@ import javax.imageio.ImageIO;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileSystem;
+import net.sourceforge.plantuml.code.Base64Coder;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.ImgValign;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -59,6 +59,7 @@ import net.sourceforge.plantuml.ugraphic.UImage;
public class AtomImg implements Atom {
+ private static final String DATA_IMAGE_PNG_BASE64 = "data:image/png;base64,";
private final BufferedImage image;
private AtomImg(BufferedImage image) {
@@ -67,18 +68,25 @@ public class AtomImg implements Atom {
public static Atom create(String src, final ImgValign valign, final int vspace) {
final UFont font = new UFont("Monospaced", Font.PLAIN, 14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ final FontConfiguration fc = FontConfiguration.blackBlueTrue(font);
+
+ if (src.startsWith(DATA_IMAGE_PNG_BASE64)) {
+ final String data = src.substring(DATA_IMAGE_PNG_BASE64.length(), src.length());
+ try {
+ final byte bytes[] = Base64Coder.decode(data);
+ return build(src, fc, bytes);
+ } catch (Exception e) {
+ return AtomText.create("ERROR " + e.toString(), fc);
+ }
+
+ }
try {
final File f = FileSystem.getInstance().getFile(src);
if (f.exists() == false) {
// Check if valid URL
if (src.startsWith("http:") || src.startsWith("https:")) {
final byte image[] = getFile(src);
- final BufferedImage read = ImageIO.read(new ByteArrayInputStream(image));
- if (read == null) {
- return AtomText.create("(Cannot decode: " + src + ")", fc);
- }
- return new AtomImg(read);
+ return build(src, fc, image);
}
return AtomText.create("(File not found: " + f + ")", fc);
}
@@ -96,6 +104,14 @@ public class AtomImg implements Atom {
}
}
+ private static Atom build(String source, final FontConfiguration fc, final byte[] data) throws IOException {
+ final BufferedImage read = ImageIO.read(new ByteArrayInputStream(data));
+ if (read == null) {
+ return AtomText.create("(Cannot decode: " + source + ")", fc);
+ }
+ return new AtomImg(read);
+ }
+
// Added by Alain Corbiere
static byte[] getFile(String host) throws IOException {
final ByteArrayOutputStream image = new ByteArrayOutputStream();
@@ -133,5 +149,6 @@ public class AtomImg implements Atom {
ug.draw(new UImage(image));
// tileImage.drawU(ug.apply(new UTranslate(0, -h)));
}
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java b/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
index 5c56544..6da9619 100644
--- a/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
+++ b/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -70,5 +70,5 @@ public class AtomOpenIcon implements Atom {
public void drawU(UGraphic ug) {
asTextBlock().drawU(ug);
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomSpace.java b/src/net/sourceforge/plantuml/creole/AtomSpace.java
index 76bb1bc..c03ea8c 100644
--- a/src/net/sourceforge/plantuml/creole/AtomSpace.java
+++ b/src/net/sourceforge/plantuml/creole/AtomSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/AtomSprite.java b/src/net/sourceforge/plantuml/creole/AtomSprite.java
index a8c2df2..eea5872 100644
--- a/src/net/sourceforge/plantuml/creole/AtomSprite.java
+++ b/src/net/sourceforge/plantuml/creole/AtomSprite.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -62,5 +62,5 @@ public class AtomSprite implements Atom {
public void drawU(UGraphic ug) {
sprite.drawU(ug);
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomTable.java b/src/net/sourceforge/plantuml/creole/AtomTable.java
index 468b7e8..16fdf79 100644
--- a/src/net/sourceforge/plantuml/creole/AtomTable.java
+++ b/src/net/sourceforge/plantuml/creole/AtomTable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,18 +43,27 @@ import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
+import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class AtomTable implements Atom {
class Line {
private final List<Atom> cells = new ArrayList<Atom>();
+ private final List<HtmlColor> cellsBackColor = new ArrayList<HtmlColor>();
+ private final HtmlColor lineBackColor;
- public void add(Atom cell) {
+ private Line(HtmlColor lineBackColor) {
+ this.lineBackColor = lineBackColor;
+ }
+
+ public void add(Atom cell, HtmlColor cellBackColor) {
cells.add(cell);
+ cellsBackColor.add(cellBackColor);
}
public int size() {
@@ -88,8 +97,27 @@ public class AtomTable implements Atom {
public void drawU(UGraphic ug) {
initMap(ug.getStringBounder());
- for (Line line : lines) {
- for (Atom cell : line.cells) {
+ for (int i = 0; i < getNbLines(); i++) {
+ final Line line = lines.get(i);
+ if (line.lineBackColor != null) {
+ final double y1 = getStartingY(i);
+ final double y2 = getStartingY(i + 1);
+ final double x1 = getStartingX(0);
+ final double x2 = getStartingX(getNbCols());
+ ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(line.lineBackColor))
+ .apply(new UTranslate(x1, y1)).draw(new URectangle(x2 - x1, y2 - y1));
+ }
+ for (int j = 0; j < getNbCols(); j++) {
+ final Atom cell = line.cells.get(j);
+ final HtmlColor cellBackColor = line.cellsBackColor.get(j);
+ if (cellBackColor != null) {
+ final double y1 = getStartingY(i);
+ final double y2 = getStartingY(i + 1);
+ final double x1 = getStartingX(j);
+ final double x2 = getStartingX(j + 1);
+ ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(cellBackColor))
+ .apply(new UTranslate(x1, y1)).draw(new URectangle(x2 - x1, y2 - y1));
+ }
final Position pos = positions.get(cell);
cell.drawU(ug.apply(pos.getTranslate()));
}
@@ -164,7 +192,11 @@ public class AtomTable implements Atom {
private double getColWidth(int col) {
double result = 0;
for (int i = 0; i < getNbLines(); i++) {
- final double width = getPosition(i, col).getWidth();
+ final Position position = getPosition(i, col);
+ if (position == null) {
+ continue;
+ }
+ final double width = position.getWidth();
result = Math.max(result, width);
}
return result;
@@ -173,14 +205,24 @@ public class AtomTable implements Atom {
private double getLineHeight(int line) {
double result = 0;
for (int i = 0; i < getNbCols(); i++) {
- final double height = getPosition(line, i).getHeight();
+ final Position position = getPosition(line, i);
+ if (position == null) {
+ continue;
+ }
+ final double height = position.getHeight();
result = Math.max(result, height);
}
return result;
}
private Position getPosition(int line, int col) {
+ if (line >= lines.size()) {
+ return null;
+ }
final Line l = lines.get(line);
+ if (col >= l.cells.size()) {
+ return null;
+ }
final Atom atom = l.cells.get(col);
return positions.get(atom);
}
@@ -197,13 +239,12 @@ public class AtomTable implements Atom {
return lines.get(lines.size() - 1);
}
- public void addCell(Atom cell) {
- lastLine().add(cell);
+ public void addCell(Atom cell, HtmlColor cellBackColor) {
+ lastLine().add(cell, cellBackColor);
positions.clear();
}
- public void newLine() {
- lines.add(new Line());
+ public void newLine(HtmlColor lineBackColor) {
+ lines.add(new Line(lineBackColor));
}
-
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomText.java b/src/net/sourceforge/plantuml/creole/AtomText.java
index 02c998f..27147c8 100644
--- a/src/net/sourceforge/plantuml/creole/AtomText.java
+++ b/src/net/sourceforge/plantuml/creole/AtomText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -118,8 +118,9 @@ public class AtomText implements Atom {
private AtomText(String text, FontConfiguration style, Url url, DelayedDouble marginLeft, DelayedDouble marginRight) {
this.marginLeft = marginLeft;
this.marginRight = marginRight;
- //this.text = StringUtils.showComparatorCharacters(StringUtils.manageBackslash(text));
- this.text = StringUtils.showComparatorCharacters(CharHidder.unhide(text));
+ // this.text = StringUtils.showComparatorCharacters(StringUtils.manageBackslash(text));
+ this.text = StringUtils.manageTildeArobaseStart(StringUtils.manageUnicodeNotationUplus(StringUtils
+ .manageAmpDiese(StringUtils.showComparatorCharacters(CharHidder.unhide(text)))));
this.fontConfiguration = style;
this.url = url;
}
@@ -158,7 +159,15 @@ public class AtomText implements Atom {
}
private double getTabSize(StringBounder stringBounder) {
- return stringBounder.calculateDimension(fontConfiguration.getFont(), " ").getWidth();
+ return stringBounder.calculateDimension(fontConfiguration.getFont(), tabString()).getWidth();
+ }
+
+ private String tabString() {
+ final int nb = fontConfiguration.getTabSize();
+ if (nb >= 1 && nb < 7) {
+ return " ".substring(0, nb);
+ }
+ return " ";
}
public void drawU(UGraphic ug) {
@@ -247,4 +256,5 @@ public class AtomText implements Atom {
public final String getText() {
return text;
}
+
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomTree.java b/src/net/sourceforge/plantuml/creole/AtomTree.java
new file mode 100644
index 0000000..8cbdad6
--- /dev/null
+++ b/src/net/sourceforge/plantuml/creole/AtomTree.java
@@ -0,0 +1,103 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.creole;
+
+import java.awt.geom.Dimension2D;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.salt.element.Skeleton2;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class AtomTree implements Atom {
+
+ private final HtmlColor lineColor;
+ private final List<Atom> cells = new ArrayList<Atom>();
+ private final Map<Atom, Integer> levels = new HashMap<Atom, Integer>();
+ private final double margin = 2;
+
+ public AtomTree(HtmlColor lineColor) {
+ this.lineColor = lineColor;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final Skeleton2 skeleton = new Skeleton2();
+ double width = 0;
+ double height = 0;
+ for (Atom cell : cells) {
+ final Dimension2D dim = cell.calculateDimension(stringBounder);
+ height += dim.getHeight();
+ final int level = getLevel(cell);
+ width = Math.max(width, skeleton.getXEndForLevel(level) + margin + dim.getWidth());
+ }
+ return new Dimension2DDouble(width, height);
+ }
+
+ public double getStartingAltitude(StringBounder stringBounder) {
+ return 0;
+ }
+
+ public void drawU(final UGraphic ugInit) {
+ final Skeleton2 skeleton = new Skeleton2();
+ double y = 0;
+ UGraphic ug = ugInit;
+ for (Atom cell : cells) {
+ final int level = getLevel(cell);
+ cell.drawU(ug.apply(new UTranslate(margin + skeleton.getXEndForLevel(level), 0)));
+ final Dimension2D dim = cell.calculateDimension(ug.getStringBounder());
+ skeleton.add(level, y + dim.getHeight() / 2);
+ ug = ug.apply(new UTranslate(0, dim.getHeight()));
+ y += dim.getHeight();
+ }
+ skeleton.draw(ugInit.apply(new UChangeColor(this.lineColor)));
+ }
+
+ private int getLevel(Atom atom) {
+ return levels.get(atom);
+ }
+
+ public void addCell(Atom cell, int level) {
+ this.cells.add(cell);
+ this.levels.put(cell, level);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/creole/AtomWithMargin.java b/src/net/sourceforge/plantuml/creole/AtomWithMargin.java
index 9e4180f..06f8f80 100644
--- a/src/net/sourceforge/plantuml/creole/AtomWithMargin.java
+++ b/src/net/sourceforge/plantuml/creole/AtomWithMargin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -64,5 +64,5 @@ class AtomWithMargin implements Atom {
public void drawU(UGraphic ug) {
atom.drawU(ug.apply(new UTranslate(0, marginY1)));
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/Bullet.java b/src/net/sourceforge/plantuml/creole/Bullet.java
index 76720f6..7163458 100644
--- a/src/net/sourceforge/plantuml/creole/Bullet.java
+++ b/src/net/sourceforge/plantuml/creole/Bullet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -105,6 +105,6 @@ public class Bullet implements Atom {
private Dimension2D calculateDimension1(StringBounder stringBounder) {
return new Dimension2DDouble(getWidth(stringBounder), 3);
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/Command.java b/src/net/sourceforge/plantuml/creole/Command.java
index f5e260d..dcab324 100644
--- a/src/net/sourceforge/plantuml/creole/Command.java
+++ b/src/net/sourceforge/plantuml/creole/Command.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java b/src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java
index 27c824a..ed5d1d3 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java b/src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java
index 106ce4e..7cbf7e1 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java b/src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java
index c221c4b..8939b31 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java b/src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java
index f633351..21d19ab 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java b/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
index c901bdc..71b1317 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.creole;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.graphic.Splitter;
@@ -65,14 +66,12 @@ public class CommandCreoleImg implements Command {
if (m.find() == false) {
throw new IllegalStateException();
}
- // final int size = Integer.parseInt(m.group(2));
- // final FontConfiguration fc1 = stripe.getActualFontConfiguration();
- // final FontConfiguration fc2 = fc1.changeSize(size);
- // stripe.setActualFontConfiguration(fc2);
- // stripe.analyzeAndAdd(m.group(3));
- final String src = m.group(2);
+ String src = m.group(2);
+ if (src.toLowerCase().startsWith("src=")) {
+ src = src.substring(4);
+ }
+ src = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(src, "\"");
stripe.addImage(src);
- // stripe.setActualFontConfiguration(fc1);
return line.substring(m.group(1).length());
}
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java b/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java
index 4c0b235..bbe81ee 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,14 +42,18 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
public class CommandCreoleMonospaced implements Command {
+ public static final String MONOSPACED = "monospaced";
+
private final Pattern pattern;
+ private final String monospacedFamily;
- public static Command create() {
- return new CommandCreoleMonospaced("^(?i)([%g][%g](.*?)[%g][%g])");
+ public static Command create(String monospacedFamily) {
+ return new CommandCreoleMonospaced("^(?i)([%g][%g](.*?)[%g][%g])", monospacedFamily);
}
- private CommandCreoleMonospaced(String p) {
+ private CommandCreoleMonospaced(String p, String monospacedFamily) {
this.pattern = MyPattern.cmpile(p);
+ this.monospacedFamily = monospacedFamily;
}
public int matchingSize(String line) {
@@ -66,7 +70,7 @@ public class CommandCreoleMonospaced implements Command {
throw new IllegalStateException();
}
final FontConfiguration fc1 = stripe.getActualFontConfiguration();
- final FontConfiguration fc2 = fc1.changeFamily("monospaced");
+ final FontConfiguration fc2 = fc1.changeFamily(monospacedFamily);
stripe.setActualFontConfiguration(fc2);
stripe.analyzeAndAdd(m.group(2));
stripe.setActualFontConfiguration(fc1);
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java b/src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java
index e27af9a..64a096f 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java b/src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java
index 7dadfaa..234dd1f 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java b/src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java
index 261e6ef..c2fa071 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java b/src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java
index 26b65ad..c3f043c 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java b/src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java
index 333a689..5c93928 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java b/src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java
index 6b7f146..9691c3c 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java b/src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java
index 23b0acc..e2bc658 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java
+++ b/src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CreoleContext.java b/src/net/sourceforge/plantuml/creole/CreoleContext.java
index c1f66de..1722b75 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleContext.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleContext.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java b/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java
index 730899d..f7204e4 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -79,7 +79,7 @@ public class CreoleHorizontalLine implements Atom {
if (line.length() == 0) {
return TextBlockUtils.empty(0, 0);
}
- final CreoleParser parser = new CreoleParser(fontConfiguration, HorizontalAlignment.LEFT, skinParam, false);
+ final CreoleParser parser = new CreoleParser(fontConfiguration, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL);
final Sheet sheet = parser.createSheet(Display.getWithNewlines(line));
final TextBlock tb = new SheetBlock1(sheet, 0, skinParam.getPadding());
return tb;
@@ -103,5 +103,5 @@ public class CreoleHorizontalLine implements Atom {
public double getStartingAltitude(StringBounder stringBounder) {
return 0;
}
-
+
}
diff --git a/src/net/sourceforge/plantuml/creole/CreoleMode.java b/src/net/sourceforge/plantuml/creole/CreoleMode.java
new file mode 100644
index 0000000..ec40717
--- /dev/null
+++ b/src/net/sourceforge/plantuml/creole/CreoleMode.java
@@ -0,0 +1,40 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.creole;
+
+public enum CreoleMode {
+ FULL, SIMPLE_LINE;
+
+}
diff --git a/src/net/sourceforge/plantuml/creole/CreoleParser.java b/src/net/sourceforge/plantuml/creole/CreoleParser.java
index 0e19af8..b48ca33 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleParser.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleParser.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.List;
import net.sourceforge.plantuml.EmbededDiagram;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -48,30 +49,53 @@ public class CreoleParser {
private final FontConfiguration fontConfiguration;
private final ISkinSimple skinParam;
private final HorizontalAlignment horizontalAlignment;
- private final boolean modeSimpleLine;
+ private final CreoleMode modeSimpleLine;
public CreoleParser(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
- ISkinSimple skinParam, boolean modeSimpleLine) {
+ ISkinSimple skinParam, CreoleMode modeSimpleLine) {
this.modeSimpleLine = modeSimpleLine;
this.fontConfiguration = fontConfiguration;
this.skinParam = skinParam;
+ if (skinParam == null) {
+ throw new IllegalArgumentException();
+ }
this.horizontalAlignment = horizontalAlignment;
}
private Stripe createStripe(String line, CreoleContext context, Stripe lastStripe) {
- if (lastStripe instanceof StripeTable && line.startsWith("|") && line.endsWith("|")) {
+ if (lastStripe instanceof StripeTable && isTableLine(line)) {
final StripeTable table = (StripeTable) lastStripe;
table.analyzeAndAddNormal(line);
return null;
- } else if (line.startsWith("|=") && line.endsWith("|")) {
+ } else if (lastStripe instanceof StripeTree && isTreeStart(StringUtils.trinNoTrace(line))) {
+ final StripeTree tree = (StripeTree) lastStripe;
+ tree.analyzeAndAdd(line);
+ return null;
+ } else if (isTableLine(line)) {
return new StripeTable(fontConfiguration, skinParam, line);
+ } else if (isTreeStart(line)) {
+ return new StripeTree(fontConfiguration, skinParam, line);
}
- return new CreoleStripeSimpleParser(line, context, fontConfiguration, skinParam, modeSimpleLine).createStripe(context);
+ return new CreoleStripeSimpleParser(line, context, fontConfiguration, skinParam, modeSimpleLine)
+ .createStripe(context);
+ }
+
+ private static boolean isTableLine(String line) {
+ return line.matches("^(\\<#\\w+\\>)?\\|(\\=)?.*\\|$");
+ }
+
+ public static boolean doesStartByColor(String line) {
+ return line.matches("^(\\<#\\w+\\>).*");
+ }
+
+ public static boolean isTreeStart(String line) {
+ // return false;
+ return line.startsWith("|_");
}
public Sheet createSheet(Display display) {
final Sheet sheet = new Sheet(horizontalAlignment);
- if (display != null) {
+ if (Display.isNull(display) == false) {
final CreoleContext context = new CreoleContext();
for (CharSequence cs : display) {
final Stripe stripe;
diff --git a/src/net/sourceforge/plantuml/creole/CreoleStripeSimpleParser.java b/src/net/sourceforge/plantuml/creole/CreoleStripeSimpleParser.java
index 569615b..d053404 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleStripeSimpleParser.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleStripeSimpleParser.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.utils.CharHidder;
@@ -46,16 +47,19 @@ public class CreoleStripeSimpleParser {
final private String line;
final private StripeStyle style;
- private final boolean modeSimpleLine;
+ private final CreoleMode modeSimpleLine;
private final FontConfiguration fontConfiguration;
private final ISkinSimple skinParam;
public CreoleStripeSimpleParser(String line, CreoleContext creoleContext, FontConfiguration fontConfiguration,
- ISkinSimple skinParam, boolean modeSimpleLine) {
+ ISkinSimple skinParam, CreoleMode modeSimpleLine) {
this.fontConfiguration = fontConfiguration;
this.modeSimpleLine = modeSimpleLine;
this.skinParam = skinParam;
+ if (skinParam == null) {
+ throw new IllegalArgumentException();
+ }
final Pattern p4 = MyPattern.cmpile("^--([^-]*)--$");
final Matcher m4 = p4.matcher(line);
@@ -80,15 +84,15 @@ public class CreoleStripeSimpleParser {
return;
}
- if (modeSimpleLine == false) {
- final Pattern p6 = MyPattern.cmpile("^__([^_]*)__$");
- final Matcher m6 = p6.matcher(line);
- if (m6.find()) {
- this.line = m6.group(1);
- this.style = new StripeStyle(StripeStyleType.HORIZONTAL_LINE, 0, '_');
- return;
- }
- }
+ // if (modeSimpleLine == CreoleMode.FULL) {
+ // final Pattern p6 = MyPattern.cmpile("^__([^_]*)__$");
+ // final Matcher m6 = p6.matcher(line);
+ // if (m6.find()) {
+ // this.line = m6.group(1);
+ // this.style = new StripeStyle(StripeStyleType.HORIZONTAL_LINE, 0, '_');
+ // return;
+ // }
+ // }
final Pattern p7 = MyPattern.cmpile("^\\.\\.([^\\.]*)\\.\\.$");
final Matcher m7 = p7.matcher(line);
@@ -98,22 +102,22 @@ public class CreoleStripeSimpleParser {
return;
}
- if (modeSimpleLine == false) {
+ if (modeSimpleLine == CreoleMode.FULL) {
final Pattern p1 = MyPattern.cmpile("^(\\*+)([^*]+(?:[^*]|\\*\\*[^*]+\\*\\*)*)$");
final Matcher m1 = p1.matcher(line);
if (m1.find()) {
- this.line = m1.group(2).trim();
+ this.line = StringUtils.trin(m1.group(2));
final int order = m1.group(1).length() - 1;
this.style = new StripeStyle(StripeStyleType.LIST_WITHOUT_NUMBER, order, '\0');
return;
}
}
- if (modeSimpleLine == false) {
+ if (modeSimpleLine == CreoleMode.FULL) {
final Pattern p2 = MyPattern.cmpile("^(#+)(.+)$");
final Matcher m2 = p2.matcher(CharHidder.hide(line));
if (m2.find()) {
- this.line = CharHidder.unhide(m2.group(2)).trim();
+ this.line = StringUtils.trin(CharHidder.unhide(m2.group(2)));
final int order = CharHidder.unhide(m2.group(1)).length() - 1;
this.style = new StripeStyle(StripeStyleType.LIST_WITH_NUMBER, order, '\0');
return;
@@ -123,7 +127,7 @@ public class CreoleStripeSimpleParser {
final Pattern p3 = MyPattern.cmpile("^(=+)(.+)$");
final Matcher m3 = p3.matcher(line);
if (m3.find()) {
- this.line = m3.group(2).trim();
+ this.line = StringUtils.trin(m3.group(2));
final int order = m3.group(1).length() - 1;
this.style = new StripeStyle(StripeStyleType.HEADING, order, '\0');
return;
diff --git a/src/net/sourceforge/plantuml/creole/Fission.java b/src/net/sourceforge/plantuml/creole/Fission.java
index d28d158..c4f3dad 100644
--- a/src/net/sourceforge/plantuml/creole/Fission.java
+++ b/src/net/sourceforge/plantuml/creole/Fission.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/PSystemCreole.java b/src/net/sourceforge/plantuml/creole/PSystemCreole.java
index a1c0535..1ccaffe 100644
--- a/src/net/sourceforge/plantuml/creole/PSystemCreole.java
+++ b/src/net/sourceforge/plantuml/creole/PSystemCreole.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -48,7 +48,6 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -71,15 +70,15 @@ public class PSystemCreole extends AbstractPSystem {
public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
final Display display = Display.create(lines);
final UFont font = new UFont("Serif", Font.PLAIN, 14);
- final FontConfiguration fontConfiguration = new FontConfiguration(font, HtmlColorUtils.BLACK,
- HtmlColorUtils.BLUE, true);
- final Sheet sheet = new CreoleParser(fontConfiguration, HorizontalAlignment.LEFT, null, false)
+ final FontConfiguration fontConfiguration = FontConfiguration.blackBlueTrue(font);
+ final Sheet sheet = new CreoleParser(fontConfiguration, HorizontalAlignment.LEFT, null, CreoleMode.FULL)
.createSheet(display);
final SheetBlock1 sheetBlock = new SheetBlock1(sheet, 0, 0);
- final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, null, null, null, 0, 0, null, false);
+ final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, null, null, null, 0, 0, null,
+ false);
builder.addUDrawable(sheetBlock);
- return builder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return builder.writeImageTOBEMOVED(fileFormat, os);
// final Dimension2D dim = TextBlockUtils.getDimension(sheetBlock);
// final UGraphic2 ug = fileFormat.createUGraphic(new ColorMapperIdentity(), 1, dim, null, false);
diff --git a/src/net/sourceforge/plantuml/creole/PSystemCreoleFactory.java b/src/net/sourceforge/plantuml/creole/PSystemCreoleFactory.java
index 3a81d1a..d86f596 100644
--- a/src/net/sourceforge/plantuml/creole/PSystemCreoleFactory.java
+++ b/src/net/sourceforge/plantuml/creole/PSystemCreoleFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/Position.java b/src/net/sourceforge/plantuml/creole/Position.java
index b9abc12..bd950ff 100644
--- a/src/net/sourceforge/plantuml/creole/Position.java
+++ b/src/net/sourceforge/plantuml/creole/Position.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/Sea.java b/src/net/sourceforge/plantuml/creole/Sea.java
index 3f452ad..898b181 100644
--- a/src/net/sourceforge/plantuml/creole/Sea.java
+++ b/src/net/sourceforge/plantuml/creole/Sea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/Sheet.java b/src/net/sourceforge/plantuml/creole/Sheet.java
index 93c29c9..37420ba 100644
--- a/src/net/sourceforge/plantuml/creole/Sheet.java
+++ b/src/net/sourceforge/plantuml/creole/Sheet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/SheetBlock1.java b/src/net/sourceforge/plantuml/creole/SheetBlock1.java
index 222cb15..71ee079 100644
--- a/src/net/sourceforge/plantuml/creole/SheetBlock1.java
+++ b/src/net/sourceforge/plantuml/creole/SheetBlock1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,12 +35,14 @@
package net.sourceforge.plantuml.creole;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -48,7 +50,7 @@ import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class SheetBlock1 implements TextBlock, Atom, Stencil {
+public class SheetBlock1 extends AbstractTextBlock implements TextBlock, Atom, Stencil {
private final Sheet sheet;
private List<Stripe> stripes;
@@ -129,6 +131,12 @@ public class SheetBlock1 implements TextBlock, Atom, Stencil {
initMap(stringBounder);
return Dimension2DDouble.delta(minMax.getDimension(), 2 * padding);
}
+
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ return null;
+ }
+
public void drawU(UGraphic ug) {
initMap(ug.getStringBounder());
@@ -155,4 +163,5 @@ public class SheetBlock1 implements TextBlock, Atom, Stencil {
public double getEndingX(StringBounder stringBounder, double y) {
return calculateDimension(stringBounder).getWidth();
}
+
}
diff --git a/src/net/sourceforge/plantuml/creole/SheetBlock2.java b/src/net/sourceforge/plantuml/creole/SheetBlock2.java
index 4db2090..0aba8a9 100644
--- a/src/net/sourceforge/plantuml/creole/SheetBlock2.java
+++ b/src/net/sourceforge/plantuml/creole/SheetBlock2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,14 +35,16 @@
package net.sourceforge.plantuml.creole;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public class SheetBlock2 implements TextBlock, Atom {
+public class SheetBlock2 extends AbstractTextBlock implements TextBlock, Atom {
private final SheetBlock1 block;
private final UStroke defaultStroke;
@@ -71,4 +73,10 @@ public class SheetBlock2 implements TextBlock, Atom {
public double getStartingAltitude(StringBounder stringBounder) {
return 0;
}
+
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ return block.getInnerPosition(member, stringBounder);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/creole/Stencil.java b/src/net/sourceforge/plantuml/creole/Stencil.java
index be1ee03..a332f7b 100644
--- a/src/net/sourceforge/plantuml/creole/Stencil.java
+++ b/src/net/sourceforge/plantuml/creole/Stencil.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/Stripe.java b/src/net/sourceforge/plantuml/creole/Stripe.java
index 04ac5d1..dfa9607 100644
--- a/src/net/sourceforge/plantuml/creole/Stripe.java
+++ b/src/net/sourceforge/plantuml/creole/Stripe.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/StripeSimple.java b/src/net/sourceforge/plantuml/creole/StripeSimple.java
index 468b05c..96db6b3 100644
--- a/src/net/sourceforge/plantuml/creole/StripeSimple.java
+++ b/src/net/sourceforge/plantuml/creole/StripeSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,13 +45,13 @@ import net.sourceforge.plantuml.graphic.FontPosition;
import net.sourceforge.plantuml.graphic.FontStyle;
import net.sourceforge.plantuml.graphic.ImgValign;
import net.sourceforge.plantuml.openiconic.OpenIcon;
-import net.sourceforge.plantuml.ugraphic.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
import net.sourceforge.plantuml.utils.CharHidder;
public class StripeSimple implements Stripe {
final private List<Atom> atoms = new ArrayList<Atom>();
- private final List<Command> commands = new ArrayList<Command>();
+ final private List<Command> commands = new ArrayList<Command>();
private FontConfiguration fontConfiguration;
@@ -59,7 +59,7 @@ public class StripeSimple implements Stripe {
final private ISkinSimple skinParam;
public StripeSimple(FontConfiguration fontConfiguration, StripeStyle style, CreoleContext context,
- ISkinSimple skinParam, boolean modeSimpleLine) {
+ ISkinSimple skinParam, CreoleMode modeSimpleLine) {
this.fontConfiguration = fontConfiguration;
this.style = style;
this.skinParam = skinParam;
@@ -71,7 +71,7 @@ public class StripeSimple implements Stripe {
this.commands.add(CommandCreoleStyle.createCreole(FontStyle.ITALIC));
this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.ITALIC));
this.commands.add(CommandCreoleStyle.createLegacyEol(FontStyle.ITALIC));
- if (modeSimpleLine == false) {
+ if (modeSimpleLine == CreoleMode.FULL) {
this.commands.add(CommandCreoleStyle.createCreole(FontStyle.UNDERLINE));
}
this.commands.add(CommandCreoleStyle.createLegacy(FontStyle.UNDERLINE));
@@ -98,7 +98,7 @@ public class StripeSimple implements Stripe {
this.commands.add(CommandCreoleSpace.create());
this.commands.add(CommandCreoleFontFamilyChange.create());
this.commands.add(CommandCreoleFontFamilyChange.createEol());
- this.commands.add(CommandCreoleMonospaced.create());
+ this.commands.add(CommandCreoleMonospaced.create(skinParam.getMonospacedFamily()));
this.commands.add(CommandCreoleUrl.create(skinParam));
this.commands.add(CommandCreoleSvgAttributeChange.create());
diff --git a/src/net/sourceforge/plantuml/creole/StripeStyle.java b/src/net/sourceforge/plantuml/creole/StripeStyle.java
index 0e422af..52cc596 100644
--- a/src/net/sourceforge/plantuml/creole/StripeStyle.java
+++ b/src/net/sourceforge/plantuml/creole/StripeStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/creole/StripeStyleType.java b/src/net/sourceforge/plantuml/creole/StripeStyleType.java
index c7f53b9..9e8953d 100644
--- a/src/net/sourceforge/plantuml/creole/StripeStyleType.java
+++ b/src/net/sourceforge/plantuml/creole/StripeStyleType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,5 +35,5 @@
package net.sourceforge.plantuml.creole;
public enum StripeStyleType {
- NORMAL, HEADING, LIST_WITHOUT_NUMBER, LIST_WITH_NUMBER, HORIZONTAL_LINE
+ NORMAL, HEADING, LIST_WITHOUT_NUMBER, LIST_WITH_NUMBER, HORIZONTAL_LINE, TREE
}
diff --git a/src/net/sourceforge/plantuml/creole/StripeTable.java b/src/net/sourceforge/plantuml/creole/StripeTable.java
index 9bb57b0..535217f 100644
--- a/src/net/sourceforge/plantuml/creole/StripeTable.java
+++ b/src/net/sourceforge/plantuml/creole/StripeTable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,7 @@ import java.util.StringTokenizer;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
public class StripeTable implements Stripe {
@@ -67,7 +68,7 @@ public class StripeTable implements Stripe {
return Collections.<Atom> singletonList(marged);
}
- private static Atom asAtom(List<StripeSimple> cells, double padding) {
+ static Atom asAtom(List<StripeSimple> cells, double padding) {
final Sheet sheet = new Sheet(HorizontalAlignment.LEFT);
for (StripeSimple cell : cells) {
sheet.add(cell);
@@ -75,10 +76,39 @@ public class StripeTable implements Stripe {
return new SheetBlock1(sheet, 0, padding);
}
+ private HtmlColor getBackColor(String line) {
+ if (CreoleParser.doesStartByColor(line)) {
+ final int idx1 = line.indexOf('#');
+ final int idx2 = line.indexOf('>');
+ if (idx2 == -1) {
+ throw new IllegalStateException();
+ }
+ final String color = line.substring(idx1, idx2);
+ return skinParam.getIHtmlColorSet().getColorIfValid(color);
+ }
+ return null;
+ }
+
+ private String withouBackColor(String line) {
+ final int idx2 = line.indexOf('>');
+ if (idx2 == -1) {
+ throw new IllegalStateException();
+ }
+ return line.substring(idx2 + 1);
+ }
+
private void analyzeAndAddInternal(String line, Mode mode) {
- table.newLine();
+ HtmlColor lineBackColor = getBackColor(line);
+ if (lineBackColor != null) {
+ line = withouBackColor(line);
+ }
+ table.newLine(lineBackColor);
for (final StringTokenizer st = new StringTokenizer(line, "|"); st.hasMoreTokens();) {
String v = st.nextToken();
+ HtmlColor cellBackColor = getBackColor(v);
+ if (cellBackColor != null) {
+ v = withouBackColor(v);
+ }
if (mode == Mode.HEADER && v.startsWith("=")) {
v = v.substring(1);
}
@@ -86,15 +116,15 @@ public class StripeTable implements Stripe {
final List<StripeSimple> cells = new ArrayList<StripeSimple>();
for (String s : lines) {
final StripeSimple cell = new StripeSimple(getFontConfiguration(mode), stripeStyle,
- new CreoleContext(), skinParam, false);
+ new CreoleContext(), skinParam, CreoleMode.FULL);
cell.analyzeAndAdd(s);
cells.add(cell);
}
- table.addCell(asAtom(cells, skinParam.getPadding()));
+ table.addCell(asAtom(cells, skinParam.getPadding()), cellBackColor);
}
}
- private static List<String> getWithNewlinesInternal(String s) {
+ static List<String> getWithNewlinesInternal(String s) {
final List<String> result = new ArrayList<String>();
final StringBuilder current = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
diff --git a/src/net/sourceforge/plantuml/creole/StripeTree.java b/src/net/sourceforge/plantuml/creole/StripeTree.java
new file mode 100644
index 0000000..d6aef95
--- /dev/null
+++ b/src/net/sourceforge/plantuml/creole/StripeTree.java
@@ -0,0 +1,77 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.creole;
+
+import java.util.Collections;
+import java.util.List;
+
+import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+
+public class StripeTree implements Stripe {
+
+ private FontConfiguration fontConfiguration;
+ final private ISkinSimple skinParam;
+ final private AtomTree tree;
+ final private Atom marged;
+ final private StripeStyle stripeStyle = new StripeStyle(StripeStyleType.TREE, 0, '\0');
+
+ public StripeTree(FontConfiguration fontConfiguration, ISkinSimple skinParam, String line) {
+ this.fontConfiguration = fontConfiguration;
+ this.skinParam = skinParam;
+ this.tree = new AtomTree(fontConfiguration.getColor());
+ this.marged = new AtomWithMargin(tree, 2, 2);
+ analyzeAndAdd(line);
+ }
+
+ public List<Atom> getAtoms() {
+ return Collections.<Atom> singletonList(marged);
+ }
+
+ public void analyzeAndAdd(String line) {
+ final List<String> lines = StripeTable.getWithNewlinesInternal(line);
+ for (String s : lines) {
+ final StripeSimple cell = new StripeSimple(fontConfiguration, stripeStyle, new CreoleContext(), skinParam,
+ CreoleMode.FULL);
+ // EMTEC
+ final String text = s.replaceFirst("^\\s*\\|_", "");
+ final int level = (s.length() - text.length()) / 2;
+ cell.analyzeAndAdd(text);
+ this.tree.addCell(StripeTable.asAtom(Collections.singletonList(cell), 0), level);
+ }
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/creole/UCreole.java b/src/net/sourceforge/plantuml/creole/UCreole.java
index 677052e..d19e106 100644
--- a/src/net/sourceforge/plantuml/creole/UCreole.java
+++ b/src/net/sourceforge/plantuml/creole/UCreole.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Bodier.java b/src/net/sourceforge/plantuml/cucadiagram/Bodier.java
index 2d3670d..54eb3cb 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Bodier.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Bodier.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,19 +41,28 @@ import java.util.Set;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.TextBlockVertical2;
import net.sourceforge.plantuml.skin.VisibilityModifier;
-import net.sourceforge.plantuml.StringUtils;
public class Bodier {
private final List<String> rawBody = new ArrayList<String>();
private final Set<VisibilityModifier> hides;
- private final LeafType type;
+ private LeafType type;
private List<Member> methodsToDisplay;
private List<Member> fieldsToDisplay;
private final boolean manageModifier;
+ public void muteClassToObject() {
+ methodsToDisplay = null;
+ fieldsToDisplay = null;
+ type = LeafType.OBJECT;
+ }
+
public Bodier(LeafType type, Set<VisibilityModifier> hides) {
this.hides = hides;
this.type = type;
@@ -67,7 +76,7 @@ public class Bodier {
rawBody.add(s);
}
- public boolean isBodyEnhanced() {
+ private boolean isBodyEnhanced() {
for (String s : rawBody) {
if (BodyEnhanced.isBlockSeparator(s)) {
return true;
@@ -76,24 +85,10 @@ public class Bodier {
return false;
}
- public BlockMember getBodyEnhanced() {
- return new BlockMember() {
- public TextBlock asTextBlock(FontParam fontParam, ISkinParam skinParam) {
- final BodyEnhanced result = new BodyEnhanced(rawBody, fontParam, skinParam, manageModifier);
- return result;
- }
- };
- }
-
- private LeafType getEntityType() {
- return type;
- }
-
private boolean isMethod(String s) {
- if (getEntityType() == LeafType.ANNOTATION || getEntityType() == LeafType.ABSTRACT_CLASS
- || getEntityType() == LeafType.CLASS || getEntityType() == LeafType.INTERFACE
- || getEntityType() == LeafType.ENUM) {
- return StringUtils.isMethod(s);
+ if (type == LeafType.ANNOTATION || type == LeafType.ABSTRACT_CLASS || type == LeafType.CLASS
+ || type == LeafType.INTERFACE || type == LeafType.ENUM) {
+ return MemberImpl.isMethod(s);
}
return false;
}
@@ -109,7 +104,7 @@ public class Bodier {
if (s.length() == 0 && methodsToDisplay.size() == 0) {
continue;
}
- final Member m = new Member(s, true, manageModifier);
+ final Member m = new MemberImpl(s, true, manageModifier, true);
if (hides == null || hides.contains(m.getVisibilityModifier()) == false) {
methodsToDisplay.add(m);
}
@@ -137,7 +132,7 @@ public class Bodier {
if (s.length() == 0 && fieldsToDisplay.size() == 0) {
continue;
}
- final Member m = new Member(s, false, manageModifier);
+ final Member m = new MemberImpl(s, false, manageModifier, true);
if (hides == null || hides.contains(m.getVisibilityModifier()) == false) {
fieldsToDisplay.add(m);
}
@@ -148,7 +143,7 @@ public class Bodier {
}
private void removeFinalEmptyMembers(List<Member> result) {
- while (result.size() > 0 && result.get(result.size() - 1).getDisplay(false).trim().length() == 0) {
+ while (result.size() > 0 && StringUtils.trin(result.get(result.size() - 1).getDisplay(false)).length() == 0) {
result.remove(result.size() - 1);
}
}
@@ -166,4 +161,34 @@ public class Bodier {
}
return true;
}
+
+ public TextBlock getBody(final FontParam fontParam, final ISkinParam skinParam, final boolean showMethods,
+ final boolean showFields) {
+ if (type.isLikeClass() && isBodyEnhanced()) {
+ if (showMethods || showFields) {
+ return new BodyEnhanced(rawBody, fontParam, skinParam, manageModifier);
+ }
+ return null;
+ }
+ final MethodsOrFieldsArea fields = new MethodsOrFieldsArea(getFieldsToDisplay(), fontParam, skinParam);
+ if (type == LeafType.OBJECT) {
+ return fields.asBlockMemberImpl();
+ }
+ if (type.isLikeClass() == false) {
+ throw new UnsupportedOperationException();
+ }
+ final MethodsOrFieldsArea methods = new MethodsOrFieldsArea(getMethodsToDisplay(), fontParam, skinParam);
+ if (showFields && showMethods == false) {
+ return fields.asBlockMemberImpl();
+ } else if (showMethods && showFields == false) {
+ return methods.asBlockMemberImpl();
+ } else if (showFields == false && showMethods == false) {
+ return TextBlockUtils.empty(0, 0);
+ }
+
+ final TextBlock bb1 = fields.asBlockMemberImpl();
+ final TextBlock bb2 = methods.asBlockMemberImpl();
+ return new TextBlockVertical2(bb1, bb2, HorizontalAlignment.LEFT);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java
index 1941f05..8678467 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,11 +38,16 @@ import java.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.ListIterator;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.creole.CreoleMode;
+import net.sourceforge.plantuml.creole.CreoleParser;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -52,9 +57,8 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockVertical2;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.StringUtils;
-public class BodyEnhanced implements TextBlock {
+public class BodyEnhanced extends AbstractTextBlock implements TextBlock {
private TextBlock area2;
private final FontConfiguration titleConfig;
@@ -66,14 +70,15 @@ public class BodyEnhanced implements TextBlock {
private final boolean manageHorizontalLine;
private final boolean manageModifier;
private final List<Url> urls = new ArrayList<Url>();
+ private final boolean manageUrl;
public BodyEnhanced(List<String> rawBody, FontParam fontParam, ISkinParam skinParam, boolean manageModifier) {
this.rawBody = new ArrayList<String>(rawBody);
this.fontParam = fontParam;
this.skinParam = skinParam;
+ this.manageUrl = true;
- this.titleConfig = new FontConfiguration(skinParam.getFont(fontParam, null, false), new Rose().getFontColor(skinParam,
- fontParam), skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
+ this.titleConfig = new FontConfiguration(skinParam, fontParam, null);
this.lineFirst = true;
this.align = HorizontalAlignment.LEFT;
this.manageHorizontalLine = true;
@@ -81,7 +86,8 @@ public class BodyEnhanced implements TextBlock {
}
public BodyEnhanced(Display display, FontParam fontParam, ISkinParam skinParam, HorizontalAlignment align,
- Stereotype stereotype, boolean manageHorizontalLine, boolean manageModifier) {
+ Stereotype stereotype, boolean manageHorizontalLine, boolean manageModifier, boolean manageUrl) {
+ this.manageUrl = manageUrl;
this.rawBody = new ArrayList<String>();
for (CharSequence s : display) {
this.rawBody.add(s.toString());
@@ -124,15 +130,26 @@ public class BodyEnhanced implements TextBlock {
char separator = lineFirst ? '_' : 0;
TextBlock title = null;
List<Member> members = new ArrayList<Member>();
- for (String s : rawBody) {
+ for (ListIterator<String> it = rawBody.listIterator(); it.hasNext();) {
+ final String s = it.next();
if (manageHorizontalLine && isBlockSeparator(s)) {
blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(members, fontParam, skinParam, align),
separator, title));
separator = s.charAt(0);
title = getTitle(s, skinParam);
members = new ArrayList<Member>();
+ } else if (CreoleParser.isTreeStart(s)) {
+ if (members.size() > 0) {
+ blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(members, fontParam, skinParam, align),
+ separator, title));
+ }
+ members = new ArrayList<Member>();
+ final List<String> allTree = buildAllTree(s, it);
+ final TextBlock bloc = Display.create(allTree).create(fontParam.getFontConfiguration(skinParam), align,
+ skinParam, CreoleMode.FULL);
+ blocks.add(bloc);
} else {
- final Member m = new Member(s, StringUtils.isMethod(s), manageModifier);
+ final Member m = new MemberImpl(s, MemberImpl.isMethod(s), manageModifier, manageUrl);
members.add(m);
if (m.getUrl() != null) {
urls.add(m.getUrl());
@@ -151,6 +168,22 @@ public class BodyEnhanced implements TextBlock {
return area2;
}
+ private static List<String> buildAllTree(String init, ListIterator<String> it) {
+ final List<String> result = new ArrayList<String>();
+ result.add(init);
+ while (it.hasNext()) {
+ final String s = it.next();
+ if (CreoleParser.isTreeStart(StringUtils.trinNoTrace(s))) {
+ result.add(s);
+ } else {
+ it.previous();
+ return result;
+ }
+
+ }
+ return result;
+ }
+
public static boolean isBlockSeparator(String s) {
if (s.startsWith("--") && s.endsWith("--")) {
return true;
@@ -171,9 +204,8 @@ public class BodyEnhanced implements TextBlock {
if (s.length() <= 4) {
return null;
}
- s = s.substring(2, s.length() - 2).trim();
- return TextBlockUtils
- .create(Display.getWithNewlines(s), titleConfig, HorizontalAlignment.LEFT, spriteContainer);
+ s = StringUtils.trin(s.substring(2, s.length() - 2));
+ return Display.getWithNewlines(s).create(titleConfig, HorizontalAlignment.LEFT, spriteContainer);
}
public void drawU(UGraphic ug) {
@@ -183,5 +215,4 @@ public class BodyEnhanced implements TextBlock {
public List<Url> getUrls() {
return Collections.unmodifiableList(urls);
}
-
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java
index 88ada3d..3904ca0 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,18 +40,18 @@ import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockVertical2;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class BodyEnhanced2 implements TextBlock {
+public class BodyEnhanced2 extends AbstractTextBlock implements TextBlock {
private TextBlock area2;
private final FontConfiguration titleConfig;
@@ -120,7 +120,7 @@ public class BodyEnhanced2 implements TextBlock {
}
private TextBlock getTextBlock(Display members2, StringBounder stringBounder) {
- final TextBlock result = TextBlockUtils.create(members2, titleConfig, align, spriteContainer);
+ final TextBlock result = members2.create(titleConfig, align, spriteContainer);
return result;
}
@@ -144,9 +144,8 @@ public class BodyEnhanced2 implements TextBlock {
if (s.length() <= 4) {
return null;
}
- s = s.substring(2, s.length() - 2).trim();
- return TextBlockUtils
- .create(Display.getWithNewlines(s), titleConfig, HorizontalAlignment.LEFT, spriteContainer);
+ s = StringUtils.trin(s.substring(2, s.length() - 2));
+ return Display.getWithNewlines(s).create(titleConfig, HorizontalAlignment.LEFT, spriteContainer);
}
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Code.java b/src/net/sourceforge/plantuml/cucadiagram/Code.java
index df20990..03b09d9 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Code.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Code.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
index 568debb..de3eed1 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -113,6 +113,9 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
result = createLeafInternal(code, Display.getWithNewlines(code), type, getCurrentGroup(), symbol);
result.setUSymbol(symbol);
}
+ if (result.getEntityType() == LeafType.CLASS && type == LeafType.OBJECT) {
+ result.muteToType(type, symbol);
+ }
this.lastEntity = result;
return result;
}
@@ -125,7 +128,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
}
final protected ILeaf createLeafInternal(Code code, Display display, LeafType type, IGroup group, USymbol symbol) {
- if (display == null) {
+ if (Display.isNull(display)) {
display = Display.getWithNewlines(code);
}
final ILeaf leaf = entityFactory.createLeaf(code, display, type, group, getHides(), getNamespaceSeparator());
@@ -155,8 +158,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
return g;
}
- private IGroup getOrCreateGroupInternal(Code code, Display display, Code namespace2, GroupType type,
- IGroup parent) {
+ private IGroup getOrCreateGroupInternal(Code code, Display display, Code namespace2, GroupType type, IGroup parent) {
IGroup result = entityFactory.getGroups().get(code);
if (result != null) {
return result;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Display.java b/src/net/sourceforge/plantuml/cucadiagram/Display.java
index 4fe93ca..b6bac58 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Display.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Display.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,35 +36,74 @@ package net.sourceforge.plantuml.cucadiagram;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
import net.sourceforge.plantuml.EmbededDiagram;
+import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.LineLocationImpl;
+import net.sourceforge.plantuml.SpriteContainer;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.creole.CreoleMode;
+import net.sourceforge.plantuml.creole.CreoleParser;
+import net.sourceforge.plantuml.creole.Sheet;
+import net.sourceforge.plantuml.creole.SheetBlock1;
+import net.sourceforge.plantuml.creole.SheetBlock2;
+import net.sourceforge.plantuml.graphic.CircledCharacter;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockSimple;
+import net.sourceforge.plantuml.graphic.TextBlockSpotted;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
+import net.sourceforge.plantuml.sequencediagram.MessageNumber;
+import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.UStroke;
public class Display implements Iterable<CharSequence> {
- private final List<CharSequence> display = new ArrayList<CharSequence>();
+ private final List<CharSequence> display;
private final HorizontalAlignment naturalHorizontalAlignment;
+ private final boolean isNull;
+ private final CreoleMode defaultCreoleMode;
+
+ // public void setDefaultCreoleMode(CreoleMode defaultCreoleMode) {
+ // this.defaultCreoleMode = defaultCreoleMode;
+ // }
+
+ public Display removeUrlHiddenNewLineUrl() {
+ final String full = UrlBuilder.purgeUrl(asStringWithHiddenNewLine());
+ return new Display(StringUtils.splitHiddenNewLine(full), this.naturalHorizontalAlignment, this.isNull,
+ this.defaultCreoleMode);
+ }
+
+ public final static Display NULL = new Display(null, null, true, CreoleMode.FULL);
public boolean isWhite() {
return display.size() == 0 || (display.size() == 1 && display.get(0).toString().matches("\\s*"));
}
public static Display empty() {
- return new Display((HorizontalAlignment) null);
+ return new Display((HorizontalAlignment) null, false, CreoleMode.FULL);
}
public static Display create(CharSequence... s) {
return create(Arrays.asList(s));
}
- public static Display create(List<? extends CharSequence> other) {
- return new Display(other, null);
+ public static Display create(Collection<? extends CharSequence> other) {
+ return new Display(other, null, false, CreoleMode.FULL);
}
public static Display getWithNewlines(Code s) {
@@ -73,7 +112,8 @@ public class Display implements Iterable<CharSequence> {
public static Display getWithNewlines(String s) {
if (s == null) {
- return null;
+ // Thread.dumpStack();
+ return NULL;
}
final List<String> result = new ArrayList<String>();
final StringBuilder current = new StringBuilder();
@@ -99,39 +139,48 @@ public class Display implements Iterable<CharSequence> {
current.append(c);
current.append(c2);
}
+ } else if (c == StringUtils.hiddenNewLine()) {
+ result.add(current.toString());
+ current.setLength(0);
} else {
current.append(c);
}
}
result.add(current.toString());
- return new Display(result, naturalHorizontalAlignment);
+ return new Display(result, naturalHorizontalAlignment, false, CreoleMode.FULL);
}
- private Display(Display other) {
- this(other.naturalHorizontalAlignment);
+ private Display(Display other, CreoleMode mode) {
+ this(other.naturalHorizontalAlignment, other.isNull, mode);
this.display.addAll(other.display);
}
- private Display(HorizontalAlignment naturalHorizontalAlignment) {
- this.naturalHorizontalAlignment = naturalHorizontalAlignment;
+ private Display(HorizontalAlignment naturalHorizontalAlignment, boolean isNull, CreoleMode defaultCreoleMode) {
+ this.defaultCreoleMode = defaultCreoleMode;
+ this.isNull = isNull;
+ this.display = isNull ? null : new ArrayList<CharSequence>();
+ this.naturalHorizontalAlignment = isNull ? null : naturalHorizontalAlignment;
}
- private Display(List<? extends CharSequence> other, HorizontalAlignment naturalHorizontalAlignment) {
- this(naturalHorizontalAlignment);
- this.display.addAll(manageEmbededDiagrams2(other));
+ private Display(Collection<? extends CharSequence> other, HorizontalAlignment naturalHorizontalAlignment,
+ boolean isNull, CreoleMode defaultCreoleMode) {
+ this(naturalHorizontalAlignment, isNull, defaultCreoleMode);
+ if (isNull == false) {
+ this.display.addAll(manageEmbededDiagrams2(other));
+ }
}
- private static List<CharSequence> manageEmbededDiagrams2(final List<? extends CharSequence> strings) {
+ private static List<CharSequence> manageEmbededDiagrams2(final Collection<? extends CharSequence> strings) {
final List<CharSequence> result = new ArrayList<CharSequence>();
final Iterator<? extends CharSequence> it = strings.iterator();
while (it.hasNext()) {
CharSequence s = it.next();
- if (s != null && s.toString().trim().equals("{{")) {
+ if (s != null && StringUtils.trin(s.toString()).equals("{{")) {
final List<CharSequence> other = new ArrayList<CharSequence>();
other.add("@startuml");
while (it.hasNext()) {
final CharSequence s2 = it.next();
- if (s2 != null && s2.toString().trim().equals("}}")) {
+ if (s2 != null && StringUtils.trin(s2.toString()).equals("}}")) {
break;
}
other.add(s2);
@@ -149,11 +198,32 @@ public class Display implements Iterable<CharSequence> {
for (CharSequence line : display) {
result.add("<u>" + line);
}
- return new Display(result, this.naturalHorizontalAlignment);
+ return new Display(result, this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
+ }
+
+ public Display withCreoleMode(CreoleMode mode) {
+ if (isNull) {
+ throw new IllegalArgumentException();
+ }
+ return new Display(this, mode);
+ }
+
+ public String asStringWithHiddenNewLine() {
+ final StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < display.size(); i++) {
+ sb.append(display.get(i));
+ if (i < display.size() - 1) {
+ sb.append(StringUtils.hiddenNewLine());
+ }
+ }
+ return sb.toString();
}
@Override
public String toString() {
+ if (isNull) {
+ return "NULL";
+ }
return display.toString();
}
@@ -168,55 +238,27 @@ public class Display implements Iterable<CharSequence> {
}
public Display addAll(Display other) {
- final Display result = new Display(this);
+ final Display result = new Display(this, this.defaultCreoleMode);
result.display.addAll(other.display);
return result;
}
public Display addFirst(CharSequence s) {
- final Display result = new Display(this);
+ final Display result = new Display(this, this.defaultCreoleMode);
result.display.add(0, s);
return result;
}
public Display add(CharSequence s) {
- final Display result = new Display(this);
+ final Display result = new Display(this, this.defaultCreoleMode);
result.display.add(s);
return result;
}
- private boolean firstColumnRemovable() {
- boolean allEmpty = true;
- for (CharSequence s : this) {
- if (s.length() == 0) {
- continue;
- }
- allEmpty = false;
- final char c = s.charAt(0);
- if (c != ' ' && c != '\t') {
- return false;
- }
- }
- return allEmpty == false;
- }
-
- public Display removeEmptyColumns() {
- if (firstColumnRemovable() == false) {
- return this;
- }
- final Display result = new Display(this);
- do {
- for (int i = 0; i < result.size(); i++) {
- final CharSequence s = result.get(i);
- if (s.length() > 0) {
- result.display.set(i, s.toString().substring(1));
- }
- }
- } while (result.firstColumnRemovable());
- return result;
- }
-
public int size() {
+ if (isNull) {
+ return 0;
+ }
return display.size();
}
@@ -229,26 +271,37 @@ public class Display implements Iterable<CharSequence> {
}
public Display subList(int i, int size) {
- return new Display(display.subList(i, size), this.naturalHorizontalAlignment);
+ return new Display(display.subList(i, size), this.naturalHorizontalAlignment, this.isNull,
+ this.defaultCreoleMode);
}
public List<? extends CharSequence> as() {
return Collections.unmodifiableList(display);
}
+ public List<CharSequence2> as2() {
+ final List<CharSequence2> result = new ArrayList<CharSequence2>();
+ LineLocationImpl location = new LineLocationImpl("inner", null);
+ for (CharSequence cs : display) {
+ location = location.oneLineRead();
+ result.add(new CharSequence2Impl(cs, location));
+ }
+ return Collections.unmodifiableList(result);
+ }
+
public Url initUrl() {
if (this.size() == 0) {
return null;
}
final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_START);
- return urlBuilder.getUrl(this.get(0).toString().trim());
+ return urlBuilder.getUrl(StringUtils.trin(this.get(0).toString()));
}
public Display removeUrl(Url url) {
if (url == null) {
return this;
}
- final Display result = new Display(this.naturalHorizontalAlignment);
+ final Display result = new Display(this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
result.display.add(UrlBuilder.purgeUrl(this.get(0).toString()));
result.display.addAll(this.subList(1, this.size()).display);
return result;
@@ -268,4 +321,108 @@ public class Display implements Iterable<CharSequence> {
return naturalHorizontalAlignment;
}
+ public List<Display> splitMultiline(Pattern separator) {
+ final List<Display> result = new ArrayList<Display>();
+ Display pending = new Display(this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
+ result.add(pending);
+ for (CharSequence line : display) {
+ final Matcher m = separator.matcher(line);
+ if (m.find()) {
+ final CharSequence s1 = line.subSequence(0, m.start());
+ pending.display.add(s1);
+ final CharSequence s2 = line.subSequence(m.end(), line.length());
+ pending = new Display(this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
+ result.add(pending);
+ pending.display.add(s2);
+ } else {
+ pending.display.add(line);
+ }
+ }
+ return Collections.unmodifiableList(result);
+ }
+
+ // ------
+
+ public static boolean isNull(Display display) {
+ // if (display == null) {
+ // throw new IllegalArgumentException();
+ // }
+ return display == null || display.isNull;
+ }
+
+ public TextBlock create(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ ISkinSimple spriteContainer) {
+ return create(fontConfiguration, horizontalAlignment, spriteContainer, CreoleMode.FULL);
+ }
+
+ public TextBlock createWithNiceCreoleMode(FontConfiguration fontConfiguration,
+ HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer) {
+ return create(fontConfiguration, horizontalAlignment, spriteContainer, defaultCreoleMode);
+ }
+
+ public TextBlock create(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ ISkinSimple spriteContainer, CreoleMode modeSimpleLine) {
+ return create(fontConfiguration, horizontalAlignment, spriteContainer, 0, modeSimpleLine, null, null);
+ }
+
+ public TextBlock create(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ ISkinSimple spriteContainer, double maxMessageSize, CreoleMode modeSimpleLine, UFont fontForStereotype,
+ HtmlColor htmlColorForStereotype) {
+ if (getNaturalHorizontalAlignment() != null) {
+ horizontalAlignment = getNaturalHorizontalAlignment();
+ }
+ if (size() > 0) {
+ if (get(0) instanceof Stereotype) {
+ return createStereotype(fontConfiguration, horizontalAlignment, spriteContainer, 0, fontForStereotype,
+ htmlColorForStereotype);
+ }
+ if (get(size() - 1) instanceof Stereotype) {
+ return createStereotype(fontConfiguration, horizontalAlignment, spriteContainer, size() - 1,
+ fontForStereotype, htmlColorForStereotype);
+ }
+ if (get(0) instanceof MessageNumber) {
+ return createMessageNumber(fontConfiguration, horizontalAlignment, spriteContainer, maxMessageSize);
+ }
+ }
+
+ return getCreole(fontConfiguration, horizontalAlignment, spriteContainer, maxMessageSize, modeSimpleLine);
+ }
+
+ private TextBlock getCreole(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ ISkinSimple spriteContainer, double maxMessageSize, CreoleMode modeSimpleLine) {
+ final Sheet sheet = new CreoleParser(fontConfiguration, horizontalAlignment, spriteContainer, modeSimpleLine)
+ .createSheet(this);
+ final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, maxMessageSize, spriteContainer == null ? 0
+ : spriteContainer.getPadding());
+ return new SheetBlock2(sheetBlock1, sheetBlock1, new UStroke(1.5));
+ }
+
+ private TextBlock createMessageNumber(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ ISkinSimple spriteContainer, double maxMessageSize) {
+ TextBlock tb1 = subList(0, 1).getCreole(fontConfiguration, horizontalAlignment, spriteContainer,
+ maxMessageSize, CreoleMode.FULL);
+ tb1 = TextBlockUtils.withMargin(tb1, 0, 4, 0, 0);
+ final TextBlock tb2 = subList(1, size()).getCreole(fontConfiguration, horizontalAlignment, spriteContainer,
+ maxMessageSize, CreoleMode.FULL);
+ return TextBlockUtils.mergeLR(tb1, tb2, VerticalAlignment.CENTER);
+
+ }
+
+ private TextBlock createStereotype(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
+ SpriteContainer spriteContainer, int position, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
+ final Stereotype stereotype = (Stereotype) get(position);
+ if (stereotype.isSpotted()) {
+ final CircledCharacter circledCharacter = new CircledCharacter(stereotype.getCharacter(),
+ stereotype.getRadius(), stereotype.getCircledFont(), stereotype.getHtmlColor(), null,
+ fontConfiguration.getColor());
+ if (stereotype.getLabel(false) == null) {
+ return new TextBlockSpotted(circledCharacter, this.subList(1, this.size()), fontConfiguration,
+ horizontalAlignment, spriteContainer);
+ }
+ return new TextBlockSpotted(circledCharacter, this, fontConfiguration, horizontalAlignment, spriteContainer);
+ }
+ return new TextBlockSimple(this, fontConfiguration, horizontalAlignment, spriteContainer, 0, fontForStereotype,
+ htmlColorForStereotype);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Display2.java b/src/net/sourceforge/plantuml/cucadiagram/Display2.java
deleted file mode 100644
index bb8884c..0000000
--- a/src/net/sourceforge/plantuml/cucadiagram/Display2.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2014, Arnaud Roques
- *
- * Project Info: http://plantuml.sourceforge.net
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.cucadiagram;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.UrlBuilder;
-import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
-
-public class Display2 implements Iterable<CharSequence> {
-
- private final List<CharSequence> display = new ArrayList<CharSequence>();
-
- public static Display2 empty() {
- return new Display2();
- }
-
- public static Display2 create(CharSequence... s) {
- if (s.length==1 && s[0]==null) {
- return empty();
- }
- return new Display2(Arrays.asList(s));
- }
-
- public static Display2 create(List<? extends CharSequence> other) {
- return new Display2(other);
- }
-
- public static Display2 getWithNewlines(Code s) {
- return getWithNewlines(s.getFullName());
- }
-
- public static Display2 getWithNewlines(String s) {
- if (s == null) {
- return null;
- }
- final Display2 result = new Display2();
- result.display.addAll(getWithNewlinesInternal(s));
- return result;
- }
-
- private Display2(List<? extends CharSequence> other) {
- for (CharSequence s : other) {
- this.display.addAll(getWithNewlinesInternal(s));
- }
- }
-
- private Display2(Display2 other) {
- this.display.addAll(other.display);
- }
-
- private Display2() {
- }
-
- public Display2 underlined() {
- final List<CharSequence> result = new ArrayList<CharSequence>();
- for (CharSequence line : display) {
- result.add("<u>" + line);
- }
- return new Display2(result);
- }
-
- @Override
- public String toString() {
- return display.toString();
- }
-
- @Override
- public int hashCode() {
- return display.hashCode();
- }
-
- @Override
- public boolean equals(Object other) {
- return this.display.equals(((Display2) other).display);
- }
-
- public Display2 addAll(Display2 other) {
- final Display2 result = new Display2(this);
- result.display.addAll(other.display);
- return result;
- }
-
- public Display2 addFirst(CharSequence s) {
- final Display2 result = new Display2(this);
- result.display.addAll(0, getWithNewlinesInternal(s));
- return result;
- }
-
- public Display2 add(CharSequence s) {
- final Display2 result = new Display2(this);
- result.display.addAll(getWithNewlinesInternal(s));
- return result;
- }
-
- private boolean firstColumnRemovable() {
- boolean allEmpty = true;
- for (CharSequence s : this) {
- if (s.length() == 0) {
- continue;
- }
- allEmpty = false;
- final char c = s.charAt(0);
- if (c != ' ' && c != '\t') {
- return false;
- }
- }
- return allEmpty == false;
- }
-
- public Display2 removeEmptyColumns() {
- if (firstColumnRemovable() == false) {
- return this;
- }
- final Display2 result = new Display2(this);
- do {
- for (int i = 0; i < result.size(); i++) {
- final CharSequence s = result.get(i);
- if (s.length() > 0) {
- result.display.set(i, s.toString().substring(1));
- }
- }
- } while (result.firstColumnRemovable());
- return result;
- }
-
- public int size() {
- return display.size();
- }
-
- public CharSequence get(int i) {
- return display.get(i);
- }
-
- public Iterator<CharSequence> iterator() {
- return Collections.unmodifiableList(display).iterator();
- }
-
- public Display2 subList(int i, int size) {
- final Display2 result = new Display2();
- result.display.addAll(display.subList(i, size));
- return result;
- }
-
- public List<? extends CharSequence> as() {
- return Collections.unmodifiableList(display);
- }
-
- private static List<String> getWithNewlinesInternal(CharSequence s) {
- final List<String> result = new ArrayList<String>();
- final StringBuilder current = new StringBuilder();
- for (int i = 0; i < s.length(); i++) {
- final char c = s.charAt(i);
- if (c == '\\' && i < s.length() - 1) {
- final char c2 = s.charAt(i + 1);
- i++;
- if (c2 == 'n') {
- result.add(current.toString());
- current.setLength(0);
- } else if (c2 == 't') {
- current.append('\t');
- } else if (c2 == '\\') {
- current.append(c2);
- } else {
- current.append(c);
- current.append(c2);
- }
- } else {
- current.append(c);
- }
- }
- result.add(current.toString());
- return result;
- }
-
- public Url initUrl() {
- if (this.size() == 0) {
- return null;
- }
- final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_START);
- return urlBuilder.getUrl(this.get(0).toString().trim());
- }
-
- public Display2 removeUrl(Url url) {
- if (url == null) {
- return this;
- }
- final Display2 result = new Display2();
- result.display.add(UrlBuilder.purgeUrl(this.get(0).toString()));
- result.display.addAll(this.subList(1, this.size()).display);
- return result;
- }
-
- public boolean hasUrl() {
- final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.ANYWHERE);
- for (CharSequence s : this) {
- if (urlBuilder.getUrl(s.toString()) != null) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java b/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java
new file mode 100644
index 0000000..4492259
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/DisplayPositionned.java
@@ -0,0 +1,77 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.cucadiagram;
+
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
+
+public class DisplayPositionned {
+
+ private final Display display;
+ private final HorizontalAlignment horizontalAlignment;
+ private final VerticalAlignment verticalAlignment;
+
+ public DisplayPositionned(Display display, HorizontalAlignment horizontalAlignment,
+ VerticalAlignment verticalAlignment) {
+ this.display = display;
+ this.horizontalAlignment = horizontalAlignment;
+ this.verticalAlignment = verticalAlignment;
+ }
+
+ public static DisplayPositionned none(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) {
+ return new DisplayPositionned(Display.NULL, horizontalAlignment, verticalAlignment);
+ }
+
+ public final Display getDisplay() {
+ return display;
+ }
+
+ public final HorizontalAlignment getHorizontalAlignment() {
+ return horizontalAlignment;
+ }
+
+ public final VerticalAlignment getVerticalAlignment() {
+ return verticalAlignment;
+ }
+
+ public static boolean isNull(DisplayPositionned data) {
+ return data == null || Display.isNull(data.display);
+ }
+
+ public boolean hasUrl() {
+ return display.hasUrl();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityGender.java b/src/net/sourceforge/plantuml/cucadiagram/EntityGender.java
index 23d90a5..bc433bc 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/EntityGender.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/EntityGender.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityGenderUtils.java b/src/net/sourceforge/plantuml/cucadiagram/EntityGenderUtils.java
index 3c6acc4..0754044 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/EntityGenderUtils.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/EntityGenderUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -88,7 +88,6 @@ public class EntityGenderUtils {
};
}
-
static public EntityGender all() {
return new EntityGender() {
public boolean contains(IEntity test) {
@@ -100,7 +99,7 @@ public class EntityGenderUtils {
static public EntityGender emptyMethods() {
return new EntityGender() {
public boolean contains(IEntity test) {
- return test.getMethodsToDisplay().size()==0;
+ return test.getBodier().getMethodsToDisplay().size() == 0;
}
};
}
@@ -108,7 +107,7 @@ public class EntityGenderUtils {
static public EntityGender emptyFields() {
return new EntityGender() {
public boolean contains(IEntity test) {
- return test.getFieldsToDisplay().size()==0;
+ return test.getBodier().getFieldsToDisplay().size() == 0;
}
};
}
@@ -116,7 +115,8 @@ public class EntityGenderUtils {
static public EntityGender emptyMembers() {
return new EntityGender() {
public boolean contains(IEntity test) {
- return test.getMethodsToDisplay().size()==0 && test.getFieldsToDisplay().size()==0;
+ return test.getBodier().getMethodsToDisplay().size() == 0
+ && test.getBodier().getFieldsToDisplay().size() == 0;
}
};
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityPortion.java b/src/net/sourceforge/plantuml/cucadiagram/EntityPortion.java
index bd8f321..dd0eea4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/EntityPortion.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/EntityPortion.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java b/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java
index ed34fef..a3728e6 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityUtils.java b/src/net/sourceforge/plantuml/cucadiagram/EntityUtils.java
index db1fda3..9ac3af0 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/EntityUtils.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/EntityUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupHierarchy.java b/src/net/sourceforge/plantuml/cucadiagram/GroupHierarchy.java
index 67228c1..1384242 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupHierarchy.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupHierarchy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java b/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java
index 6e3a0cb..eee4dda 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
index bb9441a..71418c7 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,12 +38,18 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.svek.SingleStrategy;
@@ -106,17 +112,7 @@ public class GroupRoot implements IGroup {
}
- public List<Member> getFieldsToDisplay() {
- throw new UnsupportedOperationException();
-
- }
-
- public List<Member> getMethodsToDisplay() {
- throw new UnsupportedOperationException();
-
- }
-
- public BlockMember getBody(PortionShower portionShower) {
+ public TextBlock getBody(PortionShower portionShower, FontParam fontParam, ISkinParam skinParam) {
throw new UnsupportedOperationException();
}
@@ -129,35 +125,11 @@ public class GroupRoot implements IGroup {
return null;
}
- public BlockMember getMouseOver() {
- throw new UnsupportedOperationException();
- }
-
- public void addFieldOrMethod(String s) {
- throw new UnsupportedOperationException();
-
- }
-
- public void mouseOver(String s) {
- throw new UnsupportedOperationException();
-
- }
-
public void addUrl(Url url) {
throw new UnsupportedOperationException();
}
- public HtmlColor getSpecificBackColor() {
- throw new UnsupportedOperationException();
-
- }
-
- public void setSpecificBackcolor(HtmlColor specificBackcolor) {
- throw new UnsupportedOperationException();
-
- }
-
public IGroup getParentContainer() {
return null;
}
@@ -234,47 +206,67 @@ public class GroupRoot implements IGroup {
return false;
}
- public HtmlColor getSpecificLineColor() {
- return null;
+ public boolean hasUrl() {
+ return false;
}
- public void setSpecificLineColor(HtmlColor specificLinecolor) {
+ public int getHectorLayer() {
throw new UnsupportedOperationException();
}
- public UStroke getSpecificLineStroke() {
- return null;
+ public void setHectorLayer(int layer) {
+ throw new UnsupportedOperationException();
}
- public void setSpecificLineStroke(UStroke specificLineStoke) {
+ public int getRawLayout() {
throw new UnsupportedOperationException();
}
- public boolean hasUrl() {
- return false;
+ public char getConcurrentSeparator() {
+ throw new UnsupportedOperationException();
}
- public int getHectorLayer() {
+ public void setConcurrentSeparator(char separator) {
+ // throw new UnsupportedOperationException();
+ }
+
+ public void putTip(String member, Display display) {
throw new UnsupportedOperationException();
}
- public void setHectorLayer(int layer) {
+ public Map<String, Display> getTips() {
throw new UnsupportedOperationException();
}
- public FontParam getTitleFontParam() {
+ public Bodier getBodier() {
throw new UnsupportedOperationException();
}
- public int getRawLayout() {
+ public Colors getColors(ISkinParam skinParam) {
+ return Colors.empty();
+ }
+
+ public void setColors(Colors colors) {
throw new UnsupportedOperationException();
}
- public char getConcurrentSeparator() {
+ public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
throw new UnsupportedOperationException();
}
- public void setConcurrentSeparator(char separator) {
+ public void setSpecificLineStroke(UStroke specificLineStroke) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void applyStroke(String s) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void applyStroke(Colors colors) {
+ throw new UnsupportedOperationException();
+ }
+
+ public FontConfiguration getFontConfigurationForTitle(ISkinParam skinParam) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupType.java b/src/net/sourceforge/plantuml/cucadiagram/GroupType.java
index f7a81a3..5c93f89 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/IEntity.java b/src/net/sourceforge/plantuml/cucadiagram/IEntity.java
index 76696d5..761adae 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/IEntity.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/IEntity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,7 +34,7 @@
*/
package net.sourceforge.plantuml.cucadiagram;
-import java.util.List;
+import java.util.Map;
import net.sourceforge.plantuml.Hideable;
import net.sourceforge.plantuml.LineConfigurable;
@@ -42,6 +42,7 @@ import net.sourceforge.plantuml.Removeable;
import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.Colors;
public interface IEntity extends SpecificBackcolorable, Hideable, Removeable, LineConfigurable {
@@ -69,17 +70,7 @@ public interface IEntity extends SpecificBackcolorable, Hideable, Removeable, Li
public void setStereotype(Stereotype stereotype);
- public List<Member> getFieldsToDisplay();
-
- public List<Member> getMethodsToDisplay();
-
- public BlockMember getBody(PortionShower portionShower);
-
- public BlockMember getMouseOver();
-
- public void addFieldOrMethod(String s);
-
- public void mouseOver(String s);
+ public Bodier getBodier();
public void addUrl(Url url);
@@ -93,4 +84,11 @@ public interface IEntity extends SpecificBackcolorable, Hideable, Removeable, Li
public int getRawLayout();
+ public void putTip(String member, Display display);
+
+ public Map<String, Display> getTips();
+
+ @Deprecated
+ public void applyStroke(String s);
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/IGroup.java b/src/net/sourceforge/plantuml/cucadiagram/IGroup.java
index c321636..fc7ddb1 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/IGroup.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/IGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,7 +36,8 @@ package net.sourceforge.plantuml.cucadiagram;
import java.util.Collection;
-import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.svek.SingleStrategy;
@@ -67,9 +68,9 @@ public interface IGroup extends IEntity {
public SingleStrategy getSingleStrategy();
- public FontParam getTitleFontParam();
-
+ public FontConfiguration getFontConfigurationForTitle(ISkinParam skinParam);
+
public char getConcurrentSeparator();
-
+
public void setConcurrentSeparator(char separator);
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/ILeaf.java b/src/net/sourceforge/plantuml/cucadiagram/ILeaf.java
index 207b87e..5a371e1 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/ILeaf.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/ILeaf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Ident.java b/src/net/sourceforge/plantuml/cucadiagram/Ident.java
index 4adf427..9e18647 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Ident.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Ident.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LeafType.java b/src/net/sourceforge/plantuml/cucadiagram/LeafType.java
index 9db70c3..de535fb 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LeafType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LeafType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,7 +40,7 @@ public enum LeafType {
EMPTY_PACKAGE,
- ABSTRACT_CLASS, CLASS, INTERFACE, ANNOTATION, LOLLIPOP, NOTE, OBJECT, ASSOCIATION, ENUM,
+ ABSTRACT_CLASS, CLASS, INTERFACE, ANNOTATION, LOLLIPOP, NOTE, TIPS, OBJECT, ASSOCIATION, ENUM,
USECASE,
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Link.java b/src/net/sourceforge/plantuml/cucadiagram/Link.java
index 32cb61c..5399bf9 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Link.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Link.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,11 +46,10 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbolInterface;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.utils.UniqueSequence;
@@ -68,7 +67,7 @@ public class Link implements Hideable, Removeable {
private Display note;
private Position notePosition;
- private HtmlColor noteColor;
+ private Colors noteColors;
private boolean invis = false;
private double weight = 1.0;
@@ -111,8 +110,8 @@ public class Link implements Hideable, Removeable {
this.cl1 = cl1;
this.cl2 = cl2;
this.type = type;
- if (label == null) {
- this.label = null;
+ if (Display.isNull(label)) {
+ this.label = Display.NULL;
} else if (doWeHaveToRemoveUrlAtStart(label)) {
this.url = label.initUrl();
this.label = label.removeUrl(url);
@@ -131,9 +130,9 @@ public class Link implements Hideable, Removeable {
if (qualifier2 != null) {
((ILeaf) cl2).setNearDecoration(true);
}
-// if (type.getDecor2() == LinkDecor.EXTENDS) {
-// setSametail(cl1.getUid());
-// }
+ // if (type.getDecor2() == LinkDecor.EXTENDS) {
+ // setSametail(cl1.getUid());
+ // }
}
private static boolean doWeHaveToRemoveUrlAtStart(Display label) {
@@ -247,6 +246,25 @@ public class Link implements Hideable, Removeable {
return result;
}
+ private boolean isReallyGroup(IEntity ent) {
+ if (ent.isGroup() == false) {
+ return false;
+ }
+ final IGroup group = (IGroup) ent;
+ return group.getChildren().size() + group.getLeafsDirect().size() > 0;
+ }
+
+ public LinkType getTypePatchCluster() {
+ LinkType result = getType();
+ if (isReallyGroup(getEntity1())) {
+ result = result.withoutDecors2();
+ }
+ if (isReallyGroup(getEntity2())) {
+ result = result.withoutDecors1();
+ }
+ return result;
+ }
+
private LinkType getTypeSpecialForPrinting() {
if (opale) {
return new LinkType(LinkDecor.NONE, LinkDecor.NONE);
@@ -299,25 +317,25 @@ public class Link implements Hideable, Removeable {
return note;
}
- public final HtmlColor getNoteColor() {
- return noteColor;
+ public final Colors getNoteColors() {
+ return noteColors;
}
public final Position getNotePosition() {
return notePosition;
}
- public final void addNote(Display note, Position position, HtmlColor noteColor) {
+ public final void addNote(Display note, Position position, Colors colors) {
this.note = note;
this.notePosition = position;
- this.noteColor = noteColor;
+ this.noteColors = colors;
}
- public final void addNote(String n, Position position, HtmlColor noteColor) {
- this.note = Display.getWithNewlines(n);
- this.notePosition = position;
- this.noteColor = noteColor;
- }
+ // public final void addNote(String n, Position position, Colors colors) {
+ // this.note = Display.getWithNewlines(n);
+ // this.notePosition = position;
+ // this.noteColors = colors;
+ // }
public boolean isAutoLinkOfAGroup() {
if (getEntity1().isGroup() == false) {
@@ -371,8 +389,8 @@ public class Link implements Hideable, Removeable {
private double getQualifierMargin(StringBounder stringBounder, UFont fontQualif, String qualif,
ISkinSimple spriteContainer) {
if (qualif != null) {
- final TextBlock b = TextBlockUtils.create(Display.create(qualif), new FontConfiguration(fontQualif,
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT, spriteContainer);
+ final TextBlock b = Display.create(qualif).create(FontConfiguration.blackBlueTrue(fontQualif),
+ HorizontalAlignment.LEFT, spriteContainer);
final Dimension2D dim = b.calculateDimension(stringBounder);
return Math.max(dim.getWidth(), dim.getHeight());
}
@@ -481,7 +499,7 @@ public class Link implements Hideable, Removeable {
}
public boolean hasUrl() {
- if (label != null && label.hasUrl()) {
+ if (Display.isNull(label) == false && label.hasUrl()) {
return true;
}
return getUrl() != null;
@@ -495,4 +513,14 @@ public class Link implements Hideable, Removeable {
this.sametail = sametail;
}
+ private Colors colors;
+
+ public void setColors(Colors colors) {
+ this.colors = colors;
+ }
+
+ public final Colors getColors() {
+ return colors;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkArrow.java b/src/net/sourceforge/plantuml/cucadiagram/LinkArrow.java
index e611792..89050ff 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkArrow.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java b/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java
index 98d65f6..999f163 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkHat.java b/src/net/sourceforge/plantuml/cucadiagram/LinkHat.java
index f2c93f4..fdf00b5 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkHat.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkHat.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java b/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
index f3fbce2..1e53dab 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java b/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java
index 96ff57f..032fda4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,10 +34,27 @@
*/
package net.sourceforge.plantuml.cucadiagram;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+
public enum LinkStyle {
NORMAL, DASHED, DOTTED, BOLD, INVISIBLE,
DOUBLE_tobedone, __toremove_INTERFACE_PROVIDER, __toremove_INTERFACE_USER;
+
+ public static UStroke getStroke(LinkStyle style) {
+ if (style == LinkStyle.DASHED) {
+ return new UStroke(6, 6, 1);
+ }
+ if (style == LinkStyle.DOTTED) {
+ return new UStroke(1, 3, 1);
+ }
+ if (style == LinkStyle.BOLD) {
+ return new UStroke(2.5);
+ }
+ return new UStroke();
+ }
+
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkType.java b/src/net/sourceforge/plantuml/cucadiagram/LinkType.java
index e26fe7e..76a86ea 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,6 +53,14 @@ public class LinkType {
this(hat1, decor1, LinkStyle.NORMAL, LinkMiddleDecor.NONE, decor2, hat2);
}
+ public LinkType withoutDecors1() {
+ return new LinkType(hat1, LinkDecor.NONE, style, middleDecor, decor2, hat2);
+ }
+
+ public LinkType withoutDecors2() {
+ return new LinkType(hat1, decor1, style, middleDecor, LinkDecor.NONE, hat2);
+ }
+
// public boolean contains(LinkDecor decors) {
// return decor1 == decors || decor2 == decors;
// }
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LongCode.java b/src/net/sourceforge/plantuml/cucadiagram/LongCode.java
index 6750d05..596788e 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LongCode.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LongCode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Magma.java b/src/net/sourceforge/plantuml/cucadiagram/Magma.java
index 0b6cfaa..b4bcd13 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Magma.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Magma.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,11 +50,11 @@ class Magma {
public void putInSquare() {
final SquareLinker<ILeaf> linker = new SquareLinker<ILeaf>() {
public void topDown(ILeaf top, ILeaf down) {
- system.addLink(new Link(top, down, linkType, null, 2));
+ system.addLink(new Link(top, down, linkType, Display.NULL, 2));
}
public void leftRight(ILeaf left, ILeaf right) {
- system.addLink(new Link(left, right, linkType, null, 1));
+ system.addLink(new Link(left, right, linkType, Display.NULL, 1));
}
};
new SquareMaker<ILeaf>().putInSquare(standalones, linker);
@@ -100,12 +100,12 @@ class Magma {
}
public void linkToDown(Magma down) {
- system.addLink(new Link(this.getBottomLeft(), down.getTopLeft(), linkType, null, 2));
+ system.addLink(new Link(this.getBottomLeft(), down.getTopLeft(), linkType, Display.NULL, 2));
}
public void linkToRight(Magma right) {
- system.addLink(new Link(this.getTopRight(), right.getTopLeft(), linkType, null, 1));
+ system.addLink(new Link(this.getTopRight(), right.getTopLeft(), linkType, Display.NULL, 1));
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/MagmaList.java b/src/net/sourceforge/plantuml/cucadiagram/MagmaList.java
index 0ff97f0..ceea320 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/MagmaList.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/MagmaList.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Member.java b/src/net/sourceforge/plantuml/cucadiagram/Member.java
index 1f21968..28f9789 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Member.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Member.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,159 +34,20 @@
*/
package net.sourceforge.plantuml.cucadiagram;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.UrlBuilder;
-import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
-import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.skin.VisibilityModifier;
-public class Member {
-
- private final String display;
- private final boolean staticModifier;
- private final boolean abstractModifier;
- private final Url url;
- private final boolean hasUrl;
-
- private final VisibilityModifier visibilityModifier;
-
- public Member(String display, boolean isMethod, boolean manageModifier) {
- this.hasUrl = new UrlBuilder(null, ModeUrl.ANYWHERE).getUrl(display) != null;
- final Pattern pstart = MyPattern.cmpile("^(" + UrlBuilder.getRegexp() + ")([^\\[\\]]+)$");
- final Matcher mstart = pstart.matcher(display);
-
- if (mstart.matches()) {
- if (mstart.groupCount() != 5) {
- throw new IllegalStateException();
- }
- final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_START);
- url = urlBuilder.getUrl(mstart.group(1));
- url.setMember(true);
- display = /* mstart.group(1).trim() + */mstart.group(mstart.groupCount()).trim();
- } else {
- final Pattern pend = MyPattern.cmpile("^((?:[^\\[\\]]|\\[[^\\[\\]]*\\])+)(" + UrlBuilder.getRegexp() + ")$");
- final Matcher mend = pend.matcher(display);
-
- if (mend.matches()) {
- if (mend.groupCount() != 5) {
- throw new IllegalStateException();
- }
- final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_END);
- url = urlBuilder.getUrl(mend.group(2));
- url.setMember(true);
- display = mend.group(1).trim();
- } else {
- url = null;
- }
- }
-
- final String lower = StringUtils.goLowerCase(display);
-
- if (manageModifier) {
- this.staticModifier = lower.contains("{static}") || lower.contains("{classifier}");
- this.abstractModifier = lower.contains("{abstract}");
- String displayClean = display.replaceAll("(?i)\\{(static|classifier|abstract)\\}", "").trim();
- if (displayClean.length() == 0) {
- displayClean = " ";
- }
-
- if (VisibilityModifier.isVisibilityCharacter(displayClean.charAt(0))) {
- visibilityModifier = VisibilityModifier.getVisibilityModifier(display.charAt(0), isMethod == false);
- this.display = displayClean.substring(1).trim();
- } else {
- this.display = displayClean;
- visibilityModifier = null;
- }
- } else {
- this.staticModifier = false;
- this.visibilityModifier = null;
- this.abstractModifier = false;
- display = display.trim();
- this.display = display.length() == 0 ? " " : display.trim();
- }
- }
-
- public String getDisplay(boolean withVisibilityChar) {
- if (withVisibilityChar) {
- return getDisplayWithVisibilityChar();
- }
- return getDisplayWithoutVisibilityChar();
- }
-
- public String getDisplayWithoutVisibilityChar() {
- // assert display.length() == 0 || VisibilityModifier.isVisibilityCharacter(display.charAt(0)) == false;
- return display;
- }
-
- public String getDisplayWithVisibilityChar() {
- if (isPrivate()) {
- return "-" + display;
- }
- if (isPublic()) {
- return "+" + display;
- }
- if (isPackagePrivate()) {
- return "~" + display;
- }
- if (isProtected()) {
- return "#" + display;
- }
- return display;
- }
-
- @Override
- public boolean equals(Object obj) {
- final Member other = (Member) obj;
- return this.display.equals(other.display);
- }
-
- @Override
- public int hashCode() {
- return display.hashCode();
- }
-
- public final boolean isStatic() {
- return staticModifier;
- }
-
- public final boolean isAbstract() {
- return abstractModifier;
- }
-
- private boolean isPrivate() {
- return visibilityModifier == VisibilityModifier.PRIVATE_FIELD
- || visibilityModifier == VisibilityModifier.PRIVATE_METHOD;
- }
-
- private boolean isProtected() {
- return visibilityModifier == VisibilityModifier.PROTECTED_FIELD
- || visibilityModifier == VisibilityModifier.PROTECTED_METHOD;
- }
+public interface Member {
- private boolean isPublic() {
- return visibilityModifier == VisibilityModifier.PUBLIC_FIELD
- || visibilityModifier == VisibilityModifier.PUBLIC_METHOD;
- }
+ public Url getUrl();
- private boolean isPackagePrivate() {
- return visibilityModifier == VisibilityModifier.PACKAGE_PRIVATE_FIELD
- || visibilityModifier == VisibilityModifier.PACKAGE_PRIVATE_METHOD;
- }
+ public String getDisplay(boolean withVisibilityChar);
- public final VisibilityModifier getVisibilityModifier() {
- return visibilityModifier;
- }
+ public boolean hasUrl();
- public final Url getUrl() {
- return url;
- }
+ public VisibilityModifier getVisibilityModifier();
- public boolean hasUrl() {
- return hasUrl;
- }
+ public boolean isStatic();
+ public boolean isAbstract();
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/MemberImpl.java b/src/net/sourceforge/plantuml/cucadiagram/MemberImpl.java
new file mode 100644
index 0000000..539d19b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/MemberImpl.java
@@ -0,0 +1,210 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.cucadiagram;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.UrlBuilder;
+import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.skin.VisibilityModifier;
+
+public class MemberImpl implements Member {
+
+ private final String display;
+ private final boolean staticModifier;
+ private final boolean abstractModifier;
+ private final Url url;
+ private final boolean hasUrl;
+
+ private final VisibilityModifier visibilityModifier;
+
+ public MemberImpl(String tmpDisplay, boolean isMethod, boolean manageModifier, boolean manageUrl) {
+ tmpDisplay = tmpDisplay.replaceAll("(?i)\\{(method|field)\\}\\s*", "");
+ if (manageModifier) {
+ this.hasUrl = new UrlBuilder(null, ModeUrl.ANYWHERE).getUrl(tmpDisplay) != null;
+ final Pattern pstart = MyPattern.cmpile("^(" + UrlBuilder.getRegexp() + ")([^\\[\\]]+)$");
+ final Matcher mstart = pstart.matcher(tmpDisplay);
+
+ if (mstart.matches()) {
+ if (mstart.groupCount() != 5) {
+ throw new IllegalStateException();
+ }
+ final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_START);
+ this.url = urlBuilder.getUrl(mstart.group(1));
+ this.url.setMember(true);
+ tmpDisplay = /* mstart.group(1).trim() + */StringUtils.trin(mstart.group(mstart.groupCount()));
+ } else {
+ final Pattern pend = MyPattern.cmpile("^((?:[^\\[\\]]|\\[[^\\[\\]]*\\])+)(" + UrlBuilder.getRegexp()
+ + ")$");
+ final Matcher mend = pend.matcher(tmpDisplay);
+
+ if (mend.matches()) {
+ if (mend.groupCount() != 5) {
+ throw new IllegalStateException();
+ }
+ final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_END);
+ this.url = urlBuilder.getUrl(mend.group(2));
+ this.url.setMember(true);
+ tmpDisplay = StringUtils.trin(mend.group(1));
+ } else {
+ this.url = null;
+ }
+ }
+ } else {
+ this.url = null;
+ this.hasUrl = false;
+ }
+
+ final String lower = StringUtils.goLowerCase(tmpDisplay);
+
+ if (manageModifier) {
+ this.staticModifier = lower.contains("{static}") || lower.contains("{classifier}");
+ this.abstractModifier = lower.contains("{abstract}");
+ String displayClean = tmpDisplay.replaceAll("(?i)\\{(static|classifier|abstract)\\}\\s*", "");
+ if (displayClean.length() == 0) {
+ displayClean = " ";
+ }
+
+ if (VisibilityModifier.isVisibilityCharacter(displayClean.charAt(0))) {
+ visibilityModifier = VisibilityModifier
+ .getVisibilityModifier(displayClean.charAt(0), isMethod == false);
+ this.display = StringUtils.trin(StringUtils.manageGuillemet(displayClean.substring(1)));
+ } else {
+ this.display = StringUtils.manageGuillemet(displayClean);
+ visibilityModifier = null;
+ }
+ } else {
+ this.staticModifier = false;
+ this.visibilityModifier = null;
+ this.abstractModifier = false;
+ tmpDisplay = StringUtils.trin(tmpDisplay);
+ this.display = tmpDisplay.length() == 0 ? " " : StringUtils.manageGuillemet(StringUtils.trin(tmpDisplay));
+ }
+ }
+
+ public String getDisplay(boolean withVisibilityChar) {
+ if (withVisibilityChar) {
+ return getDisplayWithVisibilityChar();
+ }
+ return getDisplayWithoutVisibilityChar();
+ }
+
+ private String getDisplayWithoutVisibilityChar() {
+ // assert display.length() == 0 || VisibilityModifier.isVisibilityCharacter(display.charAt(0)) == false;
+ return display;
+ }
+
+ public String getDisplayWithVisibilityChar() {
+ if (isPrivate()) {
+ return "-" + display;
+ }
+ if (isPublic()) {
+ return "+" + display;
+ }
+ if (isPackagePrivate()) {
+ return "~" + display;
+ }
+ if (isProtected()) {
+ return "#" + display;
+ }
+ return display;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ final MemberImpl other = (MemberImpl) obj;
+ return this.display.equals(other.display);
+ }
+
+ @Override
+ public int hashCode() {
+ return display.hashCode();
+ }
+
+ public final boolean isStatic() {
+ return staticModifier;
+ }
+
+ public final boolean isAbstract() {
+ return abstractModifier;
+ }
+
+ private boolean isPrivate() {
+ return visibilityModifier == VisibilityModifier.PRIVATE_FIELD
+ || visibilityModifier == VisibilityModifier.PRIVATE_METHOD;
+ }
+
+ private boolean isProtected() {
+ return visibilityModifier == VisibilityModifier.PROTECTED_FIELD
+ || visibilityModifier == VisibilityModifier.PROTECTED_METHOD;
+ }
+
+ private boolean isPublic() {
+ return visibilityModifier == VisibilityModifier.PUBLIC_FIELD
+ || visibilityModifier == VisibilityModifier.PUBLIC_METHOD;
+ }
+
+ private boolean isPackagePrivate() {
+ return visibilityModifier == VisibilityModifier.PACKAGE_PRIVATE_FIELD
+ || visibilityModifier == VisibilityModifier.PACKAGE_PRIVATE_METHOD;
+ }
+
+ public final VisibilityModifier getVisibilityModifier() {
+ return visibilityModifier;
+ }
+
+ public final Url getUrl() {
+ return url;
+ }
+
+ public boolean hasUrl() {
+ return hasUrl;
+ }
+
+ public static boolean isMethod(String s) {
+ if (s.contains("{method}")) {
+ return true;
+ }
+ if (s.contains("{field}")) {
+ return false;
+ }
+ return s.contains("(") || s.contains(")");
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
index 2b28f67..3254e1a 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.cucadiagram;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
@@ -42,11 +43,14 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.creole.CreoleMode;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockWidth;
import net.sourceforge.plantuml.skin.VisibilityModifier;
@@ -60,9 +64,13 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
import net.sourceforge.plantuml.utils.CharHidder;
-public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
+public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlockWidth, TextBlock {
- private final UFont font;
+ public TextBlock asBlockMemberImpl() {
+ return new TextBlockLineBefore(TextBlockUtils.withMargin(this, 6, 4));
+ }
+
+ private final FontParam fontParam;
private final ISkinParam skinParam;
private final HtmlColor color;
private final HtmlColor hyperlinkColor;
@@ -79,7 +87,7 @@ public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
HorizontalAlignment align) {
this.align = align;
this.skinParam = skinParam;
- this.font = skinParam.getFont(fontParam, null, false);
+ this.fontParam = fontParam;
this.color = rose.getFontColor(skinParam, fontParam);
this.hyperlinkColor = skinParam.getHyperlinkColor();
this.useUnderlineForHyperlink = skinParam.useUnderlineForHyperlink();
@@ -121,18 +129,19 @@ public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
if (withVisibilityChar && s.startsWith("#")) {
s = CharHidder.addTileAtBegin(s);
}
- FontConfiguration config = new FontConfiguration(font, color, hyperlinkColor, useUnderlineForHyperlink);
+ FontConfiguration config = new FontConfiguration(skinParam, fontParam, null);
if (m.isAbstract()) {
config = config.italic();
}
if (m.isStatic()) {
config = config.underline();
}
- final TextBlock bloc = TextBlockUtils.create(Display.getWithNewlines(s), config, align, skinParam, true);
+ TextBlock bloc = Display.getWithNewlines(s).create(config, align, skinParam, CreoleMode.SIMPLE_LINE);
+ bloc = TextBlockUtils.fullInnerPosition(bloc, m.getDisplay(false));
return new TextBlockTracer(m, bloc);
}
- static class TextBlockTracer implements TextBlock {
+ static class TextBlockTracer extends AbstractTextBlock implements TextBlock {
private final TextBlock bloc;
private final Url url;
@@ -157,11 +166,16 @@ public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
return dim;
}
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ return bloc.getInnerPosition(member, stringBounder);
+ }
+
}
private TextBlock getUBlock(final VisibilityModifier modifier) {
if (modifier == null) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
}
@@ -180,23 +194,29 @@ public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
}
public TextBlock asTextBlock(final double widthToUse) {
- return new TextBlock() {
+ return this;
+ }
- public void drawU(UGraphic ug) {
- MethodsOrFieldsArea.this.drawU(ug);
+ public boolean contains(String member) {
+ for (Member att : members) {
+ if (att.getDisplay(false).startsWith(member)) {
+ return true;
}
+ }
+ return false;
+ }
- public Dimension2D calculateDimension(StringBounder stringBounder) {
- return MethodsOrFieldsArea.this.calculateDimension(stringBounder);
- }
- };
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ final ULayoutGroup group = getLayout(stringBounder);
+ final Dimension2D dim = calculateDimension(stringBounder);
+ return group.getInnerPosition(member, dim.getWidth(), dim.getHeight(), stringBounder);
}
- public void drawU(UGraphic ug) {
- final Dimension2D dim = calculateDimension(ug.getStringBounder());
+ private ULayoutGroup getLayout(final StringBounder stringBounder) {
final ULayoutGroup group;
if (hasSmallIcon()) {
- group = new ULayoutGroup(new PlacementStrategyVisibility(ug.getStringBounder(),
+ group = new ULayoutGroup(new PlacementStrategyVisibility(stringBounder,
skinParam.getCircledCharacterRadius() + 3));
for (Member att : members) {
final TextBlock bloc = createTextBlock(att);
@@ -207,9 +227,9 @@ public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
} else {
final PlacementStrategy placementStrategy;
if (align == HorizontalAlignment.LEFT) {
- placementStrategy = new PlacementStrategyY1Y2Left(ug.getStringBounder());
+ placementStrategy = new PlacementStrategyY1Y2Left(stringBounder);
} else if (align == HorizontalAlignment.CENTER) {
- placementStrategy = new PlacementStrategyY1Y2Center(ug.getStringBounder());
+ placementStrategy = new PlacementStrategyY1Y2Center(stringBounder);
} else {
throw new IllegalStateException();
}
@@ -219,6 +239,13 @@ public class MethodsOrFieldsArea implements TextBlockWidth, TextBlock {
group.add(bloc);
}
}
- group.drawU(ug, 0, 0, dim.getWidth(), dim.getHeight());
+ return group;
+ }
+
+ public void drawU(UGraphic ug) {
+ final ULayoutGroup group = getLayout(ug.getStringBounder());
+ final Dimension2D dim = calculateDimension(ug.getStringBounder());
+ group.drawU(ug, dim.getWidth(), dim.getHeight());
}
+
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Namespace.java b/src/net/sourceforge/plantuml/cucadiagram/Namespace.java
index f43dd98..0601071 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Namespace.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Namespace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/PortionShower.java b/src/net/sourceforge/plantuml/cucadiagram/PortionShower.java
index abddcff..5589e76 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/PortionShower.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/PortionShower.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Rankdir.java b/src/net/sourceforge/plantuml/cucadiagram/Rankdir.java
index 7e4ddf9..fb230fb 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Rankdir.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Rankdir.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/RuleType.java b/src/net/sourceforge/plantuml/cucadiagram/RuleType.java
index 855cb11..c0cf6f2 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/RuleType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/RuleType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/SquareLinker.java b/src/net/sourceforge/plantuml/cucadiagram/SquareLinker.java
index 2ae5709..16a03b5 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/SquareLinker.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/SquareLinker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/SquareMaker.java b/src/net/sourceforge/plantuml/cucadiagram/SquareMaker.java
index 48bad05..252a739 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/SquareMaker.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/SquareMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
index db7b444..db945eb 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,12 +49,13 @@ import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteUtils;
public class Stereotype implements CharSequence, Hideable {
private final static Pattern circleChar = MyPattern
.cmpile("\\<\\<[%s]*\\(?(\\S)[%s]*,[%s]*(#[0-9a-fA-F]{6}|\\w+)[%s]*(?:[),](.*?))?\\>\\>");
- private final static Pattern circleSprite = MyPattern
- .cmpile("\\<\\<[%s]*\\(?\\$([\\p{L}0-9_]+)[%s]*(?:,[%s]*(#[0-9a-fA-F]{6}|\\w+))?[%s]*(?:[),](.*?))?\\>\\>");
+ private final static Pattern circleSprite = MyPattern.cmpile("\\<\\<[%s]*\\(?\\$(" + SpriteUtils.SPRITE_NAME
+ + ")[%s]*(?:,[%s]*(#[0-9a-fA-F]{6}|\\w+))?[%s]*(?:[),](.*?))?\\>\\>");
private final String label;
private final HtmlColor htmlColor;
@@ -121,7 +122,11 @@ public class Stereotype implements CharSequence, Hideable {
this.character = '\0';
this.radius = 0;
this.circledFont = null;
- this.sprite = null;
+ if (label.startsWith("<<$") && label.endsWith(">>")) {
+ this.sprite = label.substring(3, label.length() - 2);
+ } else {
+ this.sprite = null;
+ }
}
public HtmlColor getHtmlColor() {
@@ -146,7 +151,7 @@ public class Stereotype implements CharSequence, Hideable {
return null;
}
if (withGuillement) {
- return manageGuillemet(label);
+ return StringUtils.manageGuillemetStrict(label);
}
return label;
}
@@ -195,7 +200,7 @@ public class Stereotype implements CharSequence, Hideable {
final Matcher m = p.matcher(getLabel(false));
while (m.find()) {
if (useGuillemet) {
- result.add(manageGuillemet(m.group()));
+ result.add(StringUtils.manageGuillemetStrict(m.group()));
} else {
result.add(m.group());
}
@@ -203,20 +208,6 @@ public class Stereotype implements CharSequence, Hideable {
return Collections.unmodifiableList(result);
}
- private static String manageGuillemet(String st) {
- if (st.startsWith("<< ")) {
- st = "\u00AB" + st.substring(3);
- } else if (st.startsWith("<<")) {
- st = "\u00AB" + st.substring(2);
- }
- if (st.endsWith(" >>")) {
- st = st.substring(0, st.length() - 3) + "\u00BB";
- } else if (st.endsWith(">>")) {
- st = st.substring(0, st.length() - 2) + "\u00BB";
- }
- return st;
- }
-
public PackageStyle getPackageStyle() {
if (automaticPackageStyle == false) {
return null;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/UnparsableGraphvizException.java b/src/net/sourceforge/plantuml/cucadiagram/UnparsableGraphvizException.java
index 220aca2..316bffb 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/UnparsableGraphvizException.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/UnparsableGraphvizException.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java b/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java
index 34f3c89..b16a05e 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -148,7 +148,7 @@ abstract class AbstractGraphviz implements Graphviz {
}
sb.append(p.getError());
}
- return sb.toString().replace('\n', ' ').trim();
+ return StringUtils.trin(sb.toString().replace('\n', ' '));
}
final String[] getCommandLine() {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramPngMaker3.java b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramPngMaker3.java
index 28641bb..199162b 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramPngMaker3.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramPngMaker3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierActivity.java b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierActivity.java
index b07abf7..bf49f6f 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierActivity.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierState.java b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierState.java
index 4d09f5c..2c915a3 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierState.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramSimplifierState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
index 9368f47..173a02e 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -124,15 +124,15 @@ public final class CucaDiagramTxtMaker {
int y = 2;
ug.getCharArea().drawHLine('-', y, 1, w - 1);
y++;
- for (Member att : ent.getFieldsToDisplay()) {
- final List<String> disp = StringUtils.getWithNewlines2(att.getDisplay(true));
+ for (Member att : ent.getBodier().getFieldsToDisplay()) {
+ final List<String> disp = StringUtils.getWithNewlines(att.getDisplay(true));
ug.getCharArea().drawStringsLR(disp, 1, y);
y += StringUtils.getHeight(disp);
}
ug.getCharArea().drawHLine('-', y, 1, w - 1);
y++;
- for (Member att : ent.getMethodsToDisplay()) {
- final List<String> disp = StringUtils.getWithNewlines2(att.getDisplay(true));
+ for (Member att : ent.getBodier().getMethodsToDisplay()) {
+ final List<String> disp = StringUtils.getWithNewlines(att.getDisplay(true));
ug.getCharArea().drawStringsLR(disp, 1, y);
y += StringUtils.getHeight(disp);
}
@@ -149,10 +149,10 @@ public final class CucaDiagramTxtMaker {
private int getHeight(IEntity entity) {
int result = StringUtils.getHeight(entity.getDisplay());
- for (Member att : entity.getMethodsToDisplay()) {
+ for (Member att : entity.getBodier().getMethodsToDisplay()) {
result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true)));
}
- for (Member att : entity.getFieldsToDisplay()) {
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true)));
}
return result + 4;
@@ -160,13 +160,13 @@ public final class CucaDiagramTxtMaker {
private int getWidth(IEntity entity) {
int result = StringUtils.getWidth(entity.getDisplay());
- for (Member att : entity.getMethodsToDisplay()) {
+ for (Member att : entity.getBodier().getMethodsToDisplay()) {
final int w = StringUtils.getWidth(Display.getWithNewlines(att.getDisplay(true)));
if (w > result) {
result = w;
}
}
- for (Member att : entity.getFieldsToDisplay()) {
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
final int w = StringUtils.getWidth(Display.getWithNewlines(att.getDisplay(true)));
if (w > result) {
result = w;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java b/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java
index 3175659..6b6c7d6 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java b/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java
index 63e3c25..a97906f 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/DotMaker2.java b/src/net/sourceforge/plantuml/cucadiagram/dot/DotMaker2.java
index 5d41b7f..8fdb8d9 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/DotMaker2.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/DotMaker2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/DotSplines.java b/src/net/sourceforge/plantuml/cucadiagram/dot/DotSplines.java
index 92f9f46..515989b 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/DotSplines.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/DotSplines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/Graphviz.java b/src/net/sourceforge/plantuml/cucadiagram/dot/Graphviz.java
index 9af8ffd..f7c16f3 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/Graphviz.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/Graphviz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java
index 527ab32..8bd9c1d 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java
index 99fee24..2a17684 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLinux.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
index 878bfe3..9cc8e84 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -88,6 +88,18 @@ public class GraphvizUtils {
return null;
}
+ public static int getenvImageLimit() {
+ final String env = System.getProperty("PLANTUML_LIMIT_SIZE");
+ if (StringUtils.isNotEmpty(env) && env.matches("\\d+")) {
+ return Integer.parseInt(env);
+ }
+ final String getenv = System.getenv("PLANTUML_LIMIT_SIZE");
+ if (StringUtils.isNotEmpty(getenv) && getenv.matches("\\d+")) {
+ return Integer.parseInt(getenv);
+ }
+ return 4096;
+ }
+
public static String getenvLogData() {
final String env = System.getProperty("PLANTUML_LOGDATA");
if (StringUtils.isNotEmpty(env)) {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java
index 54f0d38..4410946 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersion.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java
index fea579c..b6d7607 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -98,7 +98,7 @@ public class GraphvizVersionFinder {
}
sb.append(p.getError());
}
- return sb.toString().replace('\n', ' ').trim();
+ return StringUtils.trin(sb.toString().replace('\n', ' '));
}
private String[] getCommandLine() {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersions.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersions.java
index b05ff49..4e95493 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersions.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersions.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindows.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindows.java
index 254b792..1802b32 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindows.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindows.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java b/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java
index 3dbe58c..85b00b3 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java b/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java
index 29d9a85..a5ca99f 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java b/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java
index 6ccfc85..05518b4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java b/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java
index e40c6aa..d68ff16 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java b/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java
index d73686b..833cabe 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessState.java b/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessState.java
index 2d22593..e66e663 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessState.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
index e99da6b..3c52348 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -105,7 +105,7 @@ public class EntityFactory {
final LongCode longCode = getLongCode(code, namespaceSeparator);
final EntityImpl result = new EntityImpl(this, code, bodier, parentContainer, groupType, namespace2, longCode,
namespaceSeparator, rawLayout);
- if (display != null) {
+ if (Display.isNull(display) == false) {
result.setDisplay(display);
}
return result;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
index 2fd8d5e..db33daf 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,19 +37,17 @@ package net.sourceforge.plantuml.cucadiagram.entity;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.cucadiagram.BlockMember;
-import net.sourceforge.plantuml.cucadiagram.BlockMemberImpl;
import net.sourceforge.plantuml.cucadiagram.Bodier;
-import net.sourceforge.plantuml.cucadiagram.BodyEnhanced;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.EntityPosition;
import net.sourceforge.plantuml.cucadiagram.EntityUtils;
import net.sourceforge.plantuml.cucadiagram.GroupRoot;
@@ -59,19 +57,18 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LongCode;
-import net.sourceforge.plantuml.cucadiagram.Member;
-import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockVertical2;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.svek.SingleStrategy;
-import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.utils.UniqueSequence;
final class EntityImpl implements ILeaf, IGroup {
@@ -95,8 +92,6 @@ final class EntityImpl implements ILeaf, IGroup {
private boolean top;
- private final List<String> mouseOver = new ArrayList<String>();
-
// Group
private Code namespace2;
@@ -105,15 +100,11 @@ final class EntityImpl implements ILeaf, IGroup {
private boolean autonom = true;
// Other
-
- private HtmlColor specificBackcolor;
private boolean nearDecoration = false;
private int xposition;
private IEntityImage svekImage;
private boolean removed = false;
- private HtmlColor specificLineColor;
- private UStroke specificStroke;
private USymbol symbol;
private final int rawLayout;
private char concurrentSeparator;
@@ -178,10 +169,13 @@ final class EntityImpl implements ILeaf, IGroup {
throw new IllegalArgumentException("type=" + leafType);
}
if (newType != LeafType.ANNOTATION && newType != LeafType.ABSTRACT_CLASS && newType != LeafType.CLASS
- && newType != LeafType.ENUM && newType != LeafType.INTERFACE) {
+ && newType != LeafType.ENUM && newType != LeafType.INTERFACE && newType != LeafType.OBJECT) {
throw new IllegalArgumentException("newtype=" + newType);
}
}
+ if (leafType == LeafType.CLASS && newType == LeafType.OBJECT) {
+ bodier.muteClassToObject();
+ }
this.leafType = newType;
this.symbol = newSymbol;
}
@@ -222,20 +216,12 @@ final class EntityImpl implements ILeaf, IGroup {
return code + " " + display + "(" + leafType + ") " + xposition + " " + getUid();
}
- public HtmlColor getSpecificBackColor() {
- return specificBackcolor;
- }
-
- public void setSpecificBackcolor(HtmlColor color) {
- this.specificBackcolor = color;
- }
-
public final Url getUrl99() {
return url;
}
public boolean hasUrl() {
- if (display != null && display.hasUrl()) {
+ if (Display.isNull(display) == false && display.hasUrl()) {
return true;
}
if (bodier.hasUrl()) {
@@ -288,72 +274,8 @@ final class EntityImpl implements ILeaf, IGroup {
return generic;
}
- public BlockMember getBody(final PortionShower portionShower) {
- checkNotGroup();
- final boolean showMethods = portionShower.showPortion(EntityPortion.METHOD, EntityImpl.this);
- final boolean showFields = portionShower.showPortion(EntityPortion.FIELD, EntityImpl.this);
- if (getEntityType().isLikeClass() && bodier.isBodyEnhanced()) {
- if (showMethods && showFields) {
- return bodier.getBodyEnhanced();
- }
- return new BlockMember() {
- public TextBlock asTextBlock(FontParam fontParam, ISkinParam skinParam) {
- return null;
- }
- };
- }
- return new BlockMember() {
- public TextBlock asTextBlock(FontParam fontParam, ISkinParam skinParam) {
- if (getEntityType().isLikeClass()) {
-
- if (showFields && showMethods) {
- return new TextBlockVertical2(new BlockMemberImpl(getFieldsToDisplay()).asTextBlock(fontParam,
- skinParam),
- new BlockMemberImpl(getMethodsToDisplay()).asTextBlock(fontParam, skinParam),
- HorizontalAlignment.LEFT);
- } else if (showFields) {
- return new BlockMemberImpl(getFieldsToDisplay()).asTextBlock(fontParam, skinParam);
- } else if (showMethods) {
- return new BlockMemberImpl(getMethodsToDisplay()).asTextBlock(fontParam, skinParam);
- }
- return null;
- }
- if (getEntityType() == LeafType.OBJECT) {
- return new BlockMemberImpl(getFieldsToDisplay()).asTextBlock(fontParam, skinParam);
- }
- throw new UnsupportedOperationException();
- }
- };
- }
-
- public BlockMember getMouseOver() {
- if (mouseOver.size() == 0) {
- return null;
- }
- return new BlockMember() {
- public TextBlock asTextBlock(FontParam fontParam, ISkinParam skinParam) {
- return new BodyEnhanced(mouseOver, fontParam, skinParam, leafType.manageModifier());
- }
- };
- }
-
- public void mouseOver(String s) {
- mouseOver.add(s);
- }
-
- public List<Member> getFieldsToDisplay() {
- // checkNotGroup();
- return bodier.getFieldsToDisplay();
- }
-
- public List<Member> getMethodsToDisplay() {
- // checkNotGroup();
- return bodier.getMethodsToDisplay();
- }
-
- public void addFieldOrMethod(String s) {
- // checkNotGroup();
- bodier.addFieldOrMethod(s);
+ public Bodier getBodier() {
+ return bodier;
}
public EntityPosition getEntityPosition() {
@@ -552,6 +474,9 @@ final class EntityImpl implements ILeaf, IGroup {
}
public USymbol getUSymbol() {
+ if (symbol != null && stereotype != null && stereotype.getSprite() != null) {
+ return symbol.withStereoAlignment(HorizontalAlignment.RIGHT);
+ }
return symbol;
}
@@ -587,22 +512,6 @@ final class EntityImpl implements ILeaf, IGroup {
this.removed = removed;
}
- public HtmlColor getSpecificLineColor() {
- return specificLineColor;
- }
-
- public void setSpecificLineColor(HtmlColor specificLinecolor) {
- this.specificLineColor = specificLinecolor;
- }
-
- public UStroke getSpecificLineStroke() {
- return specificStroke;
- }
-
- public void setSpecificLineStroke(UStroke specificLineStroke) {
- this.specificStroke = specificLineStroke;
- }
-
private int layer;
public int getHectorLayer() {
@@ -620,13 +529,22 @@ final class EntityImpl implements ILeaf, IGroup {
return longCode;
}
- public FontParam getTitleFontParam() {
+ private FontParam getTitleFontParam() {
if (symbol != null) {
return symbol.getFontParam();
}
return getGroupType() == GroupType.STATE ? FontParam.STATE : FontParam.PACKAGE;
}
+ public FontConfiguration getFontConfigurationForTitle(final ISkinParam skinParam) {
+ final FontParam fontParam = getTitleFontParam();
+ final HtmlColor fontHtmlColor = skinParam.getFontHtmlColor(getStereotype(), fontParam, FontParam.PACKAGE);
+ final UFont font = skinParam.getFont(getStereotype(), true, fontParam, FontParam.PACKAGE);
+ final FontConfiguration fontConfiguration = new FontConfiguration(font, fontHtmlColor,
+ skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
+ return fontConfiguration;
+ }
+
public final int getRawLayout() {
return rawLayout;
}
@@ -649,4 +567,45 @@ final class EntityImpl implements ILeaf, IGroup {
return neighborhood;
}
+ private final Map<String, Display> tips = new LinkedHashMap<String, Display>();
+
+ public void putTip(String member, Display display) {
+ tips.put(member, display);
+ }
+
+ public Map<String, Display> getTips() {
+ return Collections.unmodifiableMap(tips);
+ }
+
+ private Colors colors = Colors.empty();
+
+ public Colors getColors(ISkinParam skinParam) {
+ return colors;
+ }
+
+ public void setColors(Colors colors) {
+ this.colors = colors;
+ }
+
+ public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ if (color != null) {
+ this.colors = colors.add(type, color);
+ }
+ }
+
+ // public void setSpecificLineStroke(UStroke specificLineStroke) {
+ // colors = colors.addSpecificLineStroke(specificLineStroke);
+ // }
+
+ @Deprecated
+ public void applyStroke(String s) {
+ throw new UnsupportedOperationException();
+ // if (s == null) {
+ // return;
+ // }
+ // final LinkStyle style = LinkStyle.valueOf(StringUtils.goUpperCase(s));
+ // colors = colors.addSpecificLineStroke(style);
+ // // setSpecificLineStroke(LinkStyle.getStroke(style));
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/cute/ApolloniusSolver.java b/src/net/sourceforge/plantuml/cute/ApolloniusSolver.java
index 929d884..da60a39 100644
--- a/src/net/sourceforge/plantuml/cute/ApolloniusSolver.java
+++ b/src/net/sourceforge/plantuml/cute/ApolloniusSolver.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/ApolloniusSolver2.java b/src/net/sourceforge/plantuml/cute/ApolloniusSolver2.java
index 6fb38d9..040876d 100644
--- a/src/net/sourceforge/plantuml/cute/ApolloniusSolver2.java
+++ b/src/net/sourceforge/plantuml/cute/ApolloniusSolver2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Arc.java b/src/net/sourceforge/plantuml/cute/Arc.java
index 547d29c..8964e94 100644
--- a/src/net/sourceforge/plantuml/cute/Arc.java
+++ b/src/net/sourceforge/plantuml/cute/Arc.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Balloon.java b/src/net/sourceforge/plantuml/cute/Balloon.java
index 1730f81..9a961e9 100644
--- a/src/net/sourceforge/plantuml/cute/Balloon.java
+++ b/src/net/sourceforge/plantuml/cute/Balloon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/BetweenCorners.java b/src/net/sourceforge/plantuml/cute/BetweenCorners.java
index cb25b9e..3633973 100644
--- a/src/net/sourceforge/plantuml/cute/BetweenCorners.java
+++ b/src/net/sourceforge/plantuml/cute/BetweenCorners.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Cheese.java b/src/net/sourceforge/plantuml/cute/Cheese.java
index e27b5f6..b44ff20 100644
--- a/src/net/sourceforge/plantuml/cute/Cheese.java
+++ b/src/net/sourceforge/plantuml/cute/Cheese.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Circle.java b/src/net/sourceforge/plantuml/cute/Circle.java
index 117dc92..0af49cf 100644
--- a/src/net/sourceforge/plantuml/cute/Circle.java
+++ b/src/net/sourceforge/plantuml/cute/Circle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Corner.java b/src/net/sourceforge/plantuml/cute/Corner.java
index 3f87bf9..ad4d44c 100644
--- a/src/net/sourceforge/plantuml/cute/Corner.java
+++ b/src/net/sourceforge/plantuml/cute/Corner.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Crossing.java b/src/net/sourceforge/plantuml/cute/Crossing.java
index c81cd49..656dbcb 100644
--- a/src/net/sourceforge/plantuml/cute/Crossing.java
+++ b/src/net/sourceforge/plantuml/cute/Crossing.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BlockMemberImpl.java b/src/net/sourceforge/plantuml/cute/CrossingSegment.java
index 14c1229..095b206 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/BlockMemberImpl.java
+++ b/src/net/sourceforge/plantuml/cute/CrossingSegment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,33 +32,41 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.cucadiagram;
+package net.sourceforge.plantuml.cute;
+import java.awt.geom.Point2D;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import net.sourceforge.plantuml.FontParam;
-import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.geom.LineSegmentDouble;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class BlockMemberImpl implements BlockMember {
+public class CrossingSegment {
- private final List<Member> members = new ArrayList<Member>();
+ private final Balloon balloon;
+ private final LineSegmentDouble segment;
- public BlockMemberImpl(List<Member> members) {
- this.members.addAll(members);
+ public CrossingSegment(Balloon balloon, LineSegmentDouble segment) {
+ this.balloon = balloon;
+ this.segment = segment;
}
- public List<Member> getAll() {
- return Collections.unmodifiableList(members);
- }
+ public List<Point2D> intersection() {
+ final List<Point2D> result = new ArrayList<Point2D>();
+
+ final UTranslate tr = new UTranslate(balloon.getCenter());
+ final UTranslate trInverse = tr.reverse();
+
+ final CrossingSimple simple = new CrossingSimple(balloon.getRadius(),
+ new InfiniteLine(segment).translate(trInverse));
+ for (Point2D pt : simple.intersection()) {
+ pt = tr.getTranslated(pt);
+ if (segment.isPointOnSegment(pt)) {
+ result.add(pt);
+ }
+ }
- public TextBlock asTextBlock(FontParam fontParam, ISkinParam skinParam) {
- return new TextBlockLineBefore(TextBlockUtils.withMargin((TextBlock) new MethodsOrFieldsArea(members,
- fontParam, skinParam), 6, 4));
+ return result;
}
}
diff --git a/src/net/sourceforge/plantuml/cute/CrossingSimple.java b/src/net/sourceforge/plantuml/cute/CrossingSimple.java
index 6c3a8db..4de4ad0 100644
--- a/src/net/sourceforge/plantuml/cute/CrossingSimple.java
+++ b/src/net/sourceforge/plantuml/cute/CrossingSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/CutePath.java b/src/net/sourceforge/plantuml/cute/CutePath.java
index 28627b8..70f7a52 100644
--- a/src/net/sourceforge/plantuml/cute/CutePath.java
+++ b/src/net/sourceforge/plantuml/cute/CutePath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/CuteShape.java b/src/net/sourceforge/plantuml/cute/CuteShape.java
index 7616adc..71579c2 100644
--- a/src/net/sourceforge/plantuml/cute/CuteShape.java
+++ b/src/net/sourceforge/plantuml/cute/CuteShape.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/CuteShapeFactory.java b/src/net/sourceforge/plantuml/cute/CuteShapeFactory.java
index bc1726f..e69e0b9 100644
--- a/src/net/sourceforge/plantuml/cute/CuteShapeFactory.java
+++ b/src/net/sourceforge/plantuml/cute/CuteShapeFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,8 @@ package net.sourceforge.plantuml.cute;
import java.util.Map;
+import net.sourceforge.plantuml.StringUtils;
+
public class CuteShapeFactory {
private final Map<String, Group> groups;
@@ -51,7 +53,7 @@ public class CuteShapeFactory {
}
private CuteShape createCuteShape(String data) {
- data = data.toLowerCase().trim();
+ data = StringUtils.trin(data.toLowerCase());
final VarArgs varArgs = new VarArgs(data);
if (data.startsWith("circle ")) {
return new Circle(varArgs);
@@ -69,12 +71,12 @@ public class CuteShapeFactory {
return new Triangle(varArgs);
}
final String first = data.split(" ")[0];
- System.err.println("Looking for group " + first + " in " + groups.keySet());
+ // System.err.println("Looking for group " + first + " in " + groups.keySet());
final Group group = groups.get(first);
if (group == null) {
throw new IllegalArgumentException("Cannot find group " + first + " in " + groups.keySet());
}
- System.err.println("Found group " + first + " in " + groups.keySet());
+ // System.err.println("Found group " + first + " in " + groups.keySet());
return group;
}
diff --git a/src/net/sourceforge/plantuml/cute/Group.java b/src/net/sourceforge/plantuml/cute/Group.java
index 3749543..b1e7fe0 100644
--- a/src/net/sourceforge/plantuml/cute/Group.java
+++ b/src/net/sourceforge/plantuml/cute/Group.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/InfiniteLine.java b/src/net/sourceforge/plantuml/cute/InfiniteLine.java
index 8423d84..95d5ad1 100644
--- a/src/net/sourceforge/plantuml/cute/InfiniteLine.java
+++ b/src/net/sourceforge/plantuml/cute/InfiniteLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.cute;
import java.awt.geom.Point2D;
+import net.sourceforge.plantuml.geom.AbstractLineSegment;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class InfiniteLine {
@@ -48,6 +49,10 @@ public class InfiniteLine {
this.b = b;
}
+ public InfiniteLine(AbstractLineSegment segment) {
+ this(segment.getP1(), segment.getP2());
+ }
+
@Override
public String toString() {
return "{" + a + ";" + b + "}";
diff --git a/src/net/sourceforge/plantuml/cute/MyDouble.java b/src/net/sourceforge/plantuml/cute/MyDouble.java
index 6f85713..fc151b8 100644
--- a/src/net/sourceforge/plantuml/cute/MyDouble.java
+++ b/src/net/sourceforge/plantuml/cute/MyDouble.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/MyPoint2D.java b/src/net/sourceforge/plantuml/cute/MyPoint2D.java
index b74cf17..c962d62 100644
--- a/src/net/sourceforge/plantuml/cute/MyPoint2D.java
+++ b/src/net/sourceforge/plantuml/cute/MyPoint2D.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/PSystemCute.java b/src/net/sourceforge/plantuml/cute/PSystemCute.java
index f1cb15e..6de75d3 100644
--- a/src/net/sourceforge/plantuml/cute/PSystemCute.java
+++ b/src/net/sourceforge/plantuml/cute/PSystemCute.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,14 +36,11 @@ package net.sourceforge.plantuml.cute;
import java.io.IOException;
import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.DiagramDescriptionImpl;
import net.sourceforge.plantuml.core.ImageData;
@@ -65,7 +62,7 @@ public class PSystemCute extends AbstractPSystem {
}
public void doCommandLine(String line) {
- line = line.trim();
+ line = StringUtils.trin(line);
if (line.length()==0 || line.startsWith("'")) {
return;
}
@@ -89,6 +86,6 @@ public class PSystemCute extends AbstractPSystem {
public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, null, null, null, 10, 10, null, false);
builder.addUDrawable(root);
- return builder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return builder.writeImageTOBEMOVED(fileFormat, os);
}
}
diff --git a/src/net/sourceforge/plantuml/cute/PSystemCuteFactory.java b/src/net/sourceforge/plantuml/cute/PSystemCuteFactory.java
index 1550495..aa8acbd 100644
--- a/src/net/sourceforge/plantuml/cute/PSystemCuteFactory.java
+++ b/src/net/sourceforge/plantuml/cute/PSystemCuteFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Positionned.java b/src/net/sourceforge/plantuml/cute/Positionned.java
index 6cd6e4e..f392ae1 100644
--- a/src/net/sourceforge/plantuml/cute/Positionned.java
+++ b/src/net/sourceforge/plantuml/cute/Positionned.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/PositionnedImpl.java b/src/net/sourceforge/plantuml/cute/PositionnedImpl.java
index d907968..9c08ae9 100644
--- a/src/net/sourceforge/plantuml/cute/PositionnedImpl.java
+++ b/src/net/sourceforge/plantuml/cute/PositionnedImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Rectangle.java b/src/net/sourceforge/plantuml/cute/Rectangle.java
index c04ad7e..84c8c23 100644
--- a/src/net/sourceforge/plantuml/cute/Rectangle.java
+++ b/src/net/sourceforge/plantuml/cute/Rectangle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/RotationZoom.java b/src/net/sourceforge/plantuml/cute/RotationZoom.java
index aa84f3e..796b8a8 100644
--- a/src/net/sourceforge/plantuml/cute/RotationZoom.java
+++ b/src/net/sourceforge/plantuml/cute/RotationZoom.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Segment.java b/src/net/sourceforge/plantuml/cute/Segment.java
index ce63eef..a3d26f9 100644
--- a/src/net/sourceforge/plantuml/cute/Segment.java
+++ b/src/net/sourceforge/plantuml/cute/Segment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Stick.java b/src/net/sourceforge/plantuml/cute/Stick.java
index 54acf3c..25da759 100644
--- a/src/net/sourceforge/plantuml/cute/Stick.java
+++ b/src/net/sourceforge/plantuml/cute/Stick.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Tension.java b/src/net/sourceforge/plantuml/cute/Tension.java
index de13d5b..1a5e823 100644
--- a/src/net/sourceforge/plantuml/cute/Tension.java
+++ b/src/net/sourceforge/plantuml/cute/Tension.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/Triangle.java b/src/net/sourceforge/plantuml/cute/Triangle.java
index 2a6ef81..1a21bd8 100644
--- a/src/net/sourceforge/plantuml/cute/Triangle.java
+++ b/src/net/sourceforge/plantuml/cute/Triangle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/TriangleCorner.java b/src/net/sourceforge/plantuml/cute/TriangleCorner.java
index 7b9cb4a..3f8e6bc 100644
--- a/src/net/sourceforge/plantuml/cute/TriangleCorner.java
+++ b/src/net/sourceforge/plantuml/cute/TriangleCorner.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/TriangleCornerSimple.java b/src/net/sourceforge/plantuml/cute/TriangleCornerSimple.java
index 0dbbed0..56be521 100644
--- a/src/net/sourceforge/plantuml/cute/TriangleCornerSimple.java
+++ b/src/net/sourceforge/plantuml/cute/TriangleCornerSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/cute/VarArgs.java b/src/net/sourceforge/plantuml/cute/VarArgs.java
index 5b8ff53..51e00af 100644
--- a/src/net/sourceforge/plantuml/cute/VarArgs.java
+++ b/src/net/sourceforge/plantuml/cute/VarArgs.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java
index 03c0fd3..3fd928f 100644
--- a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java
+++ b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -69,7 +69,7 @@ public class DescriptionDiagram extends AbstractEntityDiagram {
LeafType.DESCRIPTION, USymbol.ACTOR);
}
if (code2.startsWith("()")) {
- code2 = code2.substring(2).trim();
+ code2 = StringUtils.trin(code2.substring(2));
code2 = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(code2);
return getOrCreateLeafDefault(Code.of(code2), LeafType.DESCRIPTION, USymbol.INTERFACE);
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java
index dfb2c7f..08745b3 100644
--- a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,11 +38,11 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.classdiagram.command.CommandHideShowSpecificClass;
import net.sourceforge.plantuml.classdiagram.command.CommandUrl;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandEndPackage;
import net.sourceforge.plantuml.command.CommandFootboxIgnored;
-import net.sourceforge.plantuml.command.CommandPackage;
import net.sourceforge.plantuml.command.CommandPage;
import net.sourceforge.plantuml.command.CommandRankDir;
import net.sourceforge.plantuml.command.UmlDiagramFactory;
@@ -79,12 +79,9 @@ public class DescriptionDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandLinkElement());
//
cmds.add(new CommandPackageWithUSymbol());
- cmds.add(new CommandPackage());
cmds.add(new CommandEndPackage());
- // addCommand(new CommandNamespace());
- // addCommand(new CommandEndNamespace());
final FactoryNoteCommand factoryNoteCommand = new FactoryNoteCommand();
- cmds.add(factoryNoteCommand.createMultiLine());
+ cmds.add(factoryNoteCommand.createMultiLine(false));
final FactoryNoteOnEntityCommand factoryNoteOnEntityCommand = new FactoryNoteOnEntityCommand(new RegexOr(
"ENTITY", //
@@ -100,19 +97,19 @@ public class DescriptionDiagramFactory extends UmlDiagramFactory {
cmds.add(factoryNoteCommand.createSingleLine());
cmds.add(new CommandUrl());
- // addCommand(new CommandCreateComponent2());
cmds.add(new CommandCreateElementFull());
- cmds.add(new CommandCreateElementMultilines());
- // addCommand(new CommandCreateElementTyped());
- // addCommand(new CommandCreateCircleInterface());
- // addCommand(new CommandCreateActorInComponent());
+ cmds.add(new CommandCreateElementMultilines(0));
+ cmds.add(new CommandCreateElementMultilines(1));
- cmds.add(factoryNoteOnEntityCommand.createMultiLine());
- cmds.add(factoryNoteCommand.createMultiLine());
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(true));
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(false));
+ cmds.add(factoryNoteCommand.createMultiLine(false));
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
- cmds.add(factoryNoteOnLinkCommand.createMultiLine());
+ cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
+
+ cmds.add(new CommandHideShowSpecificClass());
return cmds;
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
index 5273fd5..c8e5a0a 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.descdiagram.command;
import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
@@ -50,9 +51,11 @@ import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.USymbol;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiagram> {
@@ -88,9 +91,14 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("$"));
}
+
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
private static final String CODE_CORE = "[\\p{L}0-9_.]+|\\(\\)[%s]*[\\p{L}0-9_.]+|\\(\\)[%s]*[%g][^%g]+[%g]|:[^:]+:|\\([^()]+\\)|\\[[^\\[\\]]+\\]";
private static final String CODE = "(" + CODE_CORE + ")";
@@ -101,8 +109,8 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
private static final String DISPLAY_WITHOUT_QUOTE = "(" + DISPLAY_CORE + "|[\\p{L}0-9_.]+)";
@Override
- final protected boolean isForbidden(String line) {
- if (line.matches("^[\\p{L}0-9_.]+$")) {
+ final protected boolean isForbidden(CharSequence line) {
+ if (line.toString().matches("^[\\p{L}0-9_.]+$")) {
return true;
}
return false;
@@ -117,7 +125,7 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
final String symbol;
if (codeRaw.startsWith("()")) {
symbol = "interface";
- codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw.substring(2).trim());
+ codeRaw = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils.trin(codeRaw.substring(2)));
} else if (codeChar == '(' || codeDisplay == '(') {
symbol = "usecase";
} else if (codeChar == ':' || codeDisplay == ':') {
@@ -207,7 +215,7 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
entity.setUSymbol(usymbol);
if (stereotype != null) {
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
@@ -218,7 +226,15 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
entity.addUrl(url);
}
- entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
+ if (lineColor != null) {
+ colors = colors.add(ColorType.LINE, lineColor);
+ }
+ entity.setColors(colors);
+
+ //entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java
index d5ac192..2d74d32 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementMultilines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,8 @@ package net.sourceforge.plantuml.descdiagram.command;
import java.util.List;
import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
@@ -50,40 +52,63 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.USymbol;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandCreateElementMultilines extends CommandMultilines2<DescriptionDiagram> {
+ private final int type;
+
enum Mode {
EXTENDS, IMPLEMENTS
};
- public CommandCreateElementMultilines() {
- super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
+ public CommandCreateElementMultilines(int type) {
+ super(getRegexConcat(type), MultilinesStrategy.REMOVE_STARTING_QUOTE);
+ this.type = type;
}
@Override
public String getPatternEnd() {
- return "(?i)^(.*)[%g]$";
+ if (type == 0) {
+ return "(?i)^(.*)[%g]$";
+ }
+ if (type == 1) {
+ return "(?i)^(.*)\\]$";
+ }
+ throw new IllegalArgumentException();
}
- private static RegexConcat getRegexConcat() {
- return new RegexConcat(new RegexLeaf("^"), //
- new RegexLeaf("TYPE", "(usecase|database)[%s]+"), //
- new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
- new RegexLeaf("[%s]*"), //
- new RegexLeaf("DESC", "as[%s]*[%g](.*)$"));
+ private static RegexConcat getRegexConcat(int type) {
+ if (type == 0) {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("TYPE", "(usecase|database|artifact)[%s]+"), //
+ new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), //
+ new RegexLeaf("[%s]*"), //
+ ColorParser.exp1(), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("DESC", "as[%s]*[%g](.*)$"));
+ }
+ if (type == 1) {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("TYPE", "(package|usecase|database|artifact)[%s]+"), //
+ new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREO", "(\\<\\<.+\\>\\>)?"), //
+ new RegexLeaf("[%s]*"), //
+ ColorParser.exp1(), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("DESC", "\\[(.*)$"));
+ }
+ throw new IllegalArgumentException();
}
- public CommandExecutionResult executeNow(DescriptionDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, false);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(DescriptionDiagram diagram, BlocLines lines) {
+ lines = lines.trim(false);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final String symbol = StringUtils.goUpperCase(line0.get("TYPE", 0));
final LeafType type;
final USymbol usymbol;
@@ -91,22 +116,29 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
if (symbol.equalsIgnoreCase("usecase")) {
type = LeafType.USECASE;
usymbol = null;
+ } else if (symbol.equalsIgnoreCase("package")) {
+ type = LeafType.DESCRIPTION;
+ usymbol = USymbol.PACKAGE;
} else if (symbol.equalsIgnoreCase("database")) {
type = LeafType.DESCRIPTION;
usymbol = USymbol.DATABASE;
+ } else if (symbol.equalsIgnoreCase("artifact")) {
+ type = LeafType.DESCRIPTION;
+ usymbol = USymbol.ARTIFACT;
} else {
throw new IllegalStateException();
}
final Code code = Code.of(line0.get("CODE", 0));
- Display display = Display.create(lines.subList(1, lines.size() - 1));
+ final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()), lines.getLast499()
+ .toString());
+ lines = lines.subExtract(1, 1);
+ Display display = lines.toDisplay();
final String descStart = line0.get("DESC", 0);
if (StringUtils.isNotEmpty(descStart)) {
display = display.addFirst(descStart);
}
- final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()),
- lines.get(lines.size() - 1));
if (StringUtils.isNotEmpty(lineLast.get(0))) {
display = display.add(lineLast.get(0));
}
@@ -117,11 +149,11 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
result.setUSymbol(usymbol);
if (stereotype != null) {
result.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
- result.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
+ result.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java
index 5b045e2..2436e5f 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,9 @@ package net.sourceforge.plantuml.descdiagram.command;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Direction;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@@ -56,7 +58,9 @@ import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
import net.sourceforge.plantuml.graphic.USymbol;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
@@ -74,11 +78,11 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
new RegexLeaf("HEAD2", "(0\\)|<<|[<^*+#0)]|<\\||[%s]+o)?"), //
new RegexLeaf("BODY1", "([-=.~]+)"), //
new RegexLeaf("ARROW_STYLE1",
- "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden)(?:,#\\w+|,dotted|,dashed|,bold|,hidden)*)\\])?"),
+ "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("DIRECTION", "(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.~0()]))?"), //
new RegexLeaf("INSIDE", "(?:(0|\\(0\\)|\\(0|0\\))(?=[-=.~]))?"), //
new RegexLeaf("ARROW_STYLE2",
- "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden)(?:,#\\w+|,dotted|,dashed|,bold|,hidden)*)\\])?"),
+ "(?:\\[((?:#\\w+|dotted|dashed|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("BODY2", "([-=.~]*)"), //
new RegexLeaf("HEAD1", "(\\(0|>>|[>^*+#0(]|\\|>|o[%s]+)?"), //
new RegexLeaf("[%s]*"), //
@@ -86,9 +90,17 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
new RegexLeaf("[%s]*"), //
getGroup("ENT2"), //
new RegexLeaf("[%s]*"), //
+ color().getRegex(), //
+ new RegexLeaf("[%s]*"), //
+ new RegexLeaf("STEREOTYPE", "(\\<\\<.*\\>\\>)?"), //
+ new RegexLeaf("[%s]*"), //
new RegexLeaf("LABEL_LINK", "(?::[%s]*(.+))?$"));
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.LINE);
+ }
+
private LinkType getLinkType(RegexResult arg) {
final String head1 = trimAndLowerCase(arg.get("HEAD1", 0));
final String head2 = trimAndLowerCase(arg.get("HEAD2", 0));
@@ -170,7 +182,7 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (s == null) {
return "";
}
- return StringUtils.goLowerCase(s.trim());
+ return StringUtils.goLowerCase(StringUtils.trin(s));
}
private Direction getDirection(RegexResult arg) {
@@ -189,7 +201,7 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
private static RegexLeaf getGroup(String name) {
return new RegexLeaf(
name,
- "([\\p{L}0-9_.]+|\\(\\)[%s]*[\\p{L}0-9_.]+|\\(\\)[%s]*[%g][^%g]+[%g]|:[^:]+:|(?!\\[\\*\\])\\[[^\\[\\]]+\\]|\\((?!\\*\\))[^)]+\\))(?:[%s]*(\\<\\<.*\\>\\>))?");
+ "([\\p{L}0-9_.]+|\\(\\)[%s]*[\\p{L}0-9_.]+|\\(\\)[%s]*[%g][^%g]+[%g]|:[^:]+:|(?!\\[\\*\\])\\[[^\\[\\]]+\\]|\\((?!\\*\\))[^)]+\\))");
}
static class Labels {
@@ -216,7 +228,8 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
final Matcher m1 = p1.matcher(labelLink);
if (m1.matches()) {
firstLabel = m1.group(1);
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m1.group(2).trim()).trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils
+ .trin(m1.group(2))));
secondLabel = m1.group(3);
return;
}
@@ -224,7 +237,8 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
final Matcher m2 = p2.matcher(labelLink);
if (m2.matches()) {
firstLabel = m2.group(1);
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m2.group(2).trim()).trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils
+ .trin(m2.group(2))));
secondLabel = null;
return;
}
@@ -232,7 +246,8 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
final Matcher m3 = p3.matcher(labelLink);
if (m3.matches()) {
firstLabel = null;
- labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m3.group(1).trim()).trim();
+ labelLink = StringUtils.trin(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils
+ .trin(m3.group(1))));
secondLabel = m3.group(2);
}
}
@@ -247,21 +262,18 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (diagram.isGroup(ent1) && diagram.isGroup(ent2)) {
return executePackageLink(diagram, arg);
}
- // if (diagram.isGroup(ent1) || diagram.isGroup(ent2)) {
- // return CommandExecutionResult.error("Package can be only linked to other package");
- // }
final IEntity cl1 = diagram.isGroup(ent1) ? diagram.getGroup(Code.of(arg.get("ENT1", 0))) : getOrCreateLeaf(
diagram, ent1);
final IEntity cl2 = diagram.isGroup(ent2) ? diagram.getGroup(Code.of(arg.get("ENT2", 0))) : getOrCreateLeaf(
diagram, ent2);
- if (arg.get("ENT1", 1) != null) {
- cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
- }
- if (arg.get("ENT2", 1) != null) {
- cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
- }
+ // if (arg.get("ENT1", 1) != null) {
+ // cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
+ // }
+ // if (arg.get("ENT2", 1) != null) {
+ // cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
+ // }
final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg);
@@ -280,7 +292,14 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv();
}
- CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link);
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+ colors = CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors);
+ if (arg.get("STEREOTYPE", 0) != null) {
+ final Stereotype stereotype = new Stereotype(arg.get("STEREOTYPE", 0));
+ colors = colors.applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.componentArrow);
+ }
+
+ link.setColors(colors);
diagram.addLink(link);
return CommandExecutionResult.ok();
}
@@ -288,9 +307,8 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
private ILeaf getOrCreateLeaf(DescriptionDiagram diagram, final Code code2) {
final String code = code2.getFullName();
if (code.startsWith("()")) {
- return diagram.getOrCreateLeaf(
- Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(code.substring(2).trim())),
- LeafType.DESCRIPTION, USymbol.INTERFACE);
+ return diagram.getOrCreateLeaf(Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(StringUtils
+ .trin(code.substring(2)))), LeafType.DESCRIPTION, USymbol.INTERFACE);
}
final char codeChar = code.length() > 2 ? code.charAt(0) : 0;
if (codeChar == '(') {
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandNamespaceSeparator.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandNamespaceSeparator.java
index c033296..0bcb016 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandNamespaceSeparator.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandNamespaceSeparator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandNewpage.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandNewpage.java
index 21198ac..8e51c46 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandNewpage.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -60,8 +60,8 @@ public class CommandNewpage extends SingleLineCommand2<AbstractPSystem> {
@Override
protected CommandExecutionResult executeArg(AbstractPSystem diagram, RegexResult arg) {
- // NewpagedDiagram result = NewpagedDiagram.newpage(diagram, factory.createEmptyDiagram());
NewpagedDiagram result = new NewpagedDiagram(diagram, factory.createEmptyDiagram());
+ // NewpagedDiagram result = NewpagedDiagram.newpage(diagram, factory.createEmptyDiagram());
return CommandExecutionResult.newDiagram(result);
}
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java
index dfbaf85..1be27ad 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.descdiagram.command;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@@ -47,9 +48,9 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.USymbol;
-import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.utils.UniqueSequence;
public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntityDiagram> {
@@ -69,7 +70,7 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("[%s]*\\{$"));
}
@@ -100,7 +101,7 @@ public class CommandPackageWithUSymbol extends SingleLineCommand2<AbstractEntity
}
final String color = arg.get("COLOR", 0);
if (color != null) {
- p.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
+ p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(color));
}
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/directdot/PSystemDot.java b/src/net/sourceforge/plantuml/directdot/PSystemDot.java
index 2ca1332..bf60f9d 100644
--- a/src/net/sourceforge/plantuml/directdot/PSystemDot.java
+++ b/src/net/sourceforge/plantuml/directdot/PSystemDot.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java b/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java
index dcc9fef..8177a46 100644
--- a/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java
+++ b/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/donors/PSystemDonors.java b/src/net/sourceforge/plantuml/donors/PSystemDonors.java
index fdcc790..c0f6d4b 100644
--- a/src/net/sourceforge/plantuml/donors/PSystemDonors.java
+++ b/src/net/sourceforge/plantuml/donors/PSystemDonors.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -59,19 +59,14 @@ import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemDonors extends AbstractPSystem {
- public static final String DONORS = "UDfTaikosZ0CXlTw2gypquT8IOTEu5pcqEcYEv7e41sCH6s7DddwYhR11gsiqUtx9TU--cyKu9KI1LTBKc7iu1jLsVG4MyrkY50lfRY7TSWXcc17Uuo9KTop3WArz1hSMYdDT7s-lrl6aeu2Mom6IOA65uSzrBcrNc0tPeG9rbpTcoYq2-KOOPVeF92ubUhPz3NB78gmEJsKQe2LUXRtfcCaQCU7UFMX9cHnpWnF1JMUIjT6rPv-e_IspjN0rlM0OJAbRpVPSe3daZxDyEBvOWKDTqSZlqLOu4kyjPO2eg8BDFE9KvZS5WVj4ThhqdyCQEsBl8fyFfVPSR8r2IRBCpxZQl_1q_5EbVHtxjzAjaRUobv2uXc-vd2lyCJTGDvzHlPJgS3F9KoCZsWjeNngiVivKdJDk0zef_LP_dVzIDGDRXCmOaOwaFtOue2_hX_DKjn6Bmn_0C5QlDy0";
-
- // public ImageData exportDiagram(OutputStream os, int num, FileFormatOption
- // fileFormat) throws IOException {
- // return getGraphicStrings().exportDiagram(os, fileFormat);
- // }
+ public static final String DONORS = "UDfTKa6MsZ0CtUiKNkTD3v4XBNq1PlgWxM9sWcY8m5YfxT26itNNYrMX3JPePJtfI__BlxJ5_o0FNoYIDwMBuXXty9MA57A2fQJK1oWdA6vXxbE91jZG5aDaTEP5MWUbQyIRkL2yqFXyVzUEgHqTB35Rv29KF2LieKoZvGoRFb4OOCx5VJY1UcBP1zX4wbfoPYRIgRvgsaC15gS7g7YOYMLdrj87Whf_g1S7KI5JqZ6iCjPuobDTLLhwXQxHSyvQrgbxz8CgNTzakpsyvEpZ1LujdnLGyUwep6yLTl0nt4QxZ4H1PwWk9uv-C4jifK6enwE_jQZZixw2RFekZUEWPt8OjK_vAQ_w7tawtgbopLrwHR8EiWfxzP4ly3cL6u4LxrgovXdP3ha2Uyd9XF18hIPq7shS_UWfcAhVUjIljKd-Tpb4shLcuJ5WehGdTMpsWJz7escBMSYPSzzSdVCjwMU4TURbSSMTpeEYkynbSXmFzImU7ThkoRnHHEa2h5Kl-iOiUFnf-6J5Z-TV_VbjxTK3oHysywgwwo_hGETg";
public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
final GraphicStrings result = getGraphicStrings();
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/donors/PSystemDonorsFactory.java b/src/net/sourceforge/plantuml/donors/PSystemDonorsFactory.java
index 360d5bb..902c711 100644
--- a/src/net/sourceforge/plantuml/donors/PSystemDonorsFactory.java
+++ b/src/net/sourceforge/plantuml/donors/PSystemDonorsFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/EggUtils.java b/src/net/sourceforge/plantuml/eggs/EggUtils.java
index eb681fc..3e2de34 100644
--- a/src/net/sourceforge/plantuml/eggs/EggUtils.java
+++ b/src/net/sourceforge/plantuml/eggs/EggUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/GraphicsPath.java b/src/net/sourceforge/plantuml/eggs/GraphicsPath.java
index 371de2c..5020655 100644
--- a/src/net/sourceforge/plantuml/eggs/GraphicsPath.java
+++ b/src/net/sourceforge/plantuml/eggs/GraphicsPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java
index f9fe288..3aaf5f3 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -77,7 +77,7 @@ public class PSystemAppleTwo extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java
index 64a13ef..d069a1d 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java b/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java
index e6ef41d..16eb63c 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -69,7 +69,7 @@ public class PSystemCharlie extends AbstractPSystem {
ug.draw(im);
}
});
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
public DiagramDescription getDescription() {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java
index 44e7998..88b99c0 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java
index 58c49fb..0090073 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -69,7 +69,7 @@ public class PSystemEgg extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java
index 70dd4fe..2a16e60 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemLost.java b/src/net/sourceforge/plantuml/eggs/PSystemLost.java
index 0e0442f..974cd32 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemLost.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemLost.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -65,7 +65,7 @@ public class PSystemLost extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java
index 0a403de..51b893b 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemPath.java b/src/net/sourceforge/plantuml/eggs/PSystemPath.java
index 4ff71a6..26c564c 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemPath.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java
index 7988ecd..a69825e 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemRIP.java b/src/net/sourceforge/plantuml/eggs/PSystemRIP.java
index e88f56f..45be171 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemRIP.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemRIP.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -86,7 +86,7 @@ public class PSystemRIP extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java
index 189804b..ad72a4f 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java b/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java
index e9ab061..381abdd 100644
--- a/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java
+++ b/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eggs/SentenceProducer.java b/src/net/sourceforge/plantuml/eggs/SentenceProducer.java
index cb54f94..94b0190 100644
--- a/src/net/sourceforge/plantuml/eggs/SentenceProducer.java
+++ b/src/net/sourceforge/plantuml/eggs/SentenceProducer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/EpsGraphics.java b/src/net/sourceforge/plantuml/eps/EpsGraphics.java
index 175548a..669c5cc 100644
--- a/src/net/sourceforge/plantuml/eps/EpsGraphics.java
+++ b/src/net/sourceforge/plantuml/eps/EpsGraphics.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -518,6 +518,9 @@ public class EpsGraphics {
}
protected void appendColor(Color c) {
+ if (c == null) {
+ return;
+ }
final double r = c.getRed() / 255.0;
final double g = c.getGreen() / 255.0;
final double b = c.getBlue() / 255.0;
@@ -525,6 +528,9 @@ public class EpsGraphics {
}
protected void appendColorShort(Color c) {
+ if (c == null) {
+ return;
+ }
final double r = c.getRed() / 255.0;
final double g = c.getGreen() / 255.0;
final double b = c.getBlue() / 255.0;
diff --git a/src/net/sourceforge/plantuml/eps/EpsGraphicsMacro.java b/src/net/sourceforge/plantuml/eps/EpsGraphicsMacro.java
index ac67870..8cd9d24 100644
--- a/src/net/sourceforge/plantuml/eps/EpsGraphicsMacro.java
+++ b/src/net/sourceforge/plantuml/eps/EpsGraphicsMacro.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/EpsGraphicsMacroAndText.java b/src/net/sourceforge/plantuml/eps/EpsGraphicsMacroAndText.java
index 6e6a504..18fd36d 100644
--- a/src/net/sourceforge/plantuml/eps/EpsGraphicsMacroAndText.java
+++ b/src/net/sourceforge/plantuml/eps/EpsGraphicsMacroAndText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/EpsStrategy.java b/src/net/sourceforge/plantuml/eps/EpsStrategy.java
index bf7a851..afc1536 100644
--- a/src/net/sourceforge/plantuml/eps/EpsStrategy.java
+++ b/src/net/sourceforge/plantuml/eps/EpsStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommand.java b/src/net/sourceforge/plantuml/eps/PostScriptCommand.java
index a4b6059..22b94c2 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommand.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommandCurveTo.java b/src/net/sourceforge/plantuml/eps/PostScriptCommandCurveTo.java
index 6f46ece..d842864 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommandCurveTo.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommandCurveTo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommandLineTo.java b/src/net/sourceforge/plantuml/eps/PostScriptCommandLineTo.java
index 07ee796..3379ec4 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommandLineTo.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommandLineTo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommandMacro.java b/src/net/sourceforge/plantuml/eps/PostScriptCommandMacro.java
index 04c5998..f9ee5fd 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommandMacro.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommandMacro.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommandMoveTo.java b/src/net/sourceforge/plantuml/eps/PostScriptCommandMoveTo.java
index fccbd4f..5495317 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommandMoveTo.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommandMoveTo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommandQuadTo.java b/src/net/sourceforge/plantuml/eps/PostScriptCommandQuadTo.java
index 2165d5a..88dcc61 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommandQuadTo.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommandQuadTo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptCommandRaw.java b/src/net/sourceforge/plantuml/eps/PostScriptCommandRaw.java
index bce1aaa..c723629 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptCommandRaw.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptCommandRaw.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/eps/PostScriptData.java b/src/net/sourceforge/plantuml/eps/PostScriptData.java
index 7bb2d3e..046938c 100644
--- a/src/net/sourceforge/plantuml/eps/PostScriptData.java
+++ b/src/net/sourceforge/plantuml/eps/PostScriptData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java
index 938a647..bc5f41c 100644
--- a/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java
+++ b/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtils.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtils.java
index 1455c1d..504fc2f 100644
--- a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtils.java
+++ b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java
index 3ec50ee..db3ad26 100644
--- a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java
+++ b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java b/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java
index 12ecc31..5d6cea8 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,12 +41,12 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.golem.Tile;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -56,7 +56,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class ActivityBox implements TextBlock {
+public class ActivityBox extends AbstractTextBlock {
private static final int CORNER = 25;
private static final int MARGIN = 10;
@@ -71,8 +71,8 @@ public class ActivityBox implements TextBlock {
this.id = id;
this.label = label;
final UFont font = new UFont("Serif", Font.PLAIN, 14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
- tb = TextBlockUtils.create(Display.create(label), fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final FontConfiguration fc = FontConfiguration.blackBlueTrue(font);
+ tb = Display.create(label).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty());
}
public Tile getTile() {
@@ -90,14 +90,14 @@ public class ActivityBox implements TextBlock {
public void drawU(UGraphic ug) {
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
// final Dimension2D dimDesc = tb.calculateDimension(ug.getStringBounder());
-
+
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
final Shadowable rect = new URectangle(widthTotal, heightTotal, CORNER, CORNER);
ug = ug.apply(new UChangeColor(HtmlColorUtils.MY_RED));
ug = ug.apply(new UChangeBackColor(HtmlColorUtils.MY_YELLOW));
ug.apply(new UStroke(1.5)).draw(rect);
-
+
tb.drawU(ug.apply(new UTranslate(MARGIN, MARGIN)));
}
diff --git a/src/net/sourceforge/plantuml/flowdiagram/CommandLineSimple.java b/src/net/sourceforge/plantuml/flowdiagram/CommandLineSimple.java
index 629dc3b..60c2079 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/CommandLineSimple.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/CommandLineSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/flowdiagram/CommandLink.java b/src/net/sourceforge/plantuml/flowdiagram/CommandLink.java
index 77fa639..ca3b1c3 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/CommandLink.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/CommandLink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
index cb665b0..ad594d9 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,11 +36,10 @@ package net.sourceforge.plantuml.flowdiagram;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
-import java.awt.image.BufferedImage;
+import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
@@ -80,6 +79,10 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
private final Map<Tile, ActivityBox> tilesBoxes = new HashMap<Tile, ActivityBox>();
private Tile lastTile;
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
public DiagramDescription getDescription() {
return new DiagramDescriptionImpl("Flow Diagram", getClass());
}
diff --git a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java
index 8e1fa27..591b126 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/font/PSystemListFonts.java b/src/net/sourceforge/plantuml/font/PSystemListFonts.java
index c9b260e..656b74a 100644
--- a/src/net/sourceforge/plantuml/font/PSystemListFonts.java
+++ b/src/net/sourceforge/plantuml/font/PSystemListFonts.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -77,7 +77,7 @@ public class PSystemListFonts extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/font/PSystemListFontsFactory.java b/src/net/sourceforge/plantuml/font/PSystemListFontsFactory.java
index 311c24b..c4b4623 100644
--- a/src/net/sourceforge/plantuml/font/PSystemListFontsFactory.java
+++ b/src/net/sourceforge/plantuml/font/PSystemListFontsFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,7 +46,7 @@ public class PSystemListFontsFactory extends PSystemSingleLineFactory {
if (lineLower.equals("listfont") || lineLower.equals("listfonts") || lineLower.startsWith("listfont ")
|| lineLower.startsWith("listfonts ")) {
final int idx = line.indexOf(' ');
- return new PSystemListFonts(idx == -1 ? "This is a test" : line.substring(idx).trim());
+ return new PSystemListFonts(idx == -1 ? "This is a test" : StringUtils.trin(line.substring(idx)));
}
return null;
}
diff --git a/src/net/sourceforge/plantuml/ftp/FtpConnexion.java b/src/net/sourceforge/plantuml/ftp/FtpConnexion.java
index 547ac04..6ea0b91 100644
--- a/src/net/sourceforge/plantuml/ftp/FtpConnexion.java
+++ b/src/net/sourceforge/plantuml/ftp/FtpConnexion.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ftp/FtpLoop.java b/src/net/sourceforge/plantuml/ftp/FtpLoop.java
index a934c0b..749991f 100644
--- a/src/net/sourceforge/plantuml/ftp/FtpLoop.java
+++ b/src/net/sourceforge/plantuml/ftp/FtpLoop.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ftp/FtpServer.java b/src/net/sourceforge/plantuml/ftp/FtpServer.java
index bbfb07a..93cdbce 100644
--- a/src/net/sourceforge/plantuml/ftp/FtpServer.java
+++ b/src/net/sourceforge/plantuml/ftp/FtpServer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/fun/IconLoader.java b/src/net/sourceforge/plantuml/fun/IconLoader.java
index 0780a62..23fd1e0 100644
--- a/src/net/sourceforge/plantuml/fun/IconLoader.java
+++ b/src/net/sourceforge/plantuml/fun/IconLoader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/AbstractFigure.java b/src/net/sourceforge/plantuml/geom/AbstractFigure.java
index b409c71..9f5bab2 100644
--- a/src/net/sourceforge/plantuml/geom/AbstractFigure.java
+++ b/src/net/sourceforge/plantuml/geom/AbstractFigure.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/AbstractLineSegment.java b/src/net/sourceforge/plantuml/geom/AbstractLineSegment.java
index a50f75f..ac6f866 100644
--- a/src/net/sourceforge/plantuml/geom/AbstractLineSegment.java
+++ b/src/net/sourceforge/plantuml/geom/AbstractLineSegment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -77,7 +77,7 @@ public abstract class AbstractLineSegment extends Line2D {
} else if (other.isHorizontal()) {
u = getIntersectionHorizontal(other.getP1().getY());
} else {
- throw new UnsupportedOperationException();
+ return getDichoIntersection(other);
}
if (java.lang.Double.isNaN(u) || u < 0 || u > 1) {
return null;
@@ -89,6 +89,28 @@ public abstract class AbstractLineSegment extends Line2D {
return null;
}
+ private Point2D getDichoIntersection(AbstractLineSegment other) {
+ if (doesIntersect(other) == false) {
+ return null;
+ }
+ if (other.getLength() < 0.01) {
+ return other.getMiddle();
+ }
+ final LineSegmentDouble p1 = new LineSegmentDouble(other.getP1(), other.getMiddle());
+ final LineSegmentDouble p2 = new LineSegmentDouble(other.getMiddle(), other.getP2());
+ if (doesIntersect(p1)) {
+ return getDichoIntersection(p1);
+ }
+ if (doesIntersect(p2)) {
+ return getDichoIntersection(p2);
+ }
+ throw new IllegalStateException();
+ }
+
+ private Point2D.Double getMiddle() {
+ return getPoint2D(0.5);
+ }
+
private static boolean isBetween(double value, double v1, double v2) {
if (v1 < v2) {
return value >= v1 && value <= v2;
@@ -165,6 +187,10 @@ public abstract class AbstractLineSegment extends Line2D {
return Math.abs(a1 - a2) < 0.0001;
}
+ public boolean isPointOnSegment(Point2D pt) {
+ return equals(pt.distance(getP1()) + pt.distance(getP2()), getLength());
+ }
+
private double getDistanceInternal(AbstractLineSegment other) {
double result = this.getDistance(other.getP1());
result += this.getDistance(other.getP2());
@@ -238,8 +264,7 @@ public abstract class AbstractLineSegment extends Line2D {
public double determinant(AbstractLineSegment other) {
return determinant(this.getP1().getX() - this.getP2().getX(), this.getP1().getY() - this.getP2().getY(), other
- .getP1().getX()
- - other.getP2().getX(), other.getP1().getY() - other.getP2().getY());
+ .getP1().getX() - other.getP2().getX(), other.getP1().getY() - other.getP2().getY());
}
private static double determinant(double x1, double y1, double x2, double y2) {
diff --git a/src/net/sourceforge/plantuml/geom/AbstractPolyline.java b/src/net/sourceforge/plantuml/geom/AbstractPolyline.java
index 03a93c2..0573bd6 100644
--- a/src/net/sourceforge/plantuml/geom/AbstractPolyline.java
+++ b/src/net/sourceforge/plantuml/geom/AbstractPolyline.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Box.java b/src/net/sourceforge/plantuml/geom/Box.java
index f9fe6e8..adbb5fa 100644
--- a/src/net/sourceforge/plantuml/geom/Box.java
+++ b/src/net/sourceforge/plantuml/geom/Box.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/ClosedArea.java b/src/net/sourceforge/plantuml/geom/ClosedArea.java
index 4fa3b74..6681515 100644
--- a/src/net/sourceforge/plantuml/geom/ClosedArea.java
+++ b/src/net/sourceforge/plantuml/geom/ClosedArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/CollectionUtils.java b/src/net/sourceforge/plantuml/geom/CollectionUtils.java
index 8ab89fc..c7d22ce 100644
--- a/src/net/sourceforge/plantuml/geom/CollectionUtils.java
+++ b/src/net/sourceforge/plantuml/geom/CollectionUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Dijkstra.java b/src/net/sourceforge/plantuml/geom/Dijkstra.java
index 5fb0d44..175c5b1 100644
--- a/src/net/sourceforge/plantuml/geom/Dijkstra.java
+++ b/src/net/sourceforge/plantuml/geom/Dijkstra.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/InflateData.java b/src/net/sourceforge/plantuml/geom/InflateData.java
index cad3a02..e487aec 100644
--- a/src/net/sourceforge/plantuml/geom/InflateData.java
+++ b/src/net/sourceforge/plantuml/geom/InflateData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/InflationTransform.java b/src/net/sourceforge/plantuml/geom/InflationTransform.java
index f71c14f..395592c 100644
--- a/src/net/sourceforge/plantuml/geom/InflationTransform.java
+++ b/src/net/sourceforge/plantuml/geom/InflationTransform.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Kingdom.java b/src/net/sourceforge/plantuml/geom/Kingdom.java
index 8bdbf42..25dbc9d 100644
--- a/src/net/sourceforge/plantuml/geom/Kingdom.java
+++ b/src/net/sourceforge/plantuml/geom/Kingdom.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/LineSegmentDouble.java b/src/net/sourceforge/plantuml/geom/LineSegmentDouble.java
index 7421684..674fb6e 100644
--- a/src/net/sourceforge/plantuml/geom/LineSegmentDouble.java
+++ b/src/net/sourceforge/plantuml/geom/LineSegmentDouble.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.geom;
+import java.awt.geom.CubicCurve2D;
import java.awt.geom.Point2D;
import java.util.Locale;
@@ -48,8 +49,8 @@ public class LineSegmentDouble extends AbstractLineSegment {
@Override
public String toString() {
- return String.format(Locale.US, "( %.2f,%.2f - %.2f,%.2f )", getP1().getX(), getP1().getY(), getP2().getX(), getP2()
- .getY());
+ return String.format(Locale.US, "( %.2f,%.2f - %.2f,%.2f )", getP1().getX(), getP1().getY(), getP2().getX(),
+ getP2().getY());
}
public LineSegmentDouble(double x1, double y1, double x2, double y2) {
@@ -67,6 +68,14 @@ public class LineSegmentDouble extends AbstractLineSegment {
assert this.getDistance(this) == 0;
}
+ public LineSegmentDouble(CubicCurve2D.Double curve) {
+ this(curve.getP1(), curve.getP2());
+ }
+
+ public LineSegmentDouble translate(UTranslate translate) {
+ return new LineSegmentDouble(translate.getTranslated(getP1()), translate.getTranslated(getP2()));
+ }
+
@Override
public Point2D getP1() {
return p1;
@@ -104,7 +113,8 @@ public class LineSegmentDouble extends AbstractLineSegment {
final double y2 = p2.getY();
ug = ug.apply(new UTranslate(x1, y1));
ug.draw(new ULine(x2 - x1, y2 - y1));
-
+
}
+
}
diff --git a/src/net/sourceforge/plantuml/geom/LineSegmentInt.java b/src/net/sourceforge/plantuml/geom/LineSegmentInt.java
index c2a418b..96beda8 100644
--- a/src/net/sourceforge/plantuml/geom/LineSegmentInt.java
+++ b/src/net/sourceforge/plantuml/geom/LineSegmentInt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Neighborhood.java b/src/net/sourceforge/plantuml/geom/Neighborhood.java
index 01d8e37..5eef5a6 100644
--- a/src/net/sourceforge/plantuml/geom/Neighborhood.java
+++ b/src/net/sourceforge/plantuml/geom/Neighborhood.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Orientation.java b/src/net/sourceforge/plantuml/geom/Orientation.java
index c801074..d513767 100644
--- a/src/net/sourceforge/plantuml/geom/Orientation.java
+++ b/src/net/sourceforge/plantuml/geom/Orientation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Point2DInt.java b/src/net/sourceforge/plantuml/geom/Point2DInt.java
index 9834fca..83c8b42 100644
--- a/src/net/sourceforge/plantuml/geom/Point2DInt.java
+++ b/src/net/sourceforge/plantuml/geom/Point2DInt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Pointable.java b/src/net/sourceforge/plantuml/geom/Pointable.java
index 911ddf0..b236204 100644
--- a/src/net/sourceforge/plantuml/geom/Pointable.java
+++ b/src/net/sourceforge/plantuml/geom/Pointable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Polyline.java b/src/net/sourceforge/plantuml/geom/Polyline.java
index 9c2391d..fcc87f2 100644
--- a/src/net/sourceforge/plantuml/geom/Polyline.java
+++ b/src/net/sourceforge/plantuml/geom/Polyline.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java b/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java
index 667e355..289e79a 100644
--- a/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java
+++ b/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/PolylineImpl.java b/src/net/sourceforge/plantuml/geom/PolylineImpl.java
index b384674..37a1890 100644
--- a/src/net/sourceforge/plantuml/geom/PolylineImpl.java
+++ b/src/net/sourceforge/plantuml/geom/PolylineImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/Singularity.java b/src/net/sourceforge/plantuml/geom/Singularity.java
index 901224a..071c09a 100644
--- a/src/net/sourceforge/plantuml/geom/Singularity.java
+++ b/src/net/sourceforge/plantuml/geom/Singularity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/SpiderWeb.java b/src/net/sourceforge/plantuml/geom/SpiderWeb.java
index 49db8d2..4e79f60 100644
--- a/src/net/sourceforge/plantuml/geom/SpiderWeb.java
+++ b/src/net/sourceforge/plantuml/geom/SpiderWeb.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/XMoveable.java b/src/net/sourceforge/plantuml/geom/XMoveable.java
index 5dbdb2f..2418ce5 100644
--- a/src/net/sourceforge/plantuml/geom/XMoveable.java
+++ b/src/net/sourceforge/plantuml/geom/XMoveable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/Frame.java b/src/net/sourceforge/plantuml/geom/kinetic/Frame.java
index c1ab7cf..efebb44 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/Frame.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/Frame.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/MoveObserver.java b/src/net/sourceforge/plantuml/geom/kinetic/MoveObserver.java
index c232670..dcde0b9 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/MoveObserver.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/MoveObserver.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/Path.java b/src/net/sourceforge/plantuml/geom/kinetic/Path.java
index e6c7be6..f8cef47 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/Path.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/Path.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/Point2DCharge.java b/src/net/sourceforge/plantuml/geom/kinetic/Point2DCharge.java
index 8e7b79a..8ad14f5 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/Point2DCharge.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/Point2DCharge.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java b/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java
index cc058ff..4adae0c 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java b/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java
index ca897bb..b38b775 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/SegmentCutter.java b/src/net/sourceforge/plantuml/geom/kinetic/SegmentCutter.java
index 146bafa..acea0b0 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/SegmentCutter.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/SegmentCutter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/VectorForce.java b/src/net/sourceforge/plantuml/geom/kinetic/VectorForce.java
index a83ebf1..97d484f 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/VectorForce.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/VectorForce.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/geom/kinetic/World.java b/src/net/sourceforge/plantuml/geom/kinetic/World.java
index 737665f..e047593 100644
--- a/src/net/sourceforge/plantuml/geom/kinetic/World.java
+++ b/src/net/sourceforge/plantuml/geom/kinetic/World.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/Magnet.java b/src/net/sourceforge/plantuml/golem/Magnet.java
index 341bbbc..72f3e68 100644
--- a/src/net/sourceforge/plantuml/golem/Magnet.java
+++ b/src/net/sourceforge/plantuml/golem/Magnet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/MinMaxDouble.java b/src/net/sourceforge/plantuml/golem/MinMaxDouble.java
index 3d7a25e..0cc566b 100644
--- a/src/net/sourceforge/plantuml/golem/MinMaxDouble.java
+++ b/src/net/sourceforge/plantuml/golem/MinMaxDouble.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/MinMaxGolem.java b/src/net/sourceforge/plantuml/golem/MinMaxGolem.java
index b15358e..288c55a 100644
--- a/src/net/sourceforge/plantuml/golem/MinMaxGolem.java
+++ b/src/net/sourceforge/plantuml/golem/MinMaxGolem.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/Path.java b/src/net/sourceforge/plantuml/golem/Path.java
index 8d0f3f1..3f200eb 100644
--- a/src/net/sourceforge/plantuml/golem/Path.java
+++ b/src/net/sourceforge/plantuml/golem/Path.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/Position.java b/src/net/sourceforge/plantuml/golem/Position.java
index 5992da1..6ad9dc6 100644
--- a/src/net/sourceforge/plantuml/golem/Position.java
+++ b/src/net/sourceforge/plantuml/golem/Position.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/Square.java b/src/net/sourceforge/plantuml/golem/Square.java
index 20ed419..af80a5f 100644
--- a/src/net/sourceforge/plantuml/golem/Square.java
+++ b/src/net/sourceforge/plantuml/golem/Square.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/Tile.java b/src/net/sourceforge/plantuml/golem/Tile.java
index f9d5d6e..e0d06d8 100644
--- a/src/net/sourceforge/plantuml/golem/Tile.java
+++ b/src/net/sourceforge/plantuml/golem/Tile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,12 +43,12 @@ import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -56,13 +56,13 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class Tile implements TextBlock {
+public class Tile extends AbstractTextBlock implements TextBlock {
private static double SIZE = 40;
private final int num;
private final UFont numberFont = new UFont("Monospaced", Font.PLAIN, 11);
- private final FontConfiguration fc = new FontConfiguration(numberFont, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ private final FontConfiguration fc = FontConfiguration.blackBlueTrue(numberFont);
private final Map<TileGeometry, TileArea> geometries;
Tile(int num) {
@@ -80,8 +80,7 @@ public class Tile implements TextBlock {
public void drawU(UGraphic ug) {
ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
- final TextBlock n = TextBlockUtils.create(Display.create("" + num), fc, HorizontalAlignment.LEFT,
- new SpriteContainerEmpty());
+ final TextBlock n = Display.create("" + num).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty());
final Dimension2D dimNum = n.calculateDimension(ug.getStringBounder());
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
final double diffx = dimTotal.getWidth() - dimNum.getWidth();
diff --git a/src/net/sourceforge/plantuml/golem/TileArea.java b/src/net/sourceforge/plantuml/golem/TileArea.java
index 7a6f74f..6953aaa 100644
--- a/src/net/sourceforge/plantuml/golem/TileArea.java
+++ b/src/net/sourceforge/plantuml/golem/TileArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/TileGeometry.java b/src/net/sourceforge/plantuml/golem/TileGeometry.java
index 91740e0..2cbbb86 100644
--- a/src/net/sourceforge/plantuml/golem/TileGeometry.java
+++ b/src/net/sourceforge/plantuml/golem/TileGeometry.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/golem/TilesField.java b/src/net/sourceforge/plantuml/golem/TilesField.java
index fdea78e..4b474ad 100644
--- a/src/net/sourceforge/plantuml/golem/TilesField.java
+++ b/src/net/sourceforge/plantuml/golem/TilesField.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,6 +43,7 @@ import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -51,7 +52,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TilesField implements TextBlock {
+public class TilesField extends AbstractTextBlock implements TextBlock {
private int size = 1;
private final Tile root = new Tile(0);
diff --git a/src/net/sourceforge/plantuml/graph/ALink.java b/src/net/sourceforge/plantuml/graph/ALink.java
index 08b6582..dbba912 100644
--- a/src/net/sourceforge/plantuml/graph/ALink.java
+++ b/src/net/sourceforge/plantuml/graph/ALink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/ALinkImpl.java b/src/net/sourceforge/plantuml/graph/ALinkImpl.java
index 1fd4059..0fa048f 100644
--- a/src/net/sourceforge/plantuml/graph/ALinkImpl.java
+++ b/src/net/sourceforge/plantuml/graph/ALinkImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/ANode.java b/src/net/sourceforge/plantuml/graph/ANode.java
index 596f34f..a5891d9 100644
--- a/src/net/sourceforge/plantuml/graph/ANode.java
+++ b/src/net/sourceforge/plantuml/graph/ANode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/ANodeImpl.java b/src/net/sourceforge/plantuml/graph/ANodeImpl.java
index 27302bb..7e3a833 100644
--- a/src/net/sourceforge/plantuml/graph/ANodeImpl.java
+++ b/src/net/sourceforge/plantuml/graph/ANodeImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java b/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java
index 26b7b57..8b6258e 100644
--- a/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java
+++ b/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Board.java b/src/net/sourceforge/plantuml/graph/Board.java
index e6bf7df..c81803b 100644
--- a/src/net/sourceforge/plantuml/graph/Board.java
+++ b/src/net/sourceforge/plantuml/graph/Board.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/BoardCollection.java b/src/net/sourceforge/plantuml/graph/BoardCollection.java
index def8ebc..52dd17d 100644
--- a/src/net/sourceforge/plantuml/graph/BoardCollection.java
+++ b/src/net/sourceforge/plantuml/graph/BoardCollection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/BoardExplorer.java b/src/net/sourceforge/plantuml/graph/BoardExplorer.java
index 17c855d..c3c0993 100644
--- a/src/net/sourceforge/plantuml/graph/BoardExplorer.java
+++ b/src/net/sourceforge/plantuml/graph/BoardExplorer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/CostComputer.java b/src/net/sourceforge/plantuml/graph/CostComputer.java
index d5de41b..886c807 100644
--- a/src/net/sourceforge/plantuml/graph/CostComputer.java
+++ b/src/net/sourceforge/plantuml/graph/CostComputer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Elastane.java b/src/net/sourceforge/plantuml/graph/Elastane.java
index 95acc2b..5d1e554 100644
--- a/src/net/sourceforge/plantuml/graph/Elastane.java
+++ b/src/net/sourceforge/plantuml/graph/Elastane.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -270,9 +270,9 @@ public class Elastane {
final String label = l.getLabel().get(0).toString();
if (label != null) {
// polyline.getFirst().getCenter();
- final TextBlock textBlock = TextBlockUtils.create(Display.create(label),
- new FontConfiguration(UFont.getCurrentFont(g2d), HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true),
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final TextBlock textBlock = Display.create(label).create(
+ FontConfiguration.blackBlueTrue(UFont.getCurrentFont(g2d)), HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
textBlock.calculateDimension(StringBounderUtils.asStringBounder(g2d));
// textBlock.drawTOBEREMOVED(new ColorMapperIdentity(), g2d, center.getXint() - dim.getWidth() / 2,
// center.getYint() - dim.getHeight() / 2);
diff --git a/src/net/sourceforge/plantuml/graph/ElectricCharge.java b/src/net/sourceforge/plantuml/graph/ElectricCharge.java
index 2f113ed..f413479 100644
--- a/src/net/sourceforge/plantuml/graph/ElectricCharge.java
+++ b/src/net/sourceforge/plantuml/graph/ElectricCharge.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/ElectricWord.java b/src/net/sourceforge/plantuml/graph/ElectricWord.java
index c94edf5..3157570 100644
--- a/src/net/sourceforge/plantuml/graph/ElectricWord.java
+++ b/src/net/sourceforge/plantuml/graph/ElectricWord.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivity.java b/src/net/sourceforge/plantuml/graph/EntityImageActivity.java
index da6419f..d9079c7 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivity.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -48,7 +49,6 @@ import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.StringBounderUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
class EntityImageActivity extends AbstractEntityImage {
@@ -60,8 +60,8 @@ class EntityImageActivity extends AbstractEntityImage {
public EntityImageActivity(IEntity entity) {
super(entity);
- this.text = TextBlockUtils.create(entity.getDisplay(), new FontConfiguration(getFont14(),
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
+ this.text = entity.getDisplay().create(FontConfiguration.blackBlueTrue(getFont14()),
+ HorizontalAlignment.CENTER, new SpriteContainerEmpty());
}
@Override
@@ -98,7 +98,7 @@ class EntityImageActivity extends AbstractEntityImage {
g2d.draw(p);
// g2d.drawRect(0, 0, width - 1, height - 1);
g2d.setColor(Color.BLACK);
-// text.drawTOBEREMOVED(colorMapper, g2d, xMargin, yMargin);
+ // text.drawTOBEREMOVED(colorMapper, g2d, xMargin, yMargin);
}
}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java
index 4885478..0792ed5 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java
index 796441a..b0e51d8 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java
index b1d523d..dc0ec28 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java b/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java
index 03350a3..591512e 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,10 +42,8 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.CircleInterface;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
@@ -56,8 +54,8 @@ class EntityImageCircleInterface extends AbstractEntityImage {
public EntityImageCircleInterface(IEntity entity) {
super(entity);
- this.name = TextBlockUtils.create(entity.getDisplay(), new FontConfiguration(getFont14(),
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
+ this.name = entity.getDisplay().create(FontConfiguration.blackBlueTrue(getFont14()),
+ HorizontalAlignment.CENTER, new SpriteContainerEmpty());
this.circleInterface = new CircleInterface(getYellow(), getRed());
}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageComponent.java b/src/net/sourceforge/plantuml/graph/EntityImageComponent.java
deleted file mode 100644
index 87e3188..0000000
--- a/src/net/sourceforge/plantuml/graph/EntityImageComponent.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2014, Arnaud Roques
- *
- * Project Info: http://plantuml.sourceforge.net
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.graph;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.Dimension2D;
-import java.awt.geom.Rectangle2D;
-
-import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.SpriteContainerEmpty;
-import net.sourceforge.plantuml.cucadiagram.IEntity;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.StringBounderUtils;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
-
-class EntityImageComponent extends AbstractEntityImage {
-
- final private TextBlock name;
- private final float thickness = (float) 1.6;
-
- public EntityImageComponent(IEntity entity) {
- super(entity);
- this.name = TextBlockUtils.create(entity.getDisplay(), new FontConfiguration(getFont14(),
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
- }
-
- @Override
- public Dimension2D getDimension(StringBounder stringBounder) {
- final Dimension2D nameDim = name.calculateDimension(stringBounder);
- return Dimension2DDouble.delta(nameDim, 20, 14);
- }
-
- private void drawRect(ColorMapper colorMapper, Graphics2D g2d, double x, double y, double width, double height) {
- g2d.setStroke(new BasicStroke(thickness));
- final Shape head = new Rectangle2D.Double(x, y, width, height);
- g2d.setColor(colorMapper.getMappedColor(getYellow()));
- g2d.fill(head);
- g2d.setColor(colorMapper.getMappedColor(getRed()));
- g2d.draw(head);
-
- g2d.setStroke(new BasicStroke());
- }
-
- @Override
- public void draw(ColorMapper colorMapper, Graphics2D g2d) {
- final Dimension2D dimTotal = getDimension(StringBounderUtils.asStringBounder(g2d));
- name.calculateDimension(StringBounderUtils.asStringBounder(g2d));
-
- drawRect(colorMapper, g2d, 6, 0, dimTotal.getWidth(), dimTotal.getHeight());
- drawRect(colorMapper, g2d, 0, 7, 12, 6);
- drawRect(colorMapper, g2d, 0, dimTotal.getHeight() - 7 - 6, 12, 6);
-
- g2d.setColor(Color.BLACK);
-// name.drawTOBEREMOVED(colorMapper, g2d, 6 + (dimTotal.getWidth() - nameDim.getWidth()) / 2,
-// (dimTotal.getHeight() - nameDim.getHeight()) / 2);
- }
-}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageDefault.java b/src/net/sourceforge/plantuml/graph/EntityImageDefault.java
index bbc3f91..fc30628 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageDefault.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageDefault.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,11 +43,9 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.StringBounderUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
class EntityImageDefault extends AbstractEntityImage {
@@ -56,8 +54,8 @@ class EntityImageDefault extends AbstractEntityImage {
public EntityImageDefault(IEntity entity) {
super(entity);
- this.textBlock = TextBlockUtils.create(entity.getDisplay(), new FontConfiguration(getFont14(), HtmlColorUtils.BLACK,
- HtmlColorUtils.BLUE, true), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
+ this.textBlock = entity.getDisplay().create(FontConfiguration.blackBlueTrue(getFont14()),
+ HorizontalAlignment.CENTER, new SpriteContainerEmpty());
}
@Override
@@ -73,6 +71,6 @@ class EntityImageDefault extends AbstractEntityImage {
final int height = (int) dim.getHeight();
g2d.setColor(Color.BLACK);
g2d.drawRect(0, 0, width, height);
-// textBlock.drawTOBEREMOVED(colorMapper, g2d, 0, 0);
+ // textBlock.drawTOBEREMOVED(colorMapper, g2d, 0, 0);
}
}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageFactory.java b/src/net/sourceforge/plantuml/graph/EntityImageFactory.java
index cf5910d..5c1e965 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageFactory.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageNote.java b/src/net/sourceforge/plantuml/graph/EntityImageNote.java
index 006aa81..af96f55 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageNote.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,11 +44,9 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.StringBounderUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
class EntityImageNote extends AbstractEntityImage {
@@ -60,8 +58,8 @@ class EntityImageNote extends AbstractEntityImage {
public EntityImageNote(IEntity entity) {
super(entity);
- this.text = TextBlockUtils.create(entity.getDisplay(), new FontConfiguration(getFont14(),
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
+ this.text = entity.getDisplay().create(FontConfiguration.blackBlueTrue(getFont14()),
+ HorizontalAlignment.CENTER, new SpriteContainerEmpty());
}
@Override
@@ -93,7 +91,7 @@ class EntityImageNote extends AbstractEntityImage {
g2d.drawLine(width - xMargin, yMargin, width, yMargin);
g2d.setColor(Color.BLACK);
-// text.drawTOBEREMOVED(colorMapper, g2d, xMargin, yMargin);
+ // text.drawTOBEREMOVED(colorMapper, g2d, xMargin, yMargin);
}
}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageUsecase.java b/src/net/sourceforge/plantuml/graph/EntityImageUsecase.java
index f311543..9de8034 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageUsecase.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageUsecase.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,7 @@ import java.awt.geom.QuadCurve2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -49,7 +50,6 @@ import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.StringBounderUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
class EntityImageUsecase extends AbstractEntityImage {
@@ -58,8 +58,8 @@ class EntityImageUsecase extends AbstractEntityImage {
public EntityImageUsecase(IEntity entity) {
super(entity);
- this.name = TextBlockUtils.create(entity.getDisplay(), new FontConfiguration(getFont14(),
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
+ this.name = entity.getDisplay().create(FontConfiguration.blackBlueTrue(getFont14()),
+ HorizontalAlignment.CENTER, new SpriteContainerEmpty());
}
@Override
@@ -94,9 +94,9 @@ class EntityImageUsecase extends AbstractEntityImage {
g2d.setColor(colorMapper.getMappedColor(getRed()));
g2d.draw(ellipse);
-// final Dimension2D nameDim = name.calculateDimension(StringBounderUtils.asStringBounder(g2d));
-// final double posx = (w - nameDim.getWidth()) / 2;
-// final double posy = (h - nameDim.getHeight()) / 2;
+ // final Dimension2D nameDim = name.calculateDimension(StringBounderUtils.asStringBounder(g2d));
+ // final double posx = (w - nameDim.getWidth()) / 2;
+ // final double posy = (h - nameDim.getHeight()) / 2;
// final Shape rect = new Rectangle2D.Double(posx, posy, nameDim.getWidth(), nameDim.getHeight());
// g2d.draw(rect);
diff --git a/src/net/sourceforge/plantuml/graph/Galaxy4.java b/src/net/sourceforge/plantuml/graph/Galaxy4.java
index 6480162..17bee11 100644
--- a/src/net/sourceforge/plantuml/graph/Galaxy4.java
+++ b/src/net/sourceforge/plantuml/graph/Galaxy4.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java b/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java
index c1384ef..2d0cbc8 100644
--- a/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java
+++ b/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Graph1.java b/src/net/sourceforge/plantuml/graph/Graph1.java
index 45187f5..8533a1d 100644
--- a/src/net/sourceforge/plantuml/graph/Graph1.java
+++ b/src/net/sourceforge/plantuml/graph/Graph1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Graph2.java b/src/net/sourceforge/plantuml/graph/Graph2.java
index c5be27c..8694ad9 100644
--- a/src/net/sourceforge/plantuml/graph/Graph2.java
+++ b/src/net/sourceforge/plantuml/graph/Graph2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Graph3.java b/src/net/sourceforge/plantuml/graph/Graph3.java
index b6f9779..e254688 100644
--- a/src/net/sourceforge/plantuml/graph/Graph3.java
+++ b/src/net/sourceforge/plantuml/graph/Graph3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Graph4.java b/src/net/sourceforge/plantuml/graph/Graph4.java
index fbb11bf..82796ec 100644
--- a/src/net/sourceforge/plantuml/graph/Graph4.java
+++ b/src/net/sourceforge/plantuml/graph/Graph4.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Graph5.java b/src/net/sourceforge/plantuml/graph/Graph5.java
index 672a650..b691eb0 100644
--- a/src/net/sourceforge/plantuml/graph/Graph5.java
+++ b/src/net/sourceforge/plantuml/graph/Graph5.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Heap.java b/src/net/sourceforge/plantuml/graph/Heap.java
index bbff0f5..cf61d44 100644
--- a/src/net/sourceforge/plantuml/graph/Heap.java
+++ b/src/net/sourceforge/plantuml/graph/Heap.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java b/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java
index 1607781..6ff00a8 100644
--- a/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java
+++ b/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java b/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java
index 179571d..97e75f7 100644
--- a/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java
+++ b/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/LinkString.java b/src/net/sourceforge/plantuml/graph/LinkString.java
index a75562d..ddff14e 100644
--- a/src/net/sourceforge/plantuml/graph/LinkString.java
+++ b/src/net/sourceforge/plantuml/graph/LinkString.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java
index cb37255..d62b0c2 100644
--- a/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java
+++ b/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -82,8 +82,8 @@ public class MethodsOrFieldsArea {
}
private TextBlock createTextBlock(String s) {
- return TextBlockUtils.create(Display.create(s), new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true),
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ return Display.create(s).create(FontConfiguration.blackBlueTrue(font), HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
}
public void draw(UGraphic ug, double x, double y) {
diff --git a/src/net/sourceforge/plantuml/graph/Move.java b/src/net/sourceforge/plantuml/graph/Move.java
index 03e0c52..e3b3f6a 100644
--- a/src/net/sourceforge/plantuml/graph/Move.java
+++ b/src/net/sourceforge/plantuml/graph/Move.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Oven.java b/src/net/sourceforge/plantuml/graph/Oven.java
index f91fc83..86d44d1 100644
--- a/src/net/sourceforge/plantuml/graph/Oven.java
+++ b/src/net/sourceforge/plantuml/graph/Oven.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java b/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java
index 1b036d9..1012454 100644
--- a/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java
+++ b/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/SortedCollection.java b/src/net/sourceforge/plantuml/graph/SortedCollection.java
index d38196e..cffcfa5 100644
--- a/src/net/sourceforge/plantuml/graph/SortedCollection.java
+++ b/src/net/sourceforge/plantuml/graph/SortedCollection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java b/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java
index ff146b0..1be7c46 100644
--- a/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java
+++ b/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java b/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java
index fe34b93..afa2f89 100644
--- a/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java
+++ b/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Zoda1.java b/src/net/sourceforge/plantuml/graph/Zoda1.java
index 52c866f..ec47a04 100644
--- a/src/net/sourceforge/plantuml/graph/Zoda1.java
+++ b/src/net/sourceforge/plantuml/graph/Zoda1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph/Zoda2.java b/src/net/sourceforge/plantuml/graph/Zoda2.java
index 4314268..a25a70b 100644
--- a/src/net/sourceforge/plantuml/graph/Zoda2.java
+++ b/src/net/sourceforge/plantuml/graph/Zoda2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java b/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java
index 875adfb..ff461d7 100644
--- a/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java
+++ b/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/Dijkstra.java b/src/net/sourceforge/plantuml/graph2/Dijkstra.java
index 38b9da3..9913924 100644
--- a/src/net/sourceforge/plantuml/graph2/Dijkstra.java
+++ b/src/net/sourceforge/plantuml/graph2/Dijkstra.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/GeomUtils.java b/src/net/sourceforge/plantuml/graph2/GeomUtils.java
index 676f6d2..8ba22de 100644
--- a/src/net/sourceforge/plantuml/graph2/GeomUtils.java
+++ b/src/net/sourceforge/plantuml/graph2/GeomUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/IInflationTransform.java b/src/net/sourceforge/plantuml/graph2/IInflationTransform.java
index 50668c8..8be22a7 100644
--- a/src/net/sourceforge/plantuml/graph2/IInflationTransform.java
+++ b/src/net/sourceforge/plantuml/graph2/IInflationTransform.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java b/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java
index b375f63..68ec949 100644
--- a/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java
+++ b/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/InflateData2.java b/src/net/sourceforge/plantuml/graph2/InflateData2.java
index 485c618..6e33d98 100644
--- a/src/net/sourceforge/plantuml/graph2/InflateData2.java
+++ b/src/net/sourceforge/plantuml/graph2/InflateData2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/InflationTransform2.java b/src/net/sourceforge/plantuml/graph2/InflationTransform2.java
index 5837011..5cc4441 100644
--- a/src/net/sourceforge/plantuml/graph2/InflationTransform2.java
+++ b/src/net/sourceforge/plantuml/graph2/InflationTransform2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java b/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java
index 545ed25..8555c20 100644
--- a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java
+++ b/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java b/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java
index 2a954d0..a6e9951 100644
--- a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java
+++ b/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/Measurer.java b/src/net/sourceforge/plantuml/graph2/Measurer.java
index 45ad6e0..57ee517 100644
--- a/src/net/sourceforge/plantuml/graph2/Measurer.java
+++ b/src/net/sourceforge/plantuml/graph2/Measurer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/MyCurve.java b/src/net/sourceforge/plantuml/graph2/MyCurve.java
index 5c546d7..4824e3c 100644
--- a/src/net/sourceforge/plantuml/graph2/MyCurve.java
+++ b/src/net/sourceforge/plantuml/graph2/MyCurve.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/Neighborhood2.java b/src/net/sourceforge/plantuml/graph2/Neighborhood2.java
index f9e1926..72fc1ee 100644
--- a/src/net/sourceforge/plantuml/graph2/Neighborhood2.java
+++ b/src/net/sourceforge/plantuml/graph2/Neighborhood2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/Plan.java b/src/net/sourceforge/plantuml/graph2/Plan.java
index f3699b6..0a9217c 100644
--- a/src/net/sourceforge/plantuml/graph2/Plan.java
+++ b/src/net/sourceforge/plantuml/graph2/Plan.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/Polyline2.java b/src/net/sourceforge/plantuml/graph2/Polyline2.java
index b510b17..ef45eae 100644
--- a/src/net/sourceforge/plantuml/graph2/Polyline2.java
+++ b/src/net/sourceforge/plantuml/graph2/Polyline2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java b/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java
index 824e2d4..fa07a52 100644
--- a/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java
+++ b/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/Singularity2.java b/src/net/sourceforge/plantuml/graph2/Singularity2.java
index 58459fd..d84c5b4 100644
--- a/src/net/sourceforge/plantuml/graph2/Singularity2.java
+++ b/src/net/sourceforge/plantuml/graph2/Singularity2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/SortedList.java b/src/net/sourceforge/plantuml/graph2/SortedList.java
index f095062..a1a99e6 100644
--- a/src/net/sourceforge/plantuml/graph2/SortedList.java
+++ b/src/net/sourceforge/plantuml/graph2/SortedList.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graph2/SortedListImpl.java b/src/net/sourceforge/plantuml/graph2/SortedListImpl.java
index bbef49a..d6b303e 100644
--- a/src/net/sourceforge/plantuml/graph2/SortedListImpl.java
+++ b/src/net/sourceforge/plantuml/graph2/SortedListImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java b/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java
new file mode 100644
index 0000000..5392535
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/AbstractTextBlock.java
@@ -0,0 +1,44 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.graphic;
+
+import java.awt.geom.Rectangle2D;
+
+public abstract class AbstractTextBlock implements TextBlock {
+
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ throw new UnsupportedOperationException("member=" + member + " " + getClass().toString());
+ }
+}
diff --git a/src/net/sourceforge/plantuml/graphic/AddStyle.java b/src/net/sourceforge/plantuml/graphic/AddStyle.java
index 0a7800b..903e9c2 100644
--- a/src/net/sourceforge/plantuml/graphic/AddStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/AddStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/CircledCharacter.java b/src/net/sourceforge/plantuml/graphic/CircledCharacter.java
index 0247c2b..5a4d672 100644
--- a/src/net/sourceforge/plantuml/graphic/CircledCharacter.java
+++ b/src/net/sourceforge/plantuml/graphic/CircledCharacter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,7 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class CircledCharacter implements TextBlock {
+public class CircledCharacter extends AbstractTextBlock implements TextBlock {
private final String c;
private final UFont font;
diff --git a/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java b/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java
index c1a0c98..6773f38 100644
--- a/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java
+++ b/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/ColorChange.java b/src/net/sourceforge/plantuml/graphic/ColorChange.java
index f0e3207..b2e024b 100644
--- a/src/net/sourceforge/plantuml/graphic/ColorChange.java
+++ b/src/net/sourceforge/plantuml/graphic/ColorChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/DateEventUtils.java b/src/net/sourceforge/plantuml/graphic/DateEventUtils.java
index d2d5225..a29b1a1 100644
--- a/src/net/sourceforge/plantuml/graphic/DateEventUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/DateEventUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,7 +49,10 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.version.PSystemVersion;
+import net.sourceforge.plantuml.webp.Portrait;
+import net.sourceforge.plantuml.webp.Portraits;
public class DateEventUtils {
@@ -71,16 +74,52 @@ public class DateEventUtils {
"a character on a keyboard and seen it show up on their",
"own computer's screen right in front of them.\"", "\t\t\t\t\t\t\t\t\t\t<i>Steve Wozniak");
return TextBlockUtils.mergeTB(textBlock, getComment(asList, color), HorizontalAlignment.LEFT);
- } else if ("01-07".equals(today) || "01-08".equals(today)) {
+ } else if ("01-07".equals(today)) {
return addCharlie(textBlock);
-
}
+ // return addMemorial(textBlock, color);
return textBlock;
}
+ private static TextBlock addMemorial(TextBlock textBlock, HtmlColor color) {
+ final Portrait portrait = new Portraits().getOne();
+ if (portrait == null) {
+ return textBlock;
+ }
+ final BufferedImage im = portrait.getBufferedImage();
+ if (im == null) {
+ return textBlock;
+ }
+
+ final List<String> asList = Arrays.asList("A thought for those who died in Paris the 13th November 2015.");
+
+ final String name = portrait.getName();
+ final UFont font = new UFont("SansSerif", Font.BOLD, 12);
+ TextBlock comment = Display.create(name).create(new FontConfiguration(font, color, HtmlColorUtils.BLUE, true),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ comment = TextBlockUtils.withMargin(comment, 4, 4);
+
+ final TextBlock bottom0 = getComment(asList, color);
+ final TextBlock bottom1 = new AbstractTextBlock() {
+ private double margin = 10;
+
+ public void drawU(UGraphic ug) {
+ ug = ug.apply(new UTranslate(0, margin));
+ ug.draw(new UImage(im));
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return new Dimension2DDouble(im.getWidth(), margin + im.getHeight());
+ }
+ };
+ final TextBlock bottom = TextBlockUtils.mergeTB(bottom0,
+ TextBlockUtils.mergeLR(bottom1, comment, VerticalAlignment.CENTER), HorizontalAlignment.LEFT);
+ return TextBlockUtils.mergeTB(textBlock, bottom, HorizontalAlignment.LEFT);
+ }
+
private static TextBlock addCharlie(TextBlock textBlock) {
- final TextBlock charlie = new TextBlock() {
+ final TextBlock charlie = new AbstractTextBlock() {
private final BufferedImage charlie = PSystemVersion.getCharlieImage();
public void drawU(UGraphic ug) {
@@ -97,8 +136,9 @@ public class DateEventUtils {
private static TextBlock getComment(final List<String> asList, HtmlColor color) {
final UFont font = new UFont("SansSerif", Font.BOLD, 14);
- TextBlock comment = TextBlockUtils.create(Display.create(asList), new FontConfiguration(font, color,
- HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ TextBlock comment = Display.create(asList).create(
+ new FontConfiguration(font, color, HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
comment = TextBlockUtils.withMargin(comment, 4, 4);
comment = new TextBlockBordered(comment, color);
comment = TextBlockUtils.withMargin(comment, 10, 10);
diff --git a/src/net/sourceforge/plantuml/graphic/DisplayUtils.java b/src/net/sourceforge/plantuml/graphic/DisplayUtils.java
index 32d5708..b858336 100644
--- a/src/net/sourceforge/plantuml/graphic/DisplayUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/DisplayUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/EmbededSystemLine.java b/src/net/sourceforge/plantuml/graphic/EmbededSystemLine.java
index cd7b3f4..c09f928 100644
--- a/src/net/sourceforge/plantuml/graphic/EmbededSystemLine.java
+++ b/src/net/sourceforge/plantuml/graphic/EmbededSystemLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,7 @@ import java.util.List;
import javax.imageio.ImageIO;
import net.sourceforge.plantuml.BlockUml;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmbededDiagram;
import net.sourceforge.plantuml.FileFormat;
@@ -53,12 +54,12 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UShape;
-class EmbededSystemLine implements Line {
+class EmbededSystemLine extends AbstractTextBlock implements Line {
- final private List<? extends CharSequence> lines;
+ final private List<CharSequence2> lines2;
public EmbededSystemLine(EmbededDiagram sys) {
- this.lines = sys.getLines().as();
+ this.lines2 = sys.getLines().as2();
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
@@ -102,7 +103,7 @@ class EmbededSystemLine implements Line {
}
private Diagram getSystem() throws IOException, InterruptedException {
- final BlockUml blockUml = new BlockUml(lines, 0);
+ final BlockUml blockUml = new BlockUml(lines2, 0);
return blockUml.getDiagram();
}
diff --git a/src/net/sourceforge/plantuml/graphic/ExposantChange.java b/src/net/sourceforge/plantuml/graphic/ExposantChange.java
index 2c7d117..0eb6851 100644
--- a/src/net/sourceforge/plantuml/graphic/ExposantChange.java
+++ b/src/net/sourceforge/plantuml/graphic/ExposantChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/FontChange.java b/src/net/sourceforge/plantuml/graphic/FontChange.java
index 91e3003..4590c6a 100644
--- a/src/net/sourceforge/plantuml/graphic/FontChange.java
+++ b/src/net/sourceforge/plantuml/graphic/FontChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/FontConfiguration.java b/src/net/sourceforge/plantuml/graphic/FontConfiguration.java
index dcc5a1f..b025c4c 100644
--- a/src/net/sourceforge/plantuml/graphic/FontConfiguration.java
+++ b/src/net/sourceforge/plantuml/graphic/FontConfiguration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,8 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.UFont;
public class FontConfiguration {
@@ -56,19 +58,29 @@ public class FontConfiguration {
private final SvgAttributes svgAttributes;
private final boolean hyperlink;
private final boolean useUnderlineForHyperlink;
+ private final int tabSize;
public FontConfiguration(UFont font, HtmlColor color, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
+ this(font, color, hyperlinkColor, useUnderlineForHyperlink, 8);
+ }
+
+ public FontConfiguration(UFont font, HtmlColor color, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink,
+ int tabSize) {
this(getStyles(font), font, color, font, color, null, FontPosition.NORMAL, new SvgAttributes(), false,
- hyperlinkColor, useUnderlineForHyperlink);
+ hyperlinkColor, useUnderlineForHyperlink, tabSize);
+ }
+
+ public static FontConfiguration blackBlueTrue(UFont font) {
+ return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true, 8);
}
public FontConfiguration(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {
this(SkinParamUtils.getFont(skinParam, fontParam, stereo), SkinParamUtils.getFontColor(skinParam, fontParam,
- stereo), skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
+ stereo), skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
}
-
- //---
-
+
+ // ---
+
public final boolean useUnderlineForHyperlink() {
return useUnderlineForHyperlink;
}
@@ -77,7 +89,7 @@ public class FontConfiguration {
return hyperlinkColor;
}
- //---
+ // ---
private static EnumSet<FontStyle> getStyles(UFont font) {
final boolean bold = font.isBold();
@@ -101,7 +113,7 @@ public class FontConfiguration {
private FontConfiguration(EnumSet<FontStyle> styles, UFont motherFont, HtmlColor motherColor, UFont currentFont,
HtmlColor currentColor, HtmlColor extendedColor, FontPosition fontPosition, SvgAttributes svgAttributes,
- boolean hyperlink, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
+ boolean hyperlink, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, int tabSize) {
this.styles = styles;
this.currentFont = currentFont;
this.motherFont = motherFont;
@@ -113,6 +125,7 @@ public class FontConfiguration {
this.hyperlink = hyperlink;
this.hyperlinkColor = hyperlinkColor;
this.useUnderlineForHyperlink = useUnderlineForHyperlink;
+ this.tabSize = tabSize;
}
public FontConfiguration forceFont(UFont newFont, HtmlColor htmlColorForStereotype) {
@@ -120,7 +133,8 @@ public class FontConfiguration {
return add(FontStyle.ITALIC);
}
FontConfiguration result = new FontConfiguration(styles, newFont, motherColor, newFont, currentColor,
- extendedColor, fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ extendedColor, fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink,
+ tabSize);
if (htmlColorForStereotype != null) {
result = result.changeColor(htmlColorForStereotype);
}
@@ -129,27 +143,40 @@ public class FontConfiguration {
public FontConfiguration changeAttributes(SvgAttributes toBeAdded) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, currentColor, extendedColor,
- fontPosition, svgAttributes.add(toBeAdded), hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes.add(toBeAdded), hyperlink, hyperlinkColor, useUnderlineForHyperlink,
+ tabSize);
}
private FontConfiguration withHyperlink() {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, currentColor, extendedColor,
- fontPosition, svgAttributes, true, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes, true, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public FontConfiguration changeColor(HtmlColor htmlColor) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, htmlColor, extendedColor,
- fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
+ }
+
+ public FontConfiguration mute(Colors colors) {
+ if (colors == null) {
+ throw new IllegalArgumentException();
+ }
+ final HtmlColor color = colors.getColor(ColorType.TEXT);
+ if (color == null) {
+ return this;
+ }
+ return changeColor(color);
}
FontConfiguration changeExtendedColor(HtmlColor newExtendedColor) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, currentColor, newExtendedColor,
- fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public FontConfiguration changeSize(float size) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont.deriveSize(size), currentColor,
- extendedColor, fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ extendedColor, fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink,
+ tabSize);
}
public FontConfiguration bigger(double delta) {
@@ -158,25 +185,25 @@ public class FontConfiguration {
public FontConfiguration changeFontPosition(FontPosition fontPosition) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, currentColor, extendedColor,
- fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public FontConfiguration changeFamily(String family) {
return new FontConfiguration(styles, motherFont, motherColor, new UFont(family, currentFont.getStyle(),
currentFont.getSize()), currentColor, extendedColor, fontPosition, svgAttributes, hyperlink,
- hyperlinkColor, useUnderlineForHyperlink);
+ hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public FontConfiguration resetFont() {
return new FontConfiguration(styles, motherFont, motherColor, motherFont, motherColor, null,
- FontPosition.NORMAL, new SvgAttributes(), hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ FontPosition.NORMAL, new SvgAttributes(), hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
FontConfiguration add(FontStyle style) {
final EnumSet<FontStyle> r = styles.clone();
r.add(style);
return new FontConfiguration(r, motherFont, motherColor, currentFont, currentColor, extendedColor,
- fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public FontConfiguration italic() {
@@ -202,7 +229,7 @@ public class FontConfiguration {
final EnumSet<FontStyle> r = styles.clone();
r.remove(style);
return new FontConfiguration(r, motherFont, motherColor, currentFont, currentColor, extendedColor,
- fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink);
+ fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public UFont getFont() {
@@ -240,4 +267,8 @@ public class FontConfiguration {
return currentFont.getSize2D();
}
+ public int getTabSize() {
+ return tabSize;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/FontFamilyChange.java b/src/net/sourceforge/plantuml/graphic/FontFamilyChange.java
index 476f67c..d94bea0 100644
--- a/src/net/sourceforge/plantuml/graphic/FontFamilyChange.java
+++ b/src/net/sourceforge/plantuml/graphic/FontFamilyChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.graphic;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
class FontFamilyChange implements FontChange {
@@ -50,7 +51,7 @@ class FontFamilyChange implements FontChange {
if (matcherColor.find() == false) {
throw new IllegalArgumentException();
}
- this.family = matcherColor.group(1).trim();
+ this.family = StringUtils.trin(matcherColor.group(1));
}
public FontConfiguration apply(FontConfiguration initial) {
diff --git a/src/net/sourceforge/plantuml/graphic/FontPosition.java b/src/net/sourceforge/plantuml/graphic/FontPosition.java
index e049510..c8abc3c 100644
--- a/src/net/sourceforge/plantuml/graphic/FontPosition.java
+++ b/src/net/sourceforge/plantuml/graphic/FontPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/FontStyle.java b/src/net/sourceforge/plantuml/graphic/FontStyle.java
index bde9eb9..70c0d54 100644
--- a/src/net/sourceforge/plantuml/graphic/FontStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/FontStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/GraphicPosition.java b/src/net/sourceforge/plantuml/graphic/GraphicPosition.java
index a63ac0a..158dd7d 100644
--- a/src/net/sourceforge/plantuml/graphic/GraphicPosition.java
+++ b/src/net/sourceforge/plantuml/graphic/GraphicPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
index 382dfc5..2cdf7ef 100644
--- a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
+++ b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class GraphicStrings implements IEntityImage {
+public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
private final HtmlColor background;
@@ -62,7 +62,7 @@ public class GraphicStrings implements IEntityImage {
private final HtmlColor green;
private final HtmlColor hyperlinkColor = HtmlColorUtils.BLUE;
-
+
private final boolean useUnderlineForHyperlink = true;
private final List<String> strings;
@@ -111,14 +111,15 @@ public class GraphicStrings implements IEntityImage {
private TextBlock getTextBlock() {
TextBlock result = null;
if (maxLine == 0) {
- result = TextBlockUtils.create(Display.create(strings), new FontConfiguration(font, green, hyperlinkColor, useUnderlineForHyperlink),
+ result = Display.create(strings).create(
+ new FontConfiguration(font, green, hyperlinkColor, useUnderlineForHyperlink),
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
} else {
for (int i = 0; i < strings.size(); i += maxLine) {
final int n = Math.min(i + maxLine, strings.size());
- final TextBlock textBlock1 = TextBlockUtils.create(Display.create(strings.subList(i, n)),
- new FontConfiguration(font, green, hyperlinkColor, useUnderlineForHyperlink), HorizontalAlignment.LEFT,
- new SpriteContainerEmpty());
+ final TextBlock textBlock1 = Display.create(strings.subList(i, n)).create(
+ new FontConfiguration(font, green, hyperlinkColor, useUnderlineForHyperlink),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
if (result == null) {
result = textBlock1;
} else {
diff --git a/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java b/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java
index 9ef51ab..551b28f 100644
--- a/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java
+++ b/src/net/sourceforge/plantuml/graphic/HorizontalAlignment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,10 +34,12 @@
*/
package net.sourceforge.plantuml.graphic;
+import net.sourceforge.plantuml.StringUtils;
+
public enum HorizontalAlignment {
LEFT, CENTER, RIGHT;
-
+
public static HorizontalAlignment fromString(String s) {
if (LEFT.name().equalsIgnoreCase(s)) {
return LEFT;
@@ -51,4 +53,19 @@ public enum HorizontalAlignment {
return null;
}
+ public static HorizontalAlignment fromString(String s, HorizontalAlignment defaultValue) {
+ if (defaultValue == null) {
+ throw new IllegalArgumentException();
+ }
+ if (s == null) {
+ return defaultValue;
+ }
+ s = StringUtils.goUpperCase(s);
+ final HorizontalAlignment result = fromString(s);
+ if (result == null) {
+ return defaultValue;
+ }
+ return result;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColor.java b/src/net/sourceforge/plantuml/graphic/HtmlColor.java
index a65c7a3..0125d1c 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColor.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorGradient.java b/src/net/sourceforge/plantuml/graphic/HtmlColorGradient.java
index 02aeaf1..b701264 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorGradient.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorGradient.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorSet.java b/src/net/sourceforge/plantuml/graphic/HtmlColorSet.java
index ac179df..8ffcf5a 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorSet.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java b/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java
index 258110b..eaed070 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorSetSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -246,6 +246,9 @@ public class HtmlColorSetSimple implements IHtmlColorSet {
final Color color;
if (s.equalsIgnoreCase("transparent")) {
return new HtmlColorTransparent();
+ } else if (s.matches("[0-9A-Fa-f]{3}")) {
+ s = "" + s.charAt(0) + s.charAt(0) + s.charAt(1) + s.charAt(1) + s.charAt(2) + s.charAt(2);
+ color = new Color(Integer.parseInt(s, 16));
} else if (s.matches("[0-9A-Fa-f]{6}")) {
color = new Color(Integer.parseInt(s, 16));
} else {
@@ -260,6 +263,9 @@ public class HtmlColorSetSimple implements IHtmlColorSet {
private boolean isValid(String s, boolean acceptTransparent) {
s = removeFirstDieseAndgoLowerCase(s);
+ if (s.matches("[0-9A-Fa-f]{3}")) {
+ return true;
+ }
if (s.matches("[0-9A-Fa-f]{6}")) {
return true;
}
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorSimple.java b/src/net/sourceforge/plantuml/graphic/HtmlColorSimple.java
index 07f863d..ead7c84 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorSimple.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java b/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java
index 76bdcd2..404a4bf 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorUserDef.java b/src/net/sourceforge/plantuml/graphic/HtmlColorUserDef.java
index e1a2dd7..0931b7e 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorUserDef.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorUserDef.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorUtils.java b/src/net/sourceforge/plantuml/graphic/HtmlColorUtils.java
index 2c0c682..7c7ddba 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,8 +37,6 @@ package net.sourceforge.plantuml.graphic;
public class HtmlColorUtils {
- public static final String COLOR_REGEXP = "#\\w+[-\\\\|/]?\\w+";
-
public static final HtmlColor BLACK;
public static final HtmlColor WHITE;
public static final HtmlColor RED_LIGHT;
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlCommand.java b/src/net/sourceforge/plantuml/graphic/HtmlCommand.java
index c6bd5b3..59637cc 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlCommand.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlCommandFactory.java b/src/net/sourceforge/plantuml/graphic/HtmlCommandFactory.java
index 03e5dbe..cd7a35f 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlCommandFactory.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlCommandFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/IHtmlColorSet.java b/src/net/sourceforge/plantuml/graphic/IHtmlColorSet.java
index f5619c2..c127b83 100644
--- a/src/net/sourceforge/plantuml/graphic/IHtmlColorSet.java
+++ b/src/net/sourceforge/plantuml/graphic/IHtmlColorSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/Img.java b/src/net/sourceforge/plantuml/graphic/Img.java
index d12c86c..f4fdf5f 100644
--- a/src/net/sourceforge/plantuml/graphic/Img.java
+++ b/src/net/sourceforge/plantuml/graphic/Img.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/ImgValign.java b/src/net/sourceforge/plantuml/graphic/ImgValign.java
index 9c9c3d6..ee40d1e 100644
--- a/src/net/sourceforge/plantuml/graphic/ImgValign.java
+++ b/src/net/sourceforge/plantuml/graphic/ImgValign.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/Line.java b/src/net/sourceforge/plantuml/graphic/Line.java
index 21795a1..8d3eb30 100644
--- a/src/net/sourceforge/plantuml/graphic/Line.java
+++ b/src/net/sourceforge/plantuml/graphic/Line.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
index 30a7a6a..65a5655 100644
--- a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -146,9 +146,29 @@ public class QuoteUtils {
"If you are a friend, you speak the password, and the doors will open.", //
"You Shall Not Pass", //
"73.6% Of All Statistics Are Made Up", //
- "We can neither confirm nor deny that this is crashing"
- // When the beating of your heart echoes the beating of the drums
- // Never trust a computer you can't throw out a window
+ "We can neither confirm nor deny that this is crashing", //
+ "When the beating of your heart echoes the beating of the drums", //
+ "Never trust a computer you can't throw out a window", //
+ "Yeah, I'm calm. I'm a calm person. Is there some reason I shouldn't be calm?", //
+ "Everybody just stay calm. The situation is under control.", //
+ "Hippy, you think everything is a conspiracy.", //
+ "These guys are about as much fun as a tax audit.", //
+ "There is something down there! Something not us.", //
+ "I saw a glimpse of my future and everything's changed for me now.", //
+ "In space no one can hear you scream", //
+ "I can't lie to you about your chances, but... you have my sympathies.", //
+ "There is an explanation for this, you know.", //
+ "Bishop: I'm afraid I have some bad news.", //
+ "Do me a favour. Disconnect me. I could be reworked, but I'll never be top of the line again.", //
+ "Take it easy, don't push the little button on the joystick!", //
+ "I'm a very private person.", //
+ "To sculpt an elephant from a big block of marble, just knock away all the bits that don't look like an elephant.", //
+ "Who said you could talk to me? Have I got something on my face ?", //
+ "We've been through worst", //
+ "United we stand", //
+ "We shall never surrender", //
+ "Absolute honesty isn't always the most diplomatic nor the safest form of communication with emotional beings.", //
+ "Humor: seventy-five percent. [Confirmed] Self destruct sequence in T minus 10, 9... " //
);
private QuoteUtils() {
}
diff --git a/src/net/sourceforge/plantuml/graphic/RemoveStyle.java b/src/net/sourceforge/plantuml/graphic/RemoveStyle.java
index 95cf117..413d410 100644
--- a/src/net/sourceforge/plantuml/graphic/RemoveStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/RemoveStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/ResetFont.java b/src/net/sourceforge/plantuml/graphic/ResetFont.java
index 5c82273..7d22657 100644
--- a/src/net/sourceforge/plantuml/graphic/ResetFont.java
+++ b/src/net/sourceforge/plantuml/graphic/ResetFont.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/SingleLine.java b/src/net/sourceforge/plantuml/graphic/SingleLine.java
index b9b1418..0b904c2 100644
--- a/src/net/sourceforge/plantuml/graphic/SingleLine.java
+++ b/src/net/sourceforge/plantuml/graphic/SingleLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,11 +41,11 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainer;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.ugraphic.Sprite;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
-class SingleLine implements Line {
+class SingleLine extends AbstractTextBlock implements Line {
private final List<TextBlock> blocs = new ArrayList<TextBlock>();
private final HorizontalAlignment horizontalAlignment;
diff --git a/src/net/sourceforge/plantuml/graphic/SizeChange.java b/src/net/sourceforge/plantuml/graphic/SizeChange.java
index 22f4445..65e344d 100644
--- a/src/net/sourceforge/plantuml/graphic/SizeChange.java
+++ b/src/net/sourceforge/plantuml/graphic/SizeChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/SkinParameter.java b/src/net/sourceforge/plantuml/graphic/SkinParameter.java
index 76c9dda..1b55e46 100644
--- a/src/net/sourceforge/plantuml/graphic/SkinParameter.java
+++ b/src/net/sourceforge/plantuml/graphic/SkinParameter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/Splitter.java b/src/net/sourceforge/plantuml/graphic/Splitter.java
index 9bf186d..ea1c2f7 100644
--- a/src/net/sourceforge/plantuml/graphic/Splitter.java
+++ b/src/net/sourceforge/plantuml/graphic/Splitter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,8 +42,9 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteUtils;
public class Splitter {
@@ -59,8 +60,8 @@ public class Splitter {
public static final String fontFamilyPattern = "\\<font[\\s:]+([^>]+)/?\\>";
public static final String svgAttributePattern = "\\<text[\\s:]+([^>]+)/?\\>";
public static final String openiconPattern = "\\<&([-\\w]+)\\>";
- public static final String spritePattern = "\\<\\$[\\p{L}0-9_]+\\>";
- public static final String spritePattern2 = "\\<\\$([\\p{L}0-9_]+)\\>";
+ public static final String spritePattern = "\\<\\$" + SpriteUtils.SPRITE_NAME + "\\>";
+ public static final String spritePattern2 = "\\<\\$(" + SpriteUtils.SPRITE_NAME + ")\\>";
static final String htmlTag;
static final String linkPattern = "\\[\\[([^\\[\\]]+)\\]\\]";
diff --git a/src/net/sourceforge/plantuml/graphic/SpriteCommand.java b/src/net/sourceforge/plantuml/graphic/SpriteCommand.java
index 8650fb0..2882768 100644
--- a/src/net/sourceforge/plantuml/graphic/SpriteCommand.java
+++ b/src/net/sourceforge/plantuml/graphic/SpriteCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,8 @@
*/
package net.sourceforge.plantuml.graphic;
+import net.sourceforge.plantuml.StringUtils;
+
public class SpriteCommand implements HtmlCommand {
private final String sprite;
@@ -48,7 +50,7 @@ public class SpriteCommand implements HtmlCommand {
if (sprite.endsWith(">") == false) {
throw new IllegalArgumentException();
}
- this.sprite = sprite.substring(2, sprite.length() - 1).trim();
+ this.sprite = StringUtils.trin(sprite.substring(2, sprite.length() - 1));
}
public String getSprite() {
diff --git a/src/net/sourceforge/plantuml/graphic/StringBounder.java b/src/net/sourceforge/plantuml/graphic/StringBounder.java
index 69b02ce..739eed9 100644
--- a/src/net/sourceforge/plantuml/graphic/StringBounder.java
+++ b/src/net/sourceforge/plantuml/graphic/StringBounder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/StringBounderUtils.java b/src/net/sourceforge/plantuml/graphic/StringBounderUtils.java
index a9916a7..66244dc 100644
--- a/src/net/sourceforge/plantuml/graphic/StringBounderUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/StringBounderUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/SvgAttributes.java b/src/net/sourceforge/plantuml/graphic/SvgAttributes.java
index ae15f80..020387e 100644
--- a/src/net/sourceforge/plantuml/graphic/SvgAttributes.java
+++ b/src/net/sourceforge/plantuml/graphic/SvgAttributes.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/SvgAttributesChange.java b/src/net/sourceforge/plantuml/graphic/SvgAttributesChange.java
index 3ff9b0e..454a180 100644
--- a/src/net/sourceforge/plantuml/graphic/SvgAttributesChange.java
+++ b/src/net/sourceforge/plantuml/graphic/SvgAttributesChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/SymbolContext.java b/src/net/sourceforge/plantuml/graphic/SymbolContext.java
index eb28041..4668398 100644
--- a/src/net/sourceforge/plantuml/graphic/SymbolContext.java
+++ b/src/net/sourceforge/plantuml/graphic/SymbolContext.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/Text.java b/src/net/sourceforge/plantuml/graphic/Text.java
index 5b70d2d..da7c63f 100644
--- a/src/net/sourceforge/plantuml/graphic/Text.java
+++ b/src/net/sourceforge/plantuml/graphic/Text.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlock.java b/src/net/sourceforge/plantuml/graphic/TextBlock.java
index b148ecb..d9992e2 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlock.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,11 +35,15 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.ugraphic.UShape;
public interface TextBlock extends UDrawable, UShape {
public Dimension2D calculateDimension(StringBounder stringBounder);
+
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder);
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java b/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java
index 4a8b111..0da9fd1 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TextBlockArrow implements TextBlock {
+public class TextBlockArrow extends AbstractTextBlock implements TextBlock {
private final double size;
private final Direction arrow;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
index 1e2780a..77297af 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class TextBlockBordered implements TextBlock {
+class TextBlockBordered extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
private final HtmlColor color;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java b/src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java
index 12f7343..2099898 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockCompressed.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,7 +43,7 @@ import net.sourceforge.plantuml.ugraphic.SlotSet;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicCompress;
-public class TextBlockCompressed implements TextBlock {
+public class TextBlockCompressed extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java b/src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java
index 66bba9b..6550793 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockCompressed2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,7 +41,7 @@ import net.sourceforge.plantuml.ugraphic.CompressionTransform;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicCompress2;
-public class TextBlockCompressed2 implements TextBlock {
+public class TextBlockCompressed2 extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
private final CompressionTransform compressionTransform;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java b/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java
index 514bd7c..e85fd02 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,7 +39,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class TextBlockEmpty implements TextBlockWidth, TextBlock {
+public class TextBlockEmpty extends AbstractTextBlock implements TextBlockWidth, TextBlock {
private final double width;
private final double height;
@@ -61,7 +61,7 @@ public class TextBlockEmpty implements TextBlockWidth, TextBlock {
}
public TextBlock asTextBlock(final double widthToUse) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java
index ac050d0..e1079c9 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public class TextBlockGeneric implements TextBlock {
+public class TextBlockGeneric extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
private final HtmlColor background;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java b/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java
index eef19f9..6cd00b6 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,7 +40,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class TextBlockHorizontal implements TextBlock {
+class TextBlockHorizontal extends AbstractTextBlock implements TextBlock {
private final TextBlock b1;
private final TextBlock b2;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java
index 3d74311..03ada79 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,13 +35,14 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
-public class TextBlockLineBefore implements TextBlock {
+public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
private final char separator;
@@ -81,5 +82,10 @@ public class TextBlockLineBefore implements TextBlock {
UHorizontalLine.infinite(1, 1, title, separator).drawMe(ug);
}
}
+
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ return textBlock.getInnerPosition(member, stringBounder);
+ }
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java b/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java
index d734f9a..491bc26 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockMarged.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,12 +35,13 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class TextBlockMarged implements TextBlock {
+class TextBlockMarged extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
private final double x1;
@@ -62,7 +63,18 @@ class TextBlockMarged implements TextBlock {
}
public void drawU(UGraphic ug) {
- textBlock.drawU(ug.apply(new UTranslate(x1, y1)));
+ final UTranslate translate = new UTranslate(x1, y1);
+ textBlock.drawU(ug.apply(translate));
+ }
+
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ final Rectangle2D parent = textBlock.getInnerPosition(member, stringBounder);
+ if (parent == null) {
+ return null;
+ }
+ final UTranslate translate = new UTranslate(x1, y1);
+ return translate.apply(parent);
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java b/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java
index db62e12..b568bd8 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,7 +40,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class TextBlockMinWidth implements TextBlock {
+class TextBlockMinWidth extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
private final double minWidth;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
index 1cfdbc4..1d31015 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,11 +36,12 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TextBlockRecentred implements TextBlock {
+public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBackcolored {
private final TextBlock textBlock;
@@ -58,4 +59,8 @@ public class TextBlockRecentred implements TextBlock {
return minMax.getDimension();
}
+ public HtmlColor getBackcolor() {
+ return ((TextBlockBackcolored) textBlock).getBackcolor();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java b/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java
index a9b10c2..8218771 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,7 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class TextBlockSimple implements TextBlock {
+public class TextBlockSimple extends AbstractTextBlock implements TextBlock {
private List<Line> lines2;
@@ -67,7 +67,7 @@ class TextBlockSimple implements TextBlock {
this(texts, fontConfiguration, horizontalAlignment, spriteContainer, maxMessageSize, null, null);
}
- protected TextBlockSimple(Display texts, FontConfiguration fontConfiguration,
+ public TextBlockSimple(Display texts, FontConfiguration fontConfiguration,
HorizontalAlignment horizontalAlignment, SpriteContainer spriteContainer, double maxMessageSize,
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
this.texts = texts;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockSpotted.java b/src/net/sourceforge/plantuml/graphic/TextBlockSpotted.java
index 8a6089c..d916fcb 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockSpotted.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockSpotted.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class TextBlockSpotted extends TextBlockSimple {
+public class TextBlockSpotted extends TextBlockSimple {
private final CircledCharacter circledCharacter;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
index a39fc07..a4983a8 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,104 +41,19 @@ import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.ISkinSimple;
-import net.sourceforge.plantuml.SpriteContainer;
-import net.sourceforge.plantuml.creole.CreoleParser;
-import net.sourceforge.plantuml.creole.Sheet;
-import net.sourceforge.plantuml.creole.SheetBlock1;
-import net.sourceforge.plantuml.creole.SheetBlock2;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.posimo.Positionable;
import net.sourceforge.plantuml.posimo.PositionableImpl;
-import net.sourceforge.plantuml.sequencediagram.MessageNumber;
import net.sourceforge.plantuml.ugraphic.LimitFinder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UStroke;
public class TextBlockUtils {
- public static TextBlock create(Display texts, FontConfiguration fontConfiguration,
- HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer) {
- return create(texts, fontConfiguration, horizontalAlignment, spriteContainer, false);
- }
-
- public static TextBlock create(Display texts, FontConfiguration fontConfiguration,
- HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer, boolean modeSimpleLine) {
- if (texts == null) {
- return empty(0, 0);
- }
- return create(texts, fontConfiguration, horizontalAlignment, spriteContainer, 0, modeSimpleLine, null, null);
- }
-
- public static TextBlock create(Display texts, FontConfiguration fontConfiguration,
- HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer, double maxMessageSize,
- boolean modeSimpleLine, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
- if (texts.getNaturalHorizontalAlignment() != null) {
- horizontalAlignment = texts.getNaturalHorizontalAlignment();
- }
- if (texts.size() > 0) {
- if (texts.get(0) instanceof Stereotype) {
- return createStereotype(texts, fontConfiguration, horizontalAlignment, spriteContainer, 0,
- fontForStereotype, htmlColorForStereotype);
- }
- if (texts.get(texts.size() - 1) instanceof Stereotype) {
- return createStereotype(texts, fontConfiguration, horizontalAlignment, spriteContainer,
- texts.size() - 1, fontForStereotype, htmlColorForStereotype);
- }
- if (texts.get(0) instanceof MessageNumber) {
- return createMessageNumber(texts, fontConfiguration, horizontalAlignment, spriteContainer,
- maxMessageSize);
- }
- }
-
- return getCreole(texts, fontConfiguration, horizontalAlignment, spriteContainer, maxMessageSize, modeSimpleLine);
- }
-
- private static TextBlock getCreole(Display texts, FontConfiguration fontConfiguration,
- HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer, double maxMessageSize,
- boolean modeSimpleLine) {
- final Sheet sheet = new CreoleParser(fontConfiguration, horizontalAlignment, spriteContainer, modeSimpleLine)
- .createSheet(texts);
- final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet, maxMessageSize, spriteContainer == null ? 0
- : spriteContainer.getPadding());
- return new SheetBlock2(sheetBlock1, sheetBlock1, new UStroke(1.5));
- }
-
- private static TextBlock createMessageNumber(Display texts, FontConfiguration fontConfiguration,
- HorizontalAlignment horizontalAlignment, ISkinSimple spriteContainer, double maxMessageSize) {
- TextBlock tb1 = getCreole(texts.subList(0, 1), fontConfiguration, horizontalAlignment, spriteContainer,
- maxMessageSize, false);
- tb1 = TextBlockUtils.withMargin(tb1, 0, 4, 0, 0);
- final TextBlock tb2 = getCreole(texts.subList(1, texts.size()), fontConfiguration, horizontalAlignment,
- spriteContainer, maxMessageSize, false);
- return TextBlockUtils.mergeLR(tb1, tb2, VerticalAlignment.CENTER);
-
- }
-
- private static TextBlock createStereotype(Display texts, FontConfiguration fontConfiguration,
- HorizontalAlignment horizontalAlignment, SpriteContainer spriteContainer, int position,
- UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
- final Stereotype stereotype = (Stereotype) texts.get(position);
- if (stereotype.isSpotted()) {
- final CircledCharacter circledCharacter = new CircledCharacter(stereotype.getCharacter(),
- stereotype.getRadius(), stereotype.getCircledFont(), stereotype.getHtmlColor(), null,
- fontConfiguration.getColor());
- if (stereotype.getLabel(false) == null) {
- return new TextBlockSpotted(circledCharacter, texts.subList(1, texts.size()), fontConfiguration,
- horizontalAlignment, spriteContainer);
- }
- return new TextBlockSpotted(circledCharacter, texts, fontConfiguration, horizontalAlignment,
- spriteContainer);
- }
- return new TextBlockSimple(texts, fontConfiguration, horizontalAlignment, spriteContainer, 0, fontForStereotype, htmlColorForStereotype);
- }
-
public static TextBlock withMargin(TextBlock textBlock, double marginX, double marginY) {
return new TextBlockMarged(textBlock, marginX, marginX, marginY, marginY);
}
@@ -153,7 +68,7 @@ public class TextBlockUtils {
}
public static TextBlock empty(final double width, final double height) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
}
@@ -190,6 +105,14 @@ public class TextBlockUtils {
dummyStringBounder = StringBounderUtils.asStringBounder(gg);
}
+ public static boolean isEmpty(TextBlock text) {
+ if (text == null) {
+ return true;
+ }
+ final Dimension2D dim = text.calculateDimension(dummyStringBounder);
+ return dim.getHeight() == 0 && dim.getWidth() == 0;
+ }
+
public static StringBounder getDummyStringBounder() {
return dummyStringBounder;
}
@@ -214,4 +137,25 @@ public class TextBlockUtils {
return gg.getFontMetrics(font);
}
+ public static TextBlock fullInnerPosition(final TextBlock bloc, final String display) {
+ return new TextBlock() {
+
+ public void drawU(UGraphic ug) {
+ bloc.drawU(ug);
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return bloc.calculateDimension(stringBounder);
+ }
+
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ if (display.startsWith(member)) {
+ final Dimension2D dim = calculateDimension(stringBounder);
+ return new Rectangle2D.Double(0, 0, dim.getWidth(), dim.getHeight());
+ }
+ return null;
+ }
+ };
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java
index fbf3cb8..653fdd0 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
@@ -42,7 +43,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TextBlockVertical2 implements TextBlock {
+public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock {
private final List<TextBlock> blocks = new ArrayList<TextBlock>();
private final HorizontalAlignment horizontalAlignment;
@@ -72,13 +73,16 @@ public class TextBlockVertical2 implements TextBlock {
public void drawU(UGraphic ug) {
double y = 0;
final Dimension2D dimtotal = calculateDimension(ug.getStringBounder());
- for (TextBlock b : blocks) {
- final Dimension2D dimb = b.calculateDimension(ug.getStringBounder());
+ for (TextBlock block : blocks) {
+ final Dimension2D dimb = block.calculateDimension(ug.getStringBounder());
if (horizontalAlignment == HorizontalAlignment.LEFT) {
- b.drawU(ug.apply(new UTranslate(0, y)));
+ block.drawU(ug.apply(new UTranslate(0, y)));
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
final double dx = (dimtotal.getWidth() - dimb.getWidth()) / 2;
- b.drawU(ug.apply(new UTranslate(dx, y)));
+ block.drawU(ug.apply(new UTranslate(dx, y)));
+ } else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
+ final double dx = dimtotal.getWidth() - dimb.getWidth();
+ block.drawU(ug.apply(new UTranslate(dx, y)));
} else {
throw new UnsupportedOperationException();
}
@@ -86,4 +90,18 @@ public class TextBlockVertical2 implements TextBlock {
}
}
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ double y = 0;
+ for (TextBlock block : blocks) {
+ final Dimension2D dimb = block.calculateDimension(stringBounder);
+ final Rectangle2D result = block.getInnerPosition(member, stringBounder);
+ if (result != null) {
+ return new UTranslate(0, y).apply(result);
+ }
+ y += dimb.getHeight();
+ }
+ return null;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockWidth.java b/src/net/sourceforge/plantuml/graphic/TextBlockWidth.java
index 4da6229..b9ec3fd 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockWidth.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockWidthAdapter.java b/src/net/sourceforge/plantuml/graphic/TextBlockWidthAdapter.java
index fbf3c63..fedba2e 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockWidthAdapter.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockWidthAdapter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,7 +38,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class TextBlockWidthAdapter implements TextBlock {
+public class TextBlockWidthAdapter extends AbstractTextBlock implements TextBlock {
private final TextBlockWidth textBlockWidth;
private final double width;
diff --git a/src/net/sourceforge/plantuml/graphic/TextLink.java b/src/net/sourceforge/plantuml/graphic/TextLink.java
index f5c2e82..d5e5757 100644
--- a/src/net/sourceforge/plantuml/graphic/TextLink.java
+++ b/src/net/sourceforge/plantuml/graphic/TextLink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/TileImage.java b/src/net/sourceforge/plantuml/graphic/TileImage.java
index 8d254f2..25ae005 100644
--- a/src/net/sourceforge/plantuml/graphic/TileImage.java
+++ b/src/net/sourceforge/plantuml/graphic/TileImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TileImage implements TextBlock {
+public class TileImage extends AbstractTextBlock implements TextBlock {
private final BufferedImage image;
private final int vspace;
diff --git a/src/net/sourceforge/plantuml/graphic/TileImageSvg.java b/src/net/sourceforge/plantuml/graphic/TileImageSvg.java
index 623dd14..a164624 100644
--- a/src/net/sourceforge/plantuml/graphic/TileImageSvg.java
+++ b/src/net/sourceforge/plantuml/graphic/TileImageSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImageSvg;
-public class TileImageSvg implements TextBlock {
+public class TileImageSvg extends AbstractTextBlock implements TextBlock {
private final UImageSvg svg;
diff --git a/src/net/sourceforge/plantuml/graphic/TileText.java b/src/net/sourceforge/plantuml/graphic/TileText.java
index f9511c4..5a5f38d 100644
--- a/src/net/sourceforge/plantuml/graphic/TileText.java
+++ b/src/net/sourceforge/plantuml/graphic/TileText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,7 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UText;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TileText implements TextBlock {
+public class TileText extends AbstractTextBlock implements TextBlock {
private final String text;
private final FontConfiguration fontConfiguration;
diff --git a/src/net/sourceforge/plantuml/graphic/UDrawable.java b/src/net/sourceforge/plantuml/graphic/UDrawable.java
index 9bbbd02..9f604cc 100644
--- a/src/net/sourceforge/plantuml/graphic/UDrawable.java
+++ b/src/net/sourceforge/plantuml/graphic/UDrawable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/UDrawableUtils.java b/src/net/sourceforge/plantuml/graphic/UDrawableUtils.java
index b5b00c7..7fa1905 100644
--- a/src/net/sourceforge/plantuml/graphic/UDrawableUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/UDrawableUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
index 8e475eb..faddf4f 100644
--- a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
+++ b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicInterceptorUDrawable.java b/src/net/sourceforge/plantuml/graphic/UGraphicInterceptorUDrawable.java
index 6e13067..05f8435 100644
--- a/src/net/sourceforge/plantuml/graphic/UGraphicInterceptorUDrawable.java
+++ b/src/net/sourceforge/plantuml/graphic/UGraphicInterceptorUDrawable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/USymbol.java b/src/net/sourceforge/plantuml/graphic/USymbol.java
index d159f96..d8ee58b 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbol.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbol.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -57,8 +57,8 @@ public abstract class USymbol {
public final static USymbol PACKAGE = record("PACKAGE", SkinParameter.PACKAGE, new USymbolFolder(
SkinParameter.PACKAGE));
public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, new USymbolFolder(SkinParameter.FOLDER));
- public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.CARD, new USymbolRect(SkinParameter.CARD));
- public final static USymbol AGENT = record("AGENT", SkinParameter.AGENT, new USymbolRect(SkinParameter.AGENT));
+ public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.CARD, new USymbolRect(SkinParameter.CARD, HorizontalAlignment.CENTER));
+ public final static USymbol AGENT = record("AGENT", SkinParameter.AGENT, new USymbolRect(SkinParameter.AGENT, HorizontalAlignment.CENTER));
public final static USymbol ACTOR = record("ACTOR", SkinParameter.ACTOR, new USymbolActor());
public final static USymbol USECASE = null;
public final static USymbol COMPONENT1 = record("COMPONENT1", SkinParameter.COMPONENT1, new USymbolComponent1());
@@ -71,6 +71,10 @@ public abstract class USymbol {
public final static USymbol QUEUE = record("QUEUE", SkinParameter.QUEUE, new USymbolQueue());
abstract public SkinParameter getSkinParameter();
+
+ public USymbol withStereoAlignment(HorizontalAlignment alignment) {
+ return this;
+ }
public FontParam getFontParam() {
return getSkinParameter().getFontParam();
@@ -90,12 +94,12 @@ public abstract class USymbol {
}
public static USymbol getFromString(String s) {
- final USymbol result = all.get(StringUtils.goUpperCase(s));
+ final USymbol result = all.get(StringUtils.goUpperCase(s.replaceAll("\\W", "")));
if (result == null) {
if (s.equalsIgnoreCase("component")) {
return COMPONENT2;
}
- throw new IllegalArgumentException("s=" + s);
+ return null;
}
return result;
}
@@ -105,7 +109,7 @@ public abstract class USymbol {
return symbol;
}
- public abstract TextBlock asSmall(TextBlock label, TextBlock stereotype, SymbolContext symbolContext);
+ public abstract TextBlock asSmall(TextBlock name, TextBlock label, TextBlock stereotype, SymbolContext symbolContext);
public abstract TextBlock asBig(TextBlock label, TextBlock stereotype, double width, double height,
SymbolContext symbolContext);
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolActor.java b/src/net/sourceforge/plantuml/graphic/USymbolActor.java
index ac209d1..fb1a014 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolActor.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolActor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
index 79cd066..74d2657 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,10 +37,13 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
class USymbolArtifact extends USymbol {
@@ -50,7 +53,6 @@ class USymbolArtifact extends USymbol {
return SkinParameter.ARTIFACT;
}
-
private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing) {
final URectangle form = new URectangle(widthTotal, heightTotal);
@@ -86,12 +88,27 @@ class USymbolArtifact extends USymbol {
private Margin getMargin() {
return new Margin(10, 10 + 10, 10 + 3, 10);
}
+
+ public boolean manageHorizontalLine() {
+ return true;
+ }
+
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
+ final Stencil stencil = new Stencil() {
+ public double getStartingX(StringBounder stringBounder, double y) {
+ return 0;
+ }
+
+ public double getEndingX(StringBounder stringBounder, double y) {
+ return dim.getWidth();
+ }
+ };
+ ug = new UGraphicStencil(ug, stencil, new UStroke());
ug = symbolContext.apply(ug);
drawArtifact(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
final Margin margin = getMargin();
@@ -109,7 +126,7 @@ class USymbolArtifact extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java b/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java
index dbf67f9..b8f13b4 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolBoundary.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCard.java b/src/net/sourceforge/plantuml/graphic/USymbolCard.java
index 7b44855..e75947d 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCard.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCard.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -71,8 +71,8 @@ class USymbolCard extends USymbol {
return new Margin(10, 10, 3, 3);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
@@ -93,7 +93,7 @@ class USymbolCard extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
index a867749..04b0e02 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -87,8 +87,8 @@ class USymbolCloud extends USymbol {
return new Margin(10, 10, 10, 10);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
@@ -109,7 +109,7 @@ class USymbolCloud extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
index 2445c8b..ad607cf 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -70,8 +70,8 @@ class USymbolComponent1 extends USymbol {
return new Margin(10, 10, 10, 10);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
index 6a74bc6..398febc 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,9 +36,8 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
-import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.graphic.USymbol.Margin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
@@ -51,7 +50,6 @@ class USymbolComponent2 extends USymbol {
return SkinParameter.COMPONENT2;
}
-
private void drawNode(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing) {
final URectangle form = new URectangle(widthTotal, heightTotal);
@@ -75,27 +73,32 @@ class USymbolComponent2 extends USymbol {
return new Margin(10 + 5, 20 + 5, 15 + 5, 5 + 5);
}
- public TextBlock asSmall(final TextBlock label, TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawNode(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
final Margin margin = getMargin();
- label.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
+
+ final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
+ tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
+ // label.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
- final Dimension2D dim = label.calculateDimension(stringBounder);
- return getMargin().addDimension(dim);
+ final Dimension2D dimLabel = label.calculateDimension(stringBounder);
+ final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
+ return getMargin().addDimension(Dimension2DDouble.mergeTB(dimStereo, dimLabel));
}
};
}
public TextBlock asBig(final TextBlock title, TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolControl.java b/src/net/sourceforge/plantuml/graphic/USymbolControl.java
index 7f9dfbd..46b89ff 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolControl.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolControl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
index 4eda644..1a181ab 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -113,8 +113,8 @@ class USymbolDatabase extends USymbol {
return new Margin(10, 10, 20, 5);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
@@ -136,7 +136,7 @@ class USymbolDatabase extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java
index bfc6ed6..0140ecc 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolEntityDomain.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
index 2c924fa..c2a78f0 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -102,30 +102,36 @@ public class USymbolFolder extends USymbol {
return new Margin(10, 10 + 10, 10 + 3, 10);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(final TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
+ if (name == null) {
+ throw new IllegalArgumentException();
+ }
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
- drawFolder(ug, dim.getWidth(), dim.getHeight(), new Dimension2DDouble(0, 0),
- symbolContext.isShadowing());
+ final Dimension2D dimName = name.calculateDimension(ug.getStringBounder());
+ drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
- tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
+ name.drawU(ug.apply(new UTranslate(4, 3)));
+ tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
+ final Dimension2D dimName = name.calculateDimension(stringBounder);
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
- return getMargin().addDimension(Dimension2DDouble.mergeTB(dimStereo, dimLabel));
+ return getMargin().addDimension(Dimension2DDouble.mergeTB(dimName, dimStereo, dimLabel));
}
};
}
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
index f9c146d..c09e719 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -91,8 +91,8 @@ class USymbolFrame extends USymbol {
return new Margin(10 + 5, 20 + 5, 15 + 5, 5 + 5);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
@@ -113,7 +113,7 @@ class USymbolFrame extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolInterface.java b/src/net/sourceforge/plantuml/graphic/USymbolInterface.java
index 33bcec8..8ea73bb 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolInterface.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolInterface.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolNode.java b/src/net/sourceforge/plantuml/graphic/USymbolNode.java
index 3c4305c..034d609 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolNode.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolNode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -74,8 +74,8 @@ class USymbolNode extends USymbol {
return new Margin(10 + 5, 20 + 5, 15 + 5, 5 + 5);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
@@ -96,7 +96,7 @@ class USymbolNode extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java
index 01aefa9..8e4fc69 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolQueue.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolQueue.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -115,8 +115,8 @@ class USymbolQueue extends USymbol {
return new Margin(5, 15, 5, 5);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolRect.java b/src/net/sourceforge/plantuml/graphic/USymbolRect.java
index ac154db..eb7d8ec 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolRect.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolRect.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,20 +42,25 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
class USymbolRect extends USymbol {
-
- private final SkinParameter skinParameter;
+ private final SkinParameter skinParameter;
+ private final HorizontalAlignment stereotypeAlignement;
- public USymbolRect(SkinParameter skinParameter) {
+ public USymbolRect(SkinParameter skinParameter, HorizontalAlignment stereotypeAlignement) {
this.skinParameter = skinParameter;
+ this.stereotypeAlignement = stereotypeAlignement;
}
-
+
+ @Override
+ public USymbol withStereoAlignment(HorizontalAlignment alignment) {
+ return new USymbolRect(skinParameter, alignment);
+ }
+
@Override
public SkinParameter getSkinParameter() {
return skinParameter;
}
-
private void drawRect(UGraphic ug, double width, double height, boolean shadowing) {
final URectangle shape = new URectangle(width, height);
if (shadowing) {
@@ -68,15 +73,16 @@ class USymbolRect extends USymbol {
return new Margin(10, 10, 10, 10);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
+ final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
final Margin margin = getMargin();
- final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
+ final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, stereotypeAlignement);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1())));
}
@@ -90,15 +96,22 @@ class USymbolRect extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
-
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
- final double posStereo = (width - dimStereo.getWidth()) / 2;
- stereotype.drawU(ug.apply(new UTranslate(posStereo, 2)));
+ final double posStereoX;
+ final double posStereoY;
+ if (stereotypeAlignement == HorizontalAlignment.RIGHT) {
+ posStereoX = width - dimStereo.getWidth() - getMargin().getX1() / 2;
+ posStereoY = getMargin().getY1() / 2;
+ } else {
+ posStereoX = (width - dimStereo.getWidth()) / 2;
+ posStereoY = 2;
+ }
+ stereotype.drawU(ug.apply(new UTranslate(posStereoX, posStereoY)));
final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
final double posTitle = (width - dimTitle.getWidth()) / 2;
title.drawU(ug.apply(new UTranslate(posTitle, 2 + dimStereo.getHeight())));
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
index f98aa63..31e218c 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,12 +42,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
abstract class USymbolSimpleAbstract extends USymbol {
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
if (stereotype == null) {
throw new IllegalArgumentException();
}
final TextBlock stickman = getDrawing(symbolContext);
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
index 0ef378b..48928f9 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -60,8 +60,8 @@ class USymbolStorage extends USymbol {
return new Margin(10, 10, 10, 10);
}
- public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
- return new TextBlock() {
+ public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
@@ -82,7 +82,7 @@ class USymbolStorage extends USymbol {
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/UnusedSpace.java b/src/net/sourceforge/plantuml/graphic/UnusedSpace.java
index 2c820e9..54839d3 100644
--- a/src/net/sourceforge/plantuml/graphic/UnusedSpace.java
+++ b/src/net/sourceforge/plantuml/graphic/UnusedSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/VerticalAlignment.java b/src/net/sourceforge/plantuml/graphic/VerticalAlignment.java
index a5427a1..2fa1b2b 100644
--- a/src/net/sourceforge/plantuml/graphic/VerticalAlignment.java
+++ b/src/net/sourceforge/plantuml/graphic/VerticalAlignment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/VerticalPosition.java b/src/net/sourceforge/plantuml/graphic/VerticalPosition.java
index 74f9fd3..a5b4ea3 100644
--- a/src/net/sourceforge/plantuml/graphic/VerticalPosition.java
+++ b/src/net/sourceforge/plantuml/graphic/VerticalPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/graphic/color/ColorParser.java b/src/net/sourceforge/plantuml/graphic/color/ColorParser.java
new file mode 100644
index 0000000..198cddb
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/color/ColorParser.java
@@ -0,0 +1,110 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.graphic.color;
+
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexResult;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+
+public class ColorParser {
+
+ private static final String COLOR_REGEXP = "#\\w+[-\\\\|/]?\\w+";
+
+ private static final String PART2 = "#(?:\\w+[-\\\\|/]?\\w+;)?(?:(?:text|back|header|line|line\\.dashed|line\\.dotted|line\\.bold|shadowing)(?::\\w+[-\\\\|/]?\\w+)?(?:;|(?![\\w;:.])))+";
+ private static final String COLORS_REGEXP = "(?:" + PART2 + ")|(?:" + COLOR_REGEXP + ")";
+
+ private final RegexLeaf regex;
+ private final String name;
+ private final ColorType mainType;
+
+ private ColorParser(String name, RegexLeaf regex, ColorType mainType) {
+ this.regex = regex;
+ this.name = name;
+ this.mainType = mainType;
+ }
+
+ public Colors getColor(RegexResult arg, IHtmlColorSet set) {
+ if (mainType == null) {
+ throw new IllegalStateException();
+ }
+ final String data = arg.get(name, 0);
+ if (data == null) {
+ return Colors.empty();
+ }
+ return new Colors(data, set, mainType);
+ // return result.getColor(type);
+ }
+
+ // New Parsers
+ public static ColorParser simpleColor(ColorType mainType) {
+ return new ColorParser("COLOR", new RegexLeaf("COLOR", "(" + COLORS_REGEXP + ")?"), mainType);
+ }
+
+ public static ColorParser simpleColor(String optPrefix, ColorType mainType) {
+ return new ColorParser("COLOR", new RegexLeaf("COLOR", "(?:" + optPrefix + " (" + COLORS_REGEXP + "))?"),
+ mainType);
+ }
+
+ // Old Parsers
+
+ public static RegexLeaf exp1() {
+ return simpleColor(null).regex;
+ }
+
+ public static RegexLeaf exp2() {
+ return new RegexLeaf("BACKCOLOR", "(" + COLOR_REGEXP + ")?");
+ }
+
+ public static RegexLeaf exp3() {
+ return new RegexLeaf("BACKCOLOR2", "(" + COLOR_REGEXP + ")?");
+ }
+
+ public static RegexLeaf exp4() {
+ return new RegexLeaf("COLOR", "(?:(" + COLOR_REGEXP + "):)?");
+ }
+
+ public static RegexLeaf exp6() {
+ return new RegexLeaf("COLOR", "(?:(" + COLOR_REGEXP + ")\\|)?");
+ }
+
+ public static RegexLeaf exp7() {
+ return new RegexLeaf("COLOR", "(?:(" + COLOR_REGEXP + "))?");
+ }
+
+ public RegexLeaf getRegex() {
+ return regex;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/graphic/color/ColorType.java b/src/net/sourceforge/plantuml/graphic/color/ColorType.java
new file mode 100644
index 0000000..6bbf21e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/color/ColorType.java
@@ -0,0 +1,48 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.graphic.color;
+
+public enum ColorType {
+ TEXT, LINE, BACK, HEADER, ARROW;
+
+ public static ColorType getType(String s) {
+ final int x = s.indexOf('.');
+ if (x != -1) {
+ s = s.substring(0, x);
+ }
+ final ColorType key = ColorType.valueOf(s.toUpperCase());
+ return key;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/graphic/color/Colors.java b/src/net/sourceforge/plantuml/graphic/color/Colors.java
new file mode 100644
index 0000000..8331e27
--- /dev/null
+++ b/src/net/sourceforge/plantuml/graphic/color/Colors.java
@@ -0,0 +1,237 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.graphic.color;
+
+import java.util.EnumMap;
+import java.util.Map;
+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;
+import net.sourceforge.plantuml.cucadiagram.LinkStyle;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UStroke;
+
+public class Colors {
+
+ private final Map<ColorType, HtmlColor> map = new EnumMap<ColorType, HtmlColor>(ColorType.class);
+ private LinkStyle lineStyle = null;
+ private Boolean shadowing = null;
+
+ @Override
+ public String toString() {
+ return map.toString() + " " + lineStyle;
+ }
+
+ public static Colors empty() {
+ return new Colors();
+ }
+
+ private Colors copy() {
+ final Colors result = new Colors();
+ result.map.putAll(this.map);
+ result.lineStyle = this.lineStyle;
+ return result;
+ }
+
+ private Colors() {
+ }
+
+ public Colors(String data, IHtmlColorSet set, ColorType mainType) {
+ data = StringUtils.goLowerCase(data);
+
+ for (final StringTokenizer st = new StringTokenizer(data, "#;"); st.hasMoreTokens();) {
+ final String s = st.nextToken();
+ final int x = s.indexOf(':');
+ if (x == -1) {
+ if (s.contains(".") == false) {
+ map.put(mainType, set.getColorIfValid(s));
+ }
+ } else {
+ final String name = s.substring(0, x);
+ final String value = s.substring(x + 1);
+ if (name.equalsIgnoreCase("shadowing")) {
+ this.shadowing = value.equalsIgnoreCase("true");
+ } else {
+ final ColorType key = ColorType.getType(name);
+ final HtmlColor color = set.getColorIfValid(value);
+ map.put(key, color);
+ }
+ }
+ }
+ if (data.contains("line.dashed")) {
+ lineStyle = LinkStyle.DASHED;
+ } else if (data.contains("line.dotted")) {
+ lineStyle = LinkStyle.DOTTED;
+ } else if (data.contains("line.bold")) {
+ lineStyle = LinkStyle.BOLD;
+ }
+ }
+
+ public HtmlColor getColor(ColorType key) {
+ if (key == null) {
+ throw new IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public HtmlColor getColor(ColorType key1, ColorType key2) {
+ final HtmlColor result = getColor(key1);
+ if (result != null) {
+ return result;
+ }
+ return getColor(key2);
+ }
+
+ public UStroke getSpecificLineStroke() {
+ if (lineStyle == null) {
+ return null;
+ }
+ return LinkStyle.getStroke(lineStyle);
+ }
+
+ // public Colors addSpecificLineStroke(UStroke specificStroke) {
+ // final Colors result = copy();
+ // result.specificStroke = specificStroke;
+ // return result;
+ // }
+
+ public Colors add(ColorType type, HtmlColor color) {
+ if (color == null) {
+ return this;
+ }
+ final Colors result = copy();
+ result.map.put(type, color);
+ return result;
+ }
+
+ private Colors add(ColorType colorType, Colors other) {
+ final Colors result = copy();
+ result.map.putAll(other.map);
+ if (other.lineStyle != null) {
+ result.lineStyle = other.lineStyle;
+ }
+ return result;
+ }
+
+ public final LinkStyle getLineStyle() {
+ return lineStyle;
+ }
+
+ public ISkinParam mute(ISkinParam skinParam) {
+ return new SkinParamColors(skinParam, this);
+ }
+
+ public Colors addLegacyStroke(String s) {
+ if (s == null) {
+ throw new IllegalArgumentException();
+ }
+ final Colors result = copy();
+ result.lineStyle = LinkStyle.valueOf(StringUtils.goUpperCase(s));
+ return result;
+
+ }
+
+ public static UGraphic applyStroke(UGraphic ug, Colors colors) {
+ if (colors == null) {
+ return ug;
+ }
+ if (colors.lineStyle == null) {
+ return ug;
+ }
+ return ug.apply(LinkStyle.getStroke(colors.lineStyle));
+ }
+
+ public Colors applyStereotype(Stereotype stereotype, ISkinParam skinParam, ColorParam param) {
+ if (stereotype == null) {
+ throw new IllegalArgumentException();
+ }
+ if (param == null) {
+ throw new IllegalArgumentException();
+ }
+ final ColorType colorType = param.getColorType();
+ if (colorType == null) {
+ throw new IllegalArgumentException();
+ }
+ if (getColor(colorType) != null) {
+ return this;
+ }
+ final Colors colors = skinParam.getColors(param, stereotype);
+ return add(colorType, colors);
+ }
+
+ private Colors applyFontParamStereotype(Stereotype stereotype, ISkinParam skinParam, FontParam param) {
+ if (stereotype == null) {
+ throw new IllegalArgumentException();
+ }
+ if (param == null) {
+ return this;
+ }
+ final ColorType colorType = ColorType.TEXT;
+ if (getColor(colorType) != null) {
+ return this;
+ }
+ final HtmlColor col = skinParam.getFontHtmlColor(stereotype, param);
+ return add(colorType, col);
+ }
+
+ public Colors applyStereotypeForNote(Stereotype stereotype, ISkinParam skinParam, FontParam fontParam,
+ ColorParam... params) {
+ if (stereotype == null) {
+ throw new IllegalArgumentException();
+ }
+ if (params == null) {
+ throw new IllegalArgumentException();
+ }
+ Colors result = this;
+ for (ColorParam param : params) {
+ result = result.applyStereotype(stereotype, skinParam, param);
+ }
+ result = result.applyFontParamStereotype(stereotype, skinParam, fontParam);
+ result.shadowing = skinParam.shadowingForNote(stereotype);
+ return result;
+ }
+
+ public Boolean getShadowing() {
+ return shadowing;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/hector/Box2D.java b/src/net/sourceforge/plantuml/hector/Box2D.java
index 722f38f..3820161 100644
--- a/src/net/sourceforge/plantuml/hector/Box2D.java
+++ b/src/net/sourceforge/plantuml/hector/Box2D.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector.java
index 290fe13..7ecbb80 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector2.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector2.java
index 103d6c9..fcdefff 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector2.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector3.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector3.java
index ffad07a..2dd1980 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector3.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector4.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector4.java
index dce7dde..ed1ba90 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector4.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHector4.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java
index 403fec7..db69149 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB2.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB2.java
index e5a699b..9253f0e 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB2.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/GrowingTree.java b/src/net/sourceforge/plantuml/hector/GrowingTree.java
index c4aedc0..0934799 100644
--- a/src/net/sourceforge/plantuml/hector/GrowingTree.java
+++ b/src/net/sourceforge/plantuml/hector/GrowingTree.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/HectorPath.java b/src/net/sourceforge/plantuml/hector/HectorPath.java
index 3b2778d..ffa70fb 100644
--- a/src/net/sourceforge/plantuml/hector/HectorPath.java
+++ b/src/net/sourceforge/plantuml/hector/HectorPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/Pin.java b/src/net/sourceforge/plantuml/hector/Pin.java
index 08e8ed7..81dc51f 100644
--- a/src/net/sourceforge/plantuml/hector/Pin.java
+++ b/src/net/sourceforge/plantuml/hector/Pin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/PinFactory.java b/src/net/sourceforge/plantuml/hector/PinFactory.java
index 79ed583..a27e4b8 100644
--- a/src/net/sourceforge/plantuml/hector/PinFactory.java
+++ b/src/net/sourceforge/plantuml/hector/PinFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/PinLink.java b/src/net/sourceforge/plantuml/hector/PinLink.java
index cb0ce64..86c993d 100644
--- a/src/net/sourceforge/plantuml/hector/PinLink.java
+++ b/src/net/sourceforge/plantuml/hector/PinLink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java b/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java
index 5a4e2bf..e8b9394 100644
--- a/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java
+++ b/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/Skeleton.java b/src/net/sourceforge/plantuml/hector/Skeleton.java
index 62767e7..5389fdb 100644
--- a/src/net/sourceforge/plantuml/hector/Skeleton.java
+++ b/src/net/sourceforge/plantuml/hector/Skeleton.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java b/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java
index e682eb5..a2409ac 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java b/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java
index 8cada11..f0cb0fc 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java
index c8a233e..4847030 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java
index ea5d1cf..3726dfc 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java
index 9ffd158..8b893d1 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java
index 77ea314..a81e665 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java
index 25354c0..af6ccd2 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java
index c9a8cbf..05eb4f4 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SkeletonMutation.java b/src/net/sourceforge/plantuml/hector/SkeletonMutation.java
index 6b53db4..2e42597 100644
--- a/src/net/sourceforge/plantuml/hector/SkeletonMutation.java
+++ b/src/net/sourceforge/plantuml/hector/SkeletonMutation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/SmartConnection.java b/src/net/sourceforge/plantuml/hector/SmartConnection.java
index a18f5bb..85a9948 100644
--- a/src/net/sourceforge/plantuml/hector/SmartConnection.java
+++ b/src/net/sourceforge/plantuml/hector/SmartConnection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java b/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java
index 8d27d33..d585ff9 100644
--- a/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java
+++ b/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector/UnlinearCompression.java b/src/net/sourceforge/plantuml/hector/UnlinearCompression.java
index babe6b4..865a1c7 100644
--- a/src/net/sourceforge/plantuml/hector/UnlinearCompression.java
+++ b/src/net/sourceforge/plantuml/hector/UnlinearCompression.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/CucaDiagramFileMakerHectorC1.java b/src/net/sourceforge/plantuml/hector2/CucaDiagramFileMakerHectorC1.java
index b05095a..c809034 100644
--- a/src/net/sourceforge/plantuml/hector2/CucaDiagramFileMakerHectorC1.java
+++ b/src/net/sourceforge/plantuml/hector2/CucaDiagramFileMakerHectorC1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/MinMax.java b/src/net/sourceforge/plantuml/hector2/MinMax.java
index cd77143..73b749c 100644
--- a/src/net/sourceforge/plantuml/hector2/MinMax.java
+++ b/src/net/sourceforge/plantuml/hector2/MinMax.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java b/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java
index 383e473..8f11916 100644
--- a/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java
+++ b/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java b/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java
index 83da747..44ea988 100644
--- a/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java
+++ b/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java b/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java
index bd60416..b2e1f6c 100644
--- a/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java
+++ b/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java b/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java
index 4e586d5..c7756a9 100644
--- a/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java
+++ b/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.hector2.MinMax;
@@ -50,7 +51,7 @@ import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class Foo2 implements TextBlock {
+public class Foo2 extends AbstractTextBlock implements TextBlock {
private final Distribution distribution;
private final CucaDiagram diagram;
diff --git a/src/net/sourceforge/plantuml/hector2/layering/Layer.java b/src/net/sourceforge/plantuml/hector2/layering/Layer.java
index b4cef4d..9185467 100644
--- a/src/net/sourceforge/plantuml/hector2/layering/Layer.java
+++ b/src/net/sourceforge/plantuml/hector2/layering/Layer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java b/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java
index 8a1efb4..fcffc73 100644
--- a/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java
+++ b/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java b/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java
index 0dda414..5aefef8 100644
--- a/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java
+++ b/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java b/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java
index 880edd6..6cc2b71 100644
--- a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java
+++ b/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java b/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java
index 89abc6b..a525e70 100644
--- a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java
+++ b/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/html/CucaDiagramHtmlMaker.java b/src/net/sourceforge/plantuml/html/CucaDiagramHtmlMaker.java
index af823a6..8f4b047 100644
--- a/src/net/sourceforge/plantuml/html/CucaDiagramHtmlMaker.java
+++ b/src/net/sourceforge/plantuml/html/CucaDiagramHtmlMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -135,12 +135,12 @@ public final class CucaDiagramHtmlMaker {
}
pw.println("<hr>");
- if (entity.getFieldsToDisplay().size() == 0) {
+ if (entity.getBodier().getFieldsToDisplay().size() == 0) {
pw.println("<h2>No fields</h2>");
} else {
pw.println("<h2>Fields:</h2>");
pw.println("<ul>");
- for (Member m : entity.getFieldsToDisplay()) {
+ for (Member m : entity.getBodier().getFieldsToDisplay()) {
pw.println("<li>");
pw.println(StringUtils.unicodeForHtml(m.getDisplay(true)));
pw.println("</li>");
@@ -149,12 +149,12 @@ public final class CucaDiagramHtmlMaker {
}
pw.println("<hr>");
- if (entity.getMethodsToDisplay().size() == 0) {
+ if (entity.getBodier().getMethodsToDisplay().size() == 0) {
pw.println("<h2>No methods</h2>");
} else {
pw.println("<h2>Methods:</h2>");
pw.println("<ul>");
- for (Member m : entity.getMethodsToDisplay()) {
+ for (Member m : entity.getBodier().getMethodsToDisplay()) {
pw.println("<li>");
pw.println(StringUtils.unicodeForHtml(m.getDisplay(true)));
pw.println("</li>");
diff --git a/src/net/sourceforge/plantuml/html/LinkHtmlPrinter.java b/src/net/sourceforge/plantuml/html/LinkHtmlPrinter.java
index 53b3810..da4c978 100644
--- a/src/net/sourceforge/plantuml/html/LinkHtmlPrinter.java
+++ b/src/net/sourceforge/plantuml/html/LinkHtmlPrinter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/CommandAddLevel.java b/src/net/sourceforge/plantuml/jungle/CommandAddLevel.java
index abdcbec..8747598 100644
--- a/src/net/sourceforge/plantuml/jungle/CommandAddLevel.java
+++ b/src/net/sourceforge/plantuml/jungle/CommandAddLevel.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/CommandEmpty.java b/src/net/sourceforge/plantuml/jungle/CommandEmpty.java
index de32b96..1ef95aa 100644
--- a/src/net/sourceforge/plantuml/jungle/CommandEmpty.java
+++ b/src/net/sourceforge/plantuml/jungle/CommandEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/GNode.java b/src/net/sourceforge/plantuml/jungle/GNode.java
index 766a2f6..d7f2a7e 100644
--- a/src/net/sourceforge/plantuml/jungle/GNode.java
+++ b/src/net/sourceforge/plantuml/jungle/GNode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/GNodeUtils.java b/src/net/sourceforge/plantuml/jungle/GNodeUtils.java
index f908c95..02aad3f 100644
--- a/src/net/sourceforge/plantuml/jungle/GNodeUtils.java
+++ b/src/net/sourceforge/plantuml/jungle/GNodeUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/GTile.java b/src/net/sourceforge/plantuml/jungle/GTile.java
index e446eae..6757bbc 100644
--- a/src/net/sourceforge/plantuml/jungle/GTile.java
+++ b/src/net/sourceforge/plantuml/jungle/GTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/GTileGeometry.java b/src/net/sourceforge/plantuml/jungle/GTileGeometry.java
index 094c957..163cc9b 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileGeometry.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileGeometry.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java b/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java
index fbfff1c..e7f7955 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.awt.geom.Dimension2D;
import java.util.Arrays;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -45,7 +46,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class GTileLeftRight implements GTile {
+public class GTileLeftRight extends AbstractTextBlock implements GTile {
private final GTile left;
private final GTile right;
diff --git a/src/net/sourceforge/plantuml/jungle/GTileNode.java b/src/net/sourceforge/plantuml/jungle/GTileNode.java
index 0a01b9b..56d743d 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileNode.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileNode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,11 +39,12 @@ import java.util.Arrays;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.SkinParam;
-import net.sourceforge.plantuml.UmlDiagramType;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.CreoleParser;
import net.sourceforge.plantuml.creole.Sheet;
import net.sourceforge.plantuml.creole.SheetBlock1;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -57,7 +58,7 @@ import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class GTileNode implements GTile {
+public class GTileNode extends AbstractTextBlock implements GTile {
private final TextBlock tb;
@@ -66,18 +67,19 @@ public class GTileNode implements GTile {
final SheetBlock1 sheetBlock1 = getTextBlock(display);
final SymbolContext symbolContext = new SymbolContext(HtmlColorUtils.MY_YELLOW, HtmlColorUtils.BLACK);
- tb = USymbol.RECTANGLE.asSmall(sheetBlock1, TextBlockUtils.empty(0, 0), symbolContext);
+ tb = USymbol.RECTANGLE.asSmall(null, sheetBlock1, TextBlockUtils.empty(0, 0), symbolContext);
}
public static SheetBlock1 getTextBlock(final Display display) {
final Rose rose = new Rose();
final SkinParam skinParam = new SkinParam();
final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
- final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
+ final UFont fontNote = skinParam.getFont(null, false, FontParam.NOTE);
- final FontConfiguration fc = new FontConfiguration(fontNote, fontColor, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
+ final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
- final Sheet sheet9 = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, false).createSheet(display);
+ final Sheet sheet9 = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
+ .createSheet(display);
final SheetBlock1 sheetBlock1 = new SheetBlock1(sheet9, 0, 0);
return sheetBlock1;
}
diff --git a/src/net/sourceforge/plantuml/jungle/GTileOneLevelFactory.java b/src/net/sourceforge/plantuml/jungle/GTileOneLevelFactory.java
index a1bb40d..ac02ae2 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileOneLevelFactory.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileOneLevelFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/GTileStack.java b/src/net/sourceforge/plantuml/jungle/GTileStack.java
index 4286a49..473ef64 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileStack.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileStack.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,11 +38,12 @@ import java.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.List;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class GTileStack implements GTile {
+public class GTileStack extends AbstractTextBlock implements GTile {
private final List<GTile> tiles;
private final double space;
diff --git a/src/net/sourceforge/plantuml/jungle/Needle.java b/src/net/sourceforge/plantuml/jungle/Needle.java
index be16c36..b0961f7 100644
--- a/src/net/sourceforge/plantuml/jungle/Needle.java
+++ b/src/net/sourceforge/plantuml/jungle/Needle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/PSystemTree.java b/src/net/sourceforge/plantuml/jungle/PSystemTree.java
index f02574a..b4b90f3 100644
--- a/src/net/sourceforge/plantuml/jungle/PSystemTree.java
+++ b/src/net/sourceforge/plantuml/jungle/PSystemTree.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -76,7 +76,7 @@ public class PSystemTree extends AbstractPSystem {
} else {
builder.addUDrawable(new GTileOneLevelFactory().createGTile(root));
}
- return builder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return builder.writeImageTOBEMOVED(fileFormat, os);
}
public CommandExecutionResult addParagraph(int level, String label) {
diff --git a/src/net/sourceforge/plantuml/jungle/PSystemTreeFactory.java b/src/net/sourceforge/plantuml/jungle/PSystemTreeFactory.java
index efcdeb9..2ea60e9 100644
--- a/src/net/sourceforge/plantuml/jungle/PSystemTreeFactory.java
+++ b/src/net/sourceforge/plantuml/jungle/PSystemTreeFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/jungle/Rendering.java b/src/net/sourceforge/plantuml/jungle/Rendering.java
index 3158829..869baba 100644
--- a/src/net/sourceforge/plantuml/jungle/Rendering.java
+++ b/src/net/sourceforge/plantuml/jungle/Rendering.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java b/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java
index 51f3ed1..9887e05 100644
--- a/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java
+++ b/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java b/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java
index 07c7324..1a904a7 100644
--- a/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java
+++ b/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java b/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java
index 2aa11fa..ef8ae86 100644
--- a/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java
+++ b/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/mjpeg/MJPEGGenerator.java b/src/net/sourceforge/plantuml/mjpeg/MJPEGGenerator.java
index e61ecf2..c1e17d5 100644
--- a/src/net/sourceforge/plantuml/mjpeg/MJPEGGenerator.java
+++ b/src/net/sourceforge/plantuml/mjpeg/MJPEGGenerator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java
index 2d72917..9bd870d 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -156,17 +156,19 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
void createNew(int mode, LinkType linkType, Display label) {
existingLink = foundLink(entity1, entity2);
if (existingLink == null) {
- existingLink = new Link(entity1, entity2, new LinkType(LinkDecor.NONE, LinkDecor.NONE), null,
- 2);
+ existingLink = new Link(entity1, entity2, new LinkType(LinkDecor.NONE, LinkDecor.NONE), Display.NULL, 2);
} else {
removeLink(existingLink);
}
- entity1ToPoint = new Link(entity1, point, existingLink.getType().getPart2(), existingLink.getLabel(),
+ final IEntity entity1real = existingLink.isInverted() ? existingLink.getEntity2() : existingLink.getEntity1();
+ final IEntity entity2real = existingLink.isInverted() ? existingLink.getEntity1() : existingLink.getEntity2();
+
+ entity1ToPoint = new Link(entity1real, point, existingLink.getType().getPart2(), existingLink.getLabel(),
existingLink.getLength(), existingLink.getQualifier1(), null, existingLink.getLabeldistance(),
existingLink.getLabelangle());
entity1ToPoint.setLinkArrow(existingLink.getLinkArrow());
- pointToEntity2 = new Link(point, entity2, existingLink.getType().getPart1(), null,
+ pointToEntity2 = new Link(point, entity2real, existingLink.getType().getPart1(), Display.NULL,
existingLink.getLength(), null, existingLink.getQualifier2(), existingLink.getLabeldistance(),
existingLink.getLabelangle());
addLink(entity1ToPoint);
@@ -191,15 +193,14 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
void createInSecond(LinkType linkType, Display label) {
existingLink = foundLink(entity1, entity2);
if (existingLink == null) {
- existingLink = new Link(entity1, entity2, new LinkType(LinkDecor.NONE, LinkDecor.NONE), null,
- 2);
+ existingLink = new Link(entity1, entity2, new LinkType(LinkDecor.NONE, LinkDecor.NONE), Display.NULL, 2);
} else {
removeLink(existingLink);
}
entity1ToPoint = new Link(entity1, point, existingLink.getType().getPart2(), existingLink.getLabel(), 2,
existingLink.getQualifier1(), null, existingLink.getLabeldistance(), existingLink.getLabelangle());
- pointToEntity2 = new Link(point, entity2, existingLink.getType().getPart1(), null, 2, null,
+ pointToEntity2 = new Link(point, entity2, existingLink.getType().getPart1(), Display.NULL, 2, null,
existingLink.getQualifier2(), existingLink.getLabeldistance(), existingLink.getLabelangle());
// entity1ToPoint = new Link(entity1, point, existingLink.getType(),
// null, 2);
@@ -215,7 +216,8 @@ public abstract class AbstractClassOrObjectDiagram extends AbstractEntityDiagram
pointToAssocied = new Link(point, associed, linkType, label, 1);
addLink(pointToAssocied);
- final Link lnode = new Link(other.point, this.point, new LinkType(LinkDecor.NONE, LinkDecor.NONE), null, 1);
+ final Link lnode = new Link(other.point, this.point, new LinkType(LinkDecor.NONE, LinkDecor.NONE),
+ Display.NULL, 1);
lnode.setInvis(true);
addLink(lnode);
diff --git a/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagram.java b/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagram.java
index eb85c76..f7e4500 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagram.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagramFactory.java b/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagramFactory.java
index 58b6e48..5193d5b 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/ObjectDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -86,13 +86,14 @@ public class ObjectDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandUrl());
- cmds.add(factoryNoteCommand.createMultiLine());
- cmds.add(factoryNoteOnEntityCommand.createMultiLine());
+ cmds.add(factoryNoteCommand.createMultiLine(false));
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(true));
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(false));
cmds.add(new CommandCreateEntityObjectMultilines());
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
- cmds.add(factoryNoteOnLinkCommand.createMultiLine());
+ cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
// addCommand(new CommandNoopClass());
return cmds;
diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java
index 70f9fce..ba303cc 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandAddData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,24 +40,24 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
import net.sourceforge.plantuml.cucadiagram.Code;
import net.sourceforge.plantuml.cucadiagram.IEntity;
-import net.sourceforge.plantuml.objectdiagram.ObjectDiagram;
+import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.skin.VisibilityModifier;
-public class CommandAddData extends SingleLineCommand<ObjectDiagram> {
+public class CommandAddData extends SingleLineCommand<AbstractClassOrObjectDiagram> {
public CommandAddData() {
super("(?i)^([\\p{L}0-9_.]+)[%s]*:[%s]*(.*)$");
}
@Override
- protected CommandExecutionResult executeArg(ObjectDiagram diagram, List<String> arg) {
+ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram, List<String> arg) {
final IEntity entity = diagram.getOrCreateLeaf(Code.of(arg.get(0)), null, null);
final String field = arg.get(1);
if (field.length() > 0 && VisibilityModifier.isVisibilityCharacter(field.charAt(0))) {
diagram.setVisibilityModifierPresent(true);
}
- entity.addFieldOrMethod(field);
+ entity.getBodier().addFieldOrMethod(field);
return CommandExecutionResult.ok();
}
}
diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java
index a3f284c..aa9444b 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -48,10 +48,12 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.objectdiagram.ObjectDiagram;
-public class CommandCreateEntityObject extends SingleLineCommand2<ObjectDiagram> {
+public class CommandCreateEntityObject extends SingleLineCommand2<AbstractClassOrObjectDiagram> {
public CommandCreateEntityObject() {
super(getRegexConcat());
@@ -66,12 +68,12 @@ public class CommandCreateEntityObject extends SingleLineCommand2<ObjectDiagram>
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
@Override
- protected CommandExecutionResult executeArg(ObjectDiagram diagram, RegexResult arg) {
+ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
final Code code = Code.of(arg.get("NAME", 1));
final String display = arg.get("NAME", 0);
final String stereotype = arg.get("STEREO", 0);
@@ -81,7 +83,7 @@ public class CommandCreateEntityObject extends SingleLineCommand2<ObjectDiagram>
final IEntity entity = diagram.createLeaf(code, Display.getWithNewlines(display), LeafType.OBJECT, null);
if (stereotype != null) {
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
final String urlString = arg.get("URL", 0);
@@ -90,7 +92,7 @@ public class CommandCreateEntityObject extends SingleLineCommand2<ObjectDiagram>
final Url url = urlBuilder.getUrl(urlString);
entity.addUrl(url);
}
- entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java
index f727e2d..6236519 100644
--- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java
+++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,10 +34,10 @@
*/
package net.sourceforge.plantuml.objectdiagram.command;
-import java.util.List;
-
import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UrlBuilder;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
import net.sourceforge.plantuml.command.MultilinesStrategy;
@@ -49,12 +49,13 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.objectdiagram.ObjectDiagram;
import net.sourceforge.plantuml.skin.VisibilityModifier;
-import net.sourceforge.plantuml.StringUtils;
-public class CommandCreateEntityObjectMultilines extends CommandMultilines2<ObjectDiagram> {
+public class CommandCreateEntityObjectMultilines extends CommandMultilines2<AbstractClassOrObjectDiagram> {
public CommandCreateEntityObjectMultilines() {
super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
@@ -69,7 +70,7 @@ public class CommandCreateEntityObjectMultilines extends CommandMultilines2<Obje
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("[%s]*\\{[%s]*$"));
}
@@ -78,37 +79,38 @@ public class CommandCreateEntityObjectMultilines extends CommandMultilines2<Obje
return "(?i)^[%s]*\\}[%s]*$";
}
- public CommandExecutionResult executeNow(ObjectDiagram diagram, List<String> lines) {
- StringUtils.trim(lines, true);
- final RegexResult line0 = getStartingPattern().matcher(lines.get(0).trim());
+ public CommandExecutionResult executeNow(AbstractClassOrObjectDiagram diagram, BlocLines lines) {
+ lines = lines.trim(true);
+ final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final IEntity entity = executeArg0(diagram, line0);
if (entity == null) {
return CommandExecutionResult.error("No such entity");
}
- for (String s : lines.subList(1, lines.size() - 1)) {
+ lines = lines.subExtract(1, 1);
+ for (CharSequence s : lines) {
assert s.length() > 0;
if (VisibilityModifier.isVisibilityCharacter(s.charAt(0))) {
diagram.setVisibilityModifierPresent(true);
}
- entity.addFieldOrMethod(s);
+ entity.getBodier().addFieldOrMethod(s.toString());
}
return CommandExecutionResult.ok();
}
- private IEntity executeArg0(ObjectDiagram diagram, RegexResult line0) {
+ private IEntity executeArg0(AbstractClassOrObjectDiagram diagram, RegexResult line0) {
final Code code = Code.of(line0.get("NAME", 1));
final String display = line0.get("NAME", 0);
final String stereotype = line0.get("STEREO", 0);
if (diagram.leafExist(code)) {
- return diagram.getOrCreateLeaf(code, null, null);
+ return diagram.getOrCreateLeaf(code, LeafType.OBJECT, null);
}
final IEntity entity = diagram.createLeaf(code, Display.getWithNewlines(display), LeafType.OBJECT, null);
if (stereotype != null) {
entity.setStereotype(new Stereotype(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram
- .getSkinParam().getFont(FontParam.CIRCLED_CHARACTER, null, false), diagram.getSkinParam()
+ .getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam()
.getIHtmlColorSet()));
}
- entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
+ entity.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0)));
return entity;
}
diff --git a/src/net/sourceforge/plantuml/openiconic/Movement.java b/src/net/sourceforge/plantuml/openiconic/Movement.java
index 8c4d11b..55cb2fa 100644
--- a/src/net/sourceforge/plantuml/openiconic/Movement.java
+++ b/src/net/sourceforge/plantuml/openiconic/Movement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/OpenIcon.java b/src/net/sourceforge/plantuml/openiconic/OpenIcon.java
index a2fdf85..3782c1e 100644
--- a/src/net/sourceforge/plantuml/openiconic/OpenIcon.java
+++ b/src/net/sourceforge/plantuml/openiconic/OpenIcon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,6 +45,7 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -131,7 +132,7 @@ public class OpenIcon {
}
public TextBlock asTextBlock(final HtmlColor color, final double factor) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
svgPath.drawMe(ug.apply(new UChangeColor(color)), factor);
}
diff --git a/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java b/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java
index 4130a7f..71db0ba 100644
--- a/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java
+++ b/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -63,7 +63,7 @@ public class PSystemListOpenIconic extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconicFactory.java b/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconicFactory.java
index 0446212..e05c0e5 100644
--- a/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconicFactory.java
+++ b/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconicFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java b/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java
index 027e9e3..1ea7705 100644
--- a/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java
+++ b/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -63,7 +63,7 @@ public class PSystemOpenIconic extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0,
null, null, null, 5, 5, null, false);
imageBuilder.addUDrawable(icon.asTextBlock(HtmlColorUtils.BLACK, factor));
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
// UGraphic2 ug = fileFormat.createUGraphic(dim);
// ug = (UGraphic2) ug.apply(new UTranslate(10, 10));
diff --git a/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconicFactory.java b/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconicFactory.java
index 83e7f54..b50b292 100644
--- a/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconicFactory.java
+++ b/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconicFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/StringDecipher.java b/src/net/sourceforge/plantuml/openiconic/StringDecipher.java
index 0373cfc..b29fcfa 100644
--- a/src/net/sourceforge/plantuml/openiconic/StringDecipher.java
+++ b/src/net/sourceforge/plantuml/openiconic/StringDecipher.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/SvgCommand.java b/src/net/sourceforge/plantuml/openiconic/SvgCommand.java
index 2423ff8..ac7e34f 100644
--- a/src/net/sourceforge/plantuml/openiconic/SvgCommand.java
+++ b/src/net/sourceforge/plantuml/openiconic/SvgCommand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/SvgCommandLetter.java b/src/net/sourceforge/plantuml/openiconic/SvgCommandLetter.java
index 980ecb5..aa822c3 100644
--- a/src/net/sourceforge/plantuml/openiconic/SvgCommandLetter.java
+++ b/src/net/sourceforge/plantuml/openiconic/SvgCommandLetter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/SvgCommandNumber.java b/src/net/sourceforge/plantuml/openiconic/SvgCommandNumber.java
index 01119f6..64c0c8c 100644
--- a/src/net/sourceforge/plantuml/openiconic/SvgCommandNumber.java
+++ b/src/net/sourceforge/plantuml/openiconic/SvgCommandNumber.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/SvgPath.java b/src/net/sourceforge/plantuml/openiconic/SvgPath.java
index 679a6ed..fcd6ce9 100644
--- a/src/net/sourceforge/plantuml/openiconic/SvgPath.java
+++ b/src/net/sourceforge/plantuml/openiconic/SvgPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/SvgPosition.java b/src/net/sourceforge/plantuml/openiconic/SvgPosition.java
index 938769a..dceeea8 100644
--- a/src/net/sourceforge/plantuml/openiconic/SvgPosition.java
+++ b/src/net/sourceforge/plantuml/openiconic/SvgPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/openiconic/data/DummyIcon.java b/src/net/sourceforge/plantuml/openiconic/data/DummyIcon.java
index b486fff..ee7b476 100644
--- a/src/net/sourceforge/plantuml/openiconic/data/DummyIcon.java
+++ b/src/net/sourceforge/plantuml/openiconic/data/DummyIcon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/BasicGame.java b/src/net/sourceforge/plantuml/oregon/BasicGame.java
index c51f4fa..d4d02d1 100644
--- a/src/net/sourceforge/plantuml/oregon/BasicGame.java
+++ b/src/net/sourceforge/plantuml/oregon/BasicGame.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/Keyboard.java b/src/net/sourceforge/plantuml/oregon/Keyboard.java
index 324978b..7633aa8 100644
--- a/src/net/sourceforge/plantuml/oregon/Keyboard.java
+++ b/src/net/sourceforge/plantuml/oregon/Keyboard.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/KeyboardList.java b/src/net/sourceforge/plantuml/oregon/KeyboardList.java
index d26cfc9..76b7ace 100644
--- a/src/net/sourceforge/plantuml/oregon/KeyboardList.java
+++ b/src/net/sourceforge/plantuml/oregon/KeyboardList.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/MagicTable.java b/src/net/sourceforge/plantuml/oregon/MagicTable.java
index 8cfddd5..8ce2c4f 100644
--- a/src/net/sourceforge/plantuml/oregon/MagicTable.java
+++ b/src/net/sourceforge/plantuml/oregon/MagicTable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/NoInputException.java b/src/net/sourceforge/plantuml/oregon/NoInputException.java
index 353aae7..0e9e99a 100644
--- a/src/net/sourceforge/plantuml/oregon/NoInputException.java
+++ b/src/net/sourceforge/plantuml/oregon/NoInputException.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java b/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java
index 1663509..2717049 100644
--- a/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java
+++ b/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/PSystemOregon.java b/src/net/sourceforge/plantuml/oregon/PSystemOregon.java
index fa4442c..c0f37e1 100644
--- a/src/net/sourceforge/plantuml/oregon/PSystemOregon.java
+++ b/src/net/sourceforge/plantuml/oregon/PSystemOregon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -102,7 +102,7 @@ public class PSystemOregon extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
private GraphicStrings getGraphicStrings() throws IOException {
diff --git a/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java b/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java
index 1bf8cc0..9fd84df 100644
--- a/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java
+++ b/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/Screen.java b/src/net/sourceforge/plantuml/oregon/Screen.java
index b5225c4..887b156 100644
--- a/src/net/sourceforge/plantuml/oregon/Screen.java
+++ b/src/net/sourceforge/plantuml/oregon/Screen.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/SecureCoder.java b/src/net/sourceforge/plantuml/oregon/SecureCoder.java
index 5d252a6..4f0024d 100644
--- a/src/net/sourceforge/plantuml/oregon/SecureCoder.java
+++ b/src/net/sourceforge/plantuml/oregon/SecureCoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java b/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java
index 07e85d1..75632a3 100644
--- a/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java
+++ b/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/pdf/PdfConverter.java b/src/net/sourceforge/plantuml/pdf/PdfConverter.java
index 188f3d3..bfed4a7 100644
--- a/src/net/sourceforge/plantuml/pdf/PdfConverter.java
+++ b/src/net/sourceforge/plantuml/pdf/PdfConverter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/Metadata.java b/src/net/sourceforge/plantuml/png/Metadata.java
index d3e0d91..8c263ff 100644
--- a/src/net/sourceforge/plantuml/png/Metadata.java
+++ b/src/net/sourceforge/plantuml/png/Metadata.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/MetadataTag.java b/src/net/sourceforge/plantuml/png/MetadataTag.java
index bd16df7..b3576a6 100644
--- a/src/net/sourceforge/plantuml/png/MetadataTag.java
+++ b/src/net/sourceforge/plantuml/png/MetadataTag.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngFlashcoder.java b/src/net/sourceforge/plantuml/png/PngFlashcoder.java
index 39a6ae5..8be03bd 100644
--- a/src/net/sourceforge/plantuml/png/PngFlashcoder.java
+++ b/src/net/sourceforge/plantuml/png/PngFlashcoder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngIO.java b/src/net/sourceforge/plantuml/png/PngIO.java
index 03effcc..d29aa09 100644
--- a/src/net/sourceforge/plantuml/png/PngIO.java
+++ b/src/net/sourceforge/plantuml/png/PngIO.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngIOMetadata.java b/src/net/sourceforge/plantuml/png/PngIOMetadata.java
index 0a3a92a..d5b4228 100644
--- a/src/net/sourceforge/plantuml/png/PngIOMetadata.java
+++ b/src/net/sourceforge/plantuml/png/PngIOMetadata.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngRotation.java b/src/net/sourceforge/plantuml/png/PngRotation.java
index 2b746a3..0edeef9 100644
--- a/src/net/sourceforge/plantuml/png/PngRotation.java
+++ b/src/net/sourceforge/plantuml/png/PngRotation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngSegment.java b/src/net/sourceforge/plantuml/png/PngSegment.java
index a95fadb..97b0ce3 100644
--- a/src/net/sourceforge/plantuml/png/PngSegment.java
+++ b/src/net/sourceforge/plantuml/png/PngSegment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngSizer.java b/src/net/sourceforge/plantuml/png/PngSizer.java
index db43fdc..ef18370 100644
--- a/src/net/sourceforge/plantuml/png/PngSizer.java
+++ b/src/net/sourceforge/plantuml/png/PngSizer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngSplitter.java b/src/net/sourceforge/plantuml/png/PngSplitter.java
index 2f0eee4..75f1288 100644
--- a/src/net/sourceforge/plantuml/png/PngSplitter.java
+++ b/src/net/sourceforge/plantuml/png/PngSplitter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/png/PngTitler.java b/src/net/sourceforge/plantuml/png/PngTitler.java
index b9c7f91..b12c9e8 100644
--- a/src/net/sourceforge/plantuml/png/PngTitler.java
+++ b/src/net/sourceforge/plantuml/png/PngTitler.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,6 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UFont;
public class PngTitler {
@@ -78,12 +77,12 @@ public class PngTitler {
}
public TextBlock getTextBlock() {
- if (text == null || text.size() == 0) {
+ if (Display.isNull(text) || text.size() == 0) {
return null;
}
final UFont normalFont = new UFont(fontFamily, Font.PLAIN, fontSize);
- return TextBlockUtils.create(text, new FontConfiguration(normalFont, textColor, hyperlinkColor, useUnderlineForHyperlink), horizontalAlignment,
- new SpriteContainerEmpty());
+ return text.create(new FontConfiguration(normalFont, textColor, hyperlinkColor, useUnderlineForHyperlink),
+ horizontalAlignment, new SpriteContainerEmpty());
}
private double getOffsetX(double imWidth, StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java b/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java
index 8b15000..45d772f 100644
--- a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java
+++ b/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -67,11 +67,11 @@ abstract class AbstractEntityImage2 implements IEntityImageBlock {
}
protected UFont getFont(FontParam fontParam) {
- return skinParam.getFont(fontParam, null, false);
+ return skinParam.getFont(null, false, fontParam);
}
protected HtmlColor getFontColor(FontParam fontParam) {
- return skinParam.getFontHtmlColor(fontParam, null);
+ return skinParam.getFontHtmlColor(null, fontParam);
}
protected final HtmlColor getColor(ColorParam colorParam) {
diff --git a/src/net/sourceforge/plantuml/posimo/BezierUtils.java b/src/net/sourceforge/plantuml/posimo/BezierUtils.java
index 985654a..779c496 100644
--- a/src/net/sourceforge/plantuml/posimo/BezierUtils.java
+++ b/src/net/sourceforge/plantuml/posimo/BezierUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -96,16 +96,20 @@ public class BezierUtils {
}
- public static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right, final double coef) {
+ private static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right, final double coef) {
final double coef1 = coef;
final double coef2 = 1 - coef;
final double centerxA = src.getCtrlX1() * coef1 + src.getCtrlX2() * coef2;
final double centeryA = src.getCtrlY1() * coef1 + src.getCtrlY2() * coef2;
- final double ctrlx1 = src.getX1() * coef1 + src.getCtrlX1() * coef1;
- final double ctrly1 = src.getY1() * coef1 + src.getCtrlY1() * coef1;
- final double ctrlx2 = src.getX2() * coef1 + src.getCtrlX2() * coef1;
- final double ctrly2 = src.getY2() * coef1 + src.getCtrlY2() * coef1;
+ final double x1 = src.getX1();
+ final double y1 = src.getY1();
+ final double x2 = src.getX2();
+ final double y2 = src.getY2();
+ final double ctrlx1 = x1 * coef1 + src.getCtrlX1() * coef1;
+ final double ctrly1 = y1 * coef1 + src.getCtrlY1() * coef1;
+ final double ctrlx2 = x2 * coef1 + src.getCtrlX2() * coef1;
+ final double ctrly2 = y2 * coef1 + src.getCtrlY2() * coef1;
final double ctrlx12 = ctrlx1 * coef1 + centerxA * coef1;
final double ctrly12 = ctrly1 * coef1 + centeryA * coef1;
@@ -113,8 +117,8 @@ public class BezierUtils {
final double ctrly21 = ctrly2 * coef1 + centeryA * coef1;
final double centerxB = ctrlx12 * coef1 + ctrlx21 * coef1;
final double centeryB = ctrly12 * coef1 + ctrly21 * coef1;
- left.setCurve(src.getX1(), src.getY1(), ctrlx1, ctrly1, ctrlx12, ctrly12, centerxB, centeryB);
- right.setCurve(centerxB, centeryB, ctrlx21, ctrly21, ctrlx2, ctrly2, src.getX2(), src.getY2());
+ left.setCurve(x1, y1, ctrlx1, ctrly1, ctrlx12, ctrly12, centerxB, centeryB);
+ right.setCurve(centerxB, centeryB, ctrlx21, ctrly21, ctrlx2, ctrly2, x2, y2);
}
static double dist(CubicCurve2D.Double seg) {
diff --git a/src/net/sourceforge/plantuml/posimo/Block.java b/src/net/sourceforge/plantuml/posimo/Block.java
index 9627360..0ad2da5 100644
--- a/src/net/sourceforge/plantuml/posimo/Block.java
+++ b/src/net/sourceforge/plantuml/posimo/Block.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Cluster.java b/src/net/sourceforge/plantuml/posimo/Cluster.java
index 9315970..fb6e108 100644
--- a/src/net/sourceforge/plantuml/posimo/Cluster.java
+++ b/src/net/sourceforge/plantuml/posimo/Cluster.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Clusterable.java b/src/net/sourceforge/plantuml/posimo/Clusterable.java
index f3560f2..f733bff 100644
--- a/src/net/sourceforge/plantuml/posimo/Clusterable.java
+++ b/src/net/sourceforge/plantuml/posimo/Clusterable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Decor.java b/src/net/sourceforge/plantuml/posimo/Decor.java
index c415c14..8b7cee4 100644
--- a/src/net/sourceforge/plantuml/posimo/Decor.java
+++ b/src/net/sourceforge/plantuml/posimo/Decor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java b/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java
index b95f951..9c172ce 100644
--- a/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java
+++ b/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/DotPath.java b/src/net/sourceforge/plantuml/posimo/DotPath.java
index 9145028..7a7d7ae 100644
--- a/src/net/sourceforge/plantuml/posimo/DotPath.java
+++ b/src/net/sourceforge/plantuml/posimo/DotPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,8 +49,11 @@ import java.util.Map;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.EnsureVisible;
+import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.asciiart.BasicCharArea;
import net.sourceforge.plantuml.eps.EpsGraphics;
+import net.sourceforge.plantuml.geom.LineSegmentDouble;
+import net.sourceforge.plantuml.svek.Cluster;
import net.sourceforge.plantuml.svek.ClusterPosition;
import net.sourceforge.plantuml.svek.MinFinder;
import net.sourceforge.plantuml.svek.PointAndAngle;
@@ -217,7 +220,7 @@ public class DotPath implements UShape, Moveable {
}
public MinMax getMinMax() {
- MinMax result = MinMax.getEmpty(false);
+ MinMax result = MinMax.getEmpty(false);
for (CubicCurve2D.Double c : beziers) {
result = result.addPoint(c.x1, c.y1);
result = result.addPoint(c.x2, c.y2);
@@ -291,7 +294,7 @@ public class DotPath implements UShape, Moveable {
return new DotPath(copy);
}
- public DotPath addBefore(DotPath other) {
+ private DotPath addBefore(DotPath other) {
final List<CubicCurve2D.Double> copy = new ArrayList<CubicCurve2D.Double>(beziers);
copy.addAll(0, other.beziers);
return new DotPath(copy);
@@ -323,7 +326,7 @@ public class DotPath implements UShape, Moveable {
return result;
}
- public PointDirected getIntersection(ClusterPosition position) {
+ private PointDirected getIntersection(ClusterPosition position) {
for (CubicCurve2D.Double bez : beziers) {
final PointDirected result = position.getIntersection(bez);
if (result != null) {
@@ -333,15 +336,6 @@ public class DotPath implements UShape, Moveable {
return null;
}
- // public void drawOld(Graphics2D g2d, double x, double y) {
- // for (CubicCurve2D.Double bez : beziers) {
- // bez = new CubicCurve2D.Double(x + bez.x1, y + bez.y1, x + bez.ctrlx1, y +
- // bez.ctrly1, x + bez.ctrlx2, y
- // + bez.ctrly2, x + bez.x2, y + bez.y2);
- // g2d.draw(bez);
- // }
- // }
- //
public void draw(Graphics2D g2d, double x, double y) {
final GeneralPath p = new GeneralPath();
for (CubicCurve2D.Double bez : beziers) {
@@ -400,7 +394,7 @@ public class DotPath implements UShape, Moveable {
return result;
}
- public Point2D getFrontierIntersection(Shape shape, Rectangle2D... notIn) {
+ private Point2D getFrontierIntersection(Shape shape, Rectangle2D... notIn) {
final List<CubicCurve2D.Double> all = new ArrayList<CubicCurve2D.Double>(beziers);
for (int i = 0; i < 8; i++) {
for (CubicCurve2D.Double immutable : all) {
@@ -454,7 +448,7 @@ public class DotPath implements UShape, Moveable {
return false;
}
- public DotPath manageRect(Rectangle2D start, Rectangle2D end) {
+ private DotPath manageRect(Rectangle2D start, Rectangle2D end) {
final List<CubicCurve2D.Double> list = new ArrayList<CubicCurve2D.Double>(this.beziers);
while (true) {
if (BezierUtils.isCutting(list.get(0), start) == false) {
@@ -475,7 +469,7 @@ public class DotPath implements UShape, Moveable {
return new DotPath(list);
}
- public Point2D getFrontierIntersection(Positionable p) {
+ private Point2D getFrontierIntersection(Positionable p) {
return getFrontierIntersection(PositionableUtils.convert(p));
}
@@ -504,6 +498,7 @@ public class DotPath implements UShape, Moveable {
final StringBuilder sb = new StringBuilder();
for (CubicCurve2D.Double c : beziers) {
sb.append(toString(c));
+ sb.append(" - ");
}
return sb.toString();
}
@@ -537,4 +532,114 @@ public class DotPath implements UShape, Moveable {
return Collections.unmodifiableList(beziers);
}
+ public DotPath simulateCompound(Cluster head, Cluster tail) {
+ if (OptionFlags.USE_COMPOUND) {
+ throw new IllegalStateException();
+ }
+ if (head == null && tail == null) {
+ return this;
+ }
+ // System.err.println("head=" + head + " tail=" + tail);
+ DotPath me = this;
+ if (tail != null) {
+ // System.err.println("beziers1=" + this.toString());
+ final ClusterPosition clusterPosition = tail.getClusterPosition();
+ if (clusterPosition.contains(getStartPoint())) {
+ final DotPath result = new DotPath();
+ int idx = 0;
+ while (idx + 1 < this.beziers.size() && clusterPosition.contains(this.beziers.get(idx).getP2())) {
+ if (clusterPosition.contains(this.beziers.get(idx).getP1()) == false) {
+ throw new IllegalStateException();
+ }
+ idx++;
+ }
+ if (clusterPosition.contains(this.beziers.get(idx).getP2())) {
+ // System.err.println("strange1");
+ } else {
+ assert clusterPosition.contains(this.beziers.get(idx).getP1());
+ assert clusterPosition.contains(this.beziers.get(idx).getP2()) == false;
+ CubicCurve2D current = this.beziers.get(idx);
+ for (int k = 0; k < 8; k++) {
+ // System.err.println("length=" + length(current));
+ final CubicCurve2D.Double part1 = new CubicCurve2D.Double();
+ final CubicCurve2D.Double part2 = new CubicCurve2D.Double();
+ current.subdivide(part1, part2);
+ assert part1.getP2().equals(part2.getP1());
+ if (clusterPosition.contains(part1.getP2())) {
+ current = part2;
+ } else {
+ result.beziers.add(0, part2);
+ current = part1;
+ }
+ }
+ for (int i = idx + 1; i < this.beziers.size(); i++) {
+ result.beziers.add(this.beziers.get(i));
+ }
+ me = result;
+ }
+ }
+ }
+ if (head != null) {
+ // System.err.println("beziers2=" + me.toString());
+ final DotPath result = new DotPath();
+ final ClusterPosition clusterPosition = head.getClusterPosition();
+ if (clusterPosition.contains(getEndPoint())) {
+ for (CubicCurve2D.Double current : me.beziers) {
+ if (clusterPosition.contains(current.getP2()) == false) {
+ result.beziers.add(current);
+ } else {
+ if (clusterPosition.contains(current.getP1())) {
+ // System.err.println("strange2");
+ return me;
+ }
+ assert clusterPosition.contains(current.getP1()) == false;
+ assert clusterPosition.contains(current.getP2());
+ for (int k = 0; k < 8; k++) {
+ // System.err.println("length=" + length(current));
+ final CubicCurve2D.Double part1 = new CubicCurve2D.Double();
+ final CubicCurve2D.Double part2 = new CubicCurve2D.Double();
+ current.subdivide(part1, part2);
+ assert part1.getP2().equals(part2.getP1());
+ if (clusterPosition.contains(part1.getP2())) {
+ current = part1;
+ } else {
+ result.beziers.add(part1);
+ current = part2;
+ // System.err.println("k=" + k + " result=" + result.toString());
+ }
+ }
+ // System.err.println("Final Result=" + result.toString());
+ return result;
+ }
+ }
+ }
+
+ }
+ return me;
+ }
+
+ private double length(CubicCurve2D curve) {
+ return curve.getP1().distance(curve.getP2());
+ }
+
+ public boolean isLine() {
+ for (CubicCurve2D.Double curve : beziers) {
+ if (curve.getFlatnessSq() > 0.001) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public List<LineSegmentDouble> getLineSegments() {
+ final List<LineSegmentDouble> result = new ArrayList<LineSegmentDouble>();
+ for (CubicCurve2D.Double curve : beziers) {
+ if (curve.getFlatnessSq() <= 0.001) {
+ result.add(new LineSegmentDouble(curve));
+
+ }
+ }
+ return Collections.unmodifiableList(result);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/posimo/DotxMaker.java b/src/net/sourceforge/plantuml/posimo/DotxMaker.java
index d97a42e..e8ebd3f 100644
--- a/src/net/sourceforge/plantuml/posimo/DotxMaker.java
+++ b/src/net/sourceforge/plantuml/posimo/DotxMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java b/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java
index 5c0048c..462a752 100644
--- a/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java
+++ b/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Frame.java b/src/net/sourceforge/plantuml/posimo/Frame.java
index ee60f7d..75197a1 100644
--- a/src/net/sourceforge/plantuml/posimo/Frame.java
+++ b/src/net/sourceforge/plantuml/posimo/Frame.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -119,11 +119,13 @@ public class Frame implements Component {
}
private TextBlock createTextBloc() {
- final UFont font = skinParam.getFont(FontParam.PACKAGE, null, false);
- final HtmlColor textColor = skinParam.getFontHtmlColor(FontParam.PACKAGE, null);
- final TextBlock bloc = TextBlockUtils.create(Display.create(name), new FontConfiguration(font, textColor, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink()),
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
- return bloc;
+ final UFont font = skinParam.getFont(null, false, FontParam.PACKAGE);
+ final HtmlColor textColor = skinParam.getFontHtmlColor(null, FontParam.PACKAGE);
+ // final TextBlock bloc = Display.create(name).create(new FontConfiguration(font, textColor,
+ // skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink()), HorizontalAlignment.LEFT, new
+ // SpriteContainerEmpty());
+ // return bloc;
+ throw new UnsupportedOperationException();
}
public final Dimension2D getPreferredDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java b/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java
index e117355..4d1888a 100644
--- a/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java
+++ b/src/net/sourceforge/plantuml/posimo/GraphvizSolverB.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java b/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java
index a895e35..0064ab8 100644
--- a/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java
+++ b/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Label.java b/src/net/sourceforge/plantuml/posimo/Label.java
index 74694b1..beb7445 100644
--- a/src/net/sourceforge/plantuml/posimo/Label.java
+++ b/src/net/sourceforge/plantuml/posimo/Label.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/LabelImage.java b/src/net/sourceforge/plantuml/posimo/LabelImage.java
index 219fe90..71f31ab 100644
--- a/src/net/sourceforge/plantuml/posimo/LabelImage.java
+++ b/src/net/sourceforge/plantuml/posimo/LabelImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,16 +36,10 @@ package net.sourceforge.plantuml.posimo;
import java.awt.geom.Dimension2D;
-import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Link;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -64,8 +58,11 @@ public class LabelImage {
// this.entity = entity;
this.param = param;
this.rose = rose;
- this.name = TextBlockUtils.create(link.getLabel(),
- new FontConfiguration(param.getFont(FontParam.CLASS, null, false), HtmlColorUtils.BLACK, param.getHyperlinkColor(), param.useUnderlineForHyperlink()), HorizontalAlignment.CENTER, new SpriteContainerEmpty());
+// this.name = link.getLabel().create(
+// new FontConfiguration(param.getFont(FontParam.CLASS, null, false), HtmlColorUtils.BLACK,
+// param.getHyperlinkColor(), param.useUnderlineForHyperlink()), HorizontalAlignment.CENTER,
+// new SpriteContainerEmpty());
+ throw new UnsupportedOperationException();
}
public Dimension2D getDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java b/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java
index 29e318e..64bef9f 100644
--- a/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java
+++ b/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java b/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java
index d3d3575..bdb3bbc 100644
--- a/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java
+++ b/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/MargedBlock.java b/src/net/sourceforge/plantuml/posimo/MargedBlock.java
index 65a8ca7..73df5a8 100644
--- a/src/net/sourceforge/plantuml/posimo/MargedBlock.java
+++ b/src/net/sourceforge/plantuml/posimo/MargedBlock.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Mirror.java b/src/net/sourceforge/plantuml/posimo/Mirror.java
index f979a6e..536e3ae 100644
--- a/src/net/sourceforge/plantuml/posimo/Mirror.java
+++ b/src/net/sourceforge/plantuml/posimo/Mirror.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Moveable.java b/src/net/sourceforge/plantuml/posimo/Moveable.java
index a738d50..83307dc 100644
--- a/src/net/sourceforge/plantuml/posimo/Moveable.java
+++ b/src/net/sourceforge/plantuml/posimo/Moveable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Path.java b/src/net/sourceforge/plantuml/posimo/Path.java
index 452fd7c..7af1194 100644
--- a/src/net/sourceforge/plantuml/posimo/Path.java
+++ b/src/net/sourceforge/plantuml/posimo/Path.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/PathDrawer.java b/src/net/sourceforge/plantuml/posimo/PathDrawer.java
index 78c57b8..ac985c5 100644
--- a/src/net/sourceforge/plantuml/posimo/PathDrawer.java
+++ b/src/net/sourceforge/plantuml/posimo/PathDrawer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java b/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java
index e030684..6dca61e 100644
--- a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java
+++ b/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Positionable.java b/src/net/sourceforge/plantuml/posimo/Positionable.java
index 30fa0e8..a3594a9 100644
--- a/src/net/sourceforge/plantuml/posimo/Positionable.java
+++ b/src/net/sourceforge/plantuml/posimo/Positionable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/PositionableImpl.java b/src/net/sourceforge/plantuml/posimo/PositionableImpl.java
index 1763af4..2cae6d1 100644
--- a/src/net/sourceforge/plantuml/posimo/PositionableImpl.java
+++ b/src/net/sourceforge/plantuml/posimo/PositionableImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/PositionableUtils.java b/src/net/sourceforge/plantuml/posimo/PositionableUtils.java
index 4349833..207f085 100644
--- a/src/net/sourceforge/plantuml/posimo/PositionableUtils.java
+++ b/src/net/sourceforge/plantuml/posimo/PositionableUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/Racorder.java b/src/net/sourceforge/plantuml/posimo/Racorder.java
index 3e50f58..56ac285 100644
--- a/src/net/sourceforge/plantuml/posimo/Racorder.java
+++ b/src/net/sourceforge/plantuml/posimo/Racorder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java b/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java
index 9ebb9d4..92e578e 100644
--- a/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java
+++ b/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java b/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java
index 9ade66b..55b59c5 100644
--- a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java
+++ b/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java b/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java
index 6f426ad..79b6316 100644
--- a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java
+++ b/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java b/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java
index aef885f..3c8ed09 100644
--- a/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java
+++ b/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java b/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java
index 74eb8fb..936f9f6 100644
--- a/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java
+++ b/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java b/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java
index f5fb504..742208e 100644
--- a/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java
+++ b/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java b/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java
index 15996e1..2c395c7 100644
--- a/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java
+++ b/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/Area.java b/src/net/sourceforge/plantuml/postit/Area.java
index a14a3ad..959905d 100644
--- a/src/net/sourceforge/plantuml/postit/Area.java
+++ b/src/net/sourceforge/plantuml/postit/Area.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/AreaLayout.java b/src/net/sourceforge/plantuml/postit/AreaLayout.java
index 21e34ad..e2ba9b1 100644
--- a/src/net/sourceforge/plantuml/postit/AreaLayout.java
+++ b/src/net/sourceforge/plantuml/postit/AreaLayout.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java b/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java
index 0443817..f832efb 100644
--- a/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java
+++ b/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java b/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java
index 777559a..0181d25 100644
--- a/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java
+++ b/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/CommandWidth.java b/src/net/sourceforge/plantuml/postit/CommandWidth.java
index ea6d6ac..e7c3941 100644
--- a/src/net/sourceforge/plantuml/postit/CommandWidth.java
+++ b/src/net/sourceforge/plantuml/postit/CommandWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/Elastic.java b/src/net/sourceforge/plantuml/postit/Elastic.java
index 9c77412..3ec7f13 100644
--- a/src/net/sourceforge/plantuml/postit/Elastic.java
+++ b/src/net/sourceforge/plantuml/postit/Elastic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java b/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java
index ef742b5..8ddbc35 100644
--- a/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/postit/PostIt.java b/src/net/sourceforge/plantuml/postit/PostIt.java
index 33103fa..86d0150 100644
--- a/src/net/sourceforge/plantuml/postit/PostIt.java
+++ b/src/net/sourceforge/plantuml/postit/PostIt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
@@ -111,10 +112,11 @@ public class PostIt {
final HtmlColor borderColor = HtmlColorUtils.MY_RED;
final SkinParam param = SkinParam.noShadowing();
- final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
+ final UFont fontNote = param.getFont(null, false, FontParam.NOTE);
+ final FontConfiguration font2 = fontNote.toFont2(HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE, 8);
final ComponentRoseNote note = new ComponentRoseNote(
- new SymbolContext(noteBackgroundColor, borderColor).withStroke(new UStroke()), fontNote.toFont2(
- HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE), text, 0, 0, new SpriteContainerEmpty());
+ new SymbolContext(noteBackgroundColor, borderColor).withStroke(new UStroke()), font2, text, 0, 0,
+ new SpriteContainerEmpty());
return note;
}
}
diff --git a/src/net/sourceforge/plantuml/postit/PostItDiagram.java b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
index e383b1e..64bfe59 100644
--- a/src/net/sourceforge/plantuml/postit/PostItDiagram.java
+++ b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/preproc/Defines.java b/src/net/sourceforge/plantuml/preproc/Defines.java
index 1e1e7f7..00562bd 100644
--- a/src/net/sourceforge/plantuml/preproc/Defines.java
+++ b/src/net/sourceforge/plantuml/preproc/Defines.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -86,29 +86,7 @@ public class Defines {
}
final String value = Matcher.quoteReplacement(ent.getValue());
if (key.contains("(")) {
- final StringTokenizer st = new StringTokenizer(key, "(),");
- final String fctName = st.nextToken();
- String newValue = value;
- final StringBuilder regex = new StringBuilder("\\b" + fctName + "\\(");
- int i = 1;
-
- while (st.hasMoreTokens()) {
- if (st.hasMoreTokens()) {
- regex.append("([^,]*?)");
- } else {
- regex.append("([^)]*?)");
- }
- final String var1 = st.nextToken();
- final String var2 = "(##" + var1 + "\\b)|(\\b" + var1 + "##)|(\\b" + var1 + "\\b)";
- newValue = newValue.replaceAll(var2, "\\$" + i);
- i++;
- if (st.hasMoreTokens()) {
- regex.append(",");
- }
- }
-
- regex.append("\\)");
- line = line.replaceAll(regex.toString(), newValue);
+ line = applyMethod(line, key, value);
} else {
final String regex = "\\b" + key + "\\b";
line = line.replaceAll(regex, value);
@@ -117,6 +95,28 @@ public class Defines {
return Arrays.asList(line.split("\n"));
}
+ private String applyMethod(String line, final String key, final String value) {
+ final StringTokenizer st = new StringTokenizer(key, "(),");
+ final String fctName = st.nextToken();
+ String newValue = value;
+ final StringBuilder regex = new StringBuilder("\\b" + fctName + "\\(");
+ int i = 1;
+
+ while (st.hasMoreTokens()) {
+ regex.append("(?:(?:\\s*\"([^\"]*)\"\\s*)|(?:\\s*'([^']*)'\\s*)|\\s*" + "((?:\\([^()]*\\)|[^,])*?)" + ")");
+ final String var1 = st.nextToken();
+ final String var2 = "(##" + var1 + "\\b)|(\\b" + var1 + "##)|(\\b" + var1 + "\\b)";
+ newValue = newValue.replaceAll(var2, "\\$" + i + "\\$" + (i + 1) + "\\$" + (i + 2));
+ i += 3;
+ if (st.hasMoreTokens()) {
+ regex.append(",");
+ }
+ }
+ regex.append("\\)");
+ line = line.replaceAll(regex.toString(), newValue);
+ return line;
+ }
+
public void saveState() {
if (savedState.size() > 0) {
throw new IllegalStateException();
diff --git a/src/net/sourceforge/plantuml/preproc/FileWithSuffix.java b/src/net/sourceforge/plantuml/preproc/FileWithSuffix.java
new file mode 100644
index 0000000..81cceda
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/FileWithSuffix.java
@@ -0,0 +1,81 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.preproc;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+public class FileWithSuffix {
+
+ private final File file;
+ private final String suffix;
+
+ public FileWithSuffix(File file, String suffix) {
+ this.file = file;
+ this.suffix = suffix;
+ }
+
+ @Override
+ public int hashCode() {
+ return file.hashCode() + (suffix == null ? 0 : suffix.hashCode() * 43);
+ }
+
+ @Override
+ public boolean equals(Object arg) {
+ final FileWithSuffix other = (FileWithSuffix) arg;
+ return this.file.equals(other.file) && equals(suffix, other.suffix);
+ }
+
+ private static boolean equals(String s1, String s2) {
+ if (s1 == null && s2 == null) {
+ return true;
+ }
+ if (s1 != null && s2 != null) {
+ return s1.equals(s2);
+ }
+ assert (s1 == null && s2 != null) || (s1 != null && s2 == null);
+ return false;
+ }
+
+ public static Set<File> convert(Set<FileWithSuffix> all) {
+ final Set<File> result = new HashSet<File>();
+ for (FileWithSuffix f : all) {
+ result.add(f.file);
+ }
+ return result;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/preproc/IfManager.java b/src/net/sourceforge/plantuml/preproc/IfManager.java
index d940d9d..99052cf 100644
--- a/src/net/sourceforge/plantuml/preproc/IfManager.java
+++ b/src/net/sourceforge/plantuml/preproc/IfManager.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.command.regex.MyPattern;
class IfManager implements ReadLine {
@@ -56,9 +57,9 @@ class IfManager implements ReadLine {
this.source = source;
}
- final public String readLine() throws IOException {
+ final public CharSequence2 readLine() throws IOException {
if (child != null) {
- final String s = child.readLine();
+ final CharSequence2 s = child.readLine();
if (s != null) {
return s;
}
@@ -68,8 +69,8 @@ class IfManager implements ReadLine {
return readLineInternal();
}
- protected String readLineInternal() throws IOException {
- final String s = source.readLine();
+ protected CharSequence2 readLineInternal() throws IOException {
+ final CharSequence2 s = source.readLine();
if (s == null) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java b/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java
index d104ba7..ee38f20 100644
--- a/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java
+++ b/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,8 @@ package net.sourceforge.plantuml.preproc;
import java.io.IOException;
import java.util.regex.Matcher;
+import net.sourceforge.plantuml.CharSequence2;
+
class IfManagerNegatif extends IfManager {
private boolean skippingDone = false;
@@ -46,11 +48,11 @@ class IfManagerNegatif extends IfManager {
}
@Override
- protected String readLineInternal() throws IOException {
+ protected CharSequence2 readLineInternal() throws IOException {
if (skippingDone == false) {
skippingDone = true;
do {
- final String s = readLine();
+ final CharSequence2 s = readLine();
if (s == null) {
return null;
}
@@ -65,7 +67,7 @@ class IfManagerNegatif extends IfManager {
} while (true);
}
- final String s = super.readLineInternal();
+ final CharSequence2 s = super.readLineInternal();
if (s == null) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java b/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java
index c9dfef9..3dd3c30 100644
--- a/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java
+++ b/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,8 @@ package net.sourceforge.plantuml.preproc;
import java.io.IOException;
import java.util.regex.Matcher;
+import net.sourceforge.plantuml.CharSequence2;
+
class IfManagerPositif extends IfManager {
public IfManagerPositif(ReadLine source, Defines defines) {
@@ -44,8 +46,8 @@ class IfManagerPositif extends IfManager {
}
@Override
- protected String readLineInternal() throws IOException {
- String s = super.readLineInternal();
+ protected CharSequence2 readLineInternal() throws IOException {
+ CharSequence2 s = super.readLineInternal();
if (s == null) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/preproc/Preprocessor.java b/src/net/sourceforge/plantuml/preproc/Preprocessor.java
index 5cc73df..4afb012 100644
--- a/src/net/sourceforge/plantuml/preproc/Preprocessor.java
+++ b/src/net/sourceforge/plantuml/preproc/Preprocessor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,14 +37,17 @@ package net.sourceforge.plantuml.preproc;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.utils.StartUtils;
-import net.sourceforge.plantuml.StringUtils;
public class Preprocessor implements ReadLine {
@@ -60,15 +63,15 @@ public class Preprocessor implements ReadLine {
private final PreprocessorInclude rawSource;
private final ReadLineInsertable source;
- public Preprocessor(ReadLine reader, String charset, Defines defines, Set<File> filesUsed, File newCurrentDir) {
+ public Preprocessor(ReadLine reader, String charset, Defines defines, File newCurrentDir) {
this.defines = defines;
this.defines.saveState();
- this.rawSource = new PreprocessorInclude(reader, defines, charset, filesUsed, newCurrentDir);
+ this.rawSource = new PreprocessorInclude(reader, defines, charset, newCurrentDir);
this.source = new ReadLineInsertable(new IfManager(rawSource, defines));
}
- public String readLine() throws IOException {
- final String s = source.readLine();
+ public CharSequence2 readLine() throws IOException {
+ final CharSequence2 s = source.readLine();
if (s == null) {
return null;
}
@@ -96,30 +99,30 @@ public class Preprocessor implements ReadLine {
return s;
}
- final List<String> result = defines.applyDefines(s);
+ final List<String> result = defines.applyDefines(s.toString2());
if (result.size() > 1) {
ignoreDefineDuringSeveralLines = result.size() - 2;
- source.insert(result.subList(1, result.size() - 1));
+ source.insert(result.subList(1, result.size() - 1), s.getLocation());
}
- return result.get(0);
+ return new CharSequence2Impl(result.get(0), s.getLocation());
}
private int ignoreDefineDuringSeveralLines = 0;
- private String manageUndef(Matcher m) throws IOException {
+ private CharSequence2 manageUndef(Matcher m) throws IOException {
defines.undefine(m.group(1));
return this.readLine();
}
- private String manageDefineLong(Matcher m) throws IOException {
+ private CharSequence2 manageDefineLong(Matcher m) throws IOException {
final String group1 = m.group(1);
final List<String> def = new ArrayList<String>();
while (true) {
- final String read = this.readLine();
+ final CharSequence2 read = this.readLine();
if (read == null) {
return null;
}
- def.add(read);
+ def.add(read.toString2());
if (enddefinelongPattern.matcher(read).find()) {
defines.define(group1, def);
return this.readLine();
@@ -127,7 +130,7 @@ public class Preprocessor implements ReadLine {
}
}
- private String manageDefine(Matcher m) throws IOException {
+ private CharSequence2 manageDefine(Matcher m) throws IOException {
final String group1 = m.group(1);
final String group2 = m.group(2);
if (group2 == null) {
@@ -135,17 +138,18 @@ public class Preprocessor implements ReadLine {
} else {
final List<String> strings = defines.applyDefines(group2);
if (strings.size() > 1) {
- throw new UnsupportedOperationException();
- }
- final StringBuilder value = new StringBuilder(strings.get(0));
- while (StringUtils.endsWithBackslash(value.toString())) {
- value.setLength(value.length() - 1);
- final String read = this.readLine();
- value.append(read);
+ defines.define(group1, strings);
+ } else {
+ final StringBuilder value = new StringBuilder(strings.get(0));
+ while (StringUtils.endsWithBackslash(value.toString())) {
+ value.setLength(value.length() - 1);
+ final CharSequence2 read = this.readLine();
+ value.append(read.toString2());
+ }
+ final List<String> li = new ArrayList<String>();
+ li.add(value.toString());
+ defines.define(group1, li);
}
- final List<String> li = new ArrayList<String>();
- li.add(value.toString());
- defines.define(group1, li);
}
return this.readLine();
}
@@ -158,4 +162,8 @@ public class Preprocessor implements ReadLine {
rawSource.close();
}
+ public Set<FileWithSuffix> getFilesUsed() {
+ return Collections.unmodifiableSet(rawSource.getFilesUsedGlobal());
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java b/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java
index 0fbae08..bf39e70 100644
--- a/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java
+++ b/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,11 +42,16 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
import net.sourceforge.plantuml.FileSystem;
+import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.StringUtils;
@@ -67,13 +72,24 @@ class PreprocessorInclude implements ReadLine {
private PreprocessorInclude included = null;
private final File oldCurrentDir;
- private final Set<File> filesUsed;
+ private final Set<FileWithSuffix> filesUsedCurrent;
+ private final Set<FileWithSuffix> filesUsedGlobal;
- public PreprocessorInclude(ReadLine reader, Defines defines, String charset, Set<File> filesUsed, File newCurrentDir) {
+ public PreprocessorInclude(ReadLine reader, Defines defines, String charset, File newCurrentDir) {
+ this(reader, defines, charset, newCurrentDir, new HashSet<FileWithSuffix>(), new HashSet<FileWithSuffix>());
+ }
+
+ public Set<FileWithSuffix> getFilesUsedGlobal() {
+ return Collections.unmodifiableSet(filesUsedGlobal);
+ }
+
+ private PreprocessorInclude(ReadLine reader, Defines defines, String charset, File newCurrentDir,
+ Set<FileWithSuffix> filesUsedCurrent, Set<FileWithSuffix> filesUsedGlobal) {
this.defines = defines;
this.charset = charset;
this.reader2 = reader;
- this.filesUsed = filesUsed;
+ this.filesUsedCurrent = filesUsedCurrent;
+ this.filesUsedGlobal = filesUsedGlobal;
if (newCurrentDir == null) {
oldCurrentDir = null;
} else {
@@ -88,18 +104,18 @@ class PreprocessorInclude implements ReadLine {
}
}
- public String readLine() throws IOException {
- final String result = readLineInternal();
+ public CharSequence2 readLine() throws IOException {
+ final CharSequence2 result = readLineInternal();
if (result != null && (StartUtils.isArobaseEndDiagram(result) || StartUtils.isArobaseStartDiagram(result))) {
// http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram
- filesUsed.clear();
+ filesUsedCurrent.clear();
}
return result;
}
- private String readLineInternal() throws IOException {
+ private CharSequence2 readLineInternal() throws IOException {
if (included != null) {
- final String s = included.readLine();
+ final CharSequence2 s = included.readLine();
if (s != null) {
return s;
}
@@ -107,7 +123,7 @@ class PreprocessorInclude implements ReadLine {
included = null;
}
- final String s = reader2.readLine();
+ final CharSequence2 s = reader2.readLine();
numLine++;
if (s == null) {
return null;
@@ -116,17 +132,17 @@ class PreprocessorInclude implements ReadLine {
final Matcher m = includePattern.matcher(s);
assert included == null;
if (m.find()) {
- return manageFileInclude(m);
+ return manageFileInclude(m, s.getLocation());
}
}
final Matcher mUrl = includeURLPattern.matcher(s);
if (mUrl.find()) {
- return manageUrlInclude(mUrl);
+ return manageUrlInclude(mUrl, s.getLocation());
}
return s;
}
- private String manageUrlInclude(Matcher m) throws IOException {
+ private CharSequence2 manageUrlInclude(Matcher m, LineLocation lineLocation) throws IOException {
String urlString = m.group(1);
urlString = defines.applyDefines(urlString).get(0);
//
@@ -138,14 +154,15 @@ class PreprocessorInclude implements ReadLine {
}
try {
final URL url = new URL(urlString);
- included = new PreprocessorInclude(getReaderInclude(url, suf), defines, charset, filesUsed, null);
+ included = new PreprocessorInclude(getReaderInclude(url, suf, lineLocation), defines, charset, null, filesUsedCurrent,
+ filesUsedGlobal);
} catch (MalformedURLException e) {
- return "Cannot include url " + urlString;
+ return CharSequence2Impl.errorPreprocessor("Cannot include url " + urlString, lineLocation);
}
return this.readLine();
}
- private String manageFileInclude(Matcher m) throws IOException {
+ private CharSequence2 manageFileInclude(Matcher m, LineLocation lineLocation) throws IOException {
String fileName = m.group(1);
fileName = defines.applyDefines(fileName).get(0);
final int idx = fileName.lastIndexOf('!');
@@ -155,13 +172,17 @@ class PreprocessorInclude implements ReadLine {
fileName = fileName.substring(0, idx);
}
final File f = FileSystem.getInstance().getFile(withEnvironmentVariable(fileName));
+ final FileWithSuffix f2 = new FileWithSuffix(f, suf);
if (f.exists() == false) {
- return "Cannot include " + f.getAbsolutePath();
- } else if (filesUsed.contains(f)) {
- return "File already included " + f.getAbsolutePath();
+ return CharSequence2Impl.errorPreprocessor("Cannot include " + f.getAbsolutePath(), lineLocation);
+ } else if (filesUsedCurrent.contains(f2)) {
+ // return CharSequence2Impl.errorPreprocessor("File already included " + f.getAbsolutePath(), lineLocation);
+ return this.readLine();
} else {
- filesUsed.add(f);
- included = new PreprocessorInclude(getReaderInclude(f, suf), defines, charset, filesUsed, f.getParentFile());
+ filesUsedCurrent.add(f2);
+ filesUsedGlobal.add(f2);
+ included = new PreprocessorInclude(getReaderInclude(f, suf, lineLocation), defines, charset, f.getParentFile(),
+ filesUsedCurrent, filesUsedGlobal);
}
return this.readLine();
}
@@ -195,7 +216,7 @@ class PreprocessorInclude implements ReadLine {
return null;
}
- private ReadLine getReaderInclude(final File f, String suf) throws IOException {
+ private ReadLine getReaderInclude(final File f, String suf, LineLocation parent) throws IOException {
if (StartDiagramExtractReader.containsStartDiagram(f, charset)) {
int bloc = 0;
if (suf != null && suf.matches("\\d+")) {
@@ -205,13 +226,13 @@ class PreprocessorInclude implements ReadLine {
}
if (charset == null) {
Log.info("Using default charset");
- return new ReadLineReader(new FileReader(f));
+ return new ReadLineReader(new FileReader(f), f.getAbsolutePath(), parent);
}
Log.info("Using charset " + charset);
- return new ReadLineReader(new InputStreamReader(new FileInputStream(f), charset));
+ return new ReadLineReader(new InputStreamReader(new FileInputStream(f), charset), f.getAbsolutePath(), parent);
}
- private ReadLine getReaderInclude(final URL url, String suf) throws IOException {
+ private ReadLine getReaderInclude(final URL url, String suf, LineLocation parent) throws IOException {
if (StartDiagramExtractReader.containsStartDiagram(url, charset)) {
int bloc = 0;
if (suf != null && suf.matches("\\d+")) {
@@ -222,10 +243,10 @@ class PreprocessorInclude implements ReadLine {
final InputStream is = url.openStream();
if (charset == null) {
Log.info("Using default charset");
- return new ReadLineReader(new InputStreamReader(is));
+ return new ReadLineReader(new InputStreamReader(is), url.toString(), parent);
}
Log.info("Using charset " + charset);
- return new ReadLineReader(new InputStreamReader(is, charset));
+ return new ReadLineReader(new InputStreamReader(is, charset), url.toString(), parent);
}
public int getLineNumber() {
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLine.java b/src/net/sourceforge/plantuml/preproc/ReadLine.java
index 163468b..c0a3e55 100644
--- a/src/net/sourceforge/plantuml/preproc/ReadLine.java
+++ b/src/net/sourceforge/plantuml/preproc/ReadLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,9 @@ package net.sourceforge.plantuml.preproc;
import java.io.Closeable;
import java.io.IOException;
+import net.sourceforge.plantuml.CharSequence2;
+
public interface ReadLine extends Closeable {
- public String readLine() throws IOException;
+ public CharSequence2 readLine() throws IOException;
}
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java b/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java
index 764a4c5..559905a 100644
--- a/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,10 +39,14 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+import net.sourceforge.plantuml.LineLocation;
+
class ReadLineInsertable implements ReadLine {
private final ReadLine source;
- private final List<String> inserted = new LinkedList<String>();
+ private final List<CharSequence2> inserted = new LinkedList<CharSequence2>();
public ReadLineInsertable(ReadLine source) {
this.source = source;
@@ -52,18 +56,20 @@ class ReadLineInsertable implements ReadLine {
source.close();
}
- public String readLine() throws IOException {
+ public CharSequence2 readLine() throws IOException {
if (inserted.size() > 0) {
- final Iterator<String> it = inserted.iterator();
- final String result = it.next();
+ final Iterator<CharSequence2> it = inserted.iterator();
+ final CharSequence2 result = it.next();
it.remove();
return result;
}
return source.readLine();
}
- public void insert(List<String> data) {
- inserted.addAll(data);
+ public void insert(List<? extends CharSequence> data, LineLocation location) {
+ for (CharSequence s : data) {
+ inserted.add(new CharSequence2Impl(s, location));
+ }
}
}
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineReader.java b/src/net/sourceforge/plantuml/preproc/ReadLineReader.java
index 7316fc6..6c5c3a8 100644
--- a/src/net/sourceforge/plantuml/preproc/ReadLineReader.java
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineReader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,34 +38,47 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+import net.sourceforge.plantuml.LineLocation;
+import net.sourceforge.plantuml.LineLocationImpl;
+
public class ReadLineReader implements ReadLine {
private final BufferedReader br;
+ private LineLocationImpl location;
- public ReadLineReader(Reader reader) {
+ public ReadLineReader(Reader reader, String desc, LineLocation parent) {
br = new BufferedReader(reader);
+ location = new LineLocationImpl(desc, parent);
+ }
+
+ public ReadLineReader(Reader reader, String desc) {
+ this(reader, desc, null);
}
- public String readLine() throws IOException {
+ public CharSequence2 readLine() throws IOException {
String s = br.readLine();
- if (s != null && s.startsWith("\uFEFF")) {
- s = s.substring(1);
+ location = location.oneLineRead();
+ if (s == null) {
+ return null;
}
- if (s != null) {
- s = s.replace('\u2013', '-');
- // s = s.replace('\u00A0', ' ');
- // s = s.replace('\u201c', '\"');
- // s = s.replace('\u201d', '\"');
- // s = s.replace('\u00ab', '\"');
- // s = s.replace('\u00bb', '\"');
- // s = s.replace('\u2018', '\'');
- // s = s.replace('\u2019', '\'');
- // for (int i = 0; i < s.length(); i++) {
- // char c = s.charAt(i);
- // System.err.println("X " + Integer.toHexString((int) c) + " " + c);
- // }
+ if (s.startsWith("\uFEFF")) {
+ s = s.substring(1);
}
- return s;
+ s = s.replace('\u2013', '-');
+ // s = s.replace('\u00A0', ' ');
+ // s = s.replace('\u201c', '\"');
+ // s = s.replace('\u201d', '\"');
+ // s = s.replace('\u00ab', '\"');
+ // s = s.replace('\u00bb', '\"');
+ // s = s.replace('\u2018', '\'');
+ // s = s.replace('\u2019', '\'');
+ // for (int i = 0; i < s.length(); i++) {
+ // char c = s.charAt(i);
+ // System.err.println("X " + Integer.toHexString((int) c) + " " + c);
+ // }
+ return new CharSequence2Impl(s, location);
}
public void close() throws IOException {
diff --git a/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java b/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java
index 15bc52d..c434cbf 100644
--- a/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java
+++ b/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,6 +41,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
+import net.sourceforge.plantuml.CharSequence2;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.utils.StartUtils;
@@ -62,7 +63,7 @@ public class StartDiagramExtractReader implements ReadLine {
throw new IllegalArgumentException();
}
this.raw = raw;
- String s = null;
+ CharSequence2 s = null;
while ((s = raw.readLine()) != null) {
if (StartUtils.isArobaseStartDiagram(s)) {
if (num == 0) {
@@ -78,20 +79,22 @@ public class StartDiagramExtractReader implements ReadLine {
if (charset == null) {
Log.info("Using default charset");
- return new UncommentReadLine(new ReadLineReader(new FileReader(f)));
+ return new UncommentReadLine(new ReadLineReader(new FileReader(f), f.getAbsolutePath()));
}
Log.info("Using charset " + charset);
- return new UncommentReadLine(new ReadLineReader(new InputStreamReader(new FileInputStream(f), charset)));
+ return new UncommentReadLine(new ReadLineReader(new InputStreamReader(new FileInputStream(f), charset),
+ f.getAbsolutePath()));
}
private static ReadLine getReadLine(URL url, String charset) throws IOException {
if (charset == null) {
Log.info("Using default charset");
- return new UncommentReadLine(new ReadLineReader(new InputStreamReader(url.openStream())));
+ return new UncommentReadLine(new ReadLineReader(new InputStreamReader(url.openStream()), url.toString()));
}
Log.info("Using charset " + charset);
- return new UncommentReadLine(new ReadLineReader(new InputStreamReader(url.openStream(), charset)));
+ return new UncommentReadLine(
+ new ReadLineReader(new InputStreamReader(url.openStream(), charset), url.toString()));
}
static public boolean containsStartDiagram(File f, String charset) throws IOException {
@@ -106,7 +109,7 @@ public class StartDiagramExtractReader implements ReadLine {
private static boolean containsStartDiagram(final ReadLine r) throws IOException {
try {
- String s = null;
+ CharSequence2 s = null;
while ((s = r.readLine()) != null) {
if (StartUtils.isArobaseStartDiagram(s)) {
return true;
@@ -120,11 +123,11 @@ public class StartDiagramExtractReader implements ReadLine {
return false;
}
- public String readLine() throws IOException {
+ public CharSequence2 readLine() throws IOException {
if (finished) {
return null;
}
- final String result = raw.readLine();
+ final CharSequence2 result = raw.readLine();
if (result != null && StartUtils.isArobaseEndDiagram(result)) {
finished = true;
return null;
diff --git a/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java b/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java
index 2647ecb..a8103c4 100644
--- a/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java
+++ b/src/net/sourceforge/plantuml/preproc/UncommentReadLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,7 +38,10 @@ import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
import net.sourceforge.plantuml.command.regex.MyPattern;
+import net.sourceforge.plantuml.utils.StartUtils;
public class UncommentReadLine implements ReadLine {
@@ -50,12 +53,12 @@ public class UncommentReadLine implements ReadLine {
public UncommentReadLine(ReadLine source) {
this.raw = source;
- this.start = MyPattern.cmpile("(?i)((?:\\W|\\<[^<>]*\\>)*)@start");
- this.unpause = MyPattern.cmpile("(?i)((?:\\W|\\<[^<>]*\\>)*)@unpause");
+ this.start = MyPattern.cmpile(StartUtils.START_PATTERN);
+ this.unpause = MyPattern.cmpile(StartUtils.PAUSE_PATTERN);
}
- public String readLine() throws IOException {
- final String result = raw.readLine();
+ public CharSequence2 readLine() throws IOException {
+ final CharSequence2 result = raw.readLine();
if (result == null) {
return null;
@@ -71,11 +74,11 @@ public class UncommentReadLine implements ReadLine {
headerToRemove = m2.group(1);
}
}
- if (headerToRemove != null && headerToRemove.startsWith(result)) {
- return "";
+ if (headerToRemove != null && headerToRemove.startsWith(result.toString2())) {
+ return new CharSequence2Impl("", result.getLocation());
}
- if (headerToRemove != null && result.startsWith(headerToRemove)) {
- return result.substring(headerToRemove.length());
+ if (headerToRemove != null && result.toString2().startsWith(headerToRemove)) {
+ return result.subSequence(headerToRemove.length(), result.length());
}
return result;
}
diff --git a/src/net/sourceforge/plantuml/printskin/PrintSkin.java b/src/net/sourceforge/plantuml/printskin/PrintSkin.java
index 516ca31..4de7a0c 100644
--- a/src/net/sourceforge/plantuml/printskin/PrintSkin.java
+++ b/src/net/sourceforge/plantuml/printskin/PrintSkin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -154,8 +154,8 @@ class PrintSkin extends AbstractPSystem {
}
private void println(String s) {
- final TextBlock textBlock = TextBlockUtils.create(Display.create(s), new FontConfiguration(FONT1,
- HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final TextBlock textBlock = Display.create(s).create(FontConfiguration.blackBlueTrue(FONT1),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
textBlock.drawU(ug.apply(new UTranslate(xpos, ypos)));
ypos += textBlock.calculateDimension(ug.getStringBounder()).getHeight();
}
diff --git a/src/net/sourceforge/plantuml/printskin/PrintSkinFactory.java b/src/net/sourceforge/plantuml/printskin/PrintSkinFactory.java
index 4a28052..94b2ff1 100644
--- a/src/net/sourceforge/plantuml/printskin/PrintSkinFactory.java
+++ b/src/net/sourceforge/plantuml/printskin/PrintSkinFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java b/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java
index a0cecb5..5a06624 100644
--- a/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java
+++ b/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Constant.java b/src/net/sourceforge/plantuml/project/Constant.java
index 9b1395b..d792f81 100644
--- a/src/net/sourceforge/plantuml/project/Constant.java
+++ b/src/net/sourceforge/plantuml/project/Constant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Day.java b/src/net/sourceforge/plantuml/project/Day.java
index e57af57..2ec403f 100644
--- a/src/net/sourceforge/plantuml/project/Day.java
+++ b/src/net/sourceforge/plantuml/project/Day.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/DayClose.java b/src/net/sourceforge/plantuml/project/DayClose.java
index bcec283..48bf646 100644
--- a/src/net/sourceforge/plantuml/project/DayClose.java
+++ b/src/net/sourceforge/plantuml/project/DayClose.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/DayCloseNone.java b/src/net/sourceforge/plantuml/project/DayCloseNone.java
index 800678f..d040674 100644
--- a/src/net/sourceforge/plantuml/project/DayCloseNone.java
+++ b/src/net/sourceforge/plantuml/project/DayCloseNone.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/DayCloseOr.java b/src/net/sourceforge/plantuml/project/DayCloseOr.java
index 11d1195..73f08e5 100644
--- a/src/net/sourceforge/plantuml/project/DayCloseOr.java
+++ b/src/net/sourceforge/plantuml/project/DayCloseOr.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java b/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java
index 17dbb9d..0c41ca1 100644
--- a/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java
+++ b/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Duration.java b/src/net/sourceforge/plantuml/project/Duration.java
index 7ae5668..d109ab3 100644
--- a/src/net/sourceforge/plantuml/project/Duration.java
+++ b/src/net/sourceforge/plantuml/project/Duration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Expression.java b/src/net/sourceforge/plantuml/project/Expression.java
index 6a7aec7..8aaaf5a 100644
--- a/src/net/sourceforge/plantuml/project/Expression.java
+++ b/src/net/sourceforge/plantuml/project/Expression.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Formal.java b/src/net/sourceforge/plantuml/project/Formal.java
index 7204a0c..fd703fa 100644
--- a/src/net/sourceforge/plantuml/project/Formal.java
+++ b/src/net/sourceforge/plantuml/project/Formal.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/FormalAddition.java b/src/net/sourceforge/plantuml/project/FormalAddition.java
index 84a6064..f9f71da 100644
--- a/src/net/sourceforge/plantuml/project/FormalAddition.java
+++ b/src/net/sourceforge/plantuml/project/FormalAddition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java b/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java
index 9f83406..dca0683 100644
--- a/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java
+++ b/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/FreeVariable.java b/src/net/sourceforge/plantuml/project/FreeVariable.java
index b2846b9..9f49f02 100644
--- a/src/net/sourceforge/plantuml/project/FreeVariable.java
+++ b/src/net/sourceforge/plantuml/project/FreeVariable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/IncompleteItem.java b/src/net/sourceforge/plantuml/project/IncompleteItem.java
index 5f3f6e2..c16eff9 100644
--- a/src/net/sourceforge/plantuml/project/IncompleteItem.java
+++ b/src/net/sourceforge/plantuml/project/IncompleteItem.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Instant.java b/src/net/sourceforge/plantuml/project/Instant.java
index 7ddbba6..661f972 100644
--- a/src/net/sourceforge/plantuml/project/Instant.java
+++ b/src/net/sourceforge/plantuml/project/Instant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/InstantArithmetic.java b/src/net/sourceforge/plantuml/project/InstantArithmetic.java
index c86b8e0..87d0ff1 100644
--- a/src/net/sourceforge/plantuml/project/InstantArithmetic.java
+++ b/src/net/sourceforge/plantuml/project/InstantArithmetic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Item.java b/src/net/sourceforge/plantuml/project/Item.java
index 8c155be..3db976d 100644
--- a/src/net/sourceforge/plantuml/project/Item.java
+++ b/src/net/sourceforge/plantuml/project/Item.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/ItemCaract.java b/src/net/sourceforge/plantuml/project/ItemCaract.java
index 08baadb..c3c2bf5 100644
--- a/src/net/sourceforge/plantuml/project/ItemCaract.java
+++ b/src/net/sourceforge/plantuml/project/ItemCaract.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/ItemComparator.java b/src/net/sourceforge/plantuml/project/ItemComparator.java
index c17f330..9d5ad53 100644
--- a/src/net/sourceforge/plantuml/project/ItemComparator.java
+++ b/src/net/sourceforge/plantuml/project/ItemComparator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Jalon.java b/src/net/sourceforge/plantuml/project/Jalon.java
index 057e260..8f3449d 100644
--- a/src/net/sourceforge/plantuml/project/Jalon.java
+++ b/src/net/sourceforge/plantuml/project/Jalon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Load.java b/src/net/sourceforge/plantuml/project/Load.java
index 088ce39..f6da2da 100644
--- a/src/net/sourceforge/plantuml/project/Load.java
+++ b/src/net/sourceforge/plantuml/project/Load.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Month.java b/src/net/sourceforge/plantuml/project/Month.java
index ad55d5b..aaca2f7 100644
--- a/src/net/sourceforge/plantuml/project/Month.java
+++ b/src/net/sourceforge/plantuml/project/Month.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Numeric.java b/src/net/sourceforge/plantuml/project/Numeric.java
index 5361039..3b34841 100644
--- a/src/net/sourceforge/plantuml/project/Numeric.java
+++ b/src/net/sourceforge/plantuml/project/Numeric.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/NumericNumber.java b/src/net/sourceforge/plantuml/project/NumericNumber.java
index d1a1c22..daa1f53 100644
--- a/src/net/sourceforge/plantuml/project/NumericNumber.java
+++ b/src/net/sourceforge/plantuml/project/NumericNumber.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/NumericType.java b/src/net/sourceforge/plantuml/project/NumericType.java
index ddbaac9..71aaa70 100644
--- a/src/net/sourceforge/plantuml/project/NumericType.java
+++ b/src/net/sourceforge/plantuml/project/NumericType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/PSystemProject.java b/src/net/sourceforge/plantuml/project/PSystemProject.java
index d940375..cbb9ab3 100644
--- a/src/net/sourceforge/plantuml/project/PSystemProject.java
+++ b/src/net/sourceforge/plantuml/project/PSystemProject.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -79,7 +79,7 @@ public class PSystemProject extends AbstractPSystem {
final BufferedImage im = createImage(diagram);
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96);
} else if (fileFormat == FileFormat.SVG) {
- final UGraphicSvg svg = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(background), false, 1.0);
+ final UGraphicSvg svg = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(background), false, 1.0, fileFormatOption.getSvgLinkTarget());
diagram.draw(svg, 0, 0);
svg.createXml(os);
} else if (fileFormat == FileFormat.EPS) {
diff --git a/src/net/sourceforge/plantuml/project/ParentItem.java b/src/net/sourceforge/plantuml/project/ParentItem.java
index 98eb5c7..eb837d9 100644
--- a/src/net/sourceforge/plantuml/project/ParentItem.java
+++ b/src/net/sourceforge/plantuml/project/ParentItem.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/Project.java b/src/net/sourceforge/plantuml/project/Project.java
index 74ccd3e..7909e58 100644
--- a/src/net/sourceforge/plantuml/project/Project.java
+++ b/src/net/sourceforge/plantuml/project/Project.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -85,7 +85,7 @@ public class Project {
}
public Expression getExpression(String desc) {
- desc = desc.trim();
+ desc = StringUtils.trin(desc);
final int plus = desc.indexOf('+');
if (plus != -1) {
diff --git a/src/net/sourceforge/plantuml/project/Ressource.java b/src/net/sourceforge/plantuml/project/Ressource.java
index 469c69f..acc3105 100644
--- a/src/net/sourceforge/plantuml/project/Ressource.java
+++ b/src/net/sourceforge/plantuml/project/Ressource.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/WeekDay.java b/src/net/sourceforge/plantuml/project/WeekDay.java
index e3b0413..79f6b57 100644
--- a/src/net/sourceforge/plantuml/project/WeekDay.java
+++ b/src/net/sourceforge/plantuml/project/WeekDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/command/CommandAffectation.java b/src/net/sourceforge/plantuml/project/command/CommandAffectation.java
index cad5d97..0666302 100644
--- a/src/net/sourceforge/plantuml/project/command/CommandAffectation.java
+++ b/src/net/sourceforge/plantuml/project/command/CommandAffectation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.project.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
import net.sourceforge.plantuml.project.Expression;
@@ -49,8 +50,8 @@ public class CommandAffectation extends SingleLineCommand<PSystemProject> {
@Override
protected CommandExecutionResult executeArg(PSystemProject diagram, List<String> arg) {
- final Expression exp = diagram.getProject().getExpression(arg.get(1).trim());
- final boolean ok = diagram.getProject().affectation(arg.get(0).trim(), exp);
+ final Expression exp = diagram.getProject().getExpression(StringUtils.trin(arg.get(1)));
+ final boolean ok = diagram.getProject().affectation(StringUtils.trin(arg.get(0)), exp);
if (ok) {
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java b/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java
index 07cf386..2fcf51c 100644
--- a/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java
+++ b/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/graphic/GanttDiagram.java b/src/net/sourceforge/plantuml/project/graphic/GanttDiagram.java
index b7d063c..c870291 100644
--- a/src/net/sourceforge/plantuml/project/graphic/GanttDiagram.java
+++ b/src/net/sourceforge/plantuml/project/graphic/GanttDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java b/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java
index 73ef1da..f1394ca 100644
--- a/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java
+++ b/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,7 +44,6 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.project.Item;
import net.sourceforge.plantuml.project.Project;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -58,7 +57,7 @@ class ItemHeader {
private final UFont font = new UFont("Serif", Font.PLAIN, 9);
private final Project project;
- private final FontConfiguration fontConfig = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
public ItemHeader(Project project) {
this.project = project;
@@ -72,8 +71,8 @@ class ItemHeader {
ug.apply(new UTranslate(x, y)).draw(new URectangle(getWidth(stringBounder), getHeight(stringBounder)));
for (Item it : project.getValidItems()) {
- final TextBlock b = TextBlockUtils.create(Display.create("" + it.getCode()), fontConfig,
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final TextBlock b = Display.create("" + it.getCode()).create(fontConfig, HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
final Dimension2D dim = b.calculateDimension(stringBounder);
b.drawU(ug.apply(new UTranslate(x, y)));
y += dim.getHeight();
diff --git a/src/net/sourceforge/plantuml/project/graphic/TimeScale.java b/src/net/sourceforge/plantuml/project/graphic/TimeScale.java
index 743bcad..ad88bc9 100644
--- a/src/net/sourceforge/plantuml/project/graphic/TimeScale.java
+++ b/src/net/sourceforge/plantuml/project/graphic/TimeScale.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -47,7 +47,6 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.project.Day;
import net.sourceforge.plantuml.project.Instant;
import net.sourceforge.plantuml.project.Month;
@@ -63,7 +62,7 @@ class TimeScale {
private final UFont font = new UFont("Serif", Font.PLAIN, 9);
private final Project project;
- private final FontConfiguration fontConfig = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
public TimeScale(Project project) {
this.project = project;
@@ -88,8 +87,8 @@ class TimeScale {
if (printed == null || d.getMonth() != printed) {
ug.apply(new UTranslate(curx, y)).draw(new ULine(0, monthHeight));
printed = d.getMonth();
- final TextBlock b = TextBlockUtils.create(Display.create(printed.name()), fontConfig,
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final TextBlock b = Display.create(printed.name()).create(fontConfig, HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
final Dimension2D dim = b.calculateDimension(stringBounder);
b.drawU(ug.apply(new UTranslate(curx, (y + (monthHeight - dim.getHeight()) / 2))));
}
@@ -102,10 +101,11 @@ class TimeScale {
for (Instant cur = project.getStart(); cur.compareTo(end) <= 0; cur = cur.next(project.getDayClose())) {
final Day d = cur.getDay();
- final TextBlock b = TextBlockUtils.create(Display.create("" + d.getNumDay()), fontConfig,
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final TextBlock b = Display.create("" + d.getNumDay()).create(fontConfig, HorizontalAlignment.LEFT,
+ new SpriteContainerEmpty());
final Dimension2D dim = b.calculateDimension(stringBounder);
- b.drawU(ug.apply(new UTranslate((curx + (caseWidth - dim.getWidth()) / 2), (y + (caseHeight - dim.getHeight()) / 2))));
+ b.drawU(ug.apply(new UTranslate((curx + (caseWidth - dim.getWidth()) / 2), (y + (caseHeight - dim
+ .getHeight()) / 2))));
curx += caseWidth;
ug.apply(new UTranslate(curx, y)).draw(new ULine(0, caseHeight));
}
diff --git a/src/net/sourceforge/plantuml/project2/Day.java b/src/net/sourceforge/plantuml/project2/Day.java
index 2d1ab04..7bcc152 100644
--- a/src/net/sourceforge/plantuml/project2/Day.java
+++ b/src/net/sourceforge/plantuml/project2/Day.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/GanttDiagram2.java b/src/net/sourceforge/plantuml/project2/GanttDiagram2.java
index 4a624ae..a2b1d90 100644
--- a/src/net/sourceforge/plantuml/project2/GanttDiagram2.java
+++ b/src/net/sourceforge/plantuml/project2/GanttDiagram2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -60,7 +60,7 @@ public class GanttDiagram2 {
}
private final UFont font = new UFont("Serif", Font.PLAIN, 9);
- private final FontConfiguration fontConfig = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
public void draw(UGraphic ug, double x, double y) {
@@ -83,7 +83,7 @@ public class GanttDiagram2 {
final List<Row> rows = new ArrayList<Row>();
for (Task t : tasks) {
final String text = t.getCode();
- final TextBlock label = TextBlockUtils.create(Display.create(text), fontConfig, HorizontalAlignment.LEFT,
+ final TextBlock label = Display.create(text).create(fontConfig, HorizontalAlignment.LEFT,
new SpriteContainerEmpty());
rows.add(new RowSimple((Day) t.getStart(), (Day) t.getEnd(), HtmlColorUtils.BLACK, TextBlockUtils
.withMargin(label, 3, 3)));
diff --git a/src/net/sourceforge/plantuml/project2/Knowledge.java b/src/net/sourceforge/plantuml/project2/Knowledge.java
index f5ecc6e..1963cd0 100644
--- a/src/net/sourceforge/plantuml/project2/Knowledge.java
+++ b/src/net/sourceforge/plantuml/project2/Knowledge.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,8 @@ package net.sourceforge.plantuml.project2;
import java.util.HashMap;
import java.util.Map;
+import net.sourceforge.plantuml.StringUtils;
+
public class Knowledge {
private final TaskContainer taskContainer;
@@ -49,7 +51,7 @@ public class Knowledge {
}
public Value evaluate(String exp) {
- exp = exp.trim();
+ exp = StringUtils.trin(exp);
int idx = exp.indexOf('$');
if (idx != -1) {
return evaluate(exp.substring(0, idx), exp.substring(idx + 1));
diff --git a/src/net/sourceforge/plantuml/project2/PSystemProject2.java b/src/net/sourceforge/plantuml/project2/PSystemProject2.java
index ba63f6d..1ca4c63 100644
--- a/src/net/sourceforge/plantuml/project2/PSystemProject2.java
+++ b/src/net/sourceforge/plantuml/project2/PSystemProject2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -78,7 +78,7 @@ public class PSystemProject2 extends AbstractPSystem {
final BufferedImage im = createImage(diagram);
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96);
} else if (fileFormat == FileFormat.SVG) {
- final UGraphicSvg svg = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(background), false, 1.0);
+ final UGraphicSvg svg = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(background), false, 1.0, fileFormatOption.getSvgLinkTarget());
diagram.draw(svg, 0, 0);
svg.createXml(os);
} else if (fileFormat == FileFormat.EPS) {
diff --git a/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java b/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java
index 298a3a2..c18aa34 100644
--- a/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java
+++ b/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/Project2.java b/src/net/sourceforge/plantuml/project2/Project2.java
index b7a2210..13b3e67 100644
--- a/src/net/sourceforge/plantuml/project2/Project2.java
+++ b/src/net/sourceforge/plantuml/project2/Project2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/Ressource.java b/src/net/sourceforge/plantuml/project2/Ressource.java
index 4cd9414..32428b5 100644
--- a/src/net/sourceforge/plantuml/project2/Ressource.java
+++ b/src/net/sourceforge/plantuml/project2/Ressource.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/Row.java b/src/net/sourceforge/plantuml/project2/Row.java
index db2bc63..5ddb462 100644
--- a/src/net/sourceforge/plantuml/project2/Row.java
+++ b/src/net/sourceforge/plantuml/project2/Row.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/RowMerge.java b/src/net/sourceforge/plantuml/project2/RowMerge.java
index 3cb125e..975ffa1 100644
--- a/src/net/sourceforge/plantuml/project2/RowMerge.java
+++ b/src/net/sourceforge/plantuml/project2/RowMerge.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.project2;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -53,7 +54,7 @@ class RowMerge implements Row {
}
public TextBlock asTextBloc(final TimeConverter timeConverter) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
r1.asTextBloc(timeConverter).drawU(ug);
@@ -81,7 +82,7 @@ class RowMerge implements Row {
}
public TextBlock header() {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
r1.header().drawU(ug);
diff --git a/src/net/sourceforge/plantuml/project2/RowOverwrite.java b/src/net/sourceforge/plantuml/project2/RowOverwrite.java
index 8e85735..5d0268c 100644
--- a/src/net/sourceforge/plantuml/project2/RowOverwrite.java
+++ b/src/net/sourceforge/plantuml/project2/RowOverwrite.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.project2;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -53,7 +54,7 @@ class RowOverwrite implements Row {
}
public TextBlock asTextBloc(final TimeConverter timeConverter) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final double minX = getMinXwithoutHeader(timeConverter);
diff --git a/src/net/sourceforge/plantuml/project2/RowSimple.java b/src/net/sourceforge/plantuml/project2/RowSimple.java
index 6a5275d..d1afdba 100644
--- a/src/net/sourceforge/plantuml/project2/RowSimple.java
+++ b/src/net/sourceforge/plantuml/project2/RowSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.project2;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -76,7 +77,7 @@ public class RowSimple implements Row {
}
public TextBlock asTextBloc(final TimeConverter timeConverter) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final double x1 = getMinXwithoutHeader(timeConverter) + 1;
diff --git a/src/net/sourceforge/plantuml/project2/RowUtils.java b/src/net/sourceforge/plantuml/project2/RowUtils.java
index ffa92f9..5358699 100644
--- a/src/net/sourceforge/plantuml/project2/RowUtils.java
+++ b/src/net/sourceforge/plantuml/project2/RowUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/Task.java b/src/net/sourceforge/plantuml/project2/Task.java
index 063489f..14a1d60 100644
--- a/src/net/sourceforge/plantuml/project2/Task.java
+++ b/src/net/sourceforge/plantuml/project2/Task.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TaskAttribute.java b/src/net/sourceforge/plantuml/project2/TaskAttribute.java
index 12c0b04..319b507 100644
--- a/src/net/sourceforge/plantuml/project2/TaskAttribute.java
+++ b/src/net/sourceforge/plantuml/project2/TaskAttribute.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TaskContainer.java b/src/net/sourceforge/plantuml/project2/TaskContainer.java
index 9189d0a..e1ca234 100644
--- a/src/net/sourceforge/plantuml/project2/TaskContainer.java
+++ b/src/net/sourceforge/plantuml/project2/TaskContainer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TaskImpl.java b/src/net/sourceforge/plantuml/project2/TaskImpl.java
index 8c576b6..9436f72 100644
--- a/src/net/sourceforge/plantuml/project2/TaskImpl.java
+++ b/src/net/sourceforge/plantuml/project2/TaskImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TaskMerge.java b/src/net/sourceforge/plantuml/project2/TaskMerge.java
index d2fbd8c..930cb08 100644
--- a/src/net/sourceforge/plantuml/project2/TaskMerge.java
+++ b/src/net/sourceforge/plantuml/project2/TaskMerge.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeConverter.java b/src/net/sourceforge/plantuml/project2/TimeConverter.java
index 9008d42..8dbfa29 100644
--- a/src/net/sourceforge/plantuml/project2/TimeConverter.java
+++ b/src/net/sourceforge/plantuml/project2/TimeConverter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeConverterDay.java b/src/net/sourceforge/plantuml/project2/TimeConverterDay.java
index 951bf00..093cdbe 100644
--- a/src/net/sourceforge/plantuml/project2/TimeConverterDay.java
+++ b/src/net/sourceforge/plantuml/project2/TimeConverterDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeElement.java b/src/net/sourceforge/plantuml/project2/TimeElement.java
index e3a7696..918cb65 100644
--- a/src/net/sourceforge/plantuml/project2/TimeElement.java
+++ b/src/net/sourceforge/plantuml/project2/TimeElement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java b/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java
index f3c3cc1..935947c 100644
--- a/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java
+++ b/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,12 +40,12 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TimeHeaderDay implements TextBlock {
+public class TimeHeaderDay extends AbstractTextBlock implements TextBlock {
private final Day start;
private final Day end;
@@ -61,7 +61,7 @@ public class TimeHeaderDay implements TextBlock {
private final double dayWidth;
private final UFont font = new UFont("Serif", Font.PLAIN, 9);
- private final FontConfiguration fontConfig = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
public TimeHeaderDay(Day start, Day end, TimeLine timeline, double dayWidth) {
this.start = start;
@@ -74,7 +74,7 @@ public class TimeHeaderDay implements TextBlock {
int n = 0;
for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
final String text = "" + d.getNumDay();
- final TextBlock b = TextBlockUtils.create(Display.create(text), fontConfig, HorizontalAlignment.LEFT,
+ final TextBlock b = Display.create(text).create(fontConfig, HorizontalAlignment.LEFT,
new SpriteContainerEmpty());
final Dimension2D dimText = b.calculateDimension(ug.getStringBounder());
final double diffX = dayWidth - dimText.getWidth();
diff --git a/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java b/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java
index dedc7e3..a1a2418 100644
--- a/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java
+++ b/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,12 +40,12 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class TimeHeaderMonth implements TextBlock {
+public class TimeHeaderMonth extends AbstractTextBlock implements TextBlock {
private final Day start;
private final Day end;
@@ -61,7 +61,7 @@ public class TimeHeaderMonth implements TextBlock {
private final double dayWidth;
private final UFont font = new UFont("Serif", Font.PLAIN, 9);
- private final FontConfiguration fontConfig = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
public TimeHeaderMonth(Day start, Day end, TimeLine timeline, double dayWidth) {
this.start = start;
@@ -73,7 +73,7 @@ public class TimeHeaderMonth implements TextBlock {
public void drawU(UGraphic ug) {
int n = 0;
String last = null;
-
+
double pendingX = -1;
for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
final String text = "" + d.getMonth().name();
@@ -96,7 +96,7 @@ public class TimeHeaderMonth implements TextBlock {
private void manage(UGraphic ug, double x, double y, int n, String last, double pendingX) {
final double width = n * dayWidth - pendingX;
ug.apply(new UTranslate(x + pendingX, y)).draw(new URectangle(width, getHeight()));
- final TextBlock b = TextBlockUtils.create(Display.create(last), fontConfig, HorizontalAlignment.LEFT,
+ final TextBlock b = Display.create(last).create(fontConfig, HorizontalAlignment.LEFT,
new SpriteContainerEmpty());
final Dimension2D dimText = b.calculateDimension(ug.getStringBounder());
final double diffX = width - dimText.getWidth();
diff --git a/src/net/sourceforge/plantuml/project2/TimeLine.java b/src/net/sourceforge/plantuml/project2/TimeLine.java
index a3311ac..5c228c6 100644
--- a/src/net/sourceforge/plantuml/project2/TimeLine.java
+++ b/src/net/sourceforge/plantuml/project2/TimeLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeLineDay.java b/src/net/sourceforge/plantuml/project2/TimeLineDay.java
index 78f8a12..d862237 100644
--- a/src/net/sourceforge/plantuml/project2/TimeLineDay.java
+++ b/src/net/sourceforge/plantuml/project2/TimeLineDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeResolution.java b/src/net/sourceforge/plantuml/project2/TimeResolution.java
index 5451297..592800f 100644
--- a/src/net/sourceforge/plantuml/project2/TimeResolution.java
+++ b/src/net/sourceforge/plantuml/project2/TimeResolution.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/TimeUtils.java b/src/net/sourceforge/plantuml/project2/TimeUtils.java
index fccce3f..e9d6bff 100644
--- a/src/net/sourceforge/plantuml/project2/TimeUtils.java
+++ b/src/net/sourceforge/plantuml/project2/TimeUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/Value.java b/src/net/sourceforge/plantuml/project2/Value.java
index d6ffb9a..e514dde 100644
--- a/src/net/sourceforge/plantuml/project2/Value.java
+++ b/src/net/sourceforge/plantuml/project2/Value.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/ValueInt.java b/src/net/sourceforge/plantuml/project2/ValueInt.java
index 85b568e..6a3a1cb 100644
--- a/src/net/sourceforge/plantuml/project2/ValueInt.java
+++ b/src/net/sourceforge/plantuml/project2/ValueInt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/ValueTime.java b/src/net/sourceforge/plantuml/project2/ValueTime.java
index 643fb15..303e273 100644
--- a/src/net/sourceforge/plantuml/project2/ValueTime.java
+++ b/src/net/sourceforge/plantuml/project2/ValueTime.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java b/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java
index 08e41ce..7e01bc8 100644
--- a/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java
+++ b/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.project2.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
import net.sourceforge.plantuml.project2.PSystemProject2;
@@ -49,8 +50,8 @@ public class CommandAffectation extends SingleLineCommand<PSystemProject2> {
@Override
protected CommandExecutionResult executeArg(PSystemProject2 diagram, List<String> arg) {
- final Value exp = diagram.getProject().getExpression(arg.get(1).trim());
- final boolean ok = diagram.getProject().affectation(arg.get(0).trim(), exp);
+ final Value exp = diagram.getProject().getExpression(StringUtils.trin(arg.get(1)));
+ final boolean ok = diagram.getProject().affectation(StringUtils.trin(arg.get(0)), exp);
if (ok) {
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java b/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java
index b5385cf..ef08a05 100644
--- a/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java
+++ b/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/real/AbstractReal.java b/src/net/sourceforge/plantuml/real/AbstractReal.java
new file mode 100644
index 0000000..fcb473f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/real/AbstractReal.java
@@ -0,0 +1,67 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.real;
+
+
+abstract class AbstractReal implements Real {
+
+ private final RealLine line;
+
+ AbstractReal(RealLine line) {
+ this.line = line;
+ this.line.register2(this);
+ }
+
+ final RealLine getLine() {
+ return line;
+ }
+
+ abstract double getCurrentValueInternal();
+
+ final public double getCurrentValue() {
+ final double result = getCurrentValueInternal();
+ line.register(result);
+ return result;
+ }
+
+ public Real getMaxAbsolute() {
+ return line.asMaxAbsolute();
+ }
+
+ public Real getMinAbsolute() {
+ return line.asMinAbsolute();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/real/PositiveForce.java b/src/net/sourceforge/plantuml/real/PositiveForce.java
index 8e46583..ce14e3d 100644
--- a/src/net/sourceforge/plantuml/real/PositiveForce.java
+++ b/src/net/sourceforge/plantuml/real/PositiveForce.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,8 @@ class PositiveForce {
private final Real fixedPoint;
private final RealMoveable movingPoint;
private final double minimunDistance;
+ private final boolean trace = false;
+ private final Throwable creationPoint;
public PositiveForce(Real fixedPoint, RealMoveable movingPoint, double minimunDistance) {
if (fixedPoint == movingPoint) {
@@ -47,6 +49,8 @@ class PositiveForce {
this.fixedPoint = fixedPoint;
this.movingPoint = movingPoint;
this.minimunDistance = minimunDistance;
+ this.creationPoint = new Throwable();
+ this.creationPoint.fillInStackTrace();
}
@Override
@@ -55,12 +59,32 @@ class PositiveForce {
}
public boolean apply() {
- final double distance = movingPoint.getCurrentValue() - fixedPoint.getCurrentValue();
+ if (trace) {
+ System.err.println("apply " + this);
+ }
+ final double movingPointValue = movingPoint.getCurrentValue();
+ final double fixedPointValue;
+ try {
+ fixedPointValue = fixedPoint.getCurrentValue();
+ } catch (IllegalStateException e) {
+ System.err.println("Pb with force " + this);
+ System.err.println("This force has been created here:");
+ creationPoint.printStackTrace();
+ System.err.println("The fixed point has been created here: " + fixedPoint);
+ fixedPoint.printCreationStackTrace();
+ throw e;
+ }
+ final double distance = movingPointValue - fixedPointValue;
final double diff = distance - minimunDistance;
if (diff >= 0) {
+ if (trace) {
+ System.err.println("Not using ");
+ }
return false;
}
- // System.err.println("moving " + (-diff) + " " + movingPoint);
+ if (trace) {
+ System.err.println("moving " + (-diff) + " " + movingPoint);
+ }
movingPoint.move(-diff);
return true;
}
diff --git a/src/net/sourceforge/plantuml/real/Real.java b/src/net/sourceforge/plantuml/real/Real.java
index 427fbed..5ceecf4 100644
--- a/src/net/sourceforge/plantuml/real/Real.java
+++ b/src/net/sourceforge/plantuml/real/Real.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,8 @@ package net.sourceforge.plantuml.real;
public interface Real {
+ public void printCreationStackTrace();
+
public String getName();
public double getCurrentValue();
@@ -46,6 +48,8 @@ public interface Real {
public void ensureBiggerThan(Real other);
- public void compile();
-
+// public Real getMaxAbsolute();
+//
+// public Real getMinAbsolute();
+//
}
diff --git a/src/net/sourceforge/plantuml/real/RealDelta.java b/src/net/sourceforge/plantuml/real/RealDelta.java
index bf59eff..8e35848 100644
--- a/src/net/sourceforge/plantuml/real/RealDelta.java
+++ b/src/net/sourceforge/plantuml/real/RealDelta.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,12 +40,13 @@ class RealDelta extends RealMoveable {
private final double diff;
RealDelta(Real delegated, double diff) {
- super("[Delegated {" + delegated.getName() + "} d=" + diff + "]");
+ super(((AbstractReal) delegated).getLine(), "[Delegated {" + delegated.getName() + "} d=" + diff + "]");
this.delegated = delegated;
this.diff = diff;
}
- public double getCurrentValue() {
+ @Override
+ double getCurrentValueInternal() {
return delegated.getCurrentValue() + diff;
}
@@ -55,19 +56,10 @@ class RealDelta extends RealMoveable {
public void ensureBiggerThan(Real other) {
delegated.ensureBiggerThan(new RealDelta(other, -diff));
-
- }
-
- public void compile() {
- delegated.compile();
}
void move(double delta) {
((RealMoveable) delegated).move(delta);
}
- RealLine getLine() {
- return ((RealMoveable) delegated).getLine();
- }
-
}
diff --git a/src/net/sourceforge/plantuml/real/RealImpl.java b/src/net/sourceforge/plantuml/real/RealImpl.java
index 97f2a6d..8b8d7d6 100644
--- a/src/net/sourceforge/plantuml/real/RealImpl.java
+++ b/src/net/sourceforge/plantuml/real/RealImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,14 +34,12 @@
*/
package net.sourceforge.plantuml.real;
-class RealImpl extends RealMoveable {
+class RealImpl extends RealMoveable implements RealOrigin {
- private final RealLine line;
private double currentValue;
public RealImpl(String name, RealLine line, double currentValue) {
- super(name);
- this.line = line;
+ super(line, name);
this.currentValue = currentValue;
}
@@ -49,26 +47,22 @@ class RealImpl extends RealMoveable {
this.currentValue += delta;
}
- public double getCurrentValue() {
+ @Override
+ double getCurrentValueInternal() {
return currentValue;
}
public Real addAtLeast(double delta) {
- final RealImpl result = new RealImpl(getName() + ".addAtLeast" + delta, line, this.currentValue + delta);
- line.addForce(new PositiveForce(this, result, delta));
+ final RealImpl result = new RealImpl(getName() + ".addAtLeast" + delta, getLine(), this.currentValue + delta);
+ getLine().addForce(new PositiveForce(this, result, delta));
return result;
}
public void ensureBiggerThan(Real other) {
- line.addForce(new PositiveForce(other, this, 0));
+ getLine().addForce(new PositiveForce(other, this, 0));
}
- public void compile() {
- line.compile();
+ public void compileNow() {
+ getLine().compile();
}
-
- RealLine getLine() {
- return line;
- }
-
}
diff --git a/src/net/sourceforge/plantuml/real/RealLine.java b/src/net/sourceforge/plantuml/real/RealLine.java
index c9d246f..6c7a92d 100644
--- a/src/net/sourceforge/plantuml/real/RealLine.java
+++ b/src/net/sourceforge/plantuml/real/RealLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,12 +35,38 @@
package net.sourceforge.plantuml.real;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
class RealLine {
private final List<PositiveForce> forces = new ArrayList<PositiveForce>();
+ private double min;
+ private double max;
+ private Set<AbstractReal> all = new HashSet<AbstractReal>();
+
+ void register(double v) {
+ // System.err.println("RealLine::register " + v);
+ // min = Math.min(min, v);
+ // max = Math.max(max, v);
+ }
+
+ void register2(AbstractReal abstractReal) {
+ all.add(abstractReal);
+ }
+
+ public double getAbsoluteMin() {
+ return min;
+ }
+
+ public double getAbsoluteMax() {
+ return max;
+ }
+
public void addForce(PositiveForce force) {
this.forces.add(force);
}
@@ -49,12 +75,14 @@ class RealLine {
public void compile() {
int cpt = 0;
+ final Map<PositiveForce, Integer> counter = new HashMap<PositiveForce, Integer>();
do {
boolean done = true;
for (PositiveForce f : forces) {
// System.err.println("force=" + f);
final boolean change = f.apply();
if (change) {
+ incCounter(counter, f);
// System.err.println("changed! " + f);
done = false;
}
@@ -63,14 +91,90 @@ class RealLine {
// System.err.println("cpt=" + cpt + " size=" + forces.size());
CPT += cpt;
// System.err.println("CPT=" + CPT);
+ min = 0;
+ max = 0;
+ for (AbstractReal real : all) {
+ final double v = real.getCurrentValue();
+ // System.err.println("RealLine::compile v=" + v);
+ if (v > max) {
+ max = v;
+ }
+ if (v < min) {
+ min = v;
+ }
+ }
+ // System.err.println("RealLine::compile min=" + min + " max=" + max);
return;
}
cpt++;
if (cpt > 99999) {
+ printCounter(counter);
throw new IllegalStateException("Inifinite Loop?");
}
} while (true);
}
+ private void printCounter(Map<PositiveForce, Integer> counter) {
+ for (Map.Entry<PositiveForce, Integer> ent : counter.entrySet()) {
+ System.err.println("count=" + ent.getValue() + " for " + ent.getKey());
+ }
+ }
+
+ private static void incCounter(Map<PositiveForce, Integer> counter, PositiveForce f) {
+ final Integer v = counter.get(f);
+ counter.put(f, v == null ? 1 : v + 1);
+ }
+
+ Real asMaxAbsolute() {
+ return new MaxAbsolute();
+ }
+
+ Real asMinAbsolute() {
+ return new MinAbsolute();
+ }
+
+ class MaxAbsolute extends AbstractAbsolute {
+ public double getCurrentValue() {
+ return max;
+ }
+ }
+
+ class MinAbsolute extends AbstractAbsolute {
+ public double getCurrentValue() {
+ return min;
+ }
+ }
+
+ abstract class AbstractAbsolute implements Real {
+
+ public void printCreationStackTrace() {
+ }
+
+ public String getName() {
+ return getClass().getName();
+ }
+
+ public Real addFixed(double delta) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Real addAtLeast(double delta) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void ensureBiggerThan(Real other) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Real getMaxAbsolute() {
+ return asMaxAbsolute();
+ }
+
+ public Real getMinAbsolute() {
+ return asMinAbsolute();
+ }
+
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/real/RealMax.java b/src/net/sourceforge/plantuml/real/RealMax.java
index 0092108..61db463 100644
--- a/src/net/sourceforge/plantuml/real/RealMax.java
+++ b/src/net/sourceforge/plantuml/real/RealMax.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,29 +35,42 @@
package net.sourceforge.plantuml.real;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-public class RealMax implements Real {
+class RealMax extends AbstractReal implements Real {
private final List<Real> all = new ArrayList<Real>();
+ private final Throwable creationPoint;
- public void put(Real real) {
- if (real == null) {
- throw new IllegalArgumentException();
- }
- if (real == this) {
- return;
- }
- all.add(real);
+ RealMax(Collection<Real> reals) {
+ super(line(reals));
+ this.all.addAll(reals);
+ this.creationPoint = new Throwable();
+ this.creationPoint.fillInStackTrace();
+ }
+
+ static RealLine line(Collection<Real> reals) {
+ return ((AbstractReal) reals.iterator().next()).getLine();
}
public String getName() {
return "max " + all;
}
- public double getCurrentValue() {
+ @Override
+ double getCurrentValueInternal() {
double result = all.get(0).getCurrentValue();
for (int i = 1; i < all.size(); i++) {
+ Throwable t = new Throwable();
+ t.fillInStackTrace();
+ final int stackLength = t.getStackTrace().length;
+ if (stackLength > 1000) {
+ System.err.println("The faulty RealMax " + getName());
+ System.err.println("has been created here:");
+ printCreationStackTrace();
+ throw new IllegalStateException("Infinite recursion?");
+ }
final double v = all.get(i).getCurrentValue();
if (v > result) {
result = v;
@@ -75,11 +88,11 @@ public class RealMax implements Real {
}
public void ensureBiggerThan(Real other) {
- all.add(other);
+ throw new UnsupportedOperationException();
}
- public void compile() {
- all.get(0).compile();
+ public void printCreationStackTrace() {
+ creationPoint.printStackTrace();
}
}
diff --git a/src/net/sourceforge/plantuml/real/RealMiddle.java b/src/net/sourceforge/plantuml/real/RealMiddle.java
index 25200d5..1fda4c2 100644
--- a/src/net/sourceforge/plantuml/real/RealMiddle.java
+++ b/src/net/sourceforge/plantuml/real/RealMiddle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,13 +34,14 @@
*/
package net.sourceforge.plantuml.real;
-class RealMiddle implements Real {
+class RealMiddle extends AbstractReal implements Real {
private final RealMoveable p1;
private final RealMoveable p2;
private final double delta;
private RealMiddle(RealMoveable p1, RealMoveable p2, double delta) {
+ super(p1.getLine());
this.p1 = p1;
this.p2 = p2;
this.delta = delta;
@@ -50,7 +51,8 @@ class RealMiddle implements Real {
this(p1, p2, 0);
}
- public double getCurrentValue() {
+ @Override
+ double getCurrentValueInternal() {
return (p1.getCurrentValue() + p2.getCurrentValue()) / 2 + delta;
}
@@ -66,12 +68,12 @@ class RealMiddle implements Real {
throw new UnsupportedOperationException();
}
- public void compile() {
- p1.compile();
- }
-
public String getName() {
return "[Middle " + p1.getName() + " and " + p2.getName() + "]";
}
+ public void printCreationStackTrace() {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/real/RealMiddle2.java b/src/net/sourceforge/plantuml/real/RealMiddle2.java
new file mode 100644
index 0000000..17ba400
--- /dev/null
+++ b/src/net/sourceforge/plantuml/real/RealMiddle2.java
@@ -0,0 +1,72 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.real;
+
+class RealMiddle2 extends RealMoveable {
+
+ private final RealMoveable p1;
+ private final RealMoveable p2;
+
+ RealMiddle2(RealMoveable p1, RealMoveable p2) {
+ super(p1.getLine(), "middle");
+ assert p1.getLine() == p2.getLine();
+ this.p1 = p1;
+ this.p2 = p2;
+ }
+
+ @Override
+ double getCurrentValueInternal() {
+ return (p1.getCurrentValue() + p2.getCurrentValue()) / 2;
+ }
+
+ // public Real addFixed(double diff) {
+ // return new RealMiddle2(p1, p2, delta + diff);
+ // }
+
+ public Real addAtLeast(double delta) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void ensureBiggerThan(Real other) {
+ getLine().addForce(new PositiveForce(other, this, 0));
+ }
+
+ @Override
+ void move(double delta) {
+ p1.move(delta / 2);
+ p2.move(delta / 2);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/real/RealMin.java b/src/net/sourceforge/plantuml/real/RealMin.java
index cea620d..8ca6ffa 100644
--- a/src/net/sourceforge/plantuml/real/RealMin.java
+++ b/src/net/sourceforge/plantuml/real/RealMin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,27 +35,24 @@
package net.sourceforge.plantuml.real;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-public class RealMin implements Real {
+class RealMin extends AbstractReal implements Real {
private final List<Real> all = new ArrayList<Real>();
- public void put(Real real) {
- if (real == null) {
- throw new IllegalArgumentException();
- }
- if (real == this) {
- return;
- }
- all.add(real);
+ RealMin(Collection<Real> reals) {
+ super(RealMax.line(reals));
+ this.all.addAll(reals);
}
public String getName() {
return "min " + all;
}
- public double getCurrentValue() {
+ @Override
+ double getCurrentValueInternal() {
double result = all.get(0).getCurrentValue();
for (int i = 1; i < all.size(); i++) {
final double v = all.get(i).getCurrentValue();
@@ -75,15 +72,17 @@ public class RealMin implements Real {
}
public void ensureBiggerThan(Real other) {
- throw new UnsupportedOperationException();
- }
-
- public void compile() {
- all.get(0).compile();
+ for (Real r : all) {
+ r.ensureBiggerThan(other);
+ }
}
public int size() {
return all.size();
}
+ public void printCreationStackTrace() {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/real/RealMoveable.java b/src/net/sourceforge/plantuml/real/RealMoveable.java
index 7d68da0..918ef03 100644
--- a/src/net/sourceforge/plantuml/real/RealMoveable.java
+++ b/src/net/sourceforge/plantuml/real/RealMoveable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,29 +34,38 @@
*/
package net.sourceforge.plantuml.real;
-abstract class RealMoveable implements Real {
+import java.util.concurrent.atomic.AtomicInteger;
+abstract class RealMoveable extends AbstractReal implements Real {
+
+ public static final AtomicInteger CPT = new AtomicInteger();
+ private final int cpt = CPT.getAndIncrement();
private final String name;
+ private final Throwable creationPoint;
- RealMoveable(String name) {
+ RealMoveable(RealLine line, String name) {
+ super(line);
this.name = name;
+ this.creationPoint = new Throwable();
+ this.creationPoint.fillInStackTrace();
}
abstract void move(double delta);
- abstract RealLine getLine();
+ final public void printCreationStackTrace() {
+ creationPoint.printStackTrace();
+ }
final public Real addFixed(double delta) {
return new RealDelta(this, delta);
}
@Override
- public String toString() {
- return name;
+ public final String toString() {
+ return "#" + cpt + "_" + name;
}
final public String getName() {
return name;
}
-
}
diff --git a/src/net/sourceforge/plantuml/real/RealOrigin.java b/src/net/sourceforge/plantuml/real/RealOrigin.java
new file mode 100644
index 0000000..dea8165
--- /dev/null
+++ b/src/net/sourceforge/plantuml/real/RealOrigin.java
@@ -0,0 +1,40 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.real;
+
+public interface RealOrigin extends Real {
+
+ public void compileNow();
+}
diff --git a/src/net/sourceforge/plantuml/real/RealUtils.java b/src/net/sourceforge/plantuml/real/RealUtils.java
index 0ee94c3..d447804 100644
--- a/src/net/sourceforge/plantuml/real/RealUtils.java
+++ b/src/net/sourceforge/plantuml/real/RealUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,26 +34,34 @@
*/
package net.sourceforge.plantuml.real;
-import java.util.List;
+import java.util.Arrays;
+import java.util.Collection;
public class RealUtils {
- public static Real createOrigin() {
+ public static RealOrigin createOrigin() {
final RealLine line = new RealLine();
final RealImpl result = new RealImpl("O", line, 0);
return result;
}
public static Real middle(Real r1, Real r2) {
- return new RealMiddle((RealMoveable) r1, (RealMoveable) r2);
+ return new RealMiddle2((RealMoveable) r1, (RealMoveable) r2);
}
- // public static Real max(List<Real> all) {
- // return new RealMax(all);
- // }
- //
- // public static Real min(List<Real> all) {
- // return new RealMin(all);
- // }
+ public static Real max(Real... reals) {
+ return new RealMax(Arrays.asList(reals));
+ }
+
+ public static Real max(Collection<Real> reals) {
+ return new RealMax(reals);
+ }
+ public static Real min(Real... reals) {
+ return new RealMin(Arrays.asList(reals));
+ }
+
+ public static Real min(Collection<Real> reals) {
+ return new RealMin(reals);
+ }
}
diff --git a/src/net/sourceforge/plantuml/salt/Cell.java b/src/net/sourceforge/plantuml/salt/Cell.java
index e7e348a..8ab5a50 100644
--- a/src/net/sourceforge/plantuml/salt/Cell.java
+++ b/src/net/sourceforge/plantuml/salt/Cell.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/DataSource.java b/src/net/sourceforge/plantuml/salt/DataSource.java
index 20afbbc..3fc789b 100644
--- a/src/net/sourceforge/plantuml/salt/DataSource.java
+++ b/src/net/sourceforge/plantuml/salt/DataSource.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/DataSourceImpl.java b/src/net/sourceforge/plantuml/salt/DataSourceImpl.java
index d0fec7a..5b91d59 100644
--- a/src/net/sourceforge/plantuml/salt/DataSourceImpl.java
+++ b/src/net/sourceforge/plantuml/salt/DataSourceImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,6 +40,7 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
public class DataSourceImpl implements DataSource {
@@ -52,7 +53,7 @@ public class DataSourceImpl implements DataSource {
for (String s : data) {
final StringTokenizer st = new StringTokenizer(s, "|}", true);
while (st.hasMoreTokens()) {
- final String token = st.nextToken().trim();
+ final String token = StringUtils.trin(st.nextToken());
if (token.equals("|")) {
continue;
}
@@ -83,7 +84,7 @@ public class DataSourceImpl implements DataSource {
}
private void addInternal(String s, Terminator t) {
- s = s.trim();
+ s = StringUtils.trin(s);
if (s.length() > 0) {
data.add(new Terminated<String>(s, t));
}
diff --git a/src/net/sourceforge/plantuml/salt/Dictionary.java b/src/net/sourceforge/plantuml/salt/Dictionary.java
index 80a4eb3..27a1bf8 100644
--- a/src/net/sourceforge/plantuml/salt/Dictionary.java
+++ b/src/net/sourceforge/plantuml/salt/Dictionary.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,9 +39,12 @@ import java.util.Map;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.SpriteContainer;
+import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
+import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
+import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.salt.element.Element;
import net.sourceforge.plantuml.salt.element.WrappedElement;
-import net.sourceforge.plantuml.ugraphic.Sprite;
+import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class Dictionary implements SpriteContainer, ISkinSimple {
@@ -66,7 +69,7 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
public String getValue(String key) {
return null;
}
-
+
public double getPadding() {
return 0;
}
@@ -75,4 +78,16 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
return true;
}
+ public String getMonospacedFamily() {
+ return CommandCreoleMonospaced.MONOSPACED;
+ }
+
+ public int getTabSize() {
+ return 8;
+ }
+
+ public IHtmlColorSet getIHtmlColorSet() {
+ return new HtmlColorSetSimple();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/salt/PSystemSalt.java b/src/net/sourceforge/plantuml/salt/PSystemSalt.java
index 23c42a9..d6c2f9f 100644
--- a/src/net/sourceforge/plantuml/salt/PSystemSalt.java
+++ b/src/net/sourceforge/plantuml/salt/PSystemSalt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -95,7 +95,7 @@ public class PSystemSalt extends AbstractPSystem {
salt.drawU(ug, 1, new Dimension2DDouble(size.getWidth(), size.getHeight()));
}
});
- return builder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return builder.writeImageTOBEMOVED(fileFormat, os);
}
private ImageData exportDiagramOld(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
diff --git a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java
index ad11fbb..e94c7fd 100644
--- a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java
+++ b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.salt;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.PSystemBasicFactory;
import net.sourceforge.plantuml.core.DiagramType;
@@ -62,7 +63,7 @@ public class PSystemSaltFactory extends PSystemBasicFactory<PSystemSalt> {
if (system == null) {
return null;
}
- system.add(line.trim());
+ system.add(StringUtils.trin(line));
return system;
}
diff --git a/src/net/sourceforge/plantuml/salt/Position.java b/src/net/sourceforge/plantuml/salt/Position.java
index 7e6fe57..fda120d 100644
--- a/src/net/sourceforge/plantuml/salt/Position.java
+++ b/src/net/sourceforge/plantuml/salt/Position.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/Positionner2.java b/src/net/sourceforge/plantuml/salt/Positionner2.java
index 394e5b9..78c4bbc 100644
--- a/src/net/sourceforge/plantuml/salt/Positionner2.java
+++ b/src/net/sourceforge/plantuml/salt/Positionner2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/SaltUtils.java b/src/net/sourceforge/plantuml/salt/SaltUtils.java
index 4005948..6498684 100644
--- a/src/net/sourceforge/plantuml/salt/SaltUtils.java
+++ b/src/net/sourceforge/plantuml/salt/SaltUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/Terminated.java b/src/net/sourceforge/plantuml/salt/Terminated.java
index f8317ac..5f56cee 100644
--- a/src/net/sourceforge/plantuml/salt/Terminated.java
+++ b/src/net/sourceforge/plantuml/salt/Terminated.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/Terminator.java b/src/net/sourceforge/plantuml/salt/Terminator.java
index 7493664..5404c49 100644
--- a/src/net/sourceforge/plantuml/salt/Terminator.java
+++ b/src/net/sourceforge/plantuml/salt/Terminator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/AbstractElement.java b/src/net/sourceforge/plantuml/salt/element/AbstractElement.java
index b61f2e5..719e35f 100644
--- a/src/net/sourceforge/plantuml/salt/element/AbstractElement.java
+++ b/src/net/sourceforge/plantuml/salt/element/AbstractElement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java b/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java
index 8a1e6e6..2a51c35 100644
--- a/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java
+++ b/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,13 +38,12 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -56,14 +55,14 @@ abstract class AbstractElementText extends AbstractElement {
private final int charLength;
public AbstractElementText(String text, UFont font, boolean manageLength, ISkinSimple spriteContainer) {
- config = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
+ config = FontConfiguration.blackBlueTrue(font);
if (manageLength) {
this.charLength = getCharNumber(text);
- text = text.trim();
+ text = StringUtils.trin(text);
} else {
this.charLength = 0;
}
- this.block = TextBlockUtils.create(Display.create(text), config, HorizontalAlignment.LEFT, spriteContainer);
+ this.block = Display.create(text).create(config, HorizontalAlignment.LEFT, spriteContainer);
}
private int getCharNumber(String text) {
@@ -96,7 +95,7 @@ abstract class AbstractElementText extends AbstractElement {
// double max = 0;
// for (int i = 32; i < 127; i++) {
// final char c = (char) i;
- // final double w = TextBlockUtils.create(Arrays.asList("" + c), config, HorizontalAlignment.LEFT)
+ // final double w = Display.create(Arrays.asList("" + c), config, HorizontalAlignment.LEFT)
// .calculateDimension(stringBounder).getWidth();
// if (w > max) {
// Log.println("c="+c+" "+max);
diff --git a/src/net/sourceforge/plantuml/salt/element/Element.java b/src/net/sourceforge/plantuml/salt/element/Element.java
index 5467124..980c333 100644
--- a/src/net/sourceforge/plantuml/salt/element/Element.java
+++ b/src/net/sourceforge/plantuml/salt/element/Element.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementBorder.java b/src/net/sourceforge/plantuml/salt/element/ElementBorder.java
index bc7a5d1..34684f5 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementBorder.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementBorder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementButton.java b/src/net/sourceforge/plantuml/salt/element/ElementButton.java
index 47bb772..b670f2f 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementButton.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementButton.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java b/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java
index edff73e..8e66756 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -73,8 +73,7 @@ public class ElementDroplist extends AbstractElementText implements Element {
if (drop.size() == 0) {
this.openDrop = null;
} else {
- this.openDrop = TextBlockUtils.create(Display.create(drop), getConfig(), HorizontalAlignment.LEFT,
- spriteContainer);
+ this.openDrop = Display.create(drop).create(getConfig(), HorizontalAlignment.LEFT, spriteContainer);
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java b/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java
index 82af160..314dba2 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementImage.java b/src/net/sourceforge/plantuml/salt/element/ElementImage.java
index c6937c4..a484f2b 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementImage.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementLine.java b/src/net/sourceforge/plantuml/salt/element/ElementLine.java
index 61fb696..a134b02 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementLine.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java
index c38400d..bdbb49c 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java
index 17b2277..dc77f3f 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,10 +42,8 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -59,8 +57,8 @@ public class ElementMenuEntry extends AbstractElement {
private double xxx;
public ElementMenuEntry(String text, UFont font, ISkinSimple spriteContainer) {
- final FontConfiguration config = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
- this.block = TextBlockUtils.create(Display.create(text), config, HorizontalAlignment.LEFT, spriteContainer);
+ final FontConfiguration config = FontConfiguration.blackBlueTrue(font);
+ this.block = Display.create(text).create(config, HorizontalAlignment.LEFT, spriteContainer);
this.text = text;
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java
index 2de6997..9e57dae 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java b/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java
index f1aa53d..89868a4 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java b/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java
index b36d1df..77654e7 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,10 +42,8 @@ import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -68,8 +66,8 @@ public class ElementRadioCheckbox extends AbstractElement {
public ElementRadioCheckbox(List<String> text, UFont font, boolean radio, boolean checked,
ISkinSimple spriteContainer) {
- final FontConfiguration config = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
- this.block = TextBlockUtils.create(Display.create(text), config, HorizontalAlignment.LEFT, spriteContainer);
+ final FontConfiguration config = FontConfiguration.blackBlueTrue(font);
+ this.block = Display.create(text).create(config, HorizontalAlignment.LEFT, spriteContainer);
this.radio = radio;
this.checked = checked;
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java b/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java
index 73ce12e..9933a0e 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementText.java b/src/net/sourceforge/plantuml/salt/element/ElementText.java
index 26e9a44..8b49f47 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementText.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,10 +41,8 @@ import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -55,8 +53,8 @@ public class ElementText extends AbstractElement {
private final String text;
public ElementText(List<String> text, UFont font, ISkinSimple spriteContainer) {
- final FontConfiguration config = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true);
- this.block = TextBlockUtils.create(Display.create(text), config, HorizontalAlignment.LEFT, spriteContainer);
+ final FontConfiguration config = FontConfiguration.blackBlueTrue(font);
+ this.block = Display.create(text).create(config, HorizontalAlignment.LEFT, spriteContainer);
this.show = text.get(0).equals(".") == false;
this.text = text.get(0);
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTextField.java b/src/net/sourceforge/plantuml/salt/element/ElementTextField.java
index dddc4b9..20feca2 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTextField.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTextField.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTree.java b/src/net/sourceforge/plantuml/salt/element/ElementTree.java
index b05ef09..5f7d036 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTree.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTree.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,14 +42,12 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.ULine;
-import net.sourceforge.plantuml.ugraphic.URectangle;
-import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ElementTree extends AbstractElement {
@@ -71,14 +69,14 @@ public class ElementTree extends AbstractElement {
level++;
s = s.substring(1);
}
- final Element elmt = new ElementText(Arrays.asList(s.trim()), font, spriteContainer);
+ final Element elmt = new ElementText(Arrays.asList(StringUtils.trin(s)), font, spriteContainer);
entries.add(new ElementTreeEntry(level, elmt));
}
public void addCellToEntry(String s) {
final int size = entries.size();
if (size > 0) {
- final Element elmt = new ElementText(Arrays.asList(s.trim()), font, spriteContainer);
+ final Element elmt = new ElementText(Arrays.asList(StringUtils.trin(s)), font, spriteContainer);
entries.get(size - 1).addCell(elmt);
}
}
@@ -154,56 +152,4 @@ public class ElementTree extends AbstractElement {
}
}
- static class Skeleton {
-
- private final List<Entry> entries = new ArrayList<Entry>();
-
- static class Entry {
- private final double xpos;
- private final double ypos;
-
- public Entry(double x, double y) {
- this.xpos = x;
- this.ypos = y;
- }
-
- public void drawRectangle(UGraphic ug) {
- ug.apply(new UTranslate(xpos, ypos)).draw(new URectangle(2, 2));
- }
- }
-
- public void add(double x, double y) {
- entries.add(new Entry(x, y));
- }
-
- public void draw(UGraphic ug, double x, double y) {
- for (int i = 0; i < entries.size(); i++) {
- final Entry en = entries.get(i);
- if (i + 1 < entries.size() && entries.get(i + 1).xpos > en.xpos) {
- en.drawRectangle(ug);
- }
- Entry parent = null;
- for (int j = 0; j < i; j++) {
- final Entry en0 = entries.get(j);
- if (en0.xpos < en.xpos) {
- parent = en0;
- }
- }
- if (parent != null) {
- drawChild(ug, parent, en);
- }
- }
- }
-
- private void drawChild(UGraphic ug, Entry parent, Entry child) {
- final double dy = child.ypos - parent.ypos - 2;
- ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(new ULine(0, dy));
-
- final double dx = child.xpos - parent.xpos - 2;
- ug.apply(new UTranslate(parent.xpos + 1, child.ypos + 1)).draw(new ULine(dx, 0));
-
- }
-
- }
-
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java b/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java
index 4b928b0..fe1fd60 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/Grid.java b/src/net/sourceforge/plantuml/salt/element/Grid.java
index 019d720..50a2da4 100644
--- a/src/net/sourceforge/plantuml/salt/element/Grid.java
+++ b/src/net/sourceforge/plantuml/salt/element/Grid.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/Grid2.java b/src/net/sourceforge/plantuml/salt/element/Grid2.java
index cd93ca8..f491366 100644
--- a/src/net/sourceforge/plantuml/salt/element/Grid2.java
+++ b/src/net/sourceforge/plantuml/salt/element/Grid2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/LeftFirst.java b/src/net/sourceforge/plantuml/salt/element/LeftFirst.java
index 63a5dc3..663ea33 100644
--- a/src/net/sourceforge/plantuml/salt/element/LeftFirst.java
+++ b/src/net/sourceforge/plantuml/salt/element/LeftFirst.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/ListWidth.java b/src/net/sourceforge/plantuml/salt/element/ListWidth.java
index 866c675..c036716 100644
--- a/src/net/sourceforge/plantuml/salt/element/ListWidth.java
+++ b/src/net/sourceforge/plantuml/salt/element/ListWidth.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/Segment.java b/src/net/sourceforge/plantuml/salt/element/Segment.java
index 4e3ae28..ab9d7fc 100644
--- a/src/net/sourceforge/plantuml/salt/element/Segment.java
+++ b/src/net/sourceforge/plantuml/salt/element/Segment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/Skeleton.java b/src/net/sourceforge/plantuml/salt/element/Skeleton.java
new file mode 100644
index 0000000..687b2ab
--- /dev/null
+++ b/src/net/sourceforge/plantuml/salt/element/Skeleton.java
@@ -0,0 +1,95 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.salt.element;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.ULine;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class Skeleton {
+
+ private final List<Entry> entries = new ArrayList<Entry>();
+
+ static class Entry {
+ private final double xpos;
+ private final double ypos;
+
+ public Entry(double x, double y) {
+ this.xpos = x;
+ this.ypos = y;
+ }
+
+ public void drawRectangle(UGraphic ug) {
+ ug.apply(new UTranslate(xpos, ypos)).draw(new URectangle(2, 2));
+ }
+ }
+
+ public void add(double x, double y) {
+ entries.add(new Entry(x, y));
+ }
+
+ public void draw(UGraphic ug, double x, double y) {
+ for (int i = 0; i < entries.size(); i++) {
+ final Entry en = entries.get(i);
+ if (i + 1 < entries.size() && entries.get(i + 1).xpos > en.xpos) {
+ en.drawRectangle(ug);
+ }
+ Entry parent = null;
+ for (int j = 0; j < i; j++) {
+ final Entry en0 = entries.get(j);
+ if (en0.xpos < en.xpos) {
+ parent = en0;
+ }
+ }
+ if (parent != null) {
+ drawChild(ug, parent, en);
+ }
+ }
+ }
+
+ private void drawChild(UGraphic ug, Entry parent, Entry child) {
+ final double dy = child.ypos - parent.ypos - 2;
+ ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(new ULine(0, dy));
+
+ final double dx = child.xpos - parent.xpos - 2;
+ ug.apply(new UTranslate(parent.xpos + 1, child.ypos + 1)).draw(new ULine(dx, 0));
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/salt/element/Skeleton2.java b/src/net/sourceforge/plantuml/salt/element/Skeleton2.java
new file mode 100644
index 0000000..4500b4e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/salt/element/Skeleton2.java
@@ -0,0 +1,133 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.salt.element;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.ULine;
+import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class Skeleton2 {
+
+ private final List<Entry> entries = new ArrayList<Entry>();
+ private static final double sizeX = 8;
+
+ static class Entry {
+ private final int level;
+ private final double ypos;
+
+ Entry(int level, double y) {
+ // System.err.println("level=" + level);
+ this.level = level;
+ this.ypos = y;
+ }
+
+ void drawHline(UGraphic ug) {
+ final double xpos = getXStartForLevel(level);
+ ug.apply(new UTranslate(xpos + sizeX - 1, ypos - 1)).draw(new URectangle(2, 2));
+ ug.apply(new UTranslate(xpos, ypos)).draw(new ULine(sizeX, 0));
+ }
+
+ public void drawVline(UGraphic ug, double lastY) {
+ // System.err.println("ypos=" + ypos);
+ final double xpos = getXStartForLevel(level);
+ ug.apply(new UTranslate(xpos, lastY)).draw(new ULine(0, ypos - lastY));
+ }
+ }
+
+ public void add(int level, double y) {
+ entries.add(new Entry(level, y));
+ }
+
+ public void draw(UGraphic ug) {
+ for (int i = 0; i < entries.size(); i++) {
+ final Entry en = entries.get(i);
+ en.drawHline(ug);
+ final Entry up = getMotherOrSister(i);
+ en.drawVline(ug, up == null ? 0 : up.ypos);
+ }
+ }
+
+ private Entry getMotherOrSister(int idx) {
+ final int currentLevel = entries.get(idx).level;
+ for (int i = idx - 1; i >= 0; i--) {
+ final int otherLevel = entries.get(i).level;
+ if (otherLevel == currentLevel || otherLevel == currentLevel - 1) {
+ return entries.get(i);
+ }
+ }
+ return null;
+ }
+
+ private static double getXStartForLevel(int level) {
+ return level * sizeX;
+ }
+
+ public double getXEndForLevel(int level) {
+ return getXStartForLevel(level) + sizeX;
+ }
+
+ // public void drawOld(UGraphic ug, double x, double y) {
+ // for (int i = 0; i < entries.size(); i++) {
+ // final Entry en = entries.get(i);
+ // if (i + 1 < entries.size() && entries.get(i + 1).xpos > en.xpos) {
+ // en.drawRectangle(ug);
+ // }
+ // Entry parent = null;
+ // for (int j = 0; j < i; j++) {
+ // final Entry en0 = entries.get(j);
+ // if (en0.xpos < en.xpos) {
+ // parent = en0;
+ // }
+ // }
+ // if (parent != null) {
+ // drawChild(ug, parent, en);
+ // }
+ // }
+ // }
+ //
+ // private void drawChild(UGraphic ug, Entry parent, Entry child) {
+ // final double dy = child.ypos - parent.ypos - 2;
+ // ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(new ULine(0, dy));
+ //
+ // final double dx = child.xpos - parent.xpos - 2;
+ // ug.apply(new UTranslate(parent.xpos + 1, child.ypos + 1)).draw(new ULine(dx, 0));
+ //
+ // }
+
+}
diff --git a/src/net/sourceforge/plantuml/salt/element/TableStrategy.java b/src/net/sourceforge/plantuml/salt/element/TableStrategy.java
index c4370f8..87b6ad9 100644
--- a/src/net/sourceforge/plantuml/salt/element/TableStrategy.java
+++ b/src/net/sourceforge/plantuml/salt/element/TableStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/TopFirst.java b/src/net/sourceforge/plantuml/salt/element/TopFirst.java
index 3ddedb6..aadaa7e 100644
--- a/src/net/sourceforge/plantuml/salt/element/TopFirst.java
+++ b/src/net/sourceforge/plantuml/salt/element/TopFirst.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/element/WrappedElement.java b/src/net/sourceforge/plantuml/salt/element/WrappedElement.java
index 4b11b1a..1589e8c 100644
--- a/src/net/sourceforge/plantuml/salt/element/WrappedElement.java
+++ b/src/net/sourceforge/plantuml/salt/element/WrappedElement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java b/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java
index 206852f..56e62b1 100644
--- a/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java
+++ b/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java
index c1d088f..2ed155c 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java
index cae3d19..4d9c85d 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java
index 6be09eb..0a813ac 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java
index d336918..c7ee382 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.salt.DataSource;
import net.sourceforge.plantuml.salt.Terminated;
import net.sourceforge.plantuml.salt.element.Element;
@@ -68,7 +69,7 @@ public class ElementFactoryCheckboxOff implements ElementFactory {
private List<String> extracted(final String text) {
final int x = text.indexOf(']');
- return Arrays.asList(text.substring(x + 1).trim());
+ return Arrays.asList(StringUtils.trin(text.substring(x + 1)));
}
public boolean ready() {
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java
index 7562f84..e9a4032 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.salt.DataSource;
import net.sourceforge.plantuml.salt.Terminated;
import net.sourceforge.plantuml.salt.element.Element;
@@ -68,7 +69,7 @@ public class ElementFactoryCheckboxOn implements ElementFactory {
private List<String> extracted(final String text) {
final int x = text.indexOf(']');
- return Arrays.asList(text.substring(x + 1).trim());
+ return Arrays.asList(StringUtils.trin(text.substring(x + 1)));
}
public boolean ready() {
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java
index 7cb0cff..62c7a75 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java
index 60a44e4..81cc68d 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java
index 8091ffe..c32572a 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java
index 2b7dfb0..936d46a 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java
index 7925ee4..5913a31 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java
index bc47032..a7695eb 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.salt.DataSource;
import net.sourceforge.plantuml.salt.Terminated;
import net.sourceforge.plantuml.salt.element.Element;
@@ -68,7 +69,7 @@ public class ElementFactoryRadioOff implements ElementFactory {
private List<String> extracted(final String text) {
final int x = text.indexOf(')');
- return Arrays.asList(text.substring(x + 1).trim());
+ return Arrays.asList(StringUtils.trin(text.substring(x + 1)));
}
public boolean ready() {
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java
index 6472ea3..bd25a2c 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.salt.DataSource;
import net.sourceforge.plantuml.salt.Terminated;
import net.sourceforge.plantuml.salt.element.Element;
@@ -68,7 +69,7 @@ public class ElementFactoryRadioOn implements ElementFactory {
private List<String> extracted(final String text) {
final int x = text.indexOf(')');
- return Arrays.asList(text.substring(x + 1).trim());
+ return Arrays.asList(StringUtils.trin(text.substring(x + 1)));
}
public boolean ready() {
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java
index 86d5df8..f07c8c3 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java
index 8395f0e..3377860 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java
index 91bc510..9b756e4 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,7 +38,7 @@ import java.awt.Font;
import java.util.Arrays;
import net.sourceforge.plantuml.ISkinSimple;
-import net.sourceforge.plantuml.SpriteContainer;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.salt.DataSource;
import net.sourceforge.plantuml.salt.Terminated;
import net.sourceforge.plantuml.salt.element.Element;
@@ -72,7 +72,7 @@ public class ElementFactoryText implements ElementFactory {
if (text.startsWith("{") || text.startsWith("}")) {
return false;
}
- return text.trim().length() > 0;
+ return StringUtils.trin(text).length() > 0;
}
}
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java
index c6fcbe5..e51faec 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java
index 681a8c7..7d17403 100644
--- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java
+++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/AbstractEvent.java b/src/net/sourceforge/plantuml/sequencediagram/AbstractEvent.java
index 0670a72..d8b5f7c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/AbstractEvent.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/AbstractEvent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java
index a601b2f..7de8d28 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -138,6 +138,17 @@ public abstract class AbstractMessage implements EventWithDeactivate {
public final Display getLabel() {
return label;
}
+
+ public final Display getLabelNumbered() {
+ if (getMessageNumber() == null) {
+ return getLabel();
+ }
+ Display result = Display.empty();
+ result = result.add(new MessageNumber(getMessageNumber()));
+ result = result.addAll(getLabel());
+ return result;
+ }
+
public final ArrowConfiguration getArrowConfiguration() {
return arrowConfiguration;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Delay.java b/src/net/sourceforge/plantuml/sequencediagram/Delay.java
index 788fb7d..44be771 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Delay.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Delay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Divider.java b/src/net/sourceforge/plantuml/sequencediagram/Divider.java
index 422a41a..5354844 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Divider.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Divider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Englober.java b/src/net/sourceforge/plantuml/sequencediagram/Englober.java
new file mode 100644
index 0000000..9dc4f45
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/Englober.java
@@ -0,0 +1,214 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.SkinParamBackcolored;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealUtils;
+import net.sourceforge.plantuml.sequencediagram.teoz.Bordered;
+import net.sourceforge.plantuml.sequencediagram.teoz.LivingSpace;
+import net.sourceforge.plantuml.sequencediagram.teoz.TileArguments;
+import net.sourceforge.plantuml.skin.Area;
+import net.sourceforge.plantuml.skin.Component;
+import net.sourceforge.plantuml.skin.ComponentType;
+import net.sourceforge.plantuml.skin.Context2D;
+import net.sourceforge.plantuml.skin.Skin;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class Englober {
+
+ final private ParticipantEnglober participantEnglober;
+ final private List<Participant> participants = new ArrayList<Participant>();
+ final private TileArguments tileArguments;
+ final private Real core1;
+ final private Real core2;
+
+ @Deprecated
+ public Englober(ParticipantEnglober participantEnglober, Participant first, ISkinParam skinParam, Skin skin) {
+ this(participantEnglober, first, convertFunctionToBeRemoved(skinParam, skin));
+ }
+
+ private static TileArguments convertFunctionToBeRemoved(ISkinParam skinParam, Skin skin) {
+ final TileArguments result = new TileArguments(TextBlockUtils.getDummyStringBounder(), null, skin, skinParam,
+ null);
+ return result;
+ }
+
+ public Englober(ParticipantEnglober participantEnglober, Participant first, TileArguments tileArguments) {
+ if (tileArguments == null) {
+ throw new IllegalArgumentException();
+ }
+ this.participantEnglober = participantEnglober;
+ this.participants.add(first);
+ this.tileArguments = tileArguments;
+ final double preferredWidth = getPreferredWidth();
+ if (tileArguments.getLivingSpaces() == null) {
+ this.core1 = null;
+ this.core2 = null;
+ } else {
+ this.core1 = getMiddle().addFixed(-preferredWidth / 2);
+ this.core2 = getMiddle().addFixed(preferredWidth / 2);
+ }
+ }
+
+ public final Participant getFirst2TOBEPRIVATE() {
+ return participants.get(0);
+ }
+
+ public final Participant getLast2TOBEPRIVATE() {
+ return participants.get(participants.size() - 1);
+ }
+
+ private Real getMiddle() {
+ return RealUtils.middle(getPosB(), getPosD());
+ }
+
+ private Real getPosB() {
+ return getFirstLivingSpace().getPosB();
+ }
+
+ private Real getPosD() {
+ return getLastLivingSpace().getPosD(tileArguments.getStringBounder());
+ }
+
+ private Real getPosAA() {
+ final LivingSpace previous = tileArguments.getLivingSpaces().previous(getFirstLivingSpace());
+ if (previous == null) {
+ return tileArguments.getOrigin();
+ }
+ return previous.getPosD(tileArguments.getStringBounder());
+ }
+
+ private Real getPosZZ() {
+ final LivingSpace next = tileArguments.getLivingSpaces().next(getLastLivingSpace());
+ if (next == null) {
+ // return tileArguments.getMaxAbsolute();
+ return null;
+ }
+ return next.getPosB();
+ }
+
+ private LivingSpace getFirstLivingSpace() {
+ return tileArguments.getLivingSpace(getFirst2TOBEPRIVATE());
+ }
+
+ private LivingSpace getLastLivingSpace() {
+ return tileArguments.getLivingSpace(getLast2TOBEPRIVATE());
+ }
+
+ private Component getComponent() {
+ final ParticipantEnglober englober = getParticipantEnglober();
+ final ISkinParam s = englober.getBoxColor() == null ? tileArguments.getSkinParam() : new SkinParamBackcolored(
+ tileArguments.getSkinParam(), englober.getBoxColor());
+ return tileArguments.getSkin().createComponent(ComponentType.ENGLOBER, null, s, englober.getTitle());
+ }
+
+ public final ParticipantEnglober getParticipantEnglober() {
+ return participantEnglober;
+ }
+
+ public boolean contains(Participant p) {
+ return participants.contains(p);
+ }
+
+ public void add(Participant p) {
+ if (participants.contains(p)) {
+ throw new IllegalArgumentException();
+ }
+ participants.add(p);
+ }
+
+ @Override
+ public String toString() {
+ return "ParticipantEngloberContexted:" + participantEnglober.getTitle().toString() + " " + participants;
+ }
+
+ private double getPreferredWidth() {
+ return getComponent().getPreferredWidth(tileArguments.getStringBounder());
+ }
+
+ public double getPreferredHeight() {
+ final Component comp = tileArguments.getSkin().createComponent(ComponentType.ENGLOBER, null,
+ tileArguments.getSkinParam(), getParticipantEnglober().getTitle());
+ return comp.getPreferredHeight(tileArguments.getStringBounder());
+ }
+
+ public void drawEnglober(UGraphic ug, double height, Context2D context) {
+ final double x1 = getX1().getCurrentValue() - 4;
+ final double x2 = getX2().getCurrentValue() + 4;
+
+ final Dimension2DDouble dim = new Dimension2DDouble(x2 - x1, height);
+ getComponent().drawU(ug.apply(new UTranslate(x1, 1)), new Area(dim), context);
+ }
+
+ private Real getX2() {
+ return RealUtils.max(getPosD(), core2);
+ }
+
+ private Real getX1() {
+ return RealUtils.min(getPosB(), core1);
+ }
+
+ public void addInternalConstraints() {
+ getX1().ensureBiggerThan(getPosAA().addFixed(10));
+ final Real posZZ = getPosZZ();
+ final Real limit = getX2().addFixed(10);
+ if (posZZ != null) {
+ posZZ.ensureBiggerThan(limit);
+ }
+ }
+
+ public void addConstraintAfter(Englober current) {
+ current.getX1().ensureBiggerThan(getX2().addFixed(10));
+ }
+
+ public Real getMinX(StringBounder stringBounder) {
+ return getX1();
+ }
+
+ public Real getMaxX(StringBounder stringBounder) {
+ return getX2().addFixed(10);
+ }
+
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Event.java b/src/net/sourceforge/plantuml/sequencediagram/Event.java
index c128bbc..5de5adc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Event.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Event.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/EventWithDeactivate.java b/src/net/sourceforge/plantuml/sequencediagram/EventWithDeactivate.java
index 7d55aa0..4d8fcc0 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/EventWithDeactivate.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/EventWithDeactivate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java
index 21ae2a5..c61e971 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
index 9841962..4b97b1c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
index 6b0e8df..c52d628 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingType.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingType.java
index 7f8fe63..2bfc0dd 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingType.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/HSpace.java b/src/net/sourceforge/plantuml/sequencediagram/HSpace.java
index f7d3a7e..38c23f6 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/HSpace.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/HSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/InGroupable.java b/src/net/sourceforge/plantuml/sequencediagram/InGroupable.java
index 080189f..64343b3 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/InGroupable.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/InGroupable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/InGroupableList.java b/src/net/sourceforge/plantuml/sequencediagram/InGroupableList.java
index 57c9b2d..9d64587 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/InGroupableList.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/InGroupableList.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/LifeEvent.java b/src/net/sourceforge/plantuml/sequencediagram/LifeEvent.java
index a719f5a..4e12f3e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/LifeEvent.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/LifeEvent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,15 +34,15 @@
*/
package net.sourceforge.plantuml.sequencediagram;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SymbolContext;
public class LifeEvent extends AbstractEvent implements Event {
private final Participant p;
private final LifeEventType type;
- private final HtmlColor backcolor;
+ private final SymbolContext backcolor;
- public LifeEvent(Participant p, LifeEventType type, HtmlColor backcolor) {
+ public LifeEvent(Participant p, LifeEventType type, SymbolContext backcolor) {
this.p = p;
this.type = type;
this.backcolor = backcolor;
@@ -61,7 +61,7 @@ public class LifeEvent extends AbstractEvent implements Event {
return type;
}
- public HtmlColor getSpecificBackColor() {
+ public SymbolContext getSpecificColors() {
return backcolor;
}
@@ -77,10 +77,15 @@ public class LifeEvent extends AbstractEvent implements Event {
return type == LifeEventType.DEACTIVATE || type == LifeEventType.DESTROY;
}
+ @Deprecated
public boolean isDestroy() {
return type == LifeEventType.DESTROY;
}
+ public boolean isDestroy(Participant p) {
+ return this.p == p && type == LifeEventType.DESTROY;
+ }
+
// public double getStrangePos() {
// return message.getPosYendLevel();
// }
diff --git a/src/net/sourceforge/plantuml/sequencediagram/LifeEventType.java b/src/net/sourceforge/plantuml/sequencediagram/LifeEventType.java
index e606589..e309ba6 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/LifeEventType.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/LifeEventType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Message.java b/src/net/sourceforge/plantuml/sequencediagram/Message.java
index 69c7bb7..3900485 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Message.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Message.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/MessageExo.java b/src/net/sourceforge/plantuml/sequencediagram/MessageExo.java
index a950c75..1048b55 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/MessageExo.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/MessageExo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/MessageExoType.java b/src/net/sourceforge/plantuml/sequencediagram/MessageExoType.java
index 498aaef..be4d154 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/MessageExoType.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/MessageExoType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/MessageNumber.java b/src/net/sourceforge/plantuml/sequencediagram/MessageNumber.java
index bc7f460..5687ec5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/MessageNumber.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/MessageNumber.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Newpage.java b/src/net/sourceforge/plantuml/sequencediagram/Newpage.java
index e3760e5..0e91caf 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Newpage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Newpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Note.java b/src/net/sourceforge/plantuml/sequencediagram/Note.java
index ccad6ce..f56518d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Note.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Note.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,13 +35,13 @@
package net.sourceforge.plantuml.sequencediagram;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class Note extends AbstractEvent implements Event, SpecificBackcolorable {
@@ -53,6 +53,8 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
private final NotePosition position;
private NoteStyle style = NoteStyle.NORMAL;
+ // private Stereotype stereotype;
+
private final Url url;
public Note(Participant p, NotePosition position, Display strings) {
@@ -68,8 +70,9 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
this.p2 = p2;
this.position = position;
if (strings != null && strings.size() > 0) {
- final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.STRICT);
- this.url = urlBuilder.getUrl(strings.get(0).toString());
+ final UrlBuilder urlBuilder = new UrlBuilder(null, ModeUrl.AT_START);
+ final String s = strings.asStringWithHiddenNewLine();
+ this.url = urlBuilder.getUrl(s);
} else {
this.url = null;
}
@@ -77,7 +80,7 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
if (this.url == null) {
this.strings = strings;
} else {
- this.strings = strings.subList(1, strings.size());
+ this.strings = strings.removeUrlHiddenNewLineUrl();
}
}
@@ -97,14 +100,20 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
return position;
}
- private HtmlColor specificBackcolor;
-
- public HtmlColor getSpecificBackColor() {
- return specificBackcolor;
+ public Colors getColors(ISkinParam skinParam) {
+ return colors;
}
- public void setSpecificBackcolor(HtmlColor color) {
- this.specificBackcolor = color;
+ // public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ // if (color != null) {
+ // this.colors = colors.add(type, color);
+ // }
+ // }
+
+ private Colors colors = Colors.empty();
+
+ public void setColors(Colors colors) {
+ this.colors = colors;
}
public boolean dealWith(Participant someone) {
@@ -127,8 +136,18 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
this.style = style;
}
- public SkinParamBackcolored getSkinParamBackcolored(ISkinParam skinParam) {
- return new SkinParamBackcolored(skinParam, getSpecificBackColor());
+ public ISkinParam getSkinParamBackcolored(ISkinParam skinParam) {
+ // return new SkinParamBackcolored(skinParam, getColors(skinParam).getColor(ColorType.BACK));
+ return colors.mute(skinParam);
+ }
+
+ public void setStereotype(Stereotype stereotype) {
+ // this.stereotype = stereotype;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " " + strings;
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/NotePosition.java b/src/net/sourceforge/plantuml/sequencediagram/NotePosition.java
index 549f8d5..4066339 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/NotePosition.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/NotePosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java b/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java
index 1201068..f5a44e5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Notes.java b/src/net/sourceforge/plantuml/sequencediagram/Notes.java
index 51d26a0..8cae799 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Notes.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Notes.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.sequencediagram;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -63,4 +64,12 @@ public class Notes extends AbstractEvent implements Event, Iterable<Note> {
public Iterator<Note> iterator() {
return notes.iterator();
}
+
+ public Note get(int i) {
+ return notes.get(i);
+ }
+
+ public List<Note> asList() {
+ return Collections.unmodifiableList(notes);
+ }
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Participant.java b/src/net/sourceforge/plantuml/sequencediagram/Participant.java
index f514763..04d5ea7 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Participant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Participant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,9 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SymbolContext;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
public class Participant implements SpecificBackcolorable {
@@ -60,7 +63,7 @@ public class Participant implements SpecificBackcolorable {
if (code == null || code.length() == 0) {
throw new IllegalArgumentException();
}
- if (display == null || display.size() == 0) {
+ if (Display.isNull(display) || display.size() == 0) {
throw new IllegalArgumentException();
}
this.code = code;
@@ -110,25 +113,32 @@ public class Participant implements SpecificBackcolorable {
return initialLife;
}
- private HtmlColor liveBackcolor;
+ private SymbolContext liveBackcolors;
- public final void incInitialLife(HtmlColor backcolor) {
+ public final void incInitialLife(SymbolContext colors) {
initialLife++;
- this.liveBackcolor = backcolor;
+ this.liveBackcolors = colors;
}
- public HtmlColor getLiveSpecificBackColor() {
- return liveBackcolor;
+ public SymbolContext getLiveSpecificBackColors() {
+ return liveBackcolors;
}
- private HtmlColor specificBackcolor;
+ public Colors getColors(ISkinParam skinParam) {
+ return colors;
+ }
- public HtmlColor getSpecificBackColor() {
- return specificBackcolor;
+ public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ if (color != null) {
+ this.colors = colors.add(type, color);
+ }
}
- public void setSpecificBackcolor(HtmlColor color) {
- this.specificBackcolor = color;
+ private Colors colors = Colors.empty();
+
+
+ public void setColors(Colors colors) {
+ this.colors = colors;
}
private Url url;
@@ -150,7 +160,7 @@ public class Participant implements SpecificBackcolorable {
}
public SkinParamBackcolored getSkinParamBackcolored(ISkinParam skinParam) {
- HtmlColor specificBackColor = getSpecificBackColor();
+ HtmlColor specificBackColor = getColors(skinParam).getColor(ColorType.BACK);
final boolean clickable = getUrl() != null;
final HtmlColor stereoBackColor = skinParam.getHtmlColor(getBackgroundColorParam(), getStereotype(), clickable);
if (stereoBackColor != null && specificBackColor == null) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java b/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java
index 8dfc4ff..c1e37f2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java b/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java
index 001adc9..1ca4803 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/ParticipantType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Reference.java b/src/net/sourceforge/plantuml/sequencediagram/Reference.java
index b2e027e..21294ee 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Reference.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Reference.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
index 48d351c..9b7cd5f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,7 @@
*/
package net.sourceforge.plantuml.sequencediagram;
+import java.awt.geom.Dimension2D;
import java.io.IOException;
import java.io.OutputStream;
import java.text.DecimalFormat;
@@ -45,16 +46,20 @@ import java.util.List;
import java.util.Map;
import java.util.Stack;
+import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.OptionFlags;
+import net.sourceforge.plantuml.Scale;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.DiagramDescriptionImpl;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.sequencediagram.graphic.FileMaker;
import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramFileMakerPuma2;
import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramTxtMaker;
@@ -72,7 +77,8 @@ public class SequenceDiagram extends UmlDiagram {
private final Map<Participant, ParticipantEnglober> participantEnglobers2 = new HashMap<Participant, ParticipantEnglober>();
- private Skin skin = new ProtectedSkin(new Rose());
+ private final Skin skinInitial = new ProtectedSkin(new Rose());
+ private Skin skin2 = new ProtectedSkin(new Rose());
@Deprecated
public Participant getOrCreateParticipant(String code) {
@@ -99,7 +105,7 @@ public class SequenceDiagram extends UmlDiagram {
if (participants.containsKey(code)) {
throw new IllegalArgumentException();
}
- if (display == null) {
+ if (Display.isNull(display)) {
// display = Arrays.asList(code);
display = Display.getWithNewlines(code);
}
@@ -128,6 +134,7 @@ public class SequenceDiagram extends UmlDiagram {
}
public void addNote(Note n, boolean tryMerge) {
+ // this.lastEventWithDeactivate = null;
if (tryMerge && events.size() > 0) {
final Event last = events.get(events.size() - 1);
if (last instanceof Note) {
@@ -198,11 +205,15 @@ public class SequenceDiagram extends UmlDiagram {
return new SequenceDiagramTxtMaker(this, fileFormat);
}
- if (OptionFlags.FORCE_TEOZ || getPragma().useTeozLayout()) {
- return new SequenceDiagramFileMakerTeoz(this, skin, fileFormatOption);
+ if (modeTeoz()) {
+ return new SequenceDiagramFileMakerTeoz(this, getSkin2(), fileFormatOption);
}
- return new SequenceDiagramFileMakerPuma2(this, skin, fileFormatOption);
+ return new SequenceDiagramFileMakerPuma2(this, getSkin2(), fileFormatOption);
+ }
+
+ private boolean modeTeoz() {
+ return OptionFlags.FORCE_TEOZ || getPragma().useTeozLayout();
}
@Override
@@ -225,10 +236,14 @@ public class SequenceDiagram extends UmlDiagram {
private LifeEvent pendingCreate = null;
public String activate(Participant p, LifeEventType lifeEventType, HtmlColor backcolor) {
+ return activate(p, lifeEventType, backcolor, null);
+ }
+
+ public String activate(Participant p, LifeEventType lifeEventType, HtmlColor backcolor, HtmlColor linecolor) {
if (lastDelay != null) {
return "You cannot Activate/Deactivate just after a ...";
}
- final LifeEvent lifeEvent = new LifeEvent(p, lifeEventType, backcolor);
+ final LifeEvent lifeEvent = new LifeEvent(p, lifeEventType, new SymbolContext(backcolor, linecolor));
events.add(lifeEvent);
if (lifeEventType == LifeEventType.CREATE) {
pendingCreate = lifeEvent;
@@ -236,7 +251,7 @@ public class SequenceDiagram extends UmlDiagram {
}
if (lastEventWithDeactivate == null) {
if (lifeEventType == LifeEventType.ACTIVATE) {
- p.incInitialLife(backcolor);
+ p.incInitialLife(new SymbolContext(backcolor, linecolor));
return null;
}
return "Only activate command can occur before message are send";
@@ -263,6 +278,9 @@ public class SequenceDiagram extends UmlDiagram {
if (type != GroupingType.START && openGroupings.size() == 0) {
return false;
}
+ if (backColorGeneral == null) {
+ backColorGeneral = getSkinParam().getHtmlColor(ColorParam.sequenceGroupBodyBackground, null, false);
+ }
final GroupingStart top = openGroupings.size() > 0 ? openGroupings.get(0) : null;
@@ -289,32 +307,56 @@ public class SequenceDiagram extends UmlDiagram {
final Skin s = SkinUtils.loadSkin(className);
final Integer expected = new Integer(1);
if (s != null && expected.equals(s.getProtocolVersion())) {
- this.skin = new ProtectedSkin(s);
+ this.skin2 = new ProtectedSkin(s);
return true;
}
return false;
}
- public Skin getSkin() {
- return skin;
+ private Skin getSkin2() {
+ if (modeTeoz()) {
+ return skinInitial;
+ }
+ return skin2;
}
- private Integer messageNumber = null;
+ private boolean autonumber = false;
+ private int messageNumber;
private int incrementMessageNumber;
private DecimalFormat decimalFormat;
- public final void goAutonumber(int startingNumber, int increment, DecimalFormat decimalFormat) {
+ public final void autonumberGo(int startingNumber, int increment, DecimalFormat decimalFormat) {
+ this.autonumber = true;
this.messageNumber = startingNumber;
this.incrementMessageNumber = increment;
this.decimalFormat = decimalFormat;
}
+ public final void autonumberStop() {
+ this.autonumber = false;
+ }
+
+ public final void autonumberResume(DecimalFormat decimalFormat) {
+ this.autonumber = true;
+ if (decimalFormat != null) {
+ this.decimalFormat = decimalFormat;
+ }
+ }
+
+ public final void autonumberResume(int increment, DecimalFormat decimalFormat) {
+ this.autonumber = true;
+ this.incrementMessageNumber = increment;
+ if (decimalFormat != null) {
+ this.decimalFormat = decimalFormat;
+ }
+ }
+
public String getNextMessageNumber() {
- if (messageNumber == null) {
+ if (autonumber == false) {
return null;
}
- final Integer result = messageNumber;
+ final int result = messageNumber;
messageNumber += incrementMessageNumber;
return decimalFormat.format(result);
}
@@ -367,7 +409,12 @@ public class SequenceDiagram extends UmlDiagram {
@Override
public int getNbImages() {
- return getSequenceDiagramPngMaker(new FileFormatOption(FileFormat.PNG)).getNbPages();
+ try {
+ return getSequenceDiagramPngMaker(new FileFormatOption(FileFormat.PNG)).getNbPages();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return 1;
+ }
}
public void removeHiddenParticipants() {
@@ -430,7 +477,7 @@ public class SequenceDiagram extends UmlDiagram {
return true;
}
}
- if (getLegend() != null && getLegend().hasUrl()) {
+ if (DisplayPositionned.isNull(getLegend()) == false && getLegend().hasUrl()) {
return true;
}
return false;
@@ -448,4 +495,15 @@ public class SequenceDiagram extends UmlDiagram {
return true;
}
+ public double getDpiFactor(FileFormatOption fileFormatOption, Dimension2D dim) {
+ final double dpiFactor;
+ final Scale scale = getScale();
+ if (scale == null) {
+ dpiFactor = getDpiFactor(fileFormatOption);
+ } else {
+ dpiFactor = scale.getScale(dim.getWidth(), dim.getHeight());
+ }
+ return dpiFactor;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java
index 2fdc66b..f2534e2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,6 +49,8 @@ import net.sourceforge.plantuml.sequencediagram.command.CommandArrow;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutoNewpage;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutoactivate;
import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumber;
+import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberResume;
+import net.sourceforge.plantuml.sequencediagram.command.CommandAutonumberStop;
import net.sourceforge.plantuml.sequencediagram.command.CommandBoxEnd;
import net.sourceforge.plantuml.sequencediagram.command.CommandBoxStart;
import net.sourceforge.plantuml.sequencediagram.command.CommandDelay;
@@ -112,9 +114,9 @@ public class SequenceDiagramFactory extends UmlDiagramFactory {
final FactorySequenceNoteOnArrowCommand factorySequenceNoteOnArrowCommand = new FactorySequenceNoteOnArrowCommand();
cmds.add(factorySequenceNoteOnArrowCommand.createSingleLine());
- cmds.add(factorySequenceNoteCommand.createMultiLine());
- cmds.add(factorySequenceNoteOverSeveralCommand.createMultiLine());
- cmds.add(factorySequenceNoteOnArrowCommand.createMultiLine());
+ cmds.add(factorySequenceNoteCommand.createMultiLine(false));
+ cmds.add(factorySequenceNoteOverSeveralCommand.createMultiLine(false));
+ cmds.add(factorySequenceNoteOnArrowCommand.createMultiLine(false));
cmds.add(new CommandNewpage());
cmds.add(new CommandIgnoreNewpage());
@@ -125,6 +127,8 @@ public class SequenceDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandReferenceMultilinesOverSeveral());
cmds.add(new CommandSkin());
cmds.add(new CommandAutonumber());
+ cmds.add(new CommandAutonumberStop());
+ cmds.add(new CommandAutonumberResume());
cmds.add(new CommandAutoactivate());
cmds.add(new CommandFootbox());
cmds.add(new CommandDelay());
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
index 3d8b195..c96ab7f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,17 +36,19 @@ package net.sourceforge.plantuml.sequencediagram.command;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-import net.sourceforge.plantuml.StringUtils;
public class CommandActivate extends SingleLineCommand<SequenceDiagram> {
public CommandActivate() {
- super("(?i)^(activate|deactivate|destroy|create)[%s]+([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*(#\\w+)?$");
+ super(
+ "(?i)^(activate|deactivate|destroy|create)[%s]+([\\p{L}0-9_.@]+|[%g][^%g]+[%g])[%s]*(#\\w+)?(?:[%s]+(#\\w+))?$");
}
@Override
@@ -54,8 +56,9 @@ public class CommandActivate extends SingleLineCommand<SequenceDiagram> {
final LifeEventType type = LifeEventType.valueOf(StringUtils.goUpperCase(arg.get(0)));
final Participant p = diagram.getOrCreateParticipant(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get(1)));
- final String error = diagram.activate(p, type,
- diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(2)));
+ final HtmlColor backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(2));
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get(3));
+ final String error = diagram.activate(p, type, backColor, lineColor);
if (error == null) {
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate2.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate2.java
index 2214319..c3e0172 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
index 96357fc..764b7cd 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.sequencediagram.command;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@@ -168,7 +169,8 @@ public class CommandArrow extends SingleLineCommand2<SequenceDiagram> {
if (arg.get("MESSAGE", 0) == null) {
labels = Display.create("");
} else {
- labels = Display.getWithNewlines(arg.get("MESSAGE", 0));
+ final String message = UrlBuilder.multilineTooltip(arg.get("MESSAGE", 0));
+ labels = Display.getWithNewlines(message);
}
ArrowConfiguration config = hasDressing1 && hasDressing2 ? ArrowConfiguration.withDirectionBoth()
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoNewpage.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoNewpage.java
index e03dd9b..0596d93 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoNewpage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoactivate.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoactivate.java
index 32d8536..5f6e4c4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoactivate.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutoactivate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java
index 37f936c..f898974 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumber.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -66,7 +66,7 @@ public class CommandAutonumber extends SingleLineCommand<SequenceDiagram> {
return CommandExecutionResult.error("Error in pattern : " + df);
}
- sequenceDiagram.goAutonumber(start, inc, decimalFormat);
+ sequenceDiagram.autonumberGo(start, inc, decimalFormat);
return CommandExecutionResult.ok();
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java
new file mode 100644
index 0000000..e18c943
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberResume.java
@@ -0,0 +1,71 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.command;
+
+import java.text.DecimalFormat;
+import java.util.List;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+
+public class CommandAutonumberResume extends SingleLineCommand<SequenceDiagram> {
+
+ public CommandAutonumberResume() {
+ super("(?i)^autonumber[%s]*resume(?:[%s]+(\\d+))?(?:[%s]+[%g]([^%g]+)[%g])?[%s]*$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
+ final String df = arg.get(1);
+ DecimalFormat decimalFormat = null;
+ if (df != null) {
+ try {
+ decimalFormat = new DecimalFormat(df);
+ } catch (IllegalArgumentException e) {
+ return CommandExecutionResult.error("Error in pattern : " + df);
+ }
+ }
+
+ final String inc = arg.get(0);
+ if (inc == null) {
+ sequenceDiagram.autonumberResume(decimalFormat);
+ } else {
+ sequenceDiagram.autonumberResume(Integer.parseInt(arg.get(0)), decimalFormat);
+ }
+
+ return CommandExecutionResult.ok();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java
new file mode 100644
index 0000000..031046d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandAutonumberStop.java
@@ -0,0 +1,54 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.command;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+
+public class CommandAutonumberStop extends SingleLineCommand<SequenceDiagram> {
+
+ public CommandAutonumberStop() {
+ super("(?i)^autonumber[%s]*stop$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
+ sequenceDiagram.autonumberStop();
+ return CommandExecutionResult.ok();
+ }
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxEnd.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxEnd.java
index 8465258..36ca703 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxEnd.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxEnd.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java
index f899e7c..63688d1 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java
index d73165e..5746faa 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java
index 025dab6..0607bc9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
index 3ce2ebe..a6b57c8 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,11 +34,14 @@
*/
package net.sourceforge.plantuml.sequencediagram.command;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.MessageExoType;
import net.sourceforge.plantuml.sequencediagram.Participant;
@@ -47,7 +50,6 @@ import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDecoration;
import net.sourceforge.plantuml.skin.ArrowHead;
import net.sourceforge.plantuml.skin.ArrowPart;
-import net.sourceforge.plantuml.StringUtils;
abstract class CommandExoArrowAny extends SingleLineCommand2<SequenceDiagram> {
@@ -56,23 +58,23 @@ abstract class CommandExoArrowAny extends SingleLineCommand2<SequenceDiagram> {
}
@Override
- final protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, RegexResult arg2) {
- final String body = arg2.getLazzy("ARROW_BODYA", 0) + arg2.getLazzy("ARROW_BODYB", 0);
- final String dressing = arg2.getLazzy("ARROW_DRESSING", 0);
- final Participant p = sequenceDiagram.getOrCreateParticipant(StringUtils
- .eventuallyRemoveStartingAndEndingDoubleQuote(arg2.get("PARTICIPANT", 0)));
+ final protected CommandExecutionResult executeArg(SequenceDiagram diagram, RegexResult arg) {
+ final String body = arg.getLazzy("ARROW_BODYA", 0) + arg.getLazzy("ARROW_BODYB", 0);
+ final String dressing = arg.getLazzy("ARROW_DRESSING", 0);
+ final Participant p = diagram.getOrCreateParticipant(StringUtils
+ .eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("PARTICIPANT", 0)));
final boolean sync = dressing.length() == 2;
final boolean dotted = body.contains("--");
final Display labels;
- if (arg2.get("LABEL", 0) == null) {
+ if (arg.get("LABEL", 0) == null) {
labels = Display.create("");
} else {
- labels = Display.getWithNewlines(arg2.get("LABEL", 0));
+ labels = Display.getWithNewlines(arg.get("LABEL", 0));
}
- final boolean bothDirection = arg2.get("ARROW_BOTHDRESSING", 0) != null;
+ final boolean bothDirection = arg.get("ARROW_BOTHDRESSING", 0) != null;
ArrowConfiguration config = bothDirection ? ArrowConfiguration.withDirectionBoth() : ArrowConfiguration
.withDirectionNormal();
@@ -83,43 +85,56 @@ abstract class CommandExoArrowAny extends SingleLineCommand2<SequenceDiagram> {
config = config.withHead(ArrowHead.ASYNC);
}
config = config.withPart(getArrowPart(dressing));
- config = CommandArrow.applyStyle(arg2.getLazzy("ARROW_STYLE", 0), config);
- final MessageExoType messageExoType = getMessageExoType(arg2);
+ config = CommandArrow.applyStyle(arg.getLazzy("ARROW_STYLE", 0), config);
+ final MessageExoType messageExoType = getMessageExoType(arg);
if (messageExoType == MessageExoType.TO_RIGHT || messageExoType == MessageExoType.TO_LEFT) {
- if (containsSymbolExterior(arg2, "o")) {
+ if (containsSymbolExterior(arg, "o")) {
config = config.withDecoration2(ArrowDecoration.CIRCLE);
}
- if (containsSymbol(arg2, "o")) {
+ if (containsSymbol(arg, "o")) {
config = config.withDecoration1(ArrowDecoration.CIRCLE);
}
} else {
- if (containsSymbolExterior(arg2, "o")) {
+ if (containsSymbolExterior(arg, "o")) {
config = config.withDecoration1(ArrowDecoration.CIRCLE);
}
- if (containsSymbol(arg2, "o")) {
+ if (containsSymbol(arg, "o")) {
config = config.withDecoration2(ArrowDecoration.CIRCLE);
}
}
- if (containsSymbolExterior(arg2, "x") || containsSymbol(arg2, "x")) {
+ if (containsSymbolExterior(arg, "x") || containsSymbol(arg, "x")) {
config = config.withHead2(ArrowHead.CROSSX);
}
-// if (messageExoType.getDirection() == 1) {
-// if (containsSymbolExterior(arg2, "x") || containsSymbol(arg2, "x")) {
-// config = config.withHead2(ArrowHead.CROSSX);
-// }
-// } else {
-// if (containsSymbolExterior(arg2, "x") || containsSymbol(arg2, "x")) {
-// config = config.withHead2(ArrowHead.CROSSX);
-// }
-// }
-
- final String error = sequenceDiagram.addMessage(new MessageExo(p, messageExoType, labels, config,
- sequenceDiagram.getNextMessageNumber(), isShortArrow(arg2)));
+ // if (messageExoType.getDirection() == 1) {
+ // if (containsSymbolExterior(arg2, "x") || containsSymbol(arg2, "x")) {
+ // config = config.withHead2(ArrowHead.CROSSX);
+ // }
+ // } else {
+ // if (containsSymbolExterior(arg2, "x") || containsSymbol(arg2, "x")) {
+ // config = config.withHead2(ArrowHead.CROSSX);
+ // }
+ // }
+
+ final String error = diagram.addMessage(new MessageExo(p, messageExoType, labels, config, diagram
+ .getNextMessageNumber(), isShortArrow(arg)));
if (error != null) {
return CommandExecutionResult.error(error);
}
+
+ final HtmlColor activationColor = diagram.getSkinParam().getIHtmlColorSet()
+ .getColorIfValid(arg.get("LIFECOLOR", 0));
+
+ if (diagram.isAutoactivate() && (config.getHead() == ArrowHead.NORMAL || config.getHead() == ArrowHead.ASYNC)) {
+ if (config.isDotted()) {
+ diagram.activate(p, LifeEventType.DEACTIVATE, null);
+ } else {
+ diagram.activate(p, LifeEventType.ACTIVATE, activationColor);
+ }
+
+ }
+
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java
index e419541..eb71692 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowLeft.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java
index fbe168c..26a76d4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowRight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootbox.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootbox.java
index 2d932c8..03a44b4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootbox.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootbox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootboxOld.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootboxOld.java
index 3cf62c2..53dada5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootboxOld.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandFootboxOld.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
index 79c24e0..53fd6a3 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandHSpace.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandHSpace.java
index 92bbfdf..e40a5e7 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandHSpace.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandHSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandIgnoreNewpage.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandIgnoreNewpage.java
index 5ffa480..907363c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandIgnoreNewpage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandIgnoreNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java
index 8ef40bd..22d3086 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,7 +49,7 @@ public class CommandNewpage extends SingleLineCommand<SequenceDiagram> {
@Override
protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
- final Display strings = arg.get(0) == null ? null : Display.getWithNewlines(arg.get(0));
+ final Display strings = arg.get(0) == null ? Display.NULL : Display.getWithNewlines(arg.get(0));
sequenceDiagram.newpage(strings);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java
index 8c3d999..5d2c69c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,6 +49,7 @@ import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.ParticipantType;
@@ -74,7 +75,7 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
return CommandExecutionResult.ok();
}
- Display strings = null;
+ Display strings = Display.NULL;
if (arg.get("FULL", 0) != null) {
strings = Display.getWithNewlines(arg.get("FULL", 0));
}
@@ -100,12 +101,12 @@ public abstract class CommandParticipant extends SingleLineCommand2<SequenceDiag
if (stereotype != null) {
final ISkinParam skinParam = diagram.getSkinParam();
final boolean stereotypePositionTop = skinParam.stereotypePositionTop();
- final UFont font = skinParam.getFont(FontParam.CIRCLED_CHARACTER, null, false);
+ final UFont font = skinParam.getFont(null, false, FontParam.CIRCLED_CHARACTER);
participant.setStereotype(new Stereotype(stereotype, skinParam.getCircledCharacterRadius(), font, diagram
.getSkinParam().getIHtmlColorSet()), stereotypePositionTop);
}
participant
- .setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ .setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
final String urlString = arg.get("URL", 0);
if (urlString != null) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java
index 1acc19f..73f45b9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,7 @@ package net.sourceforge.plantuml.sequencediagram.command;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandParticipantA extends CommandParticipant {
@@ -56,7 +56,7 @@ public class CommandParticipantA extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java
index b3545c6..0b8d419 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,7 @@ package net.sourceforge.plantuml.sequencediagram.command;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandParticipantA2 extends CommandParticipant {
@@ -57,7 +57,7 @@ public class CommandParticipantA2 extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java
index 4c8d538..ffe7f32 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,7 @@ package net.sourceforge.plantuml.sequencediagram.command;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandParticipantA3 extends CommandParticipant {
@@ -56,7 +56,7 @@ public class CommandParticipantA3 extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java
index bf1032e..c73b345 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipantA4.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,7 @@ package net.sourceforge.plantuml.sequencediagram.command;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
public class CommandParticipantA4 extends CommandParticipant {
@@ -55,7 +55,7 @@ public class CommandParticipantA4 extends CommandParticipant {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ ColorParser.exp1(), //
new RegexLeaf("$"));
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java
index 4e0bd43..d756185 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,9 +37,11 @@ package net.sourceforge.plantuml.sequencediagram.command;
import java.util.ArrayList;
import java.util.List;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines;
import net.sourceforge.plantuml.cucadiagram.Display;
@@ -47,7 +49,6 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.Reference;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-import net.sourceforge.plantuml.StringUtils;
public class CommandReferenceMultilinesOverSeveral extends CommandMultilines<SequenceDiagram> {
@@ -61,8 +62,8 @@ public class CommandReferenceMultilinesOverSeveral extends CommandMultilines<Seq
return "(?i)^end[%s]?(ref)?$";
}
- public CommandExecutionResult execute(final SequenceDiagram diagram, List<String> lines) {
- final List<String> line0 = StringUtils.getSplit(getStartingPattern(), lines.get(0).trim());
+ public CommandExecutionResult execute(final SequenceDiagram diagram, BlocLines lines) {
+ final List<String> line0 = StringUtils.getSplit(getStartingPattern(), StringUtils.trin(lines.getFirst499()));
final HtmlColor backColorElement = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get(0));
// final HtmlColor backColorGeneral = HtmlColorSet.getInstance().getColorIfValid(line0.get(1));
@@ -72,7 +73,9 @@ public class CommandReferenceMultilinesOverSeveral extends CommandMultilines<Seq
p.add(diagram.getOrCreateParticipant(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(s)));
}
- Display strings = Display.create(lines.subList(1, lines.size() - 1)).removeEmptyColumns();
+ lines = lines.subExtract(1, 1);
+ lines = lines.removeEmptyColumns();
+ Display strings = lines.toDisplay();
Url u = null;
if (strings.size() > 0) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java
index 46e2821..193de18 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -75,7 +75,7 @@ public class CommandReferenceOverSeveral extends SingleLineCommand2<SequenceDiag
final List<String> participants = StringUtils.splitComma(arg.get("PARTS", 0));
final String url = arg.get("URL", 0);
final String title = arg.get("URL", 1);
- final String text = arg.get("TEXT", 0).trim();
+ final String text = StringUtils.trin(arg.get("TEXT", 0));
final List<Participant> p = new ArrayList<Participant>();
for (String s : participants) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java
index 5e9e278..88c48ef 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandSkin.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandSkin.java
index 5ba2ca4..a9a36e7 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandSkin.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandSkin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandUrl.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandUrl.java
index 8241f1d..797ffc2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandUrl.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandUrl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Arrow.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Arrow.java
index 08e215e..b3e056a 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Arrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Arrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndNoteBox.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndNoteBox.java
index 25c2361..9b9d00d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndNoteBox.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndNoteBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -90,7 +90,11 @@ class ArrowAndNoteBox extends Arrow implements InGroupable {
public double getPreferredWidth(StringBounder stringBounder) {
double w = arrow.getPreferredWidth(stringBounder);
w = Math.max(w, arrow.getActualWidth(stringBounder));
- return w + noteBox.getPreferredWidth(stringBounder);
+ double result = w + noteBox.getPreferredWidth(stringBounder);
+ if (noteBox.getNotePosition() == NotePosition.RIGHT) {
+ result += noteBox.getRightShift(arrow.getStartingY());
+ }
+ return result;
}
@Override
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
index 3944bb4..dd3ec22 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Constraint.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Constraint.java
index 4fa69d7..92ed838 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Constraint.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Constraint.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java
index 535fcc4..5cacf22 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
index fc2f0c0..8717d7d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,7 +53,7 @@ import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Newpage;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
-import net.sourceforge.plantuml.sequencediagram.ParticipantEngloberContexted;
+import net.sourceforge.plantuml.sequencediagram.Englober;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
@@ -139,7 +139,7 @@ public class DrawableSet {
public double getHeadAndEngloberHeight(Participant p, StringBounder stringBounder) {
final LivingParticipantBox box = participants.get(p);
final double height = box.getParticipantBox().getHeadHeight(stringBounder);
- final ParticipantEngloberContexted englober = getParticipantEnglober(p);
+ final Englober englober = getParticipantEnglober(p);
if (englober == null) {
return height;
}
@@ -149,9 +149,9 @@ public class DrawableSet {
return height + heightEnglober;
}
- public List<ParticipantEngloberContexted> getExistingParticipantEnglober() {
- final List<ParticipantEngloberContexted> result = new ArrayList<ParticipantEngloberContexted>();
- ParticipantEngloberContexted pending = null;
+ public List<Englober> getExistingParticipantEnglober() {
+ final List<Englober> result = new ArrayList<Englober>();
+ Englober pending = null;
for (Map.Entry<Participant, ParticipantEnglober> ent : participantEnglobers2.entrySet()) {
final ParticipantEnglober englober = ent.getValue();
if (englober == null) {
@@ -163,7 +163,7 @@ public class DrawableSet {
pending.add(ent.getKey());
continue;
}
- pending = new ParticipantEngloberContexted(englober, ent.getKey());
+ pending = new Englober(englober, ent.getKey(), getSkinParam(), skin);
result.add(pending);
}
return Collections.unmodifiableList(result);
@@ -171,7 +171,7 @@ public class DrawableSet {
public double getOffsetForEnglobers(StringBounder stringBounder) {
double result = 0;
- for (ParticipantEngloberContexted englober : getExistingParticipantEnglober()) {
+ for (Englober englober : getExistingParticipantEnglober()) {
final Component comp = skin.createComponent(ComponentType.ENGLOBER, null, skinParam, englober
.getParticipantEnglober().getTitle());
final double height = comp.getPreferredHeight(stringBounder);
@@ -239,26 +239,6 @@ public class DrawableSet {
return dimension;
}
- void drawU_REMOVEDME_4243(UGraphic ug, final double delta, double width, Page page, boolean showTail) {
-
- final UGraphic ugOrig = ug;
-
- final int height = (int) page.getHeight();
-
- ug = clipAndTranslate2(delta, width, page, ug);
- final SimpleContext2D context = new SimpleContext2D(true);
- this.drawPlaygroundU(ug, context);
- ug = ugOrig;
-
- this.drawEnglobers(ug, height - MARGIN_FOR_ENGLOBERS1, context);
-
- this.drawLineU_REMOVEDME_4243(ug, showTail, page);
- this.drawHeadTailU(ug, page, showTail ? height - getTailHeight(ug.getStringBounder(), true) : 0);
-
- ug = clipAndTranslate2(delta, width, page, ug);
- this.drawPlaygroundU(ug, new SimpleContext2D(false));
- }
-
void drawU22(final UGraphic ug, final double delta, double width, Page page, boolean showTail) {
// final UGraphic ugOrig = ug;
final double height = page.getHeight();
@@ -304,26 +284,6 @@ public class DrawableSet {
}
}
- private void drawLineU_REMOVEDME_4243(UGraphic ug, boolean showTail, Page page) {
- for (LivingParticipantBox box : getAllLivingParticipantBox()) {
- final double create = box.getCreate();
- final double startMin = page.getBodyRelativePosition() - box.magicMargin(ug.getStringBounder());
- // final double endMax = page.getHeight() - 1;
- final double endMax = startMin + page.getBodyHeight() + 2 * box.magicMargin(ug.getStringBounder());
- double start = startMin;
- if (create > 0) {
- if (create > page.getNewpage2()) {
- continue;
- }
- if (create >= page.getNewpage1() && create < page.getNewpage2()) {
- start += create - page.getNewpage1() + 2 * box.magicMargin(ug.getStringBounder());
- }
- }
- final double myDelta = page.getNewpage1() - page.getHeaderHeight();
- box.drawLineUTOBEREMOVED_4243(ug, start, endMax, showTail, myDelta);
- }
- }
-
private void drawHeadTailU(UGraphic ug, Page page, double positionTail) {
for (Map.Entry<Participant, LivingParticipantBox> ent : participants.entrySet()) {
final Participant p = ent.getKey();
@@ -368,7 +328,7 @@ public class DrawableSet {
}
private void drawEnglobers(UGraphic ug, double height, Context2D context) {
- for (ParticipantEngloberContexted englober : getExistingParticipantEnglober()) {
+ for (Englober englober : getExistingParticipantEnglober()) {
double x1 = getX1(englober);
final double x2 = getX2(ug.getStringBounder(), englober);
@@ -400,14 +360,14 @@ public class DrawableSet {
return skin.createComponent(ComponentType.ENGLOBER, null, s, englober.getTitle());
}
- public double getX1(ParticipantEngloberContexted englober) {
- final Participant first = englober.getFirst2();
+ public double getX1(Englober englober) {
+ final Participant first = englober.getFirst2TOBEPRIVATE();
final ParticipantBox firstBox = participants.get(first).getParticipantBox();
return firstBox.getStartingX() + 1;
}
- public double getX2(StringBounder stringBounder, ParticipantEngloberContexted englober) {
- final Participant last = englober.getLast2();
+ public double getX2(StringBounder stringBounder, Englober englober) {
+ final Participant last = englober.getLast2TOBEPRIVATE();
final ParticipantBox lastBox = participants.get(last).getParticipantBox();
return lastBox.getMaxX(stringBounder) - 1;
}
@@ -419,8 +379,8 @@ public class DrawableSet {
line.drawU(ug, getSkin(), skinParam);
}
- private ParticipantEngloberContexted getParticipantEnglober(Participant p) {
- for (ParticipantEngloberContexted pe : getExistingParticipantEnglober()) {
+ private Englober getParticipantEnglober(Participant p) {
+ for (Englober pe : getExistingParticipantEnglober()) {
if (pe.contains(p)) {
return pe;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
index 4d9d995..8e355e8 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.SkinParamBackcoloredReference;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Delay;
import net.sourceforge.plantuml.sequencediagram.Divider;
@@ -63,7 +64,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteStyle;
import net.sourceforge.plantuml.sequencediagram.Notes;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
-import net.sourceforge.plantuml.sequencediagram.ParticipantEngloberContexted;
+import net.sourceforge.plantuml.sequencediagram.Englober;
import net.sourceforge.plantuml.sequencediagram.ParticipantType;
import net.sourceforge.plantuml.sequencediagram.Reference;
import net.sourceforge.plantuml.skin.Component;
@@ -149,7 +150,7 @@ class DrawableSetInitializer {
final LivingParticipantBox living = drawableSet.getLivingParticipantBox(p);
for (int i = 0; i < p.getInitialLife(); i++) {
living.getLifeLine().addSegmentVariation(LifeSegmentVariation.LARGER,
- freeY2.getFreeY(getFullParticipantRange()), p.getLiveSpecificBackColor());
+ freeY2.getFreeY(getFullParticipantRange()), p.getLiveSpecificBackColors());
}
}
@@ -207,11 +208,13 @@ class DrawableSetInitializer {
}
private void takeParticipantEngloberTitleWidth3(StringBounder stringBounder) {
- for (ParticipantEngloberContexted pe : drawableSet.getExistingParticipantEnglober()) {
+ for (Englober pe : drawableSet.getExistingParticipantEnglober()) {
final double preferredWidth = drawableSet.getEngloberPreferedWidth(stringBounder,
pe.getParticipantEnglober());
- final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst2()).getParticipantBox();
- final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast2()).getParticipantBox();
+ final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst2TOBEPRIVATE())
+ .getParticipantBox();
+ final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast2TOBEPRIVATE())
+ .getParticipantBox();
final double x1 = drawableSet.getX1(pe);
final double x2 = drawableSet.getX2(stringBounder, pe);
final double missing = preferredWidth - (x2 - x1);
@@ -479,7 +482,7 @@ class DrawableSetInitializer {
pos = message.getPosYstartLevel() + delta1;
}
final LifeLine line1 = drawableSet.getLivingParticipantBox(lifeEvent.getParticipant()).getLifeLine();
- line1.addSegmentVariation(LifeSegmentVariation.LARGER, pos, lifeEvent.getSpecificBackColor());
+ line1.addSegmentVariation(LifeSegmentVariation.LARGER, pos, lifeEvent.getSpecificColors());
} else if (lifeEvent.getType() == LifeEventType.DESTROY || lifeEvent.getType() == LifeEventType.DEACTIVATE) {
double delta = 0;
if (OptionFlags.STRICT_SELFMESSAGE_POSITION && message != null && message.isSelfMessage()) {
@@ -491,7 +494,7 @@ class DrawableSetInitializer {
if (message != null) {
pos2 = message.getPosYendLevel() - delta;
}
- line.addSegmentVariation(LifeSegmentVariation.SMALLER, pos2, lifeEvent.getSpecificBackColor());
+ line.addSegmentVariation(LifeSegmentVariation.SMALLER, pos2, lifeEvent.getSpecificColors());
}
if (lifeEvent.getType() == LifeEventType.DESTROY) {
@@ -500,8 +503,14 @@ class DrawableSetInitializer {
final double delta = comp.getPreferredHeight(stringBounder) / 2;
final LivingParticipantBox livingParticipantBox = drawableSet.getLivingParticipantBox(lifeEvent
.getParticipant());
- final LifeDestroy destroy = new LifeDestroy(lifeEvent.getMessage().getPosYendLevel() - delta,
- livingParticipantBox.getParticipantBox(), comp);
+ double pos2 = y;
+ if (message == null) {
+ pos2 = y;
+ freeY2 = freeY2.add(comp.getPreferredHeight(stringBounder), range);
+ } else {
+ pos2 = message.getPosYendLevel() - delta;
+ }
+ final LifeDestroy destroy = new LifeDestroy(pos2, livingParticipantBox.getParticipantBox(), comp);
drawableSet.addEvent(lifeEvent, destroy);
} else {
drawableSet.addEvent(lifeEvent, new GraphicalElementLiveEvent(y));
@@ -590,7 +599,8 @@ class DrawableSetInitializer {
drawableSet.getSkinParam(), participantDisplay);
final Component delayLine = drawableSet.getSkin().createComponent(ComponentType.DELAY_LINE, null,
drawableSet.getSkinParam(), participantDisplay);
- final ParticipantBox box = new ParticipantBox(head, line, tail, delayLine, this.freeX);
+ final ParticipantBox box = new ParticipantBox(head, line, tail, delayLine, this.freeX,
+ skinParam.maxAsciiMessageLength() > 0 ? 1 : 5);
final Component comp = drawableSet.getSkin().createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null,
drawableSet.getSkinParam(), null);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FileMaker.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FileMaker.java
index 8fb5a18..c848b89 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FileMaker.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FileMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java
index 3a9d38b..58409d5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java
index 0d3ceca..b74cb48 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Frontier.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Frontier.java
index 09d1a1e..7375c02 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Frontier.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Frontier.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierComplex.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierComplex.java
index 1602d17..a7f2efc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierComplex.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierComplex.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierSimple.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierSimple.java
index 03546f9..98021b0 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierSimple.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStack.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStack.java
index a58ed13..6316cea 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStack.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStack.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStackImpl.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStackImpl.java
index ed5e97e..8bf04d8 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStackImpl.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/FrontierStackImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDelayText.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDelayText.java
index 1dbd01a..c341d55 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDelayText.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDelayText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java
index 95cee65..121af65 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElement.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElement.java
index 38e6f7f..0c91e86 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElement.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElementLiveEvent.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElementLiveEvent.java
index 5062308..6527472 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElementLiveEvent.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalElementLiveEvent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalHSpace.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalHSpace.java
index 7648a24..468b0e1 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalHSpace.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalHSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java
index b97c674..ae45437 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalReference.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalReference.java
index 86291d4..f330e33 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalReference.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalReference.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElement.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElement.java
index eeb7a09..6da544b 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElement.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElement.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementElse.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementElse.java
index 8a8531b..068847c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementElse.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementElse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java
index 0b7bac4..287b007 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementTail.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementTail.java
index 017b0ce..5ba67b5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementTail.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementTail.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/InGroupablesStack.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/InGroupablesStack.java
index bd34413..b6ee98d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/InGroupablesStack.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/InGroupablesStack.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Lazy.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Lazy.java
index 1010887..9e8f739 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Lazy.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Lazy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeDestroy.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeDestroy.java
index 166dcbf..0178da1 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeDestroy.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeDestroy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java
index 3401aa4..aeb99db 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,10 +40,13 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
+import net.sourceforge.plantuml.SkinParamForceColor;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Skin;
@@ -54,13 +57,13 @@ public class LifeLine {
static class Variation {
final private LifeSegmentVariation type;
- final private HtmlColor backcolor;
+ final private SymbolContext colors;
final private double y;
- Variation(LifeSegmentVariation type, double y, HtmlColor backcolor) {
+ Variation(LifeSegmentVariation type, double y, SymbolContext backcolor) {
this.type = type;
this.y = y;
- this.backcolor = backcolor;
+ this.colors = backcolor;
}
@Override
@@ -83,7 +86,7 @@ public class LifeLine {
this.shadowing = shadowing;
}
- public void addSegmentVariation(LifeSegmentVariation type, double y, HtmlColor backcolor) {
+ public void addSegmentVariation(LifeSegmentVariation type, double y, SymbolContext colors) {
if (events.size() > 0) {
final Variation last = events.get(events.size() - 1);
if (y < last.y) {
@@ -95,7 +98,7 @@ public class LifeLine {
// throw new IllegalArgumentException();
}
}
- events.add(new Variation(type, y, backcolor));
+ events.add(new Variation(type, y, colors));
final int currentLevel = type.apply(stairs.getLastValue());
stairs.addStep(y, currentLevel);
assert getLevel(y) == stairs.getValue(y);
@@ -180,10 +183,10 @@ public class LifeLine {
if (level == 0) {
final double y1 = events.get(i).y;
final double y2 = events.get(j).y;
- return new SegmentColored(y1, y2, events.get(i).backcolor, shadowing);
+ return new SegmentColored(y1, y2, events.get(i).colors, shadowing);
}
}
- return new SegmentColored(events.get(i).y, events.get(events.size() - 1).y, events.get(i).backcolor, shadowing);
+ return new SegmentColored(events.get(i).y, events.get(events.size() - 1).y, events.get(i).colors, shadowing);
}
private Collection<SegmentColored> getSegmentsCutted(StringBounder stringBounder, int i) {
@@ -203,7 +206,12 @@ public class LifeLine {
ComponentType type = ComponentType.ALIVE_BOX_CLOSE_OPEN;
for (final Iterator<SegmentColored> it = getSegmentsCutted(stringBounder, i).iterator(); it.hasNext();) {
final SegmentColored seg = it.next();
- final ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, seg.getSpecificBackColor());
+ ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, seg.getSpecificBackColor());
+ final HtmlColor specificLineColor = seg.getSpecificLineColor();
+ if (specificLineColor != null) {
+ skinParam2 = new SkinParamForceColor(skinParam2, ColorParam.sequenceLifeLineBorder,
+ specificLineColor);
+ }
if (it.hasNext() == false) {
type = type == ComponentType.ALIVE_BOX_CLOSE_OPEN ? ComponentType.ALIVE_BOX_CLOSE_CLOSE
: ComponentType.ALIVE_BOX_OPEN_CLOSE;
@@ -239,4 +247,11 @@ public class LifeLine {
public final boolean shadowing() {
return shadowing;
}
+
+ public SymbolContext getColors() {
+ if (events.size() == 0) {
+ return null;
+ }
+ return events.get(events.size() - 1).colors;
+ }
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeSegmentVariation.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeSegmentVariation.java
index aaa9ce6..de3ef1c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeSegmentVariation.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeSegmentVariation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/LivingParticipantBox.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/LivingParticipantBox.java
index 322f116..85dea87 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/LivingParticipantBox.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/LivingParticipantBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.sequencediagram.graphic;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -70,18 +71,8 @@ public class LivingParticipantBox implements InGroupable {
final double centerX = participantBox.getCenterX(stringBounder);
// Log.println("AZERTY " + y + " centerX=" + centerX + " left=" + left + " right=" + right);
// Log.println("Attention, null for segment");
- return new SegmentColored(centerX - left, centerX + right, null, lifeLine.shadowing());
- }
-
- public void drawLineUTOBEREMOVED_4243(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) {
- if (endingY <= startingY) {
- return;
- }
- final double destroy = lifeLine.getDestroy();
- if (destroy != 0 && destroy > startingY && destroy < endingY) {
- endingY = destroy;
- }
- participantBox.drawLineUTOBEREMOVED_4243(ug, startingY, endingY, showTail, myDelta);
+ final SymbolContext colors = lifeLine.getColors();
+ return new SegmentColored(centerX - left, centerX + right, colors, lifeLine.shadowing());
}
public void drawLineU22(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageArrow.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageArrow.java
index 73a9774..178791d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageArrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageExoArrow.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageExoArrow.java
index 18d500f..9fb8077 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageExoArrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageExoArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageSelfArrow.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageSelfArrow.java
index 6b92ece..c9bd36f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageSelfArrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/MessageSelfArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/NoteBox.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/NoteBox.java
index ca08c3d..5dd5747 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/NoteBox.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/NoteBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -75,6 +75,13 @@ final class NoteBox extends GraphicalElement implements InGroupable {
this.comp = comp;
}
+ public double getRightShift(double y) {
+ if (p1 == null) {
+ return 0;
+ }
+ return p1.getLifeLine().getRightShift(y) + 5;
+ }
+
@Override
final public double getPreferredWidth(StringBounder stringBounder) {
final double preferredWidth = comp.getPreferredWidth(stringBounder);
@@ -99,8 +106,8 @@ final class NoteBox extends GraphicalElement implements InGroupable {
final StringBounder stringBounder = ug.getStringBounder();
final double xStart = getStartingX(stringBounder);
ug = ug.apply(new UTranslate(xStart, getStartingY()));
- final Dimension2D dimensionToUse = new Dimension2DDouble(getPreferredWidth(stringBounder), comp
- .getPreferredHeight(stringBounder));
+ final Dimension2D dimensionToUse = new Dimension2DDouble(getPreferredWidth(stringBounder),
+ comp.getPreferredHeight(stringBounder));
if (url != null) {
ug.startUrl(url);
}
@@ -132,8 +139,8 @@ final class NoteBox extends GraphicalElement implements InGroupable {
private SegmentColored getSegment(StringBounder stringBounder) {
final SegmentColored segment = p1.getLiveThicknessAt(stringBounder, getStartingY());
- final SegmentColored segment2 = p1.getLiveThicknessAt(stringBounder, getStartingY()
- + comp.getPreferredHeight(stringBounder));
+ final SegmentColored segment2 = p1.getLiveThicknessAt(stringBounder,
+ getStartingY() + comp.getPreferredHeight(stringBounder));
return segment.merge(segment2);
}
@@ -157,4 +164,8 @@ final class NoteBox extends GraphicalElement implements InGroupable {
return url;
}
+ public NotePosition getNotePosition() {
+ return position;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/NotesBoxes.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/NotesBoxes.java
index 1800e36..7de97fd 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/NotesBoxes.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/NotesBoxes.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Page.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Page.java
index dcaba0a..aee5649 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Page.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Page.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/PageSplitter.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/PageSplitter.java
index 83488e3..6ceaef4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/PageSplitter.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/PageSplitter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java
index 3fa95f2..56f8d13 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,7 +52,7 @@ public class ParticipantBox implements Pushable {
private static int CPT = 0;
- private final int outMargin = 5;
+ private final int outMargin;
private double startingX;
@@ -63,7 +63,8 @@ public class ParticipantBox implements Pushable {
private int cpt = CPT++;
- public ParticipantBox(Component head, Component line, Component tail, Component delayLine, double startingX) {
+ public ParticipantBox(Component head, Component line, Component tail, Component delayLine, double startingX, int outMargin) {
+ this.outMargin = outMargin;
this.startingX = startingX;
this.head = head;
this.line = line;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBoxSimple.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBoxSimple.java
index c16f259..1439f59 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBoxSimple.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBoxSimple.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantRange.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantRange.java
index e76233d..d7801f3 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantRange.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantRange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Pushable.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Pushable.java
index e2fbff3..07909bf 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Pushable.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Pushable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Segment.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Segment.java
index 27ec32d..e1c1225 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Segment.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Segment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,7 +45,7 @@ public class Segment {
final private double pos1;
final private double pos2;
- Segment(double pos1, double pos2) {
+ public Segment(double pos1, double pos2) {
this.pos1 = pos1;
this.pos2 = pos2;
if (pos2 < pos1) {
@@ -106,11 +106,13 @@ public class Segment {
result2.add(new Segment(pendingStart, this.pos2));
return Collections.unmodifiableCollection(result2);
}
- if (this.contains(d) == false) {
- throw new IllegalStateException();
+ // if (this.contains(d) == false) {
+ // throw new IllegalStateException();
+ // }
+ if (this.contains(d)) {
+ result2.add(new Segment(pendingStart, d.pos1));
+ pendingStart = d.pos2;
}
- result2.add(new Segment(pendingStart, d.pos1));
- pendingStart = d.pos2;
}
result2.add(new Segment(pendingStart, this.pos2));
return Collections.unmodifiableCollection(result2);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java
index 341aad9..0422aed 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,7 @@ import java.util.Iterator;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.SimpleContext2D;
@@ -51,23 +52,33 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
class SegmentColored {
final private Segment segment;
- final private HtmlColor backcolor;
+ final private SymbolContext colors;
final private boolean shadowing;
final private double pos1Initial;
- SegmentColored(double pos1, double pos2, HtmlColor backcolor, boolean shadowing) {
- this(new Segment(pos1, pos2), backcolor, shadowing, pos1);
+ SegmentColored(double pos1, double pos2, SymbolContext colors, boolean shadowing) {
+ this(new Segment(pos1, pos2), colors, shadowing, pos1);
}
- private SegmentColored(Segment segment, HtmlColor backcolor, boolean shadowing, double pos1Initial) {
+ private SegmentColored(Segment segment, SymbolContext colors, boolean shadowing, double pos1Initial) {
this.segment = segment;
- this.backcolor = backcolor;
+ this.colors = colors;
this.shadowing = shadowing;
this.pos1Initial = pos1Initial;
}
public HtmlColor getSpecificBackColor() {
- return backcolor;
+ if (colors == null) {
+ return null;
+ }
+ return colors.getBackColor();
+ }
+
+ public HtmlColor getSpecificLineColor() {
+ if (colors == null) {
+ return null;
+ }
+ return colors.getForeColor();
}
@Override
@@ -104,7 +115,7 @@ class SegmentColored {
public SegmentColored merge(SegmentColored this2) {
final Segment merge = this.segment.merge(this2.segment);
- return new SegmentColored(merge, backcolor, shadowing, merge.getPos1());
+ return new SegmentColored(merge, colors, shadowing, merge.getPos1());
}
public final Segment getSegment() {
@@ -126,7 +137,7 @@ class SegmentColored {
}
public SegmentColored next() {
- return new SegmentColored(it.next(), backcolor, shadowing, pos1Initial);
+ return new SegmentColored(it.next(), colors, shadowing, pos1Initial);
}
public void remove() {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramArea.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramArea.java
index abcc008..73677e9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramArea.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramArea.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,7 +34,12 @@
*/
package net.sourceforge.plantuml.sequencediagram.graphic;
+import java.awt.geom.Dimension2D;
+
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.png.PngTitler;
+import net.sourceforge.plantuml.utils.MathUtils;
public class SequenceDiagramArea {
@@ -48,6 +53,9 @@ public class SequenceDiagramArea {
private double titleWidth;
private double titleHeight;
+ private double captionWidth;
+ private double captionHeight;
+
private double footerWidth;
private double footerHeight;
private double footerMargin;
@@ -57,9 +65,18 @@ public class SequenceDiagramArea {
this.sequenceHeight = height;
}
- public void setTitleArea(double titleWidth, double titleHeight) {
- this.titleWidth = titleWidth;
- this.titleHeight = titleHeight;
+ public void setTitleArea(double width, double height) {
+ this.titleWidth = width;
+ this.titleHeight = height;
+ }
+
+ private void setCaptionArea(double width, double height) {
+ this.captionWidth = width;
+ this.captionHeight = height;
+ }
+
+ public void setCaptionArea(Dimension2D dim) {
+ setCaptionArea(dim.getWidth(), dim.getHeight());
}
public void setHeaderArea(double headerWidth, double headerHeight, double headerMargin) {
@@ -75,21 +92,11 @@ public class SequenceDiagramArea {
}
public double getWidth() {
- double result = sequenceWidth;
- if (headerWidth > result) {
- result = headerWidth;
- }
- if (titleWidth > result) {
- result = titleWidth;
- }
- if (footerWidth > result) {
- result = footerWidth;
- }
- return result;
+ return MathUtils.max(sequenceWidth, headerWidth, titleWidth, footerWidth, captionWidth);
}
public double getHeight() {
- return sequenceHeight + headerHeight + headerMargin + titleHeight + footerMargin + footerHeight;
+ return sequenceHeight + headerHeight + headerMargin + titleHeight + footerMargin + footerHeight + captionHeight;
}
public double getTitleX() {
@@ -100,6 +107,14 @@ public class SequenceDiagramArea {
return headerHeight + headerMargin;
}
+ public double getCaptionX() {
+ return (getWidth() - captionWidth) / 2;
+ }
+
+ public double getCaptionY() {
+ return sequenceHeight + headerHeight + headerMargin + titleHeight;
+ }
+
public double getSequenceAreaX() {
return (getWidth() - sequenceWidth) / 2;
}
@@ -113,7 +128,7 @@ public class SequenceDiagramArea {
}
public double getFooterY() {
- return sequenceHeight + headerHeight + headerMargin + titleHeight + footerMargin;
+ return sequenceHeight + headerHeight + headerMargin + titleHeight + footerMargin + captionHeight;
}
public double getFooterX(HorizontalAlignment align) {
@@ -142,4 +157,18 @@ public class SequenceDiagramArea {
throw new IllegalStateException();
}
+ public void initFooter(PngTitler pngTitler) {
+ final Dimension2D dim = pngTitler.getTextDimension(TextBlockUtils.getDummyStringBounder());
+ if (dim != null) {
+ setFooterArea(dim.getWidth(), dim.getHeight(), 3);
+ }
+ }
+
+ public void initHeader(PngTitler pngTitler) {
+ final Dimension2D dim = pngTitler.getTextDimension(TextBlockUtils.getDummyStringBounder());
+ if (dim != null) {
+ setHeaderArea(dim.getWidth(), dim.getHeight(), 3);
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
index d79a8ea..20aef8d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,12 +42,14 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import net.sourceforge.plantuml.AnnotatedWorker;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -118,7 +120,8 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
for (Newpage n : newpages) {
positions.put(n, initializer.getYposition(dummyStringBounder, n));
}
- pages = create(drawableSet, positions, sequenceDiagram.isShowFootbox(), sequenceDiagram.getTitle()).getPages();
+ pages = create(drawableSet, positions, sequenceDiagram.isShowFootbox(), sequenceDiagram.getTitle().getDisplay())
+ .getPages();
}
public int getNbPages() {
@@ -145,7 +148,10 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
final SequenceDiagramArea area = new SequenceDiagramArea(fullDimension.getWidth(), page.getHeight());
final Component compTitle;
- if (page.getTitle() == null) {
+ final TextBlock caption = new AnnotatedWorker(diagram, diagram.getSkinParam()).getCaption();
+ area.setCaptionArea(caption.calculateDimension(dummyStringBounder));
+
+ if (Display.isNull(page.getTitle())) {
compTitle = null;
} else {
compTitle = drawableSet.getSkin().createComponent(ComponentType.TITLE, null, drawableSet.getSkinParam(),
@@ -153,17 +159,15 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
area.setTitleArea(compTitle.getPreferredWidth(dummyStringBounder),
compTitle.getPreferredHeight(dummyStringBounder));
}
- addFooter2(area);
- addHeader2(area);
-
- // final FileFormat fileFormat = fileFormatOption.getFileFormat();
+ area.initFooter(getPngTitler(FontParam.FOOTER));
+ area.initHeader(getPngTitler(FontParam.HEADER));
- final Display legend = diagram.getLegend();
+ final DisplayPositionned legend = diagram.getLegend();
final TextBlock legendBlock;
- if (legend == null) {
+ if (DisplayPositionned.isNull(legend)) {
legendBlock = TextBlockUtils.empty(0, 0);
} else {
- legendBlock = EntityImageLegend.create(legend, diagram.getSkinParam());
+ legendBlock = EntityImageLegend.create(legend.getDisplay(), diagram.getSkinParam());
}
final Dimension2D dimLegend = TextBlockUtils.getDimension(legendBlock);
@@ -173,8 +177,10 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
// System.err.println("dpiFactor=" + dpiFactor);
// System.err.println("scale=" + scale);
+ final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;
+
final ImageBuilder imageBuilder = new ImageBuilder(diagram.getSkinParam().getColorMapper(), oneOf(scale,
- dpiFactor), diagram.getSkinParam().getBackgroundColor(), null, null, 3, 10, diagram.getAnimation(),
+ dpiFactor), diagram.getSkinParam().getBackgroundColor(), metadata, null, 3, 10, diagram.getAnimation(),
diagram.getSkinParam().handwritten());
imageBuilder.addUDrawable(new UDrawable() {
@@ -197,11 +203,12 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
compTitle.drawU(ug.apply(new UTranslate(area.getTitleX(), area.getTitleY())), new Area(
new Dimension2DDouble(w, h)), new SimpleContext2D(false));
}
+ caption.drawU(ug.apply(new UTranslate(area.getCaptionX(), area.getCaptionY())));
final double delta1 = Math.max(0, dimLegend.getWidth() - area.getWidth());
- final boolean legendTop = legend != null
- && diagram.getLegendVerticalAlignment() == VerticalAlignment.TOP;
+ final boolean legendTop = DisplayPositionned.isNull(legend) == false
+ && legend.getVerticalAlignment() == VerticalAlignment.TOP;
double sequenceAreaY = area.getSequenceAreaY();
if (legendTop) {
@@ -210,14 +217,14 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
drawableSet.drawU22(ug.apply(new UTranslate(area.getSequenceAreaX() + delta1 / 2, sequenceAreaY)),
delta, fullDimension.getWidth(), page, diagram.isShowFootbox());
- addHeader3(area, ug);
- addFooter3(area, ug);
+ drawHeader(area, ug);
+ drawFooter(area, ug);
- if (legend != null) {
+ if (DisplayPositionned.isNull(legend) == false) {
final double delta2;
- if (diagram.getLegendAlignment() == HorizontalAlignment.LEFT) {
+ if (legend.getHorizontalAlignment() == HorizontalAlignment.LEFT) {
delta2 = 0;
- } else if (diagram.getLegendAlignment() == HorizontalAlignment.RIGHT) {
+ } else if (legend.getHorizontalAlignment() == HorizontalAlignment.RIGHT) {
delta2 = Math.max(0, area.getWidth() - dimLegend.getWidth());
} else {
delta2 = Math.max(0, area.getWidth() - dimLegend.getWidth()) / 2;
@@ -228,7 +235,27 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
}
});
- return imageBuilder.writeImageTOBEMOVED(fileFormatOption.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormatOption, os);
+ }
+
+ private void drawFooter(SequenceDiagramArea area, UGraphic ug) {
+ final PngTitler pngTitler = getPngTitler(FontParam.FOOTER);
+ final TextBlock text = pngTitler.getTextBlock();
+ if (text == null) {
+ return;
+ }
+ text.drawU(ug.apply(new UTranslate(area.getFooterX(diagram.getFooter().getHorizontalAlignment()), area
+ .getFooterY())));
+ }
+
+ private void drawHeader(SequenceDiagramArea area, UGraphic ug) {
+ final PngTitler pngTitler = getPngTitler(FontParam.HEADER);
+ final TextBlock text = pngTitler.getTextBlock();
+ if (text == null) {
+ return;
+ }
+ text.drawU(ug.apply(new UTranslate(area.getHeaderX(diagram.getHeader().getHorizontalAlignment()), area
+ .getHeaderY())));
}
private double oneOf(double a, double b) {
@@ -258,58 +285,14 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
return diagram.getScale().getScale(width, height);
}
- private void addFooter2(SequenceDiagramArea area) {
- final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
- final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.FOOTER, null);
- final String fontFamily = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getFamily(null);
- final int fontSize = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, diagram.getFooter(), fontSize, fontFamily,
- diagram.getFooterAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
- final Dimension2D dim = pngTitler.getTextDimension(dummyStringBounder);
- if (dim != null) {
- area.setFooterArea(dim.getWidth(), dim.getHeight(), 3);
- }
- }
-
- private void addHeader2(SequenceDiagramArea area) {
+ private PngTitler getPngTitler(final FontParam fontParam) {
final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
- final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.HEADER, null);
- final String fontFamily = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getFamily(null);
- final int fontSize = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, diagram.getHeader(), fontSize, fontFamily,
- diagram.getHeaderAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
- final Dimension2D dim = pngTitler.getTextDimension(dummyStringBounder);
- if (dim != null) {
- area.setHeaderArea(dim.getWidth(), dim.getHeight(), 3);
- }
- }
-
- private void addFooter3(SequenceDiagramArea area, UGraphic ug) {
- final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
- final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.FOOTER, null);
- final String fontFamily = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getFamily(null);
- final int fontSize = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, diagram.getFooter(), fontSize, fontFamily,
- diagram.getFooterAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
- final TextBlock text = pngTitler.getTextBlock();
- if (text == null) {
- return;
- }
- text.drawU(ug.apply(new UTranslate(area.getFooterX(diagram.getFooterAlignment()), area.getFooterY())));
- }
-
- private void addHeader3(SequenceDiagramArea area, UGraphic ug) {
- final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
- final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.HEADER, null);
- final String fontFamily = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getFamily(null);
- final int fontSize = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, diagram.getHeader(), fontSize, fontFamily,
- diagram.getHeaderAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
- final TextBlock text = pngTitler.getTextBlock();
- if (text == null) {
- return;
- }
- text.drawU(ug.apply(new UTranslate(area.getHeaderX(diagram.getHeaderAlignment()), area.getHeaderY())));
+ final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(null, fontParam);
+ final String fontFamily = diagram.getSkinParam().getFont(null, false, fontParam).getFamily(null);
+ final int fontSize = diagram.getSkinParam().getFont(null, false, fontParam).getSize();
+ return new PngTitler(titleColor, diagram.getFooterOrHeaderTeoz(fontParam).getDisplay(), fontSize, fontFamily,
+ diagram.getFooterOrHeaderTeoz(fontParam).getHorizontalAlignment(), hyperlinkColor, diagram
+ .getSkinParam().useUnderlineForHyperlink());
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
index b978489..8ea93b6 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Stairs.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Stairs.java
index 3330fe4..e4861d4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Stairs.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Stairs.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java
index 369c5d9..3b1167d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Abstract.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -82,17 +82,6 @@ abstract class Step1Abstract {
abstract Frontier prepareMessage(ConstraintSet constraintSet, InGroupablesStack groupingStructures);
- protected final Display getLabelOfMessage(AbstractMessage message) {
- if (message.getMessageNumber() == null) {
- return message.getLabel();
- }
- Display result = Display.empty();
- result = result.add(new MessageNumber(message.getMessageNumber()));
- result = result.addAll(message.getLabel());
- return result;
- }
-
-
protected final ArrowConfiguration getConfig() {
return config;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java
index 3d5d1ce..e78e92e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -64,7 +64,7 @@ class Step1Message extends Step1Abstract {
this.messageArrow = null;
} else {
final Component comp = drawingSet.getSkin().createComponent(ComponentType.ARROW, getConfig(),
- drawingSet.getSkinParam(), getLabelOfMessage(message));
+ drawingSet.getSkinParam(), message.getLabelNumbered());
final Component compAliveBox = drawingSet.getSkin().createComponent(ComponentType.ALIVE_BOX_OPEN_OPEN,
null, drawingSet.getSkinParam(), null);
@@ -190,7 +190,7 @@ class Step1Message extends Step1Abstract {
}
return new MessageSelfArrow(posY, getDrawingSet().getSkin(), getDrawingSet().getSkin().createComponent(
- ComponentType.ARROW, getConfig(), getDrawingSet().getSkinParam(), getLabelOfMessage(getMessage())),
+ ComponentType.ARROW, getConfig(), getDrawingSet().getSkinParam(), getMessage().getLabelNumbered()),
getLivingParticipantBox1(), deltaY, getMessage().getUrl(), deltaX);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java
index 08b1df9..b697d46 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1MessageExo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -57,7 +57,7 @@ class Step1MessageExo extends Step1Abstract {
this.messageArrow = new MessageExoArrow(freeY.getFreeY(range), drawingSet.getSkin(), drawingSet.getSkin()
.createComponent(ComponentType.ARROW, getConfig(), drawingSet.getSkinParam(),
- getLabelOfMessage(message)), getLivingParticipantBox(), message.getType(), message.getUrl(),
+ message.getLabelNumbered()), getLivingParticipantBox(), message.getType(), message.getUrl(),
message.isShortArrow(), message.getArrowConfiguration());
if (message.getNote() != null) {
@@ -109,16 +109,6 @@ class Step1MessageExo extends Step1Abstract {
return getDrawingSet().getLivingParticipantBox(((MessageExo) getMessage()).getParticipant());
}
- private Display getLabelOfMessage(MessageExo message) {
- if (message.getMessageNumber() == null) {
- return message.getLabel();
- }
- Display result = Display.empty();
- result = result.add(new MessageNumber(message.getMessageNumber()));
- result = result.addAll(message.getLabel());
- return result;
- }
-
private Arrow createArrow() {
if (getMessage().getNote() == null) {
return messageArrow;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java b/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java
index 16b69f8..f448082 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java
index b66f949..a55595d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java
index fbcb1a2..07cf227 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java
index ef2bf1e..b365f88 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java
index 4577f22..6388e27 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java
index fb2e07f..843dfca 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java b/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java
index 5850de1..1e8f067 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/Bordered.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/Bordered.java
new file mode 100644
index 0000000..43658e5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/Bordered.java
@@ -0,0 +1,44 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+
+public interface Bordered {
+
+ public double getBorder1();
+
+ public double getBorder2();
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java
index c1b9c86..8d1c405 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,13 +41,16 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
+import net.sourceforge.plantuml.sequencediagram.MessageExoType;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.ArrowComponent;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
+import net.sourceforge.plantuml.skin.ArrowDecoration;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.Skin;
+import net.sourceforge.plantuml.skin.rose.ComponentRoseArrow;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -57,21 +60,19 @@ public class CommunicationExoTile implements TileWithUpdateStairs {
private final MessageExo message;
private final Skin skin;
private final ISkinParam skinParam;
- private final Real alpha;
- private final Real omega;
+ private final TileArguments tileArguments;
public Event getEvent() {
return message;
}
public CommunicationExoTile(LivingSpace livingSpace, MessageExo message, Skin skin, ISkinParam skinParam,
- Real alpha, Real omega) {
+ TileArguments tileArguments) {
+ this.tileArguments = tileArguments;
this.livingSpace = livingSpace;
this.message = message;
this.skin = skin;
this.skinParam = skinParam;
- this.alpha = alpha;
- this.omega = omega;
}
private Component getComponent(StringBounder stringBounder) {
@@ -88,31 +89,75 @@ public class CommunicationExoTile implements TileWithUpdateStairs {
final StringBounder stringBounder = ug.getStringBounder();
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- final double x1 = getPoint1(stringBounder).getCurrentValue();
- final double x2 = getPoint2(stringBounder).getCurrentValue();
+ double x1 = getPoint1Value(stringBounder);
+ double x2 = getPoint2Value(stringBounder);
+ final int level = livingSpace.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ if (level > 0) {
+ if (message.getType().isRightBorder()) {
+ x1 += CommunicationTile.LIVE_DELTA_SIZE * level;
+ } else {
+ x2 += CommunicationTile.LIVE_DELTA_SIZE * (level - 2);
+ }
+ }
+
+ final ArrowConfiguration arrowConfiguration = message.getArrowConfiguration();
+ final MessageExoType type = message.getType();
+ if (arrowConfiguration.getDecoration1() == ArrowDecoration.CIRCLE && type == MessageExoType.FROM_LEFT) {
+ x1 += ComponentRoseArrow.diamCircle / 2 + 2;
+ }
+ if (arrowConfiguration.getDecoration2() == ArrowDecoration.CIRCLE && type == MessageExoType.TO_LEFT) {
+ x1 += ComponentRoseArrow.diamCircle / 2 + 2;
+ }
+ if (arrowConfiguration.getDecoration2() == ArrowDecoration.CIRCLE && type == MessageExoType.TO_RIGHT) {
+ x2 -= ComponentRoseArrow.diamCircle / 2 + 2;
+ }
+ if (arrowConfiguration.getDecoration1() == ArrowDecoration.CIRCLE && type == MessageExoType.FROM_RIGHT) {
+ x2 -= ComponentRoseArrow.diamCircle / 2 + 2;
+ }
+
final Area area = new Area(x2 - x1, dim.getHeight());
ug = ug.apply(new UTranslate(x1, 0));
comp.drawU(ug, area, (Context2D) ug);
}
+ private boolean isShortArrow() {
+ return message.isShortArrow();
+ }
+
public double getPreferredHeight(StringBounder stringBounder) {
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
return dim.getHeight();
}
+ private double getPreferredWidth(StringBounder stringBounder) {
+ final Component comp = getComponent(stringBounder);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ return dim.getWidth();
+ }
+
public void addConstraints(StringBounder stringBounder) {
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
final double width = dim.getWidth();
- final Real point1 = getPoint1(stringBounder);
- final Real point2 = getPoint2(stringBounder);
- if (point1.getCurrentValue() < point2.getCurrentValue()) {
- point2.ensureBiggerThan(point1.addFixed(width));
+ if (message.getType().isRightBorder()) {
+
} else {
- point1.ensureBiggerThan(point2.addFixed(width));
+ livingSpace.getPosC(stringBounder).ensureBiggerThan(tileArguments.getOrigin().addFixed(width));
}
+
+ // final Real point1 = getPoint1(stringBounder);
+ // if (message.getType().isRightBorder()) {
+ // final Real point2 = point1.addFixed(width);
+ // } else {
+ // final Real point2 = getPoint2(stringBounder);
+ // if (point1.getCurrentValue() < point2.getCurrentValue()) {
+ // point2.ensureBiggerThan(point1.addFixed(width));
+ // } else {
+ // point1.ensureBiggerThan(point2.addFixed(width));
+ // }
+ // }
}
public void updateStairs(StringBounder stringBounder, double y) {
@@ -128,14 +173,27 @@ public class CommunicationExoTile implements TileWithUpdateStairs {
if (message.getType().isRightBorder()) {
return livingSpace.getPosC(stringBounder);
}
- return alpha;
+ return tileArguments.getOrigin();
+ }
+
+ private double getPoint1Value(final StringBounder stringBounder) {
+ if (message.getType().isRightBorder()) {
+ return livingSpace.getPosC(stringBounder).getCurrentValue();
+ }
+ if (isShortArrow()) {
+ return getPoint2Value(stringBounder) - getPreferredWidth(stringBounder);
+ }
+ return tileArguments.getBorder1();
}
- private Real getPoint2(final StringBounder stringBounder) {
+ private double getPoint2Value(final StringBounder stringBounder) {
if (message.getType().isRightBorder()) {
- return omega;
+ if (isShortArrow()) {
+ return getPoint1Value(stringBounder) + getPreferredWidth(stringBounder);
+ }
+ return tileArguments.getBorder2();
}
- return livingSpace.getPosC(stringBounder);
+ return livingSpace.getPosC(stringBounder).getCurrentValue();
}
public Real getMinX(StringBounder stringBounder) {
@@ -143,7 +201,10 @@ public class CommunicationExoTile implements TileWithUpdateStairs {
}
public Real getMaxX(StringBounder stringBounder) {
- return getPoint2(stringBounder);
+ final Component comp = getComponent(stringBounder);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ final double width = dim.getWidth();
+ return getPoint1(stringBounder).addFixed(width);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java
index 9e70eb3..641f39b 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,9 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Message;
@@ -51,7 +53,7 @@ import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class CommunicationTile implements TileWithUpdateStairs {
+public class CommunicationTile implements TileWithUpdateStairs, TileWithCallbackY {
private final LivingSpace livingSpace1;
private final LivingSpace livingSpace2;
@@ -73,6 +75,10 @@ public class CommunicationTile implements TileWithUpdateStairs {
this.message = message;
this.skin = skin;
this.skinParam = skinParam;
+
+ if (message.isCreate()) {
+ livingSpace2.goCreate();
+ }
// for (LifeEvent lifeEvent : message.getLiveEvents()) {
// System.err.println("lifeEvent = " + lifeEvent);
// // livingSpace1.addLifeEvent(this, lifeEvent);
@@ -87,7 +93,10 @@ public class CommunicationTile implements TileWithUpdateStairs {
return true;
}
return false;
+ }
+ private boolean isCreate() {
+ return message.isCreate();
}
private Component getComponent(StringBounder stringBounder) {
@@ -99,7 +108,7 @@ public class CommunicationTile implements TileWithUpdateStairs {
arrowConfiguration = arrowConfiguration.reverse();
}
final Component comp = skin.createComponent(ComponentType.ARROW, arrowConfiguration, skinParam,
- message.getLabel());
+ message.getLabelNumbered());
return comp;
}
@@ -125,31 +134,47 @@ public class CommunicationTile implements TileWithUpdateStairs {
double x1 = getPoint1(stringBounder).getCurrentValue();
double x2 = getPoint2(stringBounder).getCurrentValue();
- final int level1 = livingSpace1.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
- final int level2 = livingSpace2.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
- // System.err.println("CommunicationTile::draw msg=" + message + " level1=" + level1 + " level2=" + level2);
-
final Area area;
if (isReverse(stringBounder)) {
- System.err.println("isreverse!");
- // x1 -= LIVE_DELTA_SIZE * level1;
+ final int level1 = livingSpace1.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ final int level2 = livingSpace2.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ if (level1 > 0) {
+ x1 -= LIVE_DELTA_SIZE;
+ }
x2 += LIVE_DELTA_SIZE * level2;
area = new Area(x1 - x2, dim.getHeight());
ug = ug.apply(new UTranslate(x2, 0));
+ if (isCreate()) {
+ livingSpace2.drawHead(ug, (Context2D) ug, VerticalAlignment.TOP, HorizontalAlignment.RIGHT);
+ }
} else {
+ final int level1 = livingSpace1.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ int level2 = livingSpace2.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ if (level2 > 0) {
+ level2 = level2 - 2;
+ }
x1 += LIVE_DELTA_SIZE * level1;
- x2 -= LIVE_DELTA_SIZE * level2;
+ x2 += LIVE_DELTA_SIZE * level2;
area = new Area(x2 - x1, dim.getHeight());
ug = ug.apply(new UTranslate(x1, 0));
+ if (isCreate()) {
+ livingSpace2.drawHead(ug.apply(new UTranslate(area.getDimensionToUse().getWidth(), 0)), (Context2D) ug,
+ VerticalAlignment.TOP, HorizontalAlignment.LEFT);
+ }
}
comp.drawU(ug, area, (Context2D) ug);
// ug.draw(new ULine(x2 - x1, 0));
+
}
public double getPreferredHeight(StringBounder stringBounder) {
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- return dim.getHeight();
+ double height = dim.getHeight();
+ if (isCreate()) {
+ height = Math.max(height, livingSpace2.getHeadPreferredDimension(stringBounder).getHeight());
+ }
+ return height;
}
public void addConstraints(StringBounder stringBounder) {
@@ -157,26 +182,25 @@ public class CommunicationTile implements TileWithUpdateStairs {
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
final double width = dim.getWidth();
- // if (isSelf()) {
- // final LivingSpace next = livingSpace1.getNext();
- // if (next != null) {
- // next.getPosB().ensureBiggerThan(getMaxX(stringBounder));
- // }
- // } else {
- final Real point1 = getPoint1(stringBounder);
- final Real point2 = getPoint2(stringBounder);
- if (point1.getCurrentValue() < point2.getCurrentValue()) {
- point2.ensureBiggerThan(point1.addFixed(width));
- } else {
+ Real point1 = getPoint1(stringBounder);
+ Real point2 = getPoint2(stringBounder);
+ if (isReverse(stringBounder)) {
+ final int level1 = livingSpace1.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ final int level2 = livingSpace2.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ if (level1 > 0) {
+ point1 = point1.addFixed(-LIVE_DELTA_SIZE);
+ }
+ point2 = point2.addFixed(level2 * LIVE_DELTA_SIZE);
point1.ensureBiggerThan(point2.addFixed(width));
- // }
+ } else {
+ final int level2 = livingSpace2.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ if (level2 > 0) {
+ point2 = point2.addFixed(-LIVE_DELTA_SIZE);
+ }
+ point2.ensureBiggerThan(point1.addFixed(width));
}
}
- // private boolean isSelf() {
- // return livingSpace1 == livingSpace2;
- // }
-
private Real getPoint1(final StringBounder stringBounder) {
return livingSpace1.getPosC(stringBounder);
}
@@ -199,16 +223,16 @@ public class CommunicationTile implements TileWithUpdateStairs {
}
public Real getMaxX(StringBounder stringBounder) {
- // if (isSelf()) {
- // final Component comp = getComponent(stringBounder);
- // final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- // final double width = dim.getWidth();
- // return livingSpace1.getPosC(stringBounder).addFixed(width);
- // }
if (isReverse(stringBounder)) {
return getPoint1(stringBounder);
}
return getPoint2(stringBounder);
}
+ public void callbackY(double y) {
+ if (message.isCreate()) {
+ livingSpace2.goCreate(y);
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
index cdf0d64..99f8768 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,7 +50,7 @@ import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
+public class CommunicationTileNoteLeft implements TileWithUpdateStairs, TileWithCallbackY {
private final TileWithUpdateStairs tile;
private final AbstractMessage message;
@@ -59,14 +59,13 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
private final Display notes;
// private final NotePosition notePosition;
private final LivingSpace livingSpace;
-
+
public Event getEvent() {
return message;
}
-
- public CommunicationTileNoteLeft(TileWithUpdateStairs tile, AbstractMessage message, Skin skin, ISkinParam skinParam,
- LivingSpace livingSpace) {
+ public CommunicationTileNoteLeft(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
+ ISkinParam skinParam, LivingSpace livingSpace) {
this.tile = tile;
this.message = message;
this.skin = skin;
@@ -75,14 +74,14 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
// this.notePosition = message.getNotePosition();
this.livingSpace = livingSpace;
}
-
+
public void updateStairs(StringBounder stringBounder, double y) {
tile.updateStairs(stringBounder, y);
}
-
private Component getComponent(StringBounder stringBounder) {
- final Component comp = skin.createComponent(ComponentType.NOTE, null, message.getSkinParamNoteBackcolored(skinParam), notes);
+ final Component comp = skin.createComponent(ComponentType.NOTE, null,
+ message.getSkinParamNoteBackcolored(skinParam), notes);
return comp;
}
@@ -121,4 +120,10 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
return tile.getMaxX(stringBounder);
}
+ public void callbackY(double y) {
+ if (tile instanceof TileWithCallbackY) {
+ ((TileWithCallbackY) tile).callbackY(y);
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
index 87a6508..bcad7f2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,20 +50,23 @@ import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class CommunicationTileNoteRight implements TileWithUpdateStairs {
+public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWithCallbackY {
private final TileWithUpdateStairs tile;
private final AbstractMessage message;
private final Skin skin;
private final ISkinParam skinParam;
private final Display notes;
- // private final NotePosition notePosition;
private final LivingSpace livingSpace;
public Event getEvent() {
return message;
}
+ private boolean isCreate() {
+ return message.isCreate();
+ }
+
public CommunicationTileNoteRight(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
ISkinParam skinParam, LivingSpace livingSpace) {
this.tile = tile;
@@ -71,7 +74,6 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs {
this.skin = skin;
this.skinParam = skinParam;
this.notes = message.getNote();
- // this.notePosition = message.getNotePosition();
this.livingSpace = livingSpace;
}
@@ -86,9 +88,13 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs {
}
private Real getNotePosition(StringBounder stringBounder) {
- final Component comp = getComponent(stringBounder);
- final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- return livingSpace.getPosC(stringBounder);
+ // final Component comp = getComponent(stringBounder);
+ // final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ if (isCreate()) {
+ return livingSpace.getPosD(stringBounder);
+ }
+ final int level = livingSpace.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ return livingSpace.getPosC(stringBounder).addFixed(level * CommunicationTile.LIVE_DELTA_SIZE);
}
public void drawU(UGraphic ug) {
@@ -122,4 +128,10 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs {
return getNotePosition(stringBounder).addFixed(dim.getWidth());
}
+ public void callbackY(double y) {
+ if (tile instanceof TileWithCallbackY) {
+ ((TileWithCallbackY) tile).callbackY(y);
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java
index a846280..c76c87e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -89,7 +89,7 @@ public class CommunicationTileSelf implements TileWithUpdateStairs {
ArrowConfiguration arrowConfiguration = message.getArrowConfiguration();
arrowConfiguration = arrowConfiguration.self();
final Component comp = skin.createComponent(ComponentType.ARROW, arrowConfiguration, skinParam,
- message.getLabel());
+ message.getLabelNumbered());
return comp;
}
@@ -153,7 +153,7 @@ public class CommunicationTileSelf implements TileWithUpdateStairs {
final LivingSpace next = getNext();
if (next != null) {
- next.getPosB().ensureBiggerThan(getMaxX(stringBounder));
+ next.getPosC(stringBounder).ensureBiggerThan(getMaxX(stringBounder));
}
}
@@ -183,7 +183,7 @@ public class CommunicationTileSelf implements TileWithUpdateStairs {
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
final double width = dim.getWidth();
- return livingSpace1.getPosC(stringBounder).addFixed(width);
+ return livingSpace1.getPosC2(stringBounder).addFixed(width);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
index ec561b7..3fda1bc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/ComponentAdapter.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/ComponentAdapter.java
new file mode 100644
index 0000000..ebfe69f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/ComponentAdapter.java
@@ -0,0 +1,73 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+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.SimpleContext2D;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class ComponentAdapter extends AbstractTextBlock implements TextBlock {
+
+ private final Component component;
+
+ public ComponentAdapter(Component component) {
+ this.component = component;
+ }
+
+ public void drawU(UGraphic ug) {
+ if (component == null) {
+ return;
+ }
+ component.drawU(ug, new Area(calculateDimension(ug.getStringBounder())), new SimpleContext2D(false));
+
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ if (component == null) {
+ return new Dimension2DDouble(0, 0);
+ }
+ final double width = component.getPreferredWidth(stringBounder);
+ final double height = component.getPreferredHeight(stringBounder);
+ return new Dimension2DDouble(width, height);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java
index e685861..1a3018c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,27 +38,32 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealUtils;
import net.sourceforge.plantuml.sequencediagram.Delay;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
-import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class DelayTile implements Tile {
+public class DelayTile implements Tile, TileWithCallbackY {
private final Delay delay;
private final TileArguments tileArguments;
- private Real first;
- private Real last;
-
+ // private Real first;
+ // private Real last;
+ private Real middle;
+ private double y;
+
public Event getEvent() {
return delay;
}
+ public void callbackY(double y) {
+ this.y = y;
+ }
public DelayTile(Delay delay, TileArguments tileArguments) {
this.delay = delay;
@@ -66,14 +71,13 @@ public class DelayTile implements Tile {
}
private void init(StringBounder stringBounder) {
- if (first != null) {
+ if (middle != null) {
return;
}
- this.first = tileArguments.getFirstLivingSpace().getPosC(stringBounder);
+ final Real first = tileArguments.getFirstLivingSpace().getPosC(stringBounder);
final Component comp = getComponent(stringBounder);
- final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- this.last = tileArguments.getLastLivingSpace().getPosC(stringBounder).addAtLeast(0);
- this.last.ensureBiggerThan(this.first.addFixed(dim.getWidth()));
+ final Real last = tileArguments.getLastLivingSpace().getPosC(stringBounder);
+ this.middle = RealUtils.middle(first, last);
}
@@ -83,14 +87,21 @@ public class DelayTile implements Tile {
return comp;
}
+ private double getPreferredWidth(StringBounder stringBounder) {
+ final Component comp = getComponent(stringBounder);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ return dim.getWidth();
+ }
+
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
init(stringBounder);
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- final Area area = new Area(last.getCurrentValue() - first.getCurrentValue(), dim.getHeight());
+ final Area area = new Area(getPreferredWidth(stringBounder), dim.getHeight());
+ tileArguments.getLivingSpaces().delayOn(y, dim.getHeight());
- ug = ug.apply(new UTranslate(first.getCurrentValue(), 0));
+ ug = ug.apply(new UTranslate(getMinX(stringBounder).getCurrentValue(), 0));
comp.drawU(ug, area, (Context2D) ug);
}
@@ -105,22 +116,22 @@ public class DelayTile implements Tile {
public Real getMinX(StringBounder stringBounder) {
init(stringBounder);
- return this.first;
+ return this.middle.addFixed(-getPreferredWidth(stringBounder) / 2);
}
public Real getMaxX(StringBounder stringBounder) {
init(stringBounder);
- return this.last;
+ return this.middle.addFixed(getPreferredWidth(stringBounder) / 2);
}
-// private double startingY;
-//
-// public void setStartingY(double startingY) {
-// this.startingY = startingY;
-// }
-//
-// public double getStartingY() {
-// return startingY;
-// }
+ // private double startingY;
+ //
+ // public void setStartingY(double startingY) {
+ // this.startingY = startingY;
+ // }
+ //
+ // public double getStartingY() {
+ // return startingY;
+ // }
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java
index d01f7af..bccb262 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,7 +45,6 @@ import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
-import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -55,19 +54,18 @@ public class DividerTile implements Tile {
private final ISkinParam skinParam;
private final Divider divider;
private final Real origin;
- private final Real omega;
-
+ private final TileArguments tileArguments;
+
public Event getEvent() {
return divider;
}
-
- public DividerTile(Divider divider, Skin skin, ISkinParam skinParam, Real origin, Real omega) {
+ public DividerTile(Divider divider, TileArguments tileArguments) {
+ this.tileArguments = tileArguments;
this.divider = divider;
- this.skin = skin;
- this.skinParam = skinParam;
- this.origin = origin;
- this.omega = omega;
+ this.skin = tileArguments.getSkin();
+ this.skinParam = tileArguments.getSkinParam();
+ this.origin = tileArguments.getOrigin();
}
private Component getComponent(StringBounder stringBounder) {
@@ -79,7 +77,7 @@ public class DividerTile implements Tile {
final StringBounder stringBounder = ug.getStringBounder();
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- final Area area = new Area(omega.getCurrentValue() - origin.getCurrentValue(), dim.getHeight());
+ final Area area = new Area(tileArguments.getBorder2() - origin.getCurrentValue(), dim.getHeight());
// ug = ug.apply(new UTranslate(x, 0));
comp.drawU(ug, area, (Context2D) ug);
@@ -102,7 +100,9 @@ public class DividerTile implements Tile {
}
public Real getMaxX(StringBounder stringBounder) {
- return omega;
+ final Component comp = getComponent(stringBounder);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ return origin.addFixed(dim.getWidth());
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/ElseTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/ElseTile.java
index 8032c36..f134bd5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/ElseTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/ElseTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,32 +37,28 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
-import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
-import net.sourceforge.plantuml.skin.Context2D;
-import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class ElseTile implements Tile {
+public class ElseTile implements TileWithCallbackY {
private final Skin skin;
private final ISkinParam skinParam;
private final GroupingLeaf anElse;
private final Tile parent;
-
+
public Event getEvent() {
return anElse;
}
-
public ElseTile(GroupingLeaf anElse, Skin skin, ISkinParam skinParam, Tile parent) {
this.anElse = anElse;
this.skin = skin;
@@ -70,22 +66,32 @@ public class ElseTile implements Tile {
this.parent = parent;
}
- private Component getComponent(StringBounder stringBounder) {
- final Display display = Display.create(anElse.getTitle());
- final Component comp = skin.createComponent(ComponentType.GROUPING_ELSE, null, skinParam, display);
+ public Component getComponent(StringBounder stringBounder) {
+ // final Display display = Display.create(anElse.getTitle());
+ final ISkinParam tmp = new SkinParamBackcolored(skinParam, anElse.getBackColorElement(),
+ anElse.getBackColorGeneral());
+
+ final Display display = Display.create(anElse.getComment());
+ final Component comp = skin.createComponent(ComponentType.GROUPING_ELSE, null, tmp, display);
return comp;
}
public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final Component comp = getComponent(stringBounder);
- final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- final Real min = getMinX(stringBounder);
- final Real max = getMaxX(stringBounder);
- final Area area = new Area(max.getCurrentValue() - min.getCurrentValue(), dim.getHeight());
- ug = ug.apply(new UTranslate(min.getCurrentValue(), 0));
- // ug = ug.apply(new UTranslate(x, 0));
- comp.drawU(ug, area, (Context2D) ug);
+ // final StringBounder stringBounder = ug.getStringBounder();
+ // final Component comp = getComponent(stringBounder);
+ // final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ // final Real min = getMinX(stringBounder);
+ // final Real max = getMaxX(stringBounder);
+ // final Context2D context = (Context2D) ug;
+ // double height = dim.getHeight();
+ // // if (context.isBackground() && parent instanceof GroupingTile) {
+ // // final double startingY = ((GroupingTile) parent).getStartY();
+ // // final double totalParentHeight = parent.getPreferredHeight(stringBounder);
+ // // height = totalParentHeight - (startingY - y);
+ // // }
+ // final Area area = new Area(max.getCurrentValue() - min.getCurrentValue(), height);
+ // ug = ug.apply(new UTranslate(min.getCurrentValue(), 0));
+ // comp.drawU(ug, area, context);
}
public double getPreferredHeight(StringBounder stringBounder) {
@@ -105,7 +111,19 @@ public class ElseTile implements Tile {
}
public Real getMaxX(StringBounder stringBounder) {
- return parent.getMaxX(stringBounder);
+ final Component comp = getComponent(stringBounder);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ return getMinX(stringBounder).addFixed(dim.getWidth());
+ }
+
+ private double y;
+
+ public void callbackY(double y) {
+ this.y = y;
+ }
+
+ public double getCallbackY() {
+ return y;
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/EmptyTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/EmptyTile.java
new file mode 100644
index 0000000..0308b7b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/EmptyTile.java
@@ -0,0 +1,93 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.sequencediagram.Event;
+import net.sourceforge.plantuml.sequencediagram.Participant;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class EmptyTile implements Tile {
+
+ private final double height;
+
+ private final Real origin;
+
+ public EmptyTile(double height, TileArguments tileArguments) {
+ this.origin = tileArguments.getOrigin();
+ this.height = height;
+ }
+
+ public void drawU(UGraphic ug) {
+ }
+
+ public double getPreferredHeight(StringBounder stringBounder) {
+ return height;
+ }
+
+ public void addConstraints(StringBounder stringBounder) {
+ }
+
+ public Real getMinX(StringBounder stringBounder) {
+ return origin;
+ }
+
+ public Real getMaxX(StringBounder stringBounder) {
+ return origin;
+ }
+
+ public Event getEvent() {
+ return new Event() {
+ public boolean dealWith(Participant someone) {
+ return false;
+ }
+
+ public Url getUrl() {
+ return null;
+ }
+
+ public boolean hasUrl() {
+ return false;
+ }
+
+ public boolean isParallel() {
+ return false;
+ }
+ };
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java
new file mode 100644
index 0000000..c1cbab4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/Englobers.java
@@ -0,0 +1,125 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealUtils;
+import net.sourceforge.plantuml.sequencediagram.Englober;
+import net.sourceforge.plantuml.sequencediagram.Participant;
+import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
+import net.sourceforge.plantuml.skin.Context2D;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class Englobers {
+
+ private final List<Englober> englobers = new ArrayList<Englober>();
+
+ public Englobers(TileArguments tileArguments) {
+ Englober pending = null;
+ for (Participant p : tileArguments.getLivingSpaces().participants()) {
+ final ParticipantEnglober englober = tileArguments.getLivingSpaces().get(p).getEnglober();
+ if (englober == null) {
+ pending = null;
+ continue;
+ }
+ assert englober != null;
+ if (pending != null && englober == pending.getParticipantEnglober()) {
+ pending.add(p);
+ continue;
+ }
+ pending = new Englober(englober, p, tileArguments);
+ englobers.add(pending);
+ }
+ }
+
+ public int size() {
+ return englobers.size();
+ }
+
+ public double getOffsetForEnglobers(StringBounder stringBounder) {
+ double result = 0;
+ for (Englober englober : englobers) {
+ final double height = englober.getPreferredHeight();
+ if (height > result) {
+ result = height;
+ }
+ }
+ return result;
+ }
+
+ public void addConstraints(StringBounder stringBounder) {
+ Englober last = null;
+ for (Englober current : englobers) {
+ current.addInternalConstraints();
+ if (last != null) {
+ last.addConstraintAfter(current);
+ }
+ last = current;
+ }
+ }
+
+ public void drawEnglobers(UGraphic ug, double height, Context2D context) {
+ for (Englober englober : englobers) {
+ englober.drawEnglober(ug, height, context);
+ }
+ }
+
+ public Real getMinX(StringBounder stringBounder) {
+ if (size() == 0) {
+ throw new IllegalStateException();
+ }
+ final List<Real> all = new ArrayList<Real>();
+ for (Englober englober : englobers) {
+ all.add(englober.getMinX(stringBounder));
+ }
+ return RealUtils.min(all);
+ }
+
+ public Real getMaxX(StringBounder stringBounder) {
+ if (size() == 0) {
+ throw new IllegalStateException();
+ }
+ final List<Real> all = new ArrayList<Real>();
+ for (Englober englober : englobers) {
+ all.add(englober.getMaxX(stringBounder));
+ }
+ return RealUtils.max(all);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistory.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistory.java
index 4b566e1..34554d9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistory.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,7 +39,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SymbolContext;
+import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.LifeEvent;
import net.sourceforge.plantuml.sequencediagram.Message;
@@ -86,11 +87,11 @@ public class EventsHistory {
}
}
if (event == current) {
- if (current instanceof Message) {
+ if (current instanceof AbstractMessage) {
final Event next = nextButSkippingNotes(it);
if (next instanceof LifeEvent) {
final LifeEvent le = (LifeEvent) next;
- final Message msg = (Message) current;
+ final AbstractMessage msg = (AbstractMessage) current;
if (mode != EventsHistoryMode.IGNORE_FUTURE_ACTIVATE && le.isActivate() && msg.dealWith(p)
&& le.getParticipant() == p) {
level++;
@@ -103,6 +104,9 @@ public class EventsHistory {
}
}
+ if (level < 0) {
+ return 0;
+ }
// System.err.println("<-result1 is " + level);
return level;
}
@@ -121,7 +125,7 @@ public class EventsHistory {
final Event next = nextButSkippingNotes(it);
if (next instanceof LifeEvent) {
final LifeEvent le = (LifeEvent) next;
- return le.isDestroy();
+ return le.isDestroy(p);
}
}
return false;
@@ -129,7 +133,7 @@ public class EventsHistory {
return false;
}
- private HtmlColor getActivateColor(Event event) {
+ private SymbolContext getActivateColor(Event event) {
for (Iterator<Event> it = events.iterator(); it.hasNext();) {
final Event current = it.next();
if (event != current) {
@@ -140,7 +144,7 @@ public class EventsHistory {
if (next instanceof LifeEvent) {
final LifeEvent le = (LifeEvent) next;
if (le.isActivate()) {
- return le.getSpecificBackColor();
+ return le.getSpecificColors();
}
return null;
}
@@ -164,23 +168,44 @@ public class EventsHistory {
}
}
- public Stairs2 getStairs(double totalHeight) {
- System.err.println("EventsHistory::getStairs totalHeight=" + totalHeight);
+ public Stairs2 getStairs(double createY, double totalHeight) {
+ // System.err.println("EventsHistory::getStairs totalHeight=" + totalHeight);
final Stairs2 result = new Stairs2();
int value = 0;
for (Event event : events) {
final Double position = ys3.get(event);
- System.err.println("EventsHistory::getStairs event=" + event + " position=" + position);
+ // System.err.println("EventsHistory::getStairs event=" + event + " position=" + position);
if (position != null) {
assert position <= totalHeight : "position=" + position + " totalHeight=" + totalHeight;
value = getLevelAt(event, EventsHistoryMode.CONSIDERE_FUTURE_DEACTIVATE);
- result.addStep(new StairsPosition(position, isNextEventADestroy(event)), value, getActivateColor(event));
+ result.addStep(new StairsPosition(Math.max(createY, position), isNextEventADestroy(event)), value,
+ getActivateColor(event));
}
}
- System.err.println("EventsHistory::getStairs finishing totalHeight=" + totalHeight);
+ // System.err.println("EventsHistory::getStairs finishing totalHeight=" + totalHeight);
result.addStep(new StairsPosition(totalHeight, false), value, null);
// System.err.println("EventsHistory::getStairs " + p + " result=" + result);
return result;
}
+ public int getMaxValue() {
+ int max = 0;
+ int level = 0;
+ for (Event current : events) {
+ if (current instanceof LifeEvent) {
+ final LifeEvent le = (LifeEvent) current;
+ if (le.getParticipant() == p && le.isActivate()) {
+ level++;
+ }
+ if (level > max) {
+ max = level;
+ }
+ if (le.getParticipant() == p && le.isDeactivateOrDestroy()) {
+ level--;
+ }
+ }
+ }
+ return max;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistoryMode.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistoryMode.java
index b265bb8..341a79d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistoryMode.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/EventsHistoryMode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
index 8ba04c1..2606e22 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,8 +43,7 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
-import net.sourceforge.plantuml.real.RealMax;
-import net.sourceforge.plantuml.real.RealMin;
+import net.sourceforge.plantuml.real.RealUtils;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Grouping;
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
@@ -58,13 +57,15 @@ import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class GroupingTile implements Tile {
+public class GroupingTile implements TileWithCallbackY {
+ private static final int EXTERNAL_MARGINX1 = 3;
+ private static final int EXTERNAL_MARGINX2 = 9;
private static final int MARGINX = 16;
private static final int MARGINY = 10;
private final List<Tile> tiles = new ArrayList<Tile>();
- private final RealMin min = new RealMin();
- private final RealMax max = new RealMax();
+ private final Real min;
+ private final Real max;
private final GroupingStart start;
// private final double marginX = 20;
@@ -86,33 +87,43 @@ public class GroupingTile implements Tile {
this.display = start.getTitle().equals("group") ? Display.create(start.getComment()) : Display.create(
start.getTitle(), start.getComment());
this.skin = tileArgumentsOriginal.getSkin();
+ // this.skinParam = tileArgumentsOriginal.getSkinParam();
this.skinParam = tileArgumentsBachColorChanged.getSkinParam();
- // this.max = min.addAtLeast(dim1.getWidth());
+ final List<Real> min2 = new ArrayList<Real>();
+ final List<Real> max2 = new ArrayList<Real>();
+
+ final List<Tile> allElses = new ArrayList<Tile>();
while (it.hasNext()) {
final Event ev = it.next();
- System.err.println("GroupingTile::ev=" + ev);
if (ev instanceof GroupingLeaf && ((Grouping) ev).getType() == GroupingType.END) {
break;
}
- final Tile tile = TileBuilder.buildOne(it, tileArgumentsOriginal, ev, this);
- if (tile != null) {
+ for (Tile tile : TileBuilder.buildOne(it, tileArgumentsOriginal, ev, this)) {
tiles.add(tile);
- min.put(tile.getMinX(stringBounder).addFixed(-MARGINX));
- final Real m = tile.getMaxX(stringBounder);
- max.put(m == tileArgumentsOriginal.getOmega() ? m : m.addFixed(MARGINX));
bodyHeight += tile.getPreferredHeight(stringBounder);
+ if (ev instanceof GroupingLeaf && ((Grouping) ev).getType() == GroupingType.ELSE) {
+ allElses.add(tile);
+ continue;
+ }
+ min2.add(tile.getMinX(stringBounder).addFixed(-MARGINX));
+ final Real m = tile.getMaxX(stringBounder);
+ // max2.add(m == tileArgumentsOriginal.getOmega() ? m : m.addFixed(MARGINX));
+ max2.add(m.addFixed(MARGINX));
}
}
final Dimension2D dim1 = getPreferredDimensionIfEmpty(stringBounder);
final double width = dim1.getWidth();
- System.err.println("width=" + width);
- if (min.size() == 0) {
- min.put(tileArgumentsOriginal.getOrigin());
- max.put(tileArgumentsOriginal.getOmega());
+ if (min2.size() == 0) {
+ min2.add(tileArgumentsOriginal.getOrigin());
+ }
+ this.min = RealUtils.min(min2);
+ for (Tile anElse : allElses) {
+ max2.add(anElse.getMaxX(stringBounder));
}
- // max.ensureBiggerThan(min.addFixed(width));
- this.max.ensureBiggerThan(getMinX(stringBounder).addFixed(width + 16));
+ max2.add(this.min.addFixed(width + 16));
+ this.max = RealUtils.max(max2);
+
}
private Component getComponent(StringBounder stringBounder) {
@@ -120,7 +131,7 @@ public class GroupingTile implements Tile {
return comp;
}
- public Dimension2D getPreferredDimensionIfEmpty(StringBounder stringBounder) {
+ private Dimension2D getPreferredDimensionIfEmpty(StringBounder stringBounder) {
return getComponent(stringBounder).getPreferredDimension(stringBounder);
}
@@ -129,11 +140,11 @@ public class GroupingTile implements Tile {
final Component comp = getComponent(stringBounder);
final Dimension2D dim1 = getPreferredDimensionIfEmpty(stringBounder);
- final Area area = new Area(max.getCurrentValue() - min.getCurrentValue(), bodyHeight + dim1.getHeight()
- + MARGINY / 2);
+ final Area area = new Area(max.getCurrentValue() - min.getCurrentValue(), getTotalHeight(stringBounder));
if (ug instanceof LiveBoxFinder == false) {
comp.drawU(ug.apply(new UTranslate(min.getCurrentValue(), 0)), area, (Context2D) ug);
+ drawAllElses(ug);
}
// ug.apply(new UChangeBackColor(HtmlColorUtils.LIGHT_GRAY)).draw(new URectangle(area.getDimensionToUse()));
@@ -145,6 +156,35 @@ public class GroupingTile implements Tile {
}
+ private double getTotalHeight(StringBounder stringBounder) {
+ final Dimension2D dimIfEmpty = getPreferredDimensionIfEmpty(stringBounder);
+ return bodyHeight + dimIfEmpty.getHeight() + MARGINY / 2;
+ }
+
+ private void drawAllElses(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+ final double totalHeight = getTotalHeight(stringBounder);
+ final double suppHeight = getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2;
+ final List<Double> ys = new ArrayList<Double>();
+ for (Tile tile : tiles) {
+ if (tile instanceof ElseTile) {
+ final ElseTile elseTile = (ElseTile) tile;
+ ys.add(elseTile.getCallbackY() - y + suppHeight);
+ }
+ }
+ ys.add(totalHeight);
+ int i = 0;
+ for (Tile tile : tiles) {
+ if (tile instanceof ElseTile) {
+ final ElseTile elseTile = (ElseTile) tile;
+ final Component comp = elseTile.getComponent(stringBounder);
+ final Area area = new Area(max.getCurrentValue() - min.getCurrentValue(), ys.get(i + 1) - ys.get(i));
+ comp.drawU(ug.apply(new UTranslate(min.getCurrentValue(), ys.get(i))), area, (Context2D) ug);
+ i++;
+ }
+ }
+ }
+
public double getPreferredHeight(StringBounder stringBounder) {
final Dimension2D dim1 = getPreferredDimensionIfEmpty(stringBounder);
return dim1.getHeight() + bodyHeight + MARGINY;
@@ -157,10 +197,39 @@ public class GroupingTile implements Tile {
}
public Real getMinX(StringBounder stringBounder) {
- return min;
+ return min.addFixed(-EXTERNAL_MARGINX1);
}
public Real getMaxX(StringBounder stringBounder) {
- return max;
+ return max.addFixed(EXTERNAL_MARGINX2);
}
+
+ private double y;
+
+ public void callbackY(double y) {
+ this.y = y;
+ }
+
+ public static double fillPositionelTiles(StringBounder stringBounder, double y, List<Tile> tiles,
+ final List<YPositionedTile> positionedTiles) {
+ double lastY = y;
+ for (Tile tile : tiles) {
+ if (tile.getEvent().isParallel()) {
+ y = lastY;
+ }
+ positionedTiles.add(new YPositionedTile(tile, y));
+ if (tile instanceof GroupingTile) {
+ final GroupingTile groupingTile = (GroupingTile) tile;
+ fillPositionelTiles(stringBounder, y, groupingTile.tiles, new ArrayList<YPositionedTile>());
+ }
+ lastY = y;
+ y += tile.getPreferredHeight(stringBounder);
+ }
+ return y;
+
+ }
+
+ // public double getStartY() {
+ // return y + MARGINY;
+ // }
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/HSpaceTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/HSpaceTile.java
new file mode 100644
index 0000000..731e82c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/HSpaceTile.java
@@ -0,0 +1,75 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.sequencediagram.Event;
+import net.sourceforge.plantuml.sequencediagram.HSpace;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class HSpaceTile implements Tile {
+
+ private final HSpace hspace;
+ private final Real origin;
+
+ public Event getEvent() {
+ return hspace;
+ }
+
+ public HSpaceTile(HSpace hspace, TileArguments tileArguments) {
+ this.hspace = hspace;
+ this.origin = tileArguments.getOrigin();
+ }
+
+ public void drawU(UGraphic ug) {
+ }
+
+ public double getPreferredHeight(StringBounder stringBounder) {
+ return hspace.getPixel();
+ }
+
+ public void addConstraints(StringBounder stringBounder) {
+ }
+
+ public Real getMinX(StringBounder stringBounder) {
+ return origin;
+ }
+
+ public Real getMaxX(StringBounder stringBounder) {
+ return origin.addFixed(10);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/IntegerColored.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/IntegerColored.java
index 19da327..92076f6 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/IntegerColored.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/IntegerColored.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,14 +34,17 @@
*/
package net.sourceforge.plantuml.sequencediagram.teoz;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SymbolContext;
public class IntegerColored {
private final int value;
- private final HtmlColor color;
+ private final SymbolContext color;
- public IntegerColored(int value, HtmlColor color) {
+ public IntegerColored(int value, SymbolContext color) {
+ if (value < 0) {
+ throw new IllegalArgumentException();
+ }
this.value = value;
this.color = color;
}
@@ -55,7 +58,7 @@ public class IntegerColored {
return value;
}
- public HtmlColor getColor() {
+ public SymbolContext getColors() {
return color;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
index a7430d6..be7d2d1 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,9 +34,12 @@
*/
package net.sourceforge.plantuml.sequencediagram.teoz;
+import java.awt.geom.Dimension2D;
+
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealUtils;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.LifeEvent;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
@@ -45,6 +48,7 @@ import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
public class LifeEventTile implements TileWithUpdateStairs {
@@ -73,11 +77,26 @@ public class LifeEventTile implements TileWithUpdateStairs {
}
public void drawU(UGraphic ug) {
+ if (isDestroyWithoutMessage()) {
+ final Component cross = skin.createComponent(ComponentType.DESTROY, null, skinParam, null);
+ final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder());
+ final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue();
+ cross.drawU(ug.apply(new UTranslate(x - dimCross.getWidth() / 2, 0)), null, (Context2D) ug);
+ }
+ }
+
+ public boolean isDestroyWithoutMessage() {
+ return lifeEvent.getMessage() == null && lifeEvent.getType() == LifeEventType.DESTROY;
}
public double getPreferredHeight(StringBounder stringBounder) {
- if (lifeEvent.isActivate()) {
- return 20;
+// if (lifeEvent.isActivate()) {
+// return 20;
+// }
+ if (isDestroyWithoutMessage()) {
+ final Component cross = skin.createComponent(ComponentType.DESTROY, null, skinParam, null);
+ final Dimension2D dimCross = cross.getPreferredDimension(stringBounder);
+ return dimCross.getHeight();
}
return 0;
}
@@ -86,11 +105,13 @@ public class LifeEventTile implements TileWithUpdateStairs {
}
public Real getMinX(StringBounder stringBounder) {
- return tileArguments.getLivingSpace(lifeEvent.getParticipant()).getPosB();
+ // return tileArguments.getLivingSpace(lifeEvent.getParticipant()).getPosB();
+ return livingSpace.getPosB();
}
public Real getMaxX(StringBounder stringBounder) {
- return tileArguments.getLivingSpace(lifeEvent.getParticipant()).getPosD(stringBounder);
+ // final LivingSpace livingSpace2 = tileArguments.getLivingSpace(lifeEvent.getParticipant());
+ return RealUtils.max(livingSpace.getPosD(stringBounder), livingSpace.getPosC2(stringBounder));
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
index 93c943b..d744971 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java
index c174374..74708d3 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,87 +34,78 @@
*/
package net.sourceforge.plantuml.sequencediagram.teoz;
-import java.awt.geom.Dimension2D;
import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.SkinParamBackcolored;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.skin.Area;
-import net.sourceforge.plantuml.skin.Component;
-import net.sourceforge.plantuml.skin.ComponentType;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.skin.Context2D;
+import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class LiveBoxes implements UDrawable {
+public class LiveBoxes {
private final EventsHistory eventsHistory;
private final Skin skin;
private final ISkinParam skinParam;
- private final double totalHeight;
- private final Context2D context;
+ private final Map<Double, Double> delays = new TreeMap<Double, Double>();
- public LiveBoxes(EventsHistory eventsHistory, Skin skin, ISkinParam skinParam, double totalHeight, Context2D context) {
+ public LiveBoxes(EventsHistory eventsHistory, Skin skin, ISkinParam skinParam, Participant participant) {
this.eventsHistory = eventsHistory;
this.skin = skin;
this.skinParam = skinParam;
- this.totalHeight = totalHeight;
- this.context = context;
}
- public void drawU(UGraphic ug) {
- final Stairs2 stairs = eventsHistory.getStairs(totalHeight);
+ public double getMaxPosition(StringBounder stringBounder) {
+ final int max = eventsHistory.getMaxValue();
+ final LiveBoxesDrawer drawer = new LiveBoxesDrawer(new SimpleContext2D(true), skin, skinParam, delays);
+ return drawer.getWidth(stringBounder) / 2.0 * max;
+ }
+
+ public void drawBoxes(UGraphic ug, Context2D context, double createY, double endY) {
+ final Stairs2 stairs = eventsHistory.getStairs(createY, endY);
final int max = stairs.getMaxValue();
+ if (max == 0) {
+ drawDestroys(ug, stairs, context);
+ }
for (int i = 1; i <= max; i++) {
drawOneLevel(ug, i, stairs, context);
}
}
+ private void drawDestroys(UGraphic ug, Stairs2 stairs, Context2D context) {
+ final LiveBoxesDrawer drawer = new LiveBoxesDrawer(context, skin, skinParam, delays);
+ for (StairsPosition yposition : stairs.getYs()) {
+ drawer.drawDestroyIfNeeded(ug, yposition);
+ }
+ }
+
private void drawOneLevel(UGraphic ug, int levelToDraw, Stairs2 stairs, Context2D context) {
- final Component comp1 = skin.createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam, null);
- final Component cross = skin.createComponent(ComponentType.DESTROY, null, skinParam, null);
- final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder());
- final double width = comp1.getPreferredWidth(ug.getStringBounder());
- ug = ug.apply(new UTranslate((levelToDraw - 1) * width / 2.0, 0));
+ final LiveBoxesDrawer drawer = new LiveBoxesDrawer(context, skin, skinParam, delays);
+ ug = ug.apply(new UTranslate((levelToDraw - 1) * drawer.getWidth(ug.getStringBounder()) / 2.0, 0));
- double y1 = Double.MAX_VALUE;
- HtmlColor color = null;
+ boolean pending = true;
for (Iterator<StairsPosition> it = stairs.getYs().iterator(); it.hasNext();) {
final StairsPosition yposition = it.next();
- System.err.println("LiveBoxes::drawOneLevel " + levelToDraw + " " + yposition);
final IntegerColored integerColored = stairs.getValue(yposition.getValue());
- System.err.println("integerColored=" + integerColored);
final int level = integerColored.getValue();
- if (y1 == Double.MAX_VALUE && level == levelToDraw) {
- y1 = yposition.getValue();
- color = integerColored.getColor();
- } else if (y1 != Double.MAX_VALUE && (it.hasNext() == false || level < levelToDraw)) {
- final double y2 = yposition.getValue();
- final Area area = new Area(width, y2 - y1);
-
- final ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, color);
- final Component comp = skin
- .createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam2, null);
-
- comp.drawU(ug.apply(new UTranslate(-width / 2, y1)), area, context);
- System.err.println("LiveBoxes::drawOneLevel one block " + y1 + " " + y2);
- if (yposition.isDestroy()) {
- System.err.println("LiveBoxes::drawOneLevel DESTROY " + yposition);
- cross.drawU(ug.apply(new UTranslate(-dimCross.getWidth() / 2, y2 - dimCross.getHeight() / 2)),
- null, context);
- } else {
- System.err.println("LiveBoxes::drawOneLevel NOTDESTROY " + yposition);
- }
- y1 = Double.MAX_VALUE;
+ if (pending && level == levelToDraw) {
+ drawer.addStart(yposition.getValue(), integerColored.getColors());
+ pending = false;
+ } else if (pending == false && (it.hasNext() == false || level < levelToDraw)) {
+ drawer.doDrawing(ug, yposition);
+ drawer.drawDestroyIfNeeded(ug, yposition);
+ pending = true;
}
}
}
- private UGraphic withColor(UGraphic ug) {
- return ug;
+ public void delayOn(double y, double height) {
+ delays.put(y, height);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxesDrawer.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxesDrawer.java
new file mode 100644
index 0000000..6ba5922
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxesDrawer.java
@@ -0,0 +1,124 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import java.awt.geom.Dimension2D;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.SkinParamBackcolored;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.SymbolContext;
+import net.sourceforge.plantuml.sequencediagram.graphic.Segment;
+import net.sourceforge.plantuml.skin.Area;
+import net.sourceforge.plantuml.skin.Component;
+import net.sourceforge.plantuml.skin.ComponentType;
+import net.sourceforge.plantuml.skin.Context2D;
+import net.sourceforge.plantuml.skin.Skin;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class LiveBoxesDrawer {
+
+ private double y1;
+ private SymbolContext color;
+
+ private final Component cross;
+ private final Context2D context;
+ private final Skin skin;
+ private final ISkinParam skinParam;
+ private final Component compForWidth;
+ private final Collection<Segment> delays;
+
+ public LiveBoxesDrawer(Context2D context, Skin skin, ISkinParam skinParam, Map<Double, Double> delays) {
+ this.cross = skin.createComponent(ComponentType.DESTROY, null, skinParam, null);
+ this.compForWidth = skin.createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam, null);
+ this.context = context;
+ this.skin = skin;
+ this.skinParam = skinParam;
+ this.delays = new HashSet<Segment>();
+ for (Map.Entry<Double, Double> ent : delays.entrySet()) {
+ this.delays.add(new Segment(ent.getKey(), ent.getKey() + ent.getValue()));
+ }
+ }
+
+ public double getWidth(StringBounder stringBounder) {
+ return compForWidth.getPreferredWidth(stringBounder);
+ }
+
+ public void addStart(double y1, SymbolContext color) {
+ this.y1 = y1;
+ this.color = color;
+ }
+
+ public void doDrawing(UGraphic ug, StairsPosition yposition) {
+ final Segment full = new Segment(y1, yposition.getValue());
+ final Collection<Segment> segments = full.cutSegmentIfNeed(delays);
+ ComponentType type = ComponentType.ALIVE_BOX_CLOSE_CLOSE;
+ if (segments.size() > 1) {
+ type = ComponentType.ALIVE_BOX_CLOSE_OPEN;
+ }
+ for (Iterator<Segment> it = segments.iterator(); it.hasNext();) {
+ final Segment seg = it.next();
+ if (it.hasNext() == false && type != ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
+ type = ComponentType.ALIVE_BOX_OPEN_CLOSE;
+ }
+ drawInternal(ug, yposition, seg.getPos1(), seg.getPos2(), type);
+ type = ComponentType.ALIVE_BOX_OPEN_OPEN;
+ }
+ y1 = Double.MAX_VALUE;
+ }
+
+ public void drawDestroyIfNeeded(UGraphic ug, StairsPosition yposition) {
+ if (yposition.isDestroy()) {
+ final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder());
+ cross.drawU(
+ ug.apply(new UTranslate(-dimCross.getWidth() / 2, yposition.getValue() - dimCross.getHeight() / 2)),
+ null, context);
+ }
+ }
+
+ private void drawInternal(UGraphic ug, StairsPosition yposition, double ya, double yb, ComponentType type) {
+ final double width = getWidth(ug.getStringBounder());
+ final Area area = new Area(width, yb - ya);
+ final ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, color == null ? null : color.getBackColor());
+ final Component comp = skin.createComponent(type, null, skinParam2, null);
+ comp.drawU(ug.apply(new UTranslate(-width / 2, ya)), area, context);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java
index 462a35b..48a027b 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,7 +38,10 @@ import java.awt.geom.Dimension2D;
import java.util.List;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Delay;
import net.sourceforge.plantuml.sequencediagram.Event;
@@ -52,6 +55,7 @@ import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
public class LivingSpace {
@@ -63,6 +67,7 @@ public class LivingSpace {
private final boolean useContinueLineBecauseOfDelay;
private final MutingLine mutingLine;
private final Rose rose = new Rose();
+ private final LiveBoxes liveBoxes;
// private final LivingSpaceImpl previous;
// private LivingSpace next;
@@ -72,6 +77,10 @@ public class LivingSpace {
private Real posD;
private final EventsHistory eventsHistory;
+ private boolean create = false;
+ private double createY = 0;
+
+ private final ParticipantEnglober englober;
public int getLevelAt(Tile tile, EventsHistoryMode mode) {
// assert mode == EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE;
@@ -100,6 +109,7 @@ public class LivingSpace {
this.p = p;
this.skin = skin;
this.skinParam = skinParam;
+ this.englober = englober;
this.posB = position;
if (p.getType() == ParticipantType.PARTICIPANT) {
headType = ComponentType.PARTICIPANT_HEAD;
@@ -126,7 +136,7 @@ public class LivingSpace {
// this.stairs2.addStep2(0, 0);
this.useContinueLineBecauseOfDelay = useContinueLineBecauseOfDelay(events);
this.mutingLine = new MutingLine(skin, skinParam, events);
-
+ this.liveBoxes = new LiveBoxes(eventsHistory, skin, skinParam, p);
}
private boolean useContinueLineBecauseOfDelay(List<Event> events) {
@@ -144,34 +154,41 @@ public class LivingSpace {
public void drawLineAndLiveBoxes(UGraphic ug, double height, Context2D context) {
- mutingLine.drawLine(ug, height, context);
- // final ComponentType defaultLineType = useContinueLineBecauseOfDelay ? ComponentType.CONTINUE_LINE
- // : ComponentType.PARTICIPANT_LINE;
- // final Component comp = skin.createComponent(defaultLineType, null, skinParam, p.getDisplay(false));
- // final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());
- // final Area area = new Area(dim.getWidth(), height);
- // comp.drawU(ug, area, new SimpleContext2D(false));
-
- final LiveBoxes liveBoxes = new LiveBoxes(eventsHistory, skin, skinParam, height, context);
- liveBoxes.drawU(ug);
+ mutingLine.drawLine(ug, context, createY, height);
+ liveBoxes.drawBoxes(ug, context, createY, height);
}
// public void addDelayTile(DelayTile tile) {
// System.err.println("addDelayTile " + this + " " + tile);
// }
- public void drawHead(UGraphic ug, Context2D context) {
- // final Component comp = skin.createComponent(headType, null, skinParam, p.getDisplay(false));
+ public void drawHead(UGraphic ug, Context2D context, VerticalAlignment verticalAlignment,
+ HorizontalAlignment horizontalAlignment) {
+ if (create && verticalAlignment == VerticalAlignment.BOTTOM) {
+ return;
+ }
final Component comp = rose.createComponent(headType, null, p.getSkinParamBackcolored(skinParam),
- p.getDisplay(false));
+ p.getDisplay(skinParam.forceSequenceParticipantUnderlined()));
final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());
+ if (horizontalAlignment == HorizontalAlignment.RIGHT) {
+ ug = ug.apply(new UTranslate(-dim.getWidth(), 0));
+ }
+ if (verticalAlignment == VerticalAlignment.CENTER) {
+ ug = ug.apply(new UTranslate(0, -dim.getHeight() / 2));
+ }
final Area area = new Area(dim);
+ final Url url = getParticipant().getUrl();
+ if (url != null) {
+ ug.startUrl(url);
+ }
comp.drawU(ug, area, context);
+ if (url != null) {
+ ug.closeAction();
+ }
}
public Dimension2D getHeadPreferredDimension(StringBounder stringBounder) {
- // final Component comp = skin.createComponent(headType, null, skinParam, p.getDisplay(false));
- final Component comp = rose.createComponent(headType, null, skinParam, p.getDisplay(false));
+ final Component comp = rose.createComponent(headType, null, skinParam, p.getDisplay(skinParam.forceSequenceParticipantUnderlined()));
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
return dim;
}
@@ -187,10 +204,16 @@ public class LivingSpace {
return posC;
}
+ public Real getPosC2(StringBounder stringBounder) {
+ final double delta = liveBoxes.getMaxPosition(stringBounder);
+ return getPosC(stringBounder).addFixed(delta);
+ }
+
public Real getPosD(StringBounder stringBounder) {
if (posD == null) {
this.posD = posB.addFixed(this.getPreferredWidth(stringBounder));
}
+ // System.err.println("LivingSpace::getPosD "+posD.getCurrentValue());
return posD;
}
@@ -202,4 +225,23 @@ public class LivingSpace {
return p;
}
+ public void goCreate(double y) {
+ System.err.println("LivingSpace::goCreate y=" + y);
+ this.createY = y;
+ this.create = true;
+ }
+
+ public void goCreate() {
+ this.create = true;
+ }
+
+ public void delayOn(double y, double height) {
+ mutingLine.delayOn(y, height);
+ liveBoxes.delayOn(y, height);
+ }
+
+ public ParticipantEnglober getEnglober() {
+ return englober;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java
index db9823f..258542e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,11 +36,14 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D;
import java.util.Collection;
+import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
+import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -54,6 +57,44 @@ public class LivingSpaces {
return all.values();
}
+ public void addConstraints(StringBounder stringBounder) {
+ LivingSpace previous = null;
+ for (LivingSpace current : all.values()) {
+ if (previous != null) {
+ final Real point1 = previous.getPosD(stringBounder);
+ final Real point2 = current.getPosB();
+ point2.ensureBiggerThan(point1.addFixed(10));
+ }
+ previous = current;
+ }
+ }
+
+ public LivingSpace previous(LivingSpace element) {
+ LivingSpace previous = null;
+ for (LivingSpace current : all.values()) {
+ if (current == element) {
+ return previous;
+ }
+ previous = current;
+ }
+ return null;
+ }
+
+ public LivingSpace next(LivingSpace element) {
+ for (Iterator<LivingSpace> it = all.values().iterator(); it.hasNext();) {
+ final LivingSpace current = it.next();
+ if (current == element && it.hasNext()) {
+ return it.next();
+ }
+ }
+ return null;
+
+ }
+
+ public Collection<Participant> participants() {
+ return all.keySet();
+ }
+
public void put(Participant participant, LivingSpace livingSpace) {
all.put(participant, livingSpace);
}
@@ -72,7 +113,7 @@ public class LivingSpaces {
final Dimension2D dimHead = livingSpace.getHeadPreferredDimension(stringBounder);
y = headHeight - dimHead.getHeight();
}
- livingSpace.drawHead(ug.apply(new UTranslate(x, y)), context);
+ livingSpace.drawHead(ug.apply(new UTranslate(x, y)), context, verticalAlignment, HorizontalAlignment.LEFT);
}
}
@@ -98,4 +139,14 @@ public class LivingSpaces {
}
}
+ public void delayOn(double y, double height) {
+ for (LivingSpace livingSpace : values()) {
+ livingSpace.delayOn(y, height);
+ }
+ }
+
+ public int size() {
+ return all.size();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTile.java
index 1153f8f..21faed9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,44 +37,57 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.util.ArrayList;
import java.util.List;
-import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.real.Real;
-import net.sourceforge.plantuml.real.RealMax;
-import net.sourceforge.plantuml.real.RealMin;
+import net.sourceforge.plantuml.real.RealUtils;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
-import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.LimitFinder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class MainTile implements Tile {
+public class MainTile implements Tile, Bordered {
- private final RealMin min = new RealMin();
- private final RealMax max = new RealMax();
- // private double height;
+ private final double startingY = 8;
+ private final Real min;
+ private final Real max;
+ private final boolean isShowFootbox;
private final List<Tile> tiles = new ArrayList<Tile>();
+ private final LivingSpaces livingSpaces;
- public MainTile(SequenceDiagram diagram, Skin skin, Real omega, LivingSpaces livingSpaces, Real origin) {
+ public MainTile(SequenceDiagram diagram, Englobers englobers, TileArguments tileArguments) {
- min.put(origin);
- max.put(omega);
+ this.livingSpaces = tileArguments.getLivingSpaces();
- final ISkinParam skinParam = diagram.getSkinParam();
- final StringBounder stringBounder = TextBlockUtils.getDummyStringBounder();
+ final List<Real> min2 = new ArrayList<Real>();
+ final List<Real> max2 = new ArrayList<Real>();
- final TileArguments tileArguments = new TileArguments(stringBounder, omega, livingSpaces, skin, skinParam,
- origin);
+ min2.add(tileArguments.getOrigin());
+ max2.add(tileArguments.getOrigin());
+
+ if (englobers.size() > 0) {
+ min2.add(englobers.getMinX(tileArguments.getStringBounder()));
+ max2.add(englobers.getMaxX(tileArguments.getStringBounder()));
+ }
+
+ // tiles.add(new EmptyTile(8, tileArguments));
tiles.addAll(TileBuilder.buildSeveral(diagram.events().iterator(), tileArguments, null));
for (Tile tile : tiles) {
- // height += tile.getPreferredHeight(stringBounder);
- min.put(tile.getMinX(stringBounder));
- max.put(tile.getMaxX(stringBounder));
+ min2.add(tile.getMinX(tileArguments.getStringBounder()));
+ max2.add(tile.getMaxX(tileArguments.getStringBounder()));
+ }
+
+ for (LivingSpace livingSpace : livingSpaces.values()) {
+ max2.add(livingSpace.getPosD(tileArguments.getStringBounder()));
+ max2.add(livingSpace.getPosC2(tileArguments.getStringBounder()));
}
+
+ this.min = RealUtils.min(min2);
+ this.max = RealUtils.max(max2);
+
+ this.isShowFootbox = diagram.isShowFootbox();
}
public void drawU(UGraphic ug) {
@@ -93,33 +106,21 @@ public class MainTile implements Tile {
private double drawUInternal(UGraphic ug, boolean trace) {
final StringBounder stringBounder = ug.getStringBounder();
- double y = 0;
- double lastY = 0;
final List<YPositionedTile> positionedTiles = new ArrayList<YPositionedTile>();
- for (Tile tile : tiles) {
- if (tile.getEvent().isParallel()) {
- y = lastY;
- }
- if (trace) {
- System.err.println("MainTile::drawUInternal tile=" + tile + " y=" + y);
- }
- positionedTiles.add(new YPositionedTile(tile, y));
- lastY = y;
- y += tile.getPreferredHeight(stringBounder);
- }
+ final double y = GroupingTile.fillPositionelTiles(stringBounder, startingY, tiles, positionedTiles);
for (YPositionedTile tile : positionedTiles) {
tile.drawU(ug);
}
- System.err.println("MainTile::drawUInternal finalY=" + y);
+ // System.err.println("MainTile::drawUInternal finalY=" + y);
return y;
}
public double getPreferredHeight(StringBounder stringBounder) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, true);
final UGraphicInterceptorTile interceptor = new UGraphicInterceptorTile(limitFinder, false);
- final double finalY = drawUInternal(interceptor, true);
+ final double finalY = drawUInternal(interceptor, false);
final double result = Math.max(limitFinder.getMinMax().getDimension().getHeight(), finalY) + 10;
- System.err.println("MainTile::getPreferredHeight=" + result);
+ // System.err.println("MainTile::getPreferredHeight=" + result);
return result;
}
@@ -141,4 +142,20 @@ public class MainTile implements Tile {
return null;
}
+ public boolean isShowFootbox() {
+ return isShowFootbox;
+ }
+
+ public LivingSpaces getLivingSpaces() {
+ return livingSpaces;
+ }
+
+ public double getBorder1() {
+ return min.getCurrentValue();
+ }
+
+ public double getBorder2() {
+ return max.getCurrentValue();
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTileAdapter.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTileAdapter.java
new file mode 100644
index 0000000..367a2a0
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/MainTileAdapter.java
@@ -0,0 +1,98 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.VerticalAlignment;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.skin.Context2D;
+import net.sourceforge.plantuml.skin.SimpleContext2D;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class MainTileAdapter extends AbstractTextBlock implements TextBlock {
+
+ private final MainTile mainTile;
+ private Dimension2D cacheDimension;
+
+ public MainTileAdapter(MainTile mainTile) {
+ if (mainTile == null) {
+ throw new IllegalArgumentException();
+ }
+ this.mainTile = mainTile;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ if (cacheDimension == null) {
+ final double width = mainTile.getMaxX(stringBounder).getCurrentValue()
+ - mainTile.getMinX(stringBounder).getCurrentValue();
+
+ final int factor = mainTile.isShowFootbox() ? 2 : 1;
+ final double height = mainTile.getPreferredHeight(stringBounder) + factor
+ * mainTile.getLivingSpaces().getHeadHeight(stringBounder);
+
+ cacheDimension = new Dimension2DDouble(width, height);
+ }
+ return cacheDimension;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+
+ final Context2D context = new SimpleContext2D(false);
+ final double height = mainTile.getPreferredHeight(stringBounder);
+ final LivingSpaces livingSpaces = mainTile.getLivingSpaces();
+
+ final double headHeight = livingSpaces.getHeadHeight(stringBounder);
+
+ mainTile.drawU(ug.apply(new UTranslate(0, headHeight)));
+ livingSpaces.drawLifeLines(ug.apply(new UTranslate(0, headHeight)), height, context);
+ livingSpaces.drawHeads(ug, context, VerticalAlignment.BOTTOM);
+ if (mainTile.isShowFootbox()) {
+ livingSpaces.drawHeads(ug.apply(new UTranslate(0, height + headHeight)), context, VerticalAlignment.TOP);
+ }
+ mainTile.drawForeground(ug.apply(new UTranslate(0, headHeight)));
+ }
+
+ public Real getMinX(StringBounder stringBounder) {
+ return mainTile.getMinX(stringBounder);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java
index 47a80e6..28e8676 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,8 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import java.awt.geom.Dimension2D;
import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.sequencediagram.Delay;
@@ -46,12 +48,14 @@ import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
public class MutingLine {
private final Skin skin;
private final ISkinParam skinParam;
private final boolean useContinueLineBecauseOfDelay;
+ private final Map<Double, Double> delays = new TreeMap<Double, Double>();
public MutingLine(Skin skin, ISkinParam skinParam, List<Event> events) {
this.skin = skin;
@@ -72,13 +76,39 @@ public class MutingLine {
return false;
}
- public void drawLine(UGraphic ug, double height, Context2D context) {
+ public void drawLine(UGraphic ug, Context2D context, double createY, double endY) {
final ComponentType defaultLineType = useContinueLineBecauseOfDelay ? ComponentType.CONTINUE_LINE
: ComponentType.PARTICIPANT_LINE;
+ if (delays.size() > 0) {
+ double y = createY;
+ for (Map.Entry<Double, Double> ent : delays.entrySet()) {
+ if (ent.getKey() >= createY) {
+ drawInternal(ug, context, y, ent.getKey(), defaultLineType);
+ drawInternal(ug, context, ent.getKey(), ent.getKey() + ent.getValue(), ComponentType.DELAY_LINE);
+ y = ent.getKey() + ent.getValue();
+ }
+ }
+ drawInternal(ug, context, y, endY, defaultLineType);
+ } else {
+ drawInternal(ug, context, createY, endY, defaultLineType);
+ }
+ }
+
+ private void drawInternal(UGraphic ug, Context2D context, double y1, double y2, final ComponentType defaultLineType) {
+ if (y2 == y1) {
+ return;
+ }
+ if (y2 < y1) {
+ throw new IllegalArgumentException();
+ }
final Component comp = skin.createComponent(defaultLineType, null, skinParam, null);
final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());
- final Area area = new Area(dim.getWidth(), height);
- comp.drawU(ug, area, context);
+ final Area area = new Area(dim.getWidth(), y2 - y1);
+ comp.drawU(ug.apply(new UTranslate(0, y1)), area, context);
+ }
+
+ public void delayOn(double y, double height) {
+ delays.put(y, height);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java
index e639907..4dff541 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,11 +43,11 @@ import net.sourceforge.plantuml.real.RealUtils;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
+import net.sourceforge.plantuml.sequencediagram.NoteStyle;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Context2D;
-import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -73,11 +73,21 @@ public class NoteTile implements Tile {
}
private Component getComponent(StringBounder stringBounder) {
- final Component comp = skin.createComponent(ComponentType.NOTE, null, note.getSkinParamBackcolored(skinParam),
- note.getStrings());
+ final Component comp = skin.createComponent(getNoteComponentType(note.getStyle()), null,
+ note.getSkinParamBackcolored(skinParam), note.getStrings());
return comp;
}
+ private ComponentType getNoteComponentType(NoteStyle noteStyle) {
+ if (noteStyle == NoteStyle.HEXAGONAL) {
+ return ComponentType.NOTE_HEXAGONAL;
+ }
+ if (noteStyle == NoteStyle.BOX) {
+ return ComponentType.NOTE_BOX;
+ }
+ return ComponentType.NOTE;
+ }
+
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Component comp = getComponent(stringBounder);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java
new file mode 100644
index 0000000..c7d33e3
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java
@@ -0,0 +1,176 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import java.awt.geom.Dimension2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealUtils;
+import net.sourceforge.plantuml.sequencediagram.Event;
+import net.sourceforge.plantuml.sequencediagram.Note;
+import net.sourceforge.plantuml.sequencediagram.NotePosition;
+import net.sourceforge.plantuml.sequencediagram.NoteStyle;
+import net.sourceforge.plantuml.sequencediagram.Notes;
+import net.sourceforge.plantuml.skin.Area;
+import net.sourceforge.plantuml.skin.Component;
+import net.sourceforge.plantuml.skin.ComponentType;
+import net.sourceforge.plantuml.skin.Context2D;
+import net.sourceforge.plantuml.skin.Skin;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class NotesTile implements Tile {
+
+ private final LivingSpaces livingSpaces;
+ private final Skin skin;
+ private final ISkinParam skinParam;
+ private final Notes notes;
+
+ public Event getEvent() {
+ return notes;
+ }
+
+ public NotesTile(LivingSpaces livingSpaces, Notes notes, Skin skin, ISkinParam skinParam) {
+ this.livingSpaces = livingSpaces;
+ this.notes = notes;
+ this.skin = skin;
+ this.skinParam = skinParam;
+ }
+
+ private Component getComponent(StringBounder stringBounder, Note note) {
+ final Component comp = skin.createComponent(getNoteComponentType(note.getStyle()), null,
+ note.getSkinParamBackcolored(skinParam), note.getStrings());
+ return comp;
+ }
+
+ private ComponentType getNoteComponentType(NoteStyle noteStyle) {
+ if (noteStyle == NoteStyle.HEXAGONAL) {
+ return ComponentType.NOTE_HEXAGONAL;
+ }
+ if (noteStyle == NoteStyle.BOX) {
+ return ComponentType.NOTE_BOX;
+ }
+ return ComponentType.NOTE;
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+
+ for (Note note : notes) {
+ final Component comp = getComponent(stringBounder, note);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ final double x = getX(stringBounder, note).getCurrentValue();
+ final Area area = new Area(getUsedWidth(stringBounder, note), dim.getHeight());
+
+ final UGraphic ug2 = ug.apply(new UTranslate(x, 0));
+ comp.drawU(ug2, area, (Context2D) ug2);
+ }
+ }
+
+ private double getUsedWidth(StringBounder stringBounder, Note note) {
+ final Component comp = getComponent(stringBounder, note);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ final double width = dim.getWidth();
+ return width;
+ }
+
+ private Real getX(StringBounder stringBounder, Note note) {
+ final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
+ final NotePosition position = note.getPosition();
+ final double width = getUsedWidth(stringBounder, note);
+ if (position == NotePosition.LEFT) {
+ return livingSpace1.getPosC(stringBounder).addFixed(-width);
+ } else if (position == NotePosition.RIGHT) {
+ final int level = livingSpace1.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_DEACTIVATE);
+ final double dx = level * CommunicationTile.LIVE_DELTA_SIZE;
+ return livingSpace1.getPosC(stringBounder).addFixed(dx);
+ } else if (position == NotePosition.OVER_SEVERAL) {
+ final LivingSpace livingSpace2 = livingSpaces.get(note.getParticipant2());
+ final Real x1 = livingSpace1.getPosC(stringBounder);
+ final Real x2 = livingSpace2.getPosC(stringBounder);
+ return RealUtils.middle(x1, x2).addFixed(-width / 2);
+ } else if (position == NotePosition.OVER) {
+ return livingSpace1.getPosC(stringBounder).addFixed(-width / 2);
+ } else {
+ throw new UnsupportedOperationException(position.toString());
+ }
+ }
+
+ public double getPreferredHeight(StringBounder stringBounder) {
+ double result = 0;
+ for (Note note : notes) {
+ final Component comp = getComponent(stringBounder, note);
+ final Dimension2D dim = comp.getPreferredDimension(stringBounder);
+ result = Math.max(result, dim.getHeight());
+ }
+ return result;
+ }
+
+ public void addConstraints(StringBounder stringBounder) {
+ final List<Note> all = notes.asList();
+ for (int i = 0; i < all.size() - 1; i++) {
+ for (int j = i + 1; j < all.size(); j++) {
+ final Real point1 = getX2(stringBounder, all.get(i));
+ final Real point2 = getX(stringBounder, all.get(j));
+ point2.ensureBiggerThan(point1);
+ }
+ }
+ }
+
+ public Real getMinX(StringBounder stringBounder) {
+ final List<Real> reals = new ArrayList<Real>();
+ for (Note note : notes) {
+ reals.add(getX(stringBounder, note));
+ }
+ return RealUtils.min(reals);
+ }
+
+ private Real getX2(StringBounder stringBounder, Note note) {
+ return getX(stringBounder, note).addFixed(getUsedWidth(stringBounder, note));
+ }
+
+ public Real getMaxX(StringBounder stringBounder) {
+ final List<Real> reals = new ArrayList<Real>();
+ for (Note note : notes) {
+ reals.add(getX2(stringBounder, note));
+ }
+ return RealUtils.max(reals);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java
index 5e88e7b..52ada9c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -60,7 +60,6 @@ public class ReferenceTile implements Tile {
return reference;
}
-
public ReferenceTile(Reference reference, TileArguments tileArguments) {
this.reference = reference;
this.tileArguments = tileArguments;
@@ -74,15 +73,17 @@ public class ReferenceTile implements Tile {
final LivingSpace livingSpace = tileArguments.getLivingSpace(p);
final Real pos = livingSpace.getPosC(stringBounder);
if (first == null || pos.getCurrentValue() < first.getCurrentValue()) {
- this.first = pos;
+ this.first = livingSpace.getPosB();
}
if (last == null || pos.getCurrentValue() > last.getCurrentValue()) {
- this.last = pos;
+ this.last = livingSpace.getPosD(stringBounder);
}
}
final Component comp = getComponent(stringBounder);
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
- this.last = this.last.addAtLeast(0);
+ if (reference.getParticipant().size() == 1) {
+ this.last = this.last.addAtLeast(0);
+ }
this.last.ensureBiggerThan(this.first.addFixed(dim.getWidth()));
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java
index 7699637..45a9594 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,24 +42,26 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
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.png.PngTitler;
import net.sourceforge.plantuml.real.Real;
+import net.sourceforge.plantuml.real.RealOrigin;
import net.sourceforge.plantuml.real.RealUtils;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
import net.sourceforge.plantuml.sequencediagram.graphic.FileMaker;
-import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
-import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -78,162 +80,166 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
this.diagram = sequenceDiagram;
this.fileFormatOption = fileFormatOption;
this.skin = skin;
+ this.footer = getFooterOrHeader(FontParam.FOOTER);
+ this.header = getFooterOrHeader(FontParam.HEADER);
+
+ this.main = new MainTileAdapter(createMainTile());
+ this.min1 = ((MainTileAdapter) main).getMinX(stringBounder);
+
+ this.title = getTitle();
+ this.legend = getLegend();
+
+ this.heightEnglober1 = englobers.getOffsetForEnglobers(stringBounder);
+ this.heightEnglober2 = heightEnglober1 == 0 ? 0 : 10;
+
+ final double totalWidth = MathUtils.max(main.calculateDimension(stringBounder).getWidth(), title
+ .calculateDimension(stringBounder).getWidth(), footer.calculateDimension(stringBounder).getWidth(),
+ header.calculateDimension(stringBounder).getWidth(), legend.calculateDimension(stringBounder)
+ .getWidth());
+ final double totalHeight = main.calculateDimension(stringBounder).getHeight() + heightEnglober1
+ + heightEnglober2 + title.calculateDimension(stringBounder).getHeight()
+ + header.calculateDimension(stringBounder).getHeight()
+ + legend.calculateDimension(stringBounder).getHeight()
+ + footer.calculateDimension(stringBounder).getHeight();
+ this.dimTotal = new Dimension2DDouble(totalWidth, totalHeight);
}
- public ImageData createOne(OutputStream os, int index, boolean isWithMetadata) throws IOException {
- StringBounder stringBounder = TextBlockUtils.getDummyStringBounder();
+ private Englobers englobers;
+ private final StringBounder stringBounder = TextBlockUtils.getDummyStringBounder();
- final ISkinParam skinParam = diagram.getSkinParam();
+ private final TextBlock footer;
+ private final TextBlock header;
- final Real origin = RealUtils.createOrigin();
- Real currentPos = origin.addAtLeast(0);
- LivingSpace last = null;
- LivingSpaces livingSpaces = new LivingSpaces();
- for (Participant p : diagram.participants().values()) {
- final LivingSpace livingSpace = new LivingSpace(p, diagram.getEnglober(p), skin, skinParam, currentPos,
- diagram.events());
- last = livingSpace;
- ((LivingSpaces) livingSpaces).put(p, livingSpace);
- currentPos = livingSpace.getPosD(stringBounder).addAtLeast(0);
- }
+ private final TextBlock main;
- final MainTile mainTile = new MainTile(diagram, skin, last.getPosD(stringBounder).addAtLeast(0), livingSpaces,
- origin);
- mainTile.addConstraints(stringBounder);
- origin.compile();
+ private final TextBlock title;
+ private final TextBlock legend;
+ private final Dimension2D dimTotal;
+ private final Real min1;
- final double mainHeight = mainTile.getPreferredHeight(stringBounder) + 2
- * livingSpaces.getHeadHeight(stringBounder);
+ private final LivingSpaces livingSpaces = new LivingSpaces();
+ private final double heightEnglober1;
+ private final double heightEnglober2;
- final Real min1 = mainTile.getMinX(stringBounder);
- final Real max1 = mainTile.getMaxX(stringBounder);
- // System.err.println("min1=" + min1.getCurrentValue());
- // System.err.println("max1=" + max1.getCurrentValue());
+ public ImageData createOne(OutputStream os, int index, boolean isWithMetadata) throws IOException {
+ final UTranslate min1translate = new UTranslate(-min1.getCurrentValue(), 0);
+ final double dpiFactor = diagram.getDpiFactor(fileFormatOption, dimTotal);
+ final UGraphic2 ug2 = (UGraphic2) fileFormatOption.createUGraphic(getSkinParam().getColorMapper(), dpiFactor,
+ dimTotal, getSkinParam().getBackgroundColor(), false).apply(min1translate);
- final Component compTitle = getCompTitle();
+ UGraphic ug = getSkinParam().handwritten() ? new UGraphicHandwritten(ug2) : ug2;
+ englobers.drawEnglobers(goDownForEnglobers(ug), main.calculateDimension(stringBounder).getHeight()
+ + this.heightEnglober1 + this.heightEnglober2 / 2, new SimpleContext2D(true));
- final double mainWidth = max1.getCurrentValue() - min1.getCurrentValue();
+ printAligned(ug, diagram.getFooterOrHeaderTeoz(FontParam.HEADER).getHorizontalAlignment(), header);
+ ug = goDown(ug, header);
- Dimension2D dimTitle = new Dimension2DDouble(0, 0);
- if (compTitle != null) {
- dimTitle = compTitle.getPreferredDimension(stringBounder);
- }
+ printAligned(ug, HorizontalAlignment.CENTER, title);
+ ug = goDown(ug, title);
- final PngTitler footer = getFooter();
- Dimension2D dimFooter = new Dimension2DDouble(0, 0);
- if (footer != null && footer.getTextBlock() != null) {
- dimFooter = footer.getTextBlock().calculateDimension(stringBounder);
+ if (diagram.getLegend().getVerticalAlignment() == VerticalAlignment.TOP) {
+ printAligned(ug, diagram.getLegend().getHorizontalAlignment(), legend);
+ ug = goDown(ug, legend);
}
- final PngTitler header = getHeader();
- Dimension2D dimHeader = new Dimension2DDouble(0, 0);
- if (header != null && header.getTextBlock() != null) {
- dimHeader = header.getTextBlock().calculateDimension(stringBounder);
- }
+ ug = ug.apply(new UTranslate(0, this.heightEnglober1));
+ printAligned(ug, HorizontalAlignment.CENTER, main);
+ ug = goDown(ug, main);
+ ug = ug.apply(new UTranslate(0, this.heightEnglober2));
- final double totalWidth = MathUtils.max(mainWidth, dimTitle.getWidth(), dimFooter.getWidth(),
- dimHeader.getWidth());
- final double totalHeight = mainHeight + dimTitle.getHeight() + dimHeader.getHeight() + dimFooter.getHeight();
- final Dimension2D dim = new Dimension2DDouble(totalWidth, totalHeight);
- final UGraphic2 ug2 = (UGraphic2) fileFormatOption.createUGraphic(skinParam.getColorMapper(),
- diagram.getDpiFactor(fileFormatOption), dim, skinParam.getBackgroundColor(), false).apply(
- new UTranslate(-min1.getCurrentValue(), 0));
-
- UGraphic ug = diagram.getSkinParam().handwritten() ? new UGraphicHandwritten(ug2) : ug2;
-
- if (footer != null && footer.getTextBlock() != null) {
- double dx = 0;
- if (diagram.getFooterAlignment() == HorizontalAlignment.RIGHT) {
- dx = totalWidth - dimFooter.getWidth();
- } else if (diagram.getFooterAlignment() == HorizontalAlignment.CENTER) {
- dx = (totalWidth - dimFooter.getWidth()) / 2;
- }
- footer.getTextBlock().drawU(
- ug.apply(new UTranslate(dx, mainHeight + dimTitle.getHeight() + dimHeader.getHeight())));
- }
- if (header != null && header.getTextBlock() != null) {
- double dx = 0;
- if (diagram.getHeaderAlignment() == HorizontalAlignment.RIGHT) {
- dx = totalWidth - dimHeader.getWidth();
- } else if (diagram.getHeaderAlignment() == HorizontalAlignment.CENTER) {
- dx = (totalWidth - dimHeader.getWidth()) / 2;
- }
- header.getTextBlock().drawU(ug.apply(new UTranslate(dx, 0)));
- }
- if (compTitle != null) {
- compTitle.drawU(ug.apply(new UTranslate((totalWidth - dimTitle.getWidth()) / 2, 0)), new Area(dimTitle),
- new SimpleContext2D(false));
- ug = ug.apply(new UTranslate((totalWidth - mainWidth) / 2, dimTitle.getHeight() + dimHeader.getHeight()));
+ if (diagram.getLegend().getVerticalAlignment() == VerticalAlignment.BOTTOM) {
+ printAligned(ug, diagram.getLegend().getHorizontalAlignment(), legend);
+ ug = goDown(ug, legend);
}
- drawMainTile(ug, mainTile, livingSpaces);
+ printAligned(ug, diagram.getFooterOrHeaderTeoz(FontParam.FOOTER).getHorizontalAlignment(), footer);
ug2.writeImageTOBEMOVED(os, isWithMetadata ? diagram.getMetadata() : null, diagram.getDpi(fileFormatOption));
- final Dimension2D info = new Dimension2DDouble(dim.getWidth(), dim.getHeight());
-
- // if (fileFormatOption.getFileFormat() == FileFormat.PNG && ug instanceof UGraphicG2d) {
- // final Set<Url> urls = ((UGraphicG2d) ug).getAllUrlsEncountered();
- // if (urls.size() > 0) {
- // if (scale == 0) {
- // throw new IllegalStateException();
- // }
- // final CMapData cmap = CMapData.cmapString(urls, scale);
- // return new ImageDataComplex(info, cmap, null);
- // }
- // }
- return new ImageDataSimple(info);
- }
- private Component getCompTitle() {
- final Display title = diagram.getTitle();
+ return new ImageDataSimple(dimTotal);
+ }
- final Component compTitle;
- if (title == null) {
- compTitle = null;
- } else {
- compTitle = skin.createComponent(ComponentType.TITLE, null, diagram.getSkinParam(), title);
+ private UGraphic goDownForEnglobers(UGraphic ug) {
+ ug = goDown(ug, title);
+ ug = goDown(ug, header);
+ if (diagram.getLegend().getVerticalAlignment() == VerticalAlignment.TOP) {
+ ug = goDown(ug, legend);
}
- return compTitle;
+ return ug;
+ }
+
+ private UGraphic goDown(UGraphic ug, TextBlock size) {
+ return ug.apply(new UTranslate(0, size.calculateDimension(stringBounder).getHeight()));
}
- private PngTitler getFooter() {
- if (diagram.getFooter() == null) {
- return null;
+ public void printAligned(UGraphic ug, HorizontalAlignment align, final TextBlock layer) {
+ double dx = 0;
+ if (align == HorizontalAlignment.RIGHT) {
+ dx = dimTotal.getWidth() - layer.calculateDimension(stringBounder).getWidth();
+ } else if (align == HorizontalAlignment.CENTER) {
+ dx = (dimTotal.getWidth() - layer.calculateDimension(stringBounder).getWidth()) / 2;
}
- final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
- final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.FOOTER, null);
- final String fontFamily = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getFamily(null);
- final int fontSize = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, diagram.getFooter(), fontSize, fontFamily,
- diagram.getFooterAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
- return pngTitler;
+ layer.drawU(ug.apply(new UTranslate(dx, 0)));
}
- private PngTitler getHeader() {
- final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
- final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.HEADER, null);
- final String fontFamily = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getFamily(null);
- final int fontSize = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getSize();
- final PngTitler pngTitler = new PngTitler(titleColor, diagram.getHeader(), fontSize, fontFamily,
- diagram.getHeaderAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
- return pngTitler;
+ private MainTile createMainTile() {
+ final RealOrigin origin = RealUtils.createOrigin();
+ Real currentPos = origin.addAtLeast(0);
+ for (Participant p : diagram.participants().values()) {
+ final LivingSpace livingSpace = new LivingSpace(p, diagram.getEnglober(p), skin, getSkinParam(),
+ currentPos, diagram.events());
+ livingSpaces.put(p, livingSpace);
+ currentPos = livingSpace.getPosD(stringBounder).addAtLeast(0);
+ }
+
+ final TileArguments tileArguments = new TileArguments(stringBounder, livingSpaces, skin,
+ diagram.getSkinParam(), origin);
+
+ this.englobers = new Englobers(tileArguments);
+ final MainTile mainTile = new MainTile(diagram, englobers, tileArguments);
+ this.livingSpaces.addConstraints(stringBounder);
+ mainTile.addConstraints(stringBounder);
+ this.englobers.addConstraints(stringBounder);
+ origin.compileNow();
+ tileArguments.setBordered(mainTile);
+ return mainTile;
}
- private void drawMainTile(final UGraphic ug, final MainTile mainTile, LivingSpaces livingSpaces) {
- final StringBounder stringBounder = ug.getStringBounder();
+ public ISkinParam getSkinParam() {
+ return diagram.getSkinParam();
+ }
- final Context2D context = new SimpleContext2D(false);
- livingSpaces.drawHeads(ug, context, VerticalAlignment.BOTTOM);
+ private TextBlock getTitle() {
+ if (DisplayPositionned.isNull(diagram.getTitle())) {
+ return new ComponentAdapter(null);
+ }
+ final Component compTitle = skin.createComponent(ComponentType.TITLE, null, getSkinParam(), diagram.getTitle()
+ .getDisplay());
+ return new ComponentAdapter(compTitle);
+ }
- final double headHeight = livingSpaces.getHeadHeight(stringBounder);
+ private TextBlock getLegend() {
+ final Display legend = diagram.getLegend().getDisplay();
+ if (Display.isNull(legend)) {
+ return TextBlockUtils.empty(0, 0);
+ }
+ return EntityImageLegend.create(legend, diagram.getSkinParam());
+ }
- mainTile.drawU(ug.apply(new UTranslate(0, headHeight)));
- livingSpaces.drawLifeLines(ug.apply(new UTranslate(0, headHeight)), mainTile.getPreferredHeight(stringBounder),
- context);
- livingSpaces.drawHeads(ug.apply(new UTranslate(0, mainTile.getPreferredHeight(stringBounder) + headHeight)),
- context, VerticalAlignment.TOP);
- mainTile.drawForeground(ug.apply(new UTranslate(0, headHeight)));
+ public TextBlock getFooterOrHeader(final FontParam param) {
+ if (DisplayPositionned.isNull(diagram.getFooterOrHeaderTeoz(param))) {
+ return new TeozLayer(null, stringBounder, param);
+ }
+ final Display display = diagram.getFooterOrHeaderTeoz(param).getDisplay();
+ final HtmlColor hyperlinkColor = getSkinParam().getHyperlinkColor();
+ final HtmlColor titleColor = getSkinParam().getFontHtmlColor(null, param);
+ final String fontFamily = getSkinParam().getFont(null, false, param).getFamily(null);
+ final int fontSize = getSkinParam().getFont(null, false, param).getSize();
+ final PngTitler pngTitler = new PngTitler(titleColor, display, fontSize, fontFamily, diagram
+ .getFooterOrHeaderTeoz(param).getHorizontalAlignment(), hyperlinkColor, getSkinParam()
+ .useUnderlineForHyperlink());
+ return new TeozLayer(pngTitler, stringBounder, param);
}
public int getNbPages() {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/Stairs2.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/Stairs2.java
index f6cdcc3..1973608 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/Stairs2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/Stairs2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,7 +40,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.SymbolContext;
public class Stairs2 {
@@ -48,13 +48,22 @@ public class Stairs2 {
private final List<IntegerColored> values = new ArrayList<IntegerColored>();
private final Map<Double, IntegerColored> cache = new HashMap<Double, IntegerColored>();
- public void addStep(StairsPosition position, int value, HtmlColor color) {
- System.err.println("Stairs2::addStep " + position + " " + value + " color=" + color);
+ @Override
+ public String toString() {
+ return ys.toString() + " " + values;
+ }
+
+ public void addStep(StairsPosition position, int value, SymbolContext color) {
+ if (value < 0) {
+ throw new IllegalArgumentException();
+ }
+ // System.err.println("Stairs2::addStep " + position + " " + value + " color=" + color);
assert ys.size() == values.size();
if (ys.size() > 0) {
final double lastY = ys.get(ys.size() - 1).getValue();
if (position.getValue() < lastY) {
- throw new IllegalArgumentException();
+ // throw new IllegalArgumentException();
+ return;
}
if (lastY == position.getValue()) {
values.set(ys.size() - 1, new IntegerColored(value, color));
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/StairsPosition.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/StairsPosition.java
index cf4e0f8..10241e8 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/StairsPosition.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/StairsPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java
new file mode 100644
index 0000000..c2e754d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TeozLayer.java
@@ -0,0 +1,77 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+import java.awt.geom.Dimension2D;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.png.PngTitler;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class TeozLayer extends AbstractTextBlock implements TextBlock {
+
+ private final PngTitler titler;
+ private Dimension2D dimension;
+ private final FontParam param;
+
+ public TeozLayer(PngTitler titler, StringBounder stringBounder, FontParam param) {
+ this.titler = titler;
+ this.param = param;
+
+ dimension = new Dimension2DDouble(0, 0);
+ if (titler != null && titler.getTextBlock() != null) {
+ dimension = titler.getTextBlock().calculateDimension(stringBounder);
+ }
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return dimension;
+ }
+
+ public FontParam getParam() {
+ return param;
+ }
+
+ public void drawU(UGraphic ug) {
+ if (titler != null) {
+ titler.getTextBlock().drawU(ug);
+ }
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/Tile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/Tile.java
index 1a106fe..666b92c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/Tile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/Tile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileArguments.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileArguments.java
index 4edee7e..62dee53 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileArguments.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileArguments.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,42 +44,40 @@ import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.Reference;
import net.sourceforge.plantuml.skin.Skin;
-public class TileArguments {
+public class TileArguments implements Bordered {
private final StringBounder stringBounder;
- private final Real omega;
private final Real origin;
private final LivingSpaces livingSpaces;
private final Skin skin;
private final ISkinParam skinParam;
- public TileArguments(StringBounder stringBounder, Real omega, LivingSpaces livingSpaces, Skin skin,
- ISkinParam skinParam, Real origin) {
+ public TileArguments(StringBounder stringBounder, LivingSpaces livingSpaces, Skin skin, ISkinParam skinParam,
+ Real origin) {
this.stringBounder = stringBounder;
this.origin = origin;
- this.omega = omega;
this.livingSpaces = livingSpaces;
this.skin = skin;
this.skinParam = skinParam;
}
public TileArguments withBackColorGeneral(HtmlColor backColorElement, HtmlColor backColorGeneral) {
- return new TileArguments(stringBounder, omega, livingSpaces, skin, new SkinParamBackcolored(skinParam,
+ return new TileArguments(stringBounder, livingSpaces, skin, new SkinParamBackcolored(skinParam,
backColorElement, backColorGeneral), origin);
}
public TileArguments withBackColor(Reference reference) {
final ISkinParam newSkinParam = new SkinParamBackcoloredReference(skinParam, reference.getBackColorElement(),
reference.getBackColorGeneral());
- return new TileArguments(stringBounder, omega, livingSpaces, skin, newSkinParam, origin);
+ return new TileArguments(stringBounder, livingSpaces, skin, newSkinParam, origin);
}
public final StringBounder getStringBounder() {
return stringBounder;
}
- public final Real getOmega() {
- return omega;
- }
+ // public final Real getMaxAbsolute() {
+ // return origin.getMaxAbsolute();
+ // }
public final Real getOrigin() {
return origin;
@@ -113,6 +111,28 @@ public class TileArguments {
return result;
}
+ private Bordered bordered;
+
+ public void setBordered(Bordered bordered) {
+ this.bordered = bordered;
+ }
+
+ public double getBorder1() {
+ return bordered.getBorder1();
+ }
+
+ public double getBorder2() {
+ return bordered.getBorder2();
+ }
+
+ // public double getAbsoluteMin() {
+ // return line.getAbsoluteMin();
+ // }
+ //
+ // public double getAbsoluteMax() {
+ // return line.getAbsoluteMax();
+ // }
+
// public void ensure(Tile tile) {
// getAlpha().ensureLowerThan(tile.getMinX(getStringBounder()));
// getOmega().ensureBiggerThan(tile.getMaxX(getStringBounder()));
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java
index 7a46663..961d5f8 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,20 +40,21 @@ import java.util.Iterator;
import java.util.List;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.SkinParamBackcoloredReference;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Delay;
import net.sourceforge.plantuml.sequencediagram.Divider;
import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
import net.sourceforge.plantuml.sequencediagram.GroupingStart;
import net.sourceforge.plantuml.sequencediagram.GroupingType;
+import net.sourceforge.plantuml.sequencediagram.HSpace;
import net.sourceforge.plantuml.sequencediagram.LifeEvent;
import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
+import net.sourceforge.plantuml.sequencediagram.Notes;
import net.sourceforge.plantuml.sequencediagram.Reference;
import net.sourceforge.plantuml.skin.Skin;
@@ -63,93 +64,103 @@ public class TileBuilder {
final List<Tile> tiles = new ArrayList<Tile>();
while (it.hasNext()) {
final Event ev = it.next();
- final Tile tile = TileBuilder.buildOne(it, tileArguments, ev, parent);
- if (tile != null) {
+ for (Tile tile : TileBuilder.buildOne(it, tileArguments, ev, parent)) {
tiles.add(tile);
- tileArguments.getOmega().ensureBiggerThan(tile.getMaxX(tileArguments.getStringBounder()));
+ final Real tmpMax = tile.getMaxX(tileArguments.getStringBounder());
}
}
return Collections.unmodifiableList(tiles);
}
- public static Tile buildOne(Iterator<Event> it, TileArguments tileArguments, final Event ev, Tile parent) {
+ public static List<Tile> buildOne(Iterator<Event> it, TileArguments tileArguments, final Event ev, Tile parent) {
final StringBounder stringBounder = tileArguments.getStringBounder();
final Skin skin = tileArguments.getSkin();
final ISkinParam skinParam = tileArguments.getSkinParam();
final LivingSpaces livingSpaces = tileArguments.getLivingSpaces();
- Tile tile = null;
+ final List<Tile> tiles = new ArrayList<Tile>();
// System.err.println("TileBuilder::buildOne " + ev);
if (ev instanceof Message) {
final Message msg = (Message) ev;
final LivingSpace livingSpace1 = livingSpaces.get(msg.getParticipant1());
final LivingSpace livingSpace2 = livingSpaces.get(msg.getParticipant2());
boolean reverse = false;
+ Tile result = null;
if (msg.isSelfMessage()) {
- tile = new CommunicationTileSelf(livingSpace1, msg, skin, skinParam, livingSpaces);
+ result = new CommunicationTileSelf(livingSpace1, msg, skin, skinParam, livingSpaces);
} else {
// System.err.println("msg=" + msg);
- tile = new CommunicationTile(livingSpace1, livingSpace2, msg, skin, skinParam);
- reverse = ((CommunicationTile) tile).isReverse(stringBounder);
+ result = new CommunicationTile(livingSpace1, livingSpace2, msg, skin, skinParam);
+ reverse = ((CommunicationTile) result).isReverse(stringBounder);
}
if (msg.getNote() != null) {
final NotePosition notePosition = msg.getNotePosition();
if (notePosition == NotePosition.LEFT) {
- tile = new CommunicationTileNoteLeft((TileWithUpdateStairs) tile, msg, skin, skinParam,
+ result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, msg, skin, skinParam,
reverse ? livingSpace2 : livingSpace1);
} else if (notePosition == NotePosition.RIGHT && msg.isSelfMessage()) {
- tile = new CommunicationTileSelfNoteRight((CommunicationTileSelf) tile, msg, skin, skinParam);
+ result = new CommunicationTileSelfNoteRight((CommunicationTileSelf) result, msg, skin, skinParam);
} else if (notePosition == NotePosition.RIGHT) {
- tile = new CommunicationTileNoteRight((TileWithUpdateStairs) tile, msg, skin, skinParam,
+ result = new CommunicationTileNoteRight((TileWithUpdateStairs) result, msg, skin, skinParam,
reverse ? livingSpace1 : livingSpace2);
}
}
+ tiles.add(result);
} else if (ev instanceof MessageExo) {
final MessageExo exo = (MessageExo) ev;
final LivingSpace livingSpace1 = livingSpaces.get(exo.getParticipant());
- tile = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments.getOrigin(),
- tileArguments.getOmega());
+ Tile result = null;
+ result = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments);
if (exo.getNote() != null) {
final NotePosition notePosition = exo.getNotePosition();
if (notePosition == NotePosition.LEFT) {
- tile = new CommunicationTileNoteLeft((TileWithUpdateStairs) tile, exo, skin, skinParam,
+ result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, exo, skin, skinParam,
livingSpace1);
} else if (notePosition == NotePosition.RIGHT) {
- tile = new CommunicationTileNoteRight((TileWithUpdateStairs) tile, exo, skin, skinParam,
+ result = new CommunicationTileNoteRight((TileWithUpdateStairs) result, exo, skin, skinParam,
livingSpace1);
}
}
+ tiles.add(result);
} else if (ev instanceof Note) {
final Note note = (Note) ev;
final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
final LivingSpace livingSpace2 = note.getParticipant2() == null ? null : livingSpaces.get(note
.getParticipant2());
- tile = new NoteTile(livingSpace1, livingSpace2, note, skin, skinParam);
+ tiles.add(new NoteTile(livingSpace1, livingSpace2, note, skin, skinParam));
+ } else if (ev instanceof Notes) {
+ final Notes notes = (Notes) ev;
+ tiles.add(new NotesTile(livingSpaces, notes, skin, skinParam));
} else if (ev instanceof Divider) {
final Divider divider = (Divider) ev;
- tile = new DividerTile(divider, skin, skinParam, tileArguments.getOrigin(), tileArguments.getOmega());
+ tiles.add(new DividerTile(divider, tileArguments));
} else if (ev instanceof GroupingStart) {
final GroupingStart start = (GroupingStart) ev;
- tile = new GroupingTile(it, start, tileArguments.withBackColorGeneral(start.getBackColorElement(),
- start.getBackColorGeneral()), tileArguments);
- // tile = TileUtils.withMargin(tile, 10, 10, 10, 10);
+ tiles.add(new EmptyTile(4, tileArguments));
+ tiles.add(new GroupingTile(it, start, tileArguments.withBackColorGeneral(start.getBackColorElement(),
+ start.getBackColorGeneral()), tileArguments));
+ tiles.add(new EmptyTile(4, tileArguments));
+ // tiles.add(TileUtils.withMargin(tile, 0, 0, 4, 4);
} else if (ev instanceof GroupingLeaf && ((GroupingLeaf) ev).getType() == GroupingType.ELSE) {
final GroupingLeaf anElse = (GroupingLeaf) ev;
- tile = new ElseTile(anElse, skin, skinParam, parent);
+ tiles.add(new ElseTile(anElse, skin, skinParam, parent));
} else if (ev instanceof Reference) {
final Reference ref = (Reference) ev;
- tile = new ReferenceTile(ref, tileArguments.withBackColor(ref));
+ tiles.add(new ReferenceTile(ref, tileArguments.withBackColor(ref)));
} else if (ev instanceof Delay) {
final Delay delay = (Delay) ev;
- tile = new DelayTile(delay, tileArguments);
+ tiles.add(new DelayTile(delay, tileArguments));
+ } else if (ev instanceof HSpace) {
+ final HSpace hspace = (HSpace) ev;
+ tiles.add(new HSpaceTile(hspace, tileArguments));
} else if (ev instanceof LifeEvent) {
final LifeEvent lifeEvent = (LifeEvent) ev;
final LivingSpace livingSpace = livingSpaces.get(lifeEvent.getParticipant());
- tile = new LifeEventTile(lifeEvent, tileArguments, livingSpace, skin, skinParam);
+ tiles.add(new LifeEventTile(lifeEvent, tileArguments, livingSpace, skin, skinParam));
} else {
System.err.println("TileBuilder::Ignoring " + ev.getClass());
}
- return tile;
+ return tiles;
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileMarged.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileMarged.java
index b9f698d..b7893eb 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileMarged.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileMarged.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileUtils.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileUtils.java
index 2307fa9..f4bd2e4 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileUtils.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,7 +36,7 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
public class TileUtils {
- private static Tile withMargin(Tile tile, double x1, double x2, double y1, double y2) {
+ public static Tile withMargin(Tile tile, double x1, double x2, double y1, double y2) {
return new TileMarged(tile, x1, x2, y1, y2);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithCallbackY.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithCallbackY.java
new file mode 100644
index 0000000..87e025b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithCallbackY.java
@@ -0,0 +1,41 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.sequencediagram.teoz;
+
+
+public interface TileWithCallbackY extends Tile {
+
+ public void callbackY(double y);
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithUpdateStairs.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithUpdateStairs.java
index ebb7266..d888d1e 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithUpdateStairs.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/TileWithUpdateStairs.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/UGraphicInterceptorTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/UGraphicInterceptorTile.java
index 2a13a9a..a75c761 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/UGraphicInterceptorTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/UGraphicInterceptorTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/YPositionedTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/YPositionedTile.java
index a9aaf6c..418c12f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/YPositionedTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/YPositionedTile.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,6 +46,9 @@ public class YPositionedTile implements UDrawable {
public YPositionedTile(Tile tile, double y) {
this.tile = tile;
this.y = y;
+ if (tile instanceof TileWithCallbackY) {
+ ((TileWithCallbackY) tile).callbackY(y);
+ }
}
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/skin/AbstractComponent.java b/src/net/sourceforge/plantuml/skin/AbstractComponent.java
index f85af26..02aaa95 100644
--- a/src/net/sourceforge/plantuml/skin/AbstractComponent.java
+++ b/src/net/sourceforge/plantuml/skin/AbstractComponent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java b/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java
index 457e155..d4e2500 100644
--- a/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java
+++ b/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.BodyEnhanced2;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -85,8 +86,8 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
} else if (enhanced) {
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, HorizontalAlignment.LEFT, font);
} else {
- textBlock = TextBlockUtils.create(strings, font, horizontalAlignment, spriteContainer, maxMessageSize,
- false, fontForStereotype, htmlColorForStereotype);
+ textBlock = strings.create(font, horizontalAlignment, spriteContainer, maxMessageSize, CreoleMode.FULL,
+ fontForStereotype, htmlColorForStereotype);
}
}
diff --git a/src/net/sourceforge/plantuml/skin/Area.java b/src/net/sourceforge/plantuml/skin/Area.java
index b0ae45d..eae9878 100644
--- a/src/net/sourceforge/plantuml/skin/Area.java
+++ b/src/net/sourceforge/plantuml/skin/Area.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowBody.java b/src/net/sourceforge/plantuml/skin/ArrowBody.java
index 102793b..83d0da1 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowBody.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowBody.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowComponent.java b/src/net/sourceforge/plantuml/skin/ArrowComponent.java
index 0bdcb48..423b690 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowComponent.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowComponent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java b/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java
index 77bb02a..1b3cc78 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowDecoration.java b/src/net/sourceforge/plantuml/skin/ArrowDecoration.java
index 8d38ea2..4188d22 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowDecoration.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowDecoration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowDirection.java b/src/net/sourceforge/plantuml/skin/ArrowDirection.java
index 6ee24d0..9330c0c 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowDirection.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowDirection.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowDressing.java b/src/net/sourceforge/plantuml/skin/ArrowDressing.java
index 5416e62..b4ce140 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowDressing.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowDressing.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowHead.java b/src/net/sourceforge/plantuml/skin/ArrowHead.java
index 562f8ce..04c922b 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowHead.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowHead.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ArrowPart.java b/src/net/sourceforge/plantuml/skin/ArrowPart.java
index 08ba7cc..0faf8f0 100644
--- a/src/net/sourceforge/plantuml/skin/ArrowPart.java
+++ b/src/net/sourceforge/plantuml/skin/ArrowPart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/CircleInterface.java b/src/net/sourceforge/plantuml/skin/CircleInterface.java
index dc6afda..d61584c 100644
--- a/src/net/sourceforge/plantuml/skin/CircleInterface.java
+++ b/src/net/sourceforge/plantuml/skin/CircleInterface.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/Component.java b/src/net/sourceforge/plantuml/skin/Component.java
index 2701e42..96a6f1f 100644
--- a/src/net/sourceforge/plantuml/skin/Component.java
+++ b/src/net/sourceforge/plantuml/skin/Component.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/ComponentType.java b/src/net/sourceforge/plantuml/skin/ComponentType.java
index 3420f5e..c17a69d 100644
--- a/src/net/sourceforge/plantuml/skin/ComponentType.java
+++ b/src/net/sourceforge/plantuml/skin/ComponentType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/Context2D.java b/src/net/sourceforge/plantuml/skin/Context2D.java
index 1c4e00f..df3fe15 100644
--- a/src/net/sourceforge/plantuml/skin/Context2D.java
+++ b/src/net/sourceforge/plantuml/skin/Context2D.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/GrayComponent.java b/src/net/sourceforge/plantuml/skin/GrayComponent.java
index 21704c8..3a06534 100644
--- a/src/net/sourceforge/plantuml/skin/GrayComponent.java
+++ b/src/net/sourceforge/plantuml/skin/GrayComponent.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -75,8 +75,8 @@ class GrayComponent extends AbstractComponent {
strings.add(n.substring(i, Math.min(i + split, n.length())));
}
- final TextBlock textBlock = TextBlockUtils.create(Display.create(strings), new FontConfiguration(NORMAL, HtmlColorUtils.BLACK,
- HtmlColorUtils.BLUE, true), HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final TextBlock textBlock = Display.create(strings).create(FontConfiguration.blackBlueTrue(NORMAL),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
textBlock.drawU(ug);
}
diff --git a/src/net/sourceforge/plantuml/skin/ProtectedSkin.java b/src/net/sourceforge/plantuml/skin/ProtectedSkin.java
index 45cc87e..8068564 100644
--- a/src/net/sourceforge/plantuml/skin/ProtectedSkin.java
+++ b/src/net/sourceforge/plantuml/skin/ProtectedSkin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/SimpleContext2D.java b/src/net/sourceforge/plantuml/skin/SimpleContext2D.java
index 84eb6dc..cca8018 100644
--- a/src/net/sourceforge/plantuml/skin/SimpleContext2D.java
+++ b/src/net/sourceforge/plantuml/skin/SimpleContext2D.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/Skin.java b/src/net/sourceforge/plantuml/skin/Skin.java
index 0232273..9cd1d4e 100644
--- a/src/net/sourceforge/plantuml/skin/Skin.java
+++ b/src/net/sourceforge/plantuml/skin/Skin.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/SkinUtils.java b/src/net/sourceforge/plantuml/skin/SkinUtils.java
index 63b01f2..52e114a 100644
--- a/src/net/sourceforge/plantuml/skin/SkinUtils.java
+++ b/src/net/sourceforge/plantuml/skin/SkinUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/StickMan.java b/src/net/sourceforge/plantuml/skin/StickMan.java
index 33c27e5..57fa67c 100644
--- a/src/net/sourceforge/plantuml/skin/StickMan.java
+++ b/src/net/sourceforge/plantuml/skin/StickMan.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.skin;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
@@ -47,7 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class StickMan implements TextBlock {
+public class StickMan extends AbstractTextBlock implements TextBlock {
private final double armsY = 8;
private final double armsLenght = 13;
diff --git a/src/net/sourceforge/plantuml/skin/VisibilityModifier.java b/src/net/sourceforge/plantuml/skin/VisibilityModifier.java
index 186484f..20c6508 100644
--- a/src/net/sourceforge/plantuml/skin/VisibilityModifier.java
+++ b/src/net/sourceforge/plantuml/skin/VisibilityModifier.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,9 +35,11 @@
package net.sourceforge.plantuml.skin;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -77,18 +79,19 @@ public enum VisibilityModifier {
}
public TextBlock getUBlock(final int size, final HtmlColor foregroundColor, final HtmlColor backgoundColor) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public Dimension2D calculateDimension(StringBounder stringBounder) {
return new Dimension2DDouble(size + 1, size + 1);
}
+
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ return null;
+ }
public void drawU(UGraphic ug) {
- // final double tx = ug.getTranslateX();
- // final double ty = ug.getTranslateY();
- // ug.translate(x, y);F
drawInternal(ug, size, foregroundColor, backgoundColor, 0, 0);
- // ug.setTranslate(tx, ty);
}
};
}
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java b/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java
index de3a6b4..bd8d752 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java b/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java
index 6cefbeb..a03e2e4 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -81,18 +81,19 @@ public class BlueModern implements Skin {
final HtmlColor sequenceArrow = config.getColor() == null ? HtmlColorUtils.BLACK : config.getColor();
if (config.isSelfArrow()) {
return new ComponentBlueModernSelfArrow(sequenceArrow, normalFont.toFont2(HtmlColorUtils.BLACK,
- useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config, param);
+ useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay, config, param);
}
return new ComponentBlueModernArrow(sequenceArrow, useUnderlineForHyperlink, normalFont.toFont2(
- HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config, param);
+ HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()),
+ stringsToDisplay, config, param);
}
if (type == ComponentType.PARTICIPANT_HEAD) {
return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE,
- useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
+ useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay, param);
}
if (type == ComponentType.PARTICIPANT_TAIL) {
return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE,
- useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
+ useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay, param);
}
if (type == ComponentType.PARTICIPANT_LINE) {
return new ComponentBlueModernLine(lineColor);
@@ -102,15 +103,16 @@ public class BlueModern implements Skin {
}
if (type == ComponentType.ACTOR_HEAD) {
return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink,
- hyperlinkColor), stringsToDisplay, true, param);
+ hyperlinkColor, param.getTabSize()), stringsToDisplay, true, param);
}
if (type == ComponentType.ACTOR_TAIL) {
return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink,
- hyperlinkColor), stringsToDisplay, false, param);
+ hyperlinkColor, param.getTabSize()), stringsToDisplay, false, param);
}
if (type == ComponentType.NOTE) {
return new ComponentBlueModernNote(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK, normalFont.toFont2(
- HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
+ HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()),
+ stringsToDisplay, param);
}
if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
return new ComponentBlueModernActiveLine(blue1, true, true);
@@ -128,50 +130,53 @@ public class BlueModern implements Skin {
return new ComponentBlueModernDelayLine(lineColor);
}
if (type == ComponentType.DELAY_TEXT) {
- return new ComponentBlueModernDelayText(param.getFont(FontParam.SEQUENCE_DELAY, null, false).toFont2(
- HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
+ return new ComponentBlueModernDelayText(param.getFont(null, false, FontParam.SEQUENCE_DELAY).toFont2(
+ HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()),
+ stringsToDisplay, param);
}
if (type == ComponentType.DESTROY) {
return new ComponentRoseDestroy(red);
}
if (type == ComponentType.GROUPING_HEADER) {
return new ComponentBlueModernGroupingHeader(blue1, blue3, borderGroupColor, HtmlColorUtils.BLACK,
- normalFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), smallFont,
- stringsToDisplay, param);
+ normalFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor,
+ param.getTabSize()), smallFont, stringsToDisplay, param);
}
if (type == ComponentType.GROUPING_ELSE) {
return new ComponentRoseGroupingElse(HtmlColorUtils.BLACK, smallFont.toFont2(HtmlColorUtils.BLACK,
- useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay.get(0), param, blue3);
+ useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay.get(0), param,
+ blue3);
}
if (type == ComponentType.GROUPING_SPACE) {
return new ComponentRoseGroupingSpace(7);
}
if (type == ComponentType.TITLE) {
return new ComponentRoseTitle(bigFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
- hyperlinkColor), stringsToDisplay, param);
+ hyperlinkColor, param.getTabSize()), stringsToDisplay, param);
}
if (type == ComponentType.REFERENCE) {
return new ComponentRoseReference(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
- hyperlinkColor), new SymbolContext(blue1, borderGroupColor).withStroke(Rose.getStroke(param,
- LineParam.sequenceDividerBorder, 2)), normalFont.toFont2(HtmlColorUtils.WHITE,
- useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, HorizontalAlignment.CENTER, param,
- blue3);
+ hyperlinkColor, param.getTabSize()), new SymbolContext(blue1, borderGroupColor).withStroke(Rose
+ .getStroke(param, LineParam.sequenceDividerBorder, 2)), normalFont.toFont2(HtmlColorUtils.WHITE,
+ useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay,
+ HorizontalAlignment.CENTER, param, blue3);
}
if (type == ComponentType.NEWPAGE) {
return new ComponentBlueModernNewpage(blue1);
}
if (type == ComponentType.DIVIDER) {
return new ComponentBlueModernDivider(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
- hyperlinkColor), blue2, blue1, HtmlColorUtils.BLACK, stringsToDisplay, param);
+ hyperlinkColor, param.getTabSize()), blue2, blue1, HtmlColorUtils.BLACK, stringsToDisplay, param);
}
if (type == ComponentType.SIGNATURE) {
return new ComponentRoseTitle(smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
- hyperlinkColor), Display.create("This skin was created ", "in April 2009."), param);
+ hyperlinkColor, param.getTabSize()), Display.create("This skin was created ", "in April 2009."),
+ param);
}
if (type == ComponentType.ENGLOBER) {
return new ComponentBlueModernEnglober(blue1, blue3, stringsToDisplay, param.getFont(
- FontParam.SEQUENCE_BOX, null, false).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
- hyperlinkColor), param);
+ null, false, FontParam.SEQUENCE_BOX).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
+ hyperlinkColor, param.getTabSize()), param);
}
return null;
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java
index b125755..35a1b34 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java
index 6dd1f15..4848d81 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java
index c744f41..5052cfe 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java
index c1bf6b7..16bb80a 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java
index a352df7..7a246f9 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java
index b2558c6..eab70d0 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java
index 45511ac..9b9cddf 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java
index e7c98c0..5d49e61 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -68,18 +68,19 @@ public class ComponentBlueModernGroupingHeader extends AbstractTextualComponent
private final HtmlColor borderColor;
public ComponentBlueModernGroupingHeader(HtmlColor headerBackgroundColor, HtmlColor generalBackgroundColor,
- HtmlColor borderColor, HtmlColor fontColor2, FontConfiguration bigFont, UFont smallFont, Display strings, ISkinSimple spriteContainer) {
- super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, 0, null,
- null);
+ HtmlColor borderColor, HtmlColor fontColor2, FontConfiguration bigFont, UFont smallFont, Display strings,
+ ISkinSimple spriteContainer) {
+ super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, 0, null, null);
this.headerBackgroundColor = headerBackgroundColor;
this.generalBackgroundColor = generalBackgroundColor;
this.borderColor = borderColor;
if (strings.size() == 1 || strings.get(1) == null) {
this.commentTextBlock = null;
} else {
- this.commentTextBlock = TextBlockUtils.create(Display.create("[" + strings.get(1) + "]"),
- new FontConfiguration(smallFont, fontColor2, bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink()), HorizontalAlignment.LEFT,
- spriteContainer);
+ final FontConfiguration fontConfiguration = new FontConfiguration(smallFont, fontColor2,
+ bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink(), spriteContainer.getTabSize());
+ this.commentTextBlock = Display.create("[" + strings.get(1) + "]").create(fontConfiguration,
+ HorizontalAlignment.LEFT, spriteContainer);
}
}
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java
index c69c082..c6c99ab 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java
index 8d6cf38..abca981 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java
index 671c086..0388ec7 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java
index f9bb38d..5b9b80c 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java
index fc1dd31..817711a 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java b/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java
index 9af427f..cf86ddc 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java b/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java
index 726fb96..b908875 100644
--- a/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java
+++ b/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/AbstractComponentRoseArrow.java b/src/net/sourceforge/plantuml/skin/rose/AbstractComponentRoseArrow.java
index c69804b..8852f6b 100644
--- a/src/net/sourceforge/plantuml/skin/rose/AbstractComponentRoseArrow.java
+++ b/src/net/sourceforge/plantuml/skin/rose/AbstractComponentRoseArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActiveLine.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActiveLine.java
index de9845e..7d594ea 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActiveLine.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActiveLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActor.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActor.java
index 42c6810..772b220 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActor.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseActor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java
index 01ac5a2..848c022 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseBoundary.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseBoundary.java
index a107d07..02e536f 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseBoundary.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseBoundary.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseControl.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseControl.java
index 2ea4182..943acf9 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseControl.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseControl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDatabase.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDatabase.java
index 4c18cef..48fcba5 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDatabase.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDatabase.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -66,8 +66,8 @@ public class ComponentRoseDatabase extends AbstractTextualComponent {
final SymbolContext symbolContext = new SymbolContext(biColor.getBackColor(), biColor.getForeColor())
.withStroke(new UStroke(1.5)).withShadow(biColor.getDeltaShadow() > 0);
- this.stickman = USymbol.DATABASE.asSmall(TextBlockUtils.empty(16, 17), TextBlockUtils.empty(0, 0),
- symbolContext);
+ this.stickman = USymbol.DATABASE.asSmall(null, TextBlockUtils.empty(16, 17),
+ TextBlockUtils.empty(0, 0), symbolContext);
}
@Override
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayLine.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayLine.java
index 90ad857..0f74efc 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayLine.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayText.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayText.java
index 8bc81bd..80e674d 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayText.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDelayText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDestroy.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDestroy.java
index 810599e..27c2af0 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDestroy.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDestroy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDivider.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDivider.java
index b1e8a37..56f382a 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDivider.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseDivider.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,7 +41,6 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
@@ -57,16 +56,17 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ComponentRoseDivider extends AbstractTextualComponent {
// private final int outMargin = 5;
+ private final HtmlColor borderColor;
private final HtmlColor background;
private final boolean empty;
private final boolean withShadow;
private final UStroke stroke;
public ComponentRoseDivider(FontConfiguration font, HtmlColor background, Display stringsToDisplay,
- ISkinSimple spriteContainer, boolean withShadow, UStroke stroke) {
- super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
- spriteContainer, 0, false, null, null);
+ ISkinSimple spriteContainer, boolean withShadow, UStroke stroke, HtmlColor borderColor) {
+ super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4, spriteContainer, 0, false, null, null);
this.background = background;
+ this.borderColor = borderColor;
this.empty = stringsToDisplay.get(0).length() == 0;
this.withShadow = withShadow;
this.stroke = stroke;
@@ -90,7 +90,7 @@ public class ComponentRoseDivider extends AbstractTextualComponent {
drawSep(ug.apply(new UTranslate(0, dimensionToUse.getHeight() / 2)), dimensionToUse.getWidth());
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(borderColor));
ug = ug.apply(stroke);
final URectangle rect = new URectangle(textWidth + deltaX, textHeight);
if (withShadow) {
@@ -120,7 +120,7 @@ public class ComponentRoseDivider extends AbstractTextualComponent {
}
private void drawDoubleLine(UGraphic ug, final double width) {
- ug = ug.apply(new UStroke(stroke.getThickness() / 2)).apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UStroke(stroke.getThickness() / 2)).apply(new UChangeColor(borderColor));
final ULine line = new ULine(width, 0);
ug.apply(new UTranslate(0, -1)).draw(line);
ug.apply(new UTranslate(0, 2)).draw(line);
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java
index 0e296b4..e82e3cf 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEnglober.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEntity.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEntity.java
index e0b3d2e..a9cb6cb 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEntity.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseEntity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingElse.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingElse.java
index 0a3421f..16e2ef9 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingElse.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingElse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java
index 6944322..af47ae8 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,12 +44,10 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
@@ -66,8 +64,8 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
private final HtmlColor background;
private final SymbolContext symbolContext;
- public ComponentRoseGroupingHeader(HtmlColor background, SymbolContext symbolContext, FontConfiguration bigFont, UFont smallFont,
- Display strings, ISkinSimple spriteContainer) {
+ public ComponentRoseGroupingHeader(HtmlColor background, SymbolContext symbolContext, FontConfiguration bigFont,
+ FontConfiguration smallFont2, Display strings, ISkinSimple spriteContainer) {
super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, 0, null, null);
this.symbolContext = symbolContext;
this.background = background;
@@ -75,16 +73,17 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
this.commentTextBlock = null;
} else {
final Display display = Display.getWithNewlines("[" + strings.get(1) + "]");
- this.commentTextBlock = TextBlockUtils.create(display, new FontConfiguration(smallFont, bigFont.getColor(),
- bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink()), HorizontalAlignment.LEFT,
- spriteContainer);
+ // final FontConfiguration smallFont2 = bigFont.forceFont(smallFont, null);
+ this.commentTextBlock = display.create(smallFont2, HorizontalAlignment.LEFT, spriteContainer);
}
if (this.background == null) {
throw new IllegalArgumentException();
}
-
}
+ // new FontConfiguration(smallFont, bigFont.getColor(), bigFont.getHyperlinkColor(),
+ // bigFont.useUnderlineForHyperlink());
+
private double getSuppHeightForComment(StringBounder stringBounder) {
if (commentTextBlock == null) {
return 0;
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java
index 6243331..d99f2d7 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingSpace.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseLine.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseLine.java
index 30abb6e..394049b 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseLine.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNewpage.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNewpage.java
index 2ecac3a..0837fdd 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNewpage.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNewpage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java
index 56ee046..cd615bc 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,13 +39,10 @@ import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area;
-import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
-import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.ULine;
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteBox.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteBox.java
index cac5ef9..9df137b 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteBox.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteBox.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteHexagonal.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteHexagonal.java
index b6505cc..e79fbfd 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteHexagonal.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseNoteHexagonal.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseParticipant.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseParticipant.java
index b9cb2dd..573d1ad 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseParticipant.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseParticipant.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseReference.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseReference.java
index 25cbc61..88f3b17 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseReference.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseReference.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -71,8 +71,7 @@ public class ComponentRoseReference extends AbstractTextualComponent {
this.symbolContext = symbolContext;
this.background = background;
- this.textHeader = TextBlockUtils.create(stringsToDisplay.subList(0, 1), header, HorizontalAlignment.LEFT,
- spriteContainer);
+ this.textHeader = stringsToDisplay.subList(0, 1).create(header, HorizontalAlignment.LEFT, spriteContainer);
}
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseSelfArrow.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseSelfArrow.java
index 85058d4..109eae6 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseSelfArrow.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseSelfArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseTitle.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseTitle.java
index da21aa8..ef34d17 100644
--- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseTitle.java
+++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseTitle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java
index f8782fe..74e9543 100644
--- a/src/net/sourceforge/plantuml/skin/rose/Rose.java
+++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -60,7 +61,7 @@ public class Rose implements Skin {
final private double paddingY = 5;
public HtmlColor getFontColor(ISkinParam skin, FontParam fontParam) {
- return skin.getFontHtmlColor(fontParam, null);
+ return skin.getFontHtmlColor(null, fontParam);
}
public HtmlColor getHtmlColor(ISkinParam param, ColorParam color) {
@@ -78,17 +79,15 @@ public class Rose implements Skin {
return result;
}
- private FontConfiguration getUFont2(ISkinParam param, FontParam fontParam) {
- final UFont font = param.getFont(fontParam, null, false);
- final HtmlColor fontColor = getFontColor(param, fontParam);
- return new FontConfiguration(font, fontColor, param.getHyperlinkColor(), param.useUnderlineForHyperlink());
+ private FontConfiguration getUFont2(ISkinParam skinParam, FontParam fontParam) {
+ return new FontConfiguration(skinParam, fontParam, null);
}
public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param,
Display stringsToDisplay) {
- final UFont fontGrouping = param.getFont(FontParam.SEQUENCE_GROUP, null, false);
+ final UFont fontGrouping = param.getFont(null, false, FontParam.SEQUENCE_GROUP);
- final UFont newFontForStereotype = param.getFont(FontParam.SEQUENCE_STEREOTYPE, null, false);
+ final UFont newFontForStereotype = param.getFont(null, false, FontParam.SEQUENCE_STEREOTYPE);
if (type.isArrow()) {
// if (param.maxMessageSize() > 0) {
@@ -189,10 +188,15 @@ public class Rose implements Skin {
return new ComponentRoseNoteBox(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
FontParam.NOTE), stringsToDisplay, param);
}
+ final FontConfiguration bigFont = getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER);
if (type == ComponentType.GROUPING_HEADER) {
+ FontConfiguration smallFont = bigFont.forceFont(fontGrouping, null);
+ final HtmlColor smallColor = SkinParamUtils.getFontColor(param, FontParam.SEQUENCE_GROUP, null);
+ if (smallColor != null) {
+ smallFont = smallFont.changeColor(smallColor);
+ }
return new ComponentRoseGroupingHeader(param.getBackgroundColor(), getSymbolContext(param,
- ColorParam.sequenceGroupBorder), getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER), fontGrouping,
- stringsToDisplay, param);
+ ColorParam.sequenceGroupBorder), bigFont, smallFont, stringsToDisplay, param);
}
if (type == ComponentType.GROUPING_ELSE) {
return new ComponentRoseGroupingElse(getHtmlColor(param, ColorParam.sequenceGroupBorder), getUFont2(param,
@@ -228,20 +232,21 @@ public class Rose implements Skin {
if (type == ComponentType.DIVIDER) {
return new ComponentRoseDivider(getUFont2(param, FontParam.SEQUENCE_DIVIDER), getHtmlColor(param,
ColorParam.sequenceDividerBackground), stringsToDisplay, param, deltaShadow(param) > 0, getStroke(
- param, LineParam.sequenceDividerBorder, 2));
+ param, LineParam.sequenceDividerBorder, 2), getHtmlColor(param, ColorParam.sequenceDividerBorder));
}
if (type == ComponentType.REFERENCE) {
return new ComponentRoseReference(getUFont2(param, FontParam.SEQUENCE_REFERENCE), getSymbolContext(param,
- ColorParam.sequenceReferenceBorder), getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER),
- stringsToDisplay, param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param,
- getHtmlColor(param, ColorParam.sequenceReferenceBackground));
+ ColorParam.sequenceReferenceBorder), bigFont, stringsToDisplay,
+ param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param, getHtmlColor(param,
+ ColorParam.sequenceReferenceBackground));
}
if (type == ComponentType.TITLE) {
return new ComponentRoseTitle(getUFont2(param, FontParam.SEQUENCE_TITLE), stringsToDisplay, param);
}
if (type == ComponentType.SIGNATURE) {
return new ComponentRoseTitle(fontGrouping.toFont2(HtmlColorUtils.BLACK, param.useUnderlineForHyperlink(),
- param.getHyperlinkColor()), Display.create("This skin was created ", "in April 2009."), param);
+ param.getHyperlinkColor(), param.getTabSize()), Display.create("This skin was created ",
+ "in April 2009."), param);
}
if (type == ComponentType.ENGLOBER) {
return new ComponentRoseEnglober(getSymbolContext(param, ColorParam.sequenceBoxBorder), stringsToDisplay,
diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java
index 6d147af..ee59870 100644
--- a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java
+++ b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,12 +43,13 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.LeafType;
-import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.utils.UniqueSequence;
public class StateDiagram extends AbstractEntityDiagram {
+ private static final String CONCURRENT_PREFIX = "CONC";
+
public boolean checkConcurrentStateOk(Code code) {
if (leafExist(code) == false) {
return true;
@@ -122,12 +123,12 @@ public class StateDiagram extends AbstractEntityDiagram {
super.endGroup();
}
getCurrentGroup().setConcurrentSeparator(direction);
- final IGroup conc1 = getOrCreateGroup(UniqueSequence.getCode("CONC"), Display.create(""),
+ final IGroup conc1 = getOrCreateGroup(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""),
GroupType.CONCURRENT_STATE, getCurrentGroup());
if (EntityUtils.groupRoot(cur) == false && cur.getGroupType() == GroupType.STATE) {
cur.moveEntitiesTo(conc1);
super.endGroup();
- getOrCreateGroup(UniqueSequence.getCode("CONC"), Display.create(""), GroupType.CONCURRENT_STATE,
+ getOrCreateGroup(UniqueSequence.getCode(CONCURRENT_PREFIX), Display.create(""), GroupType.CONCURRENT_STATE,
getCurrentGroup());
}
// printlink("AFTER");
diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java b/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java
index cb5e85e..fa0b745 100644
--- a/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -84,19 +84,20 @@ public class StateDiagramFactory extends UmlDiagramFactory {
"ENTITY", new RegexLeaf("[\\p{L}0-9_.]+"), //
new RegexLeaf("[%g][^%g]+[%g]") //
));
- cmds.add(factoryNoteOnEntityCommand.createMultiLine());
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(true));
+ cmds.add(factoryNoteOnEntityCommand.createMultiLine(false));
cmds.add(new CommandHideEmptyDescription());
cmds.add(factoryNoteOnEntityCommand.createSingleLine());
final FactoryNoteOnLinkCommand factoryNoteOnLinkCommand = new FactoryNoteOnLinkCommand();
cmds.add(factoryNoteOnLinkCommand.createSingleLine());
- cmds.add(factoryNoteOnLinkCommand.createMultiLine());
+ cmds.add(factoryNoteOnLinkCommand.createMultiLine(false));
cmds.add(new CommandUrl());
final FactoryNoteCommand factoryNoteCommand = new FactoryNoteCommand();
cmds.add(factoryNoteCommand.createSingleLine());
- cmds.add(factoryNoteCommand.createMultiLine());
+ cmds.add(factoryNoteCommand.createMultiLine(false));
addCommonCommands(cmds);
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java b/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java
index 71cc0a5..25433b2 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandAddField.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -67,7 +67,7 @@ public class CommandAddField extends SingleLineCommand2<StateDiagram> {
final IEntity entity = diagram.getOrCreateLeaf(Code.of(code), null, null);
- entity.addFieldOrMethod(field);
+ entity.getBodier().addFieldOrMethod(field);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandConcurrentState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandConcurrentState.java
index 79fb65c..a332e42 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandConcurrentState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandConcurrentState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java
index e785453..b90b1fd 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,6 @@ package net.sourceforge.plantuml.statediagram.command;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
-import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@@ -50,7 +49,10 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.statediagram.StateDiagram;
public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram> {
@@ -73,11 +75,16 @@ public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram>
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("LINECOLOR", "(?:##(?:\\[(dotted|dashed|bold)\\])?(\\w+)?)?"), //
new RegexLeaf("(?:[%s]*\\{|[%s]+begin)$"));
}
+
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
private String getNotNull(RegexResult arg, String v1, String v2) {
if (arg.get(v1, 0) == null) {
@@ -106,9 +113,21 @@ public class CommandCreatePackageState extends SingleLineCommand2<StateDiagram>
final Url url = urlBuilder.getUrl(urlString);
p.addUrl(url);
}
- p.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
- p.setSpecificLineColor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
- CommandCreateClassMultilines.applyStroke(p, arg.get("LINECOLOR", 0));
+
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
+ if (lineColor != null) {
+ colors = colors.add(ColorType.LINE, lineColor);
+ }
+ if (arg.get("LINECOLOR", 0) != null) {
+ colors = colors.addLegacyStroke(arg.get("LINECOLOR", 0));
+ }
+ p.setColors(colors);
+
+// p.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+// p.setSpecificColorTOBEREMOVED(ColorType.LINE, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
+// p.applyStroke(arg.get("LINECOLOR", 0));
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java
index ef288d3..c40991f 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,7 +37,6 @@ package net.sourceforge.plantuml.statediagram.command;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
-import net.sourceforge.plantuml.classdiagram.command.CommandCreateClassMultilines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@@ -49,7 +48,10 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.statediagram.StateDiagram;
public class CommandCreateState extends SingleLineCommand2<StateDiagram> {
@@ -78,7 +80,7 @@ public class CommandCreateState extends SingleLineCommand2<StateDiagram> {
new RegexLeaf("[%s]*"), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("COLOR", "(" + HtmlColorUtils.COLOR_REGEXP + ")?"), //
+ color().getRegex(), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("LINECOLOR", "(?:##(?:\\[(dotted|dashed|bold)\\])?(\\w+)?)?"), //
new RegexLeaf("[%s]*"), //
@@ -86,6 +88,10 @@ public class CommandCreateState extends SingleLineCommand2<StateDiagram> {
new RegexLeaf("$"));
}
+ private static ColorParser color() {
+ return ColorParser.simpleColor(ColorType.BACK);
+ }
+
@Override
protected CommandExecutionResult executeArg(StateDiagram diagram, RegexResult arg) {
final Code code = Code.of(arg.getLazzy("CODE", 0));
@@ -111,13 +117,27 @@ public class CommandCreateState extends SingleLineCommand2<StateDiagram> {
final Url url = urlBuilder.getUrl(urlString);
ent.addUrl(url);
}
- ent.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
- ent.setSpecificLineColor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
- CommandCreateClassMultilines.applyStroke(ent, arg.get("LINECOLOR", 0));
+
+ Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
+
+ final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
+ if (lineColor != null) {
+ colors = colors.add(ColorType.LINE, lineColor);
+ }
+ if (arg.get("LINECOLOR", 0) != null) {
+ colors = colors.addLegacyStroke(arg.get("LINECOLOR", 0));
+ }
+ ent.setColors(colors);
+
+ // ent.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));
+ // ent.setSpecificColorTOBEREMOVED(ColorType.LINE,
+ // diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1)));
+ // ent.applyStroke(arg.get("LINECOLOR", 0));
final String addFields = arg.get("ADDFIELD", 0);
if (addFields != null) {
- ent.addFieldOrMethod(addFields);
+ ent.getBodier().addFieldOrMethod(addFields);
}
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandEndState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandEndState.java
index edae33f..64b2d33 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandEndState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandEndState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandHideEmptyDescription.java b/src/net/sourceforge/plantuml/statediagram/command/CommandHideEmptyDescription.java
index ea895c1..657ded0 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandHideEmptyDescription.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandHideEmptyDescription.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java
index 414cbf4..7181b30 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.statediagram.command;
import net.sourceforge.plantuml.Direction;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@@ -49,8 +50,8 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.statediagram.StateDiagram;
-import net.sourceforge.plantuml.StringUtils;
public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
@@ -77,7 +78,7 @@ public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
new RegexLeaf("[%s]*"), //
getStatePattern("ENT2"), //
new RegexLeaf("[%s]*"), //
- new RegexLeaf("LABEL", "(?::[%s]*([^%g]+))?"), //
+ new RegexLeaf("LABEL", "(?::[%s]*(.+))?"), //
new RegexLeaf("$"));
}
@@ -107,13 +108,13 @@ public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
cl1.setStereotype(new Stereotype(arg.get("ENT1", 1)));
}
if (arg.get("ENT1", 2) != null) {
- cl1.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT1", 2)));
+ cl1.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT1", 2)));
}
if (arg.get("ENT2", 1) != null) {
cl2.setStereotype(new Stereotype(arg.get("ENT2", 1)));
}
if (arg.get("ENT2", 2) != null) {
- cl2.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT2", 2)));
+ cl2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("ENT2", 2)));
}
String queue = arg.get("ARROW_BODY1", 0) + arg.get("ARROW_BODY2", 0);
diff --git a/src/net/sourceforge/plantuml/suggest/SuggestEngine.java b/src/net/sourceforge/plantuml/suggest/SuggestEngine.java
index 3e76844..f9c1cb9 100644
--- a/src/net/sourceforge/plantuml/suggest/SuggestEngine.java
+++ b/src/net/sourceforge/plantuml/suggest/SuggestEngine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,116 +35,82 @@
package net.sourceforge.plantuml.suggest;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem;
-import net.sourceforge.plantuml.command.Command;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.CharSequence2Impl;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandControl;
-import net.sourceforge.plantuml.command.CommandExecutionResult;
-import net.sourceforge.plantuml.command.ProtectedCommand;
import net.sourceforge.plantuml.command.UmlDiagramFactory;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.utils.StartUtils;
+import net.sourceforge.plantuml.version.IteratorCounter2;
+import net.sourceforge.plantuml.version.IteratorCounter2Impl;
final public class SuggestEngine {
private final UmlDiagramFactory systemFactory;
- private final Iterator<String> it;
- private final String startLine;
-
- private String current = "";
- private String previous = "";
+ private final IteratorCounter2 it99;
public SuggestEngine(UmlSource source, UmlDiagramFactory systemFactory) {
this.systemFactory = systemFactory;
- this.it = source.iterator();
- startLine = next();
+ this.it99 = source.iterator2();
+ final CharSequence startLine = it99.next();
if (StartUtils.isArobaseStartDiagram(startLine) == false) {
throw new UnsupportedOperationException();
}
}
- private boolean hasNext() {
- return it.hasNext();
- }
-
- private String next() {
- // nb++;
- this.previous = this.current;
- this.current = it.next();
- return current;
- }
-
public SuggestEngineResult tryToSuggest(AbstractPSystem system) {
return executeUmlCommand(system);
}
private SuggestEngineResult executeUmlCommand(AbstractPSystem system) {
- // systemFactory.init(startLine);
- while (hasNext()) {
- final String s = next();
- if (StartUtils.isArobaseEndDiagram(s)) {
+ while (it99.hasNext()) {
+ if (StartUtils.isArobaseEndDiagram(it99.peek())) {
return SuggestEngineResult.SYNTAX_OK;
}
- final SuggestEngineResult check = checkAndCorrect(s);
+ final SuggestEngineResult check = checkAndCorrect();
if (check.getStatus() != SuggestEngineStatus.SYNTAX_OK) {
return check;
}
- final CommandControl commandControl = systemFactory.isValid(Arrays.asList(s));
+ final CommandControl commandControl = systemFactory.isValid2(it99);
if (commandControl == CommandControl.OK_PARTIAL) {
- final boolean ok = manageMultiline(s);
- if (ok == false) {
- return SuggestEngineResult.CANNOT_CORRECT;
- }
+ systemFactory.goForwardMultiline(it99);
+ // if (ok == false) {
+ // return SuggestEngineResult.CANNOT_CORRECT;
+ // }
} else if (commandControl == CommandControl.OK) {
-// final Command cmd = new ProtectedCommand(systemFactory.createCommand(Arrays.asList(s)));
-// final CommandExecutionResult result = cmd.execute(system, Arrays.asList(s));
-// if (result.isOk() == false) {
-// return SuggestEngineResult.CANNOT_CORRECT;
-// }
+ it99.next();
+ // final Command cmd = new ProtectedCommand(systemFactory.createCommand(Arrays.asList(s)));
+ // final CommandExecutionResult result = cmd.execute(system, Arrays.asList(s));
+ // if (result.isOk() == false) {
+ // return SuggestEngineResult.CANNOT_CORRECT;
+ // }
} else {
- assert false;
+ return SuggestEngineResult.CANNOT_CORRECT;
}
}
- throw new IllegalStateException();
- }
-
- private boolean manageMultiline(final String init) {
- final List<String> lines = new ArrayList<String>();
- lines.add(init);
- while (hasNext()) {
- final String s = next();
- if (StartUtils.isArobaseEndDiagram(s)) {
- return false;
- }
- lines.add(s);
- final CommandControl commandControl = systemFactory.isValid(lines);
- if (commandControl == CommandControl.NOT_OK) {
- throw new IllegalStateException();
- }
- if (commandControl == CommandControl.OK) {
- // final Command cmd = systemFactory.createCommand(lines);
- // return cmd.execute(lines).isOk();
- return true;
- }
- }
- return false;
-
+ return SuggestEngineResult.CANNOT_CORRECT;
+ // throw new IllegalStateException();
}
- SuggestEngineResult checkAndCorrect(final String incorrectLine) {
- final CommandControl commandControl = systemFactory.isValid(Arrays.asList(incorrectLine));
+ SuggestEngineResult checkAndCorrect() {
+ final CommandControl commandControl = systemFactory.isValid2(it99);
if (commandControl != CommandControl.NOT_OK) {
return SuggestEngineResult.SYNTAX_OK;
}
- if (incorrectLine.trim().startsWith("{")
- && systemFactory.isValid(Arrays.asList(previous + " {")) != CommandControl.NOT_OK) {
- return new SuggestEngineResult(previous + " {");
+ final String incorrectLine = it99.peek().toString();
+
+ if (StringUtils.trin(incorrectLine).startsWith("{")
+ && systemFactory.isValid(BlocLines.single(it99.peekPrevious() + " {")) != CommandControl.NOT_OK) {
+ return new SuggestEngineResult(it99.peekPrevious() + " {");
}
final Collection<Iterator<String>> all = new ArrayList<Iterator<String>>();
@@ -155,8 +121,8 @@ final public class SuggestEngine {
all.add(new VariatorAddOneCharBetweenWords(incorrectLine, ' '));
// all.add(new VariatorAddTwoChar(incorrectLine, '\"'));
- for (Iterator<String> it : all) {
- final SuggestEngineResult result = tryThis(it);
+ for (Iterator<String> it2 : all) {
+ final SuggestEngineResult result = tryThis(it2);
if (result != null) {
return result;
}
@@ -164,18 +130,30 @@ final public class SuggestEngine {
return SuggestEngineResult.CANNOT_CORRECT;
}
- private SuggestEngineResult tryThis(Iterator<String> it) {
- while (it.hasNext()) {
- final String newS = it.next();
- if (newS.trim().length() == 0) {
+ private SuggestEngineResult tryThis(Iterator<String> it2) {
+ while (it2.hasNext()) {
+ final String newS = it2.next();
+ if (StringUtils.trin(newS).length() == 0) {
continue;
}
- final CommandControl commandControl = systemFactory.isValid(Arrays.asList(newS));
- if (commandControl != CommandControl.NOT_OK) {
+ final CommandControl commandControl = systemFactory.isValid2(replaceFirstLine(newS));
+ if (commandControl == CommandControl.OK) {
return new SuggestEngineResult(newS);
}
}
return null;
+ }
+ private IteratorCounter2 replaceFirstLine(String s) {
+ final List<CharSequence2> tmp = new ArrayList<CharSequence2>();
+ tmp.add(new CharSequence2Impl(s, null));
+ final Iterator<? extends CharSequence> it3 = it99.cloneMe();
+ if (it3.hasNext()) {
+ it3.next();
+ }
+ while (it3.hasNext()) {
+ tmp.add(new CharSequence2Impl(it3.next(), null));
+ }
+ return new IteratorCounter2Impl(tmp);
}
}
diff --git a/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java b/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java
index ea7cd37..a3bd7b1 100644
--- a/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java
+++ b/src/net/sourceforge/plantuml/suggest/SuggestEngineResult.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,6 +34,8 @@
*/
package net.sourceforge.plantuml.suggest;
+import net.sourceforge.plantuml.StringUtils;
+
public class SuggestEngineResult {
@@ -78,7 +80,7 @@ public class SuggestEngineResult {
}
public SuggestEngineResult(String suggestedLine) {
- if (suggestedLine.trim().length() == 0) {
+ if (StringUtils.trin(suggestedLine).length() == 0) {
throw new IllegalArgumentException();
}
this.status = SuggestEngineStatus.ONE_SUGGESTION;
diff --git a/src/net/sourceforge/plantuml/suggest/SuggestEngineStatus.java b/src/net/sourceforge/plantuml/suggest/SuggestEngineStatus.java
index 7d47486..27cc842 100644
--- a/src/net/sourceforge/plantuml/suggest/SuggestEngineStatus.java
+++ b/src/net/sourceforge/plantuml/suggest/SuggestEngineStatus.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/Variator.java b/src/net/sourceforge/plantuml/suggest/Variator.java
index 600eb1c..78dc462 100644
--- a/src/net/sourceforge/plantuml/suggest/Variator.java
+++ b/src/net/sourceforge/plantuml/suggest/Variator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorAddOneChar.java b/src/net/sourceforge/plantuml/suggest/VariatorAddOneChar.java
index 68585b3..98948ae 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorAddOneChar.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorAddOneChar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorAddOneCharBetweenWords.java b/src/net/sourceforge/plantuml/suggest/VariatorAddOneCharBetweenWords.java
index 35b900d..755cbe6 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorAddOneCharBetweenWords.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorAddOneCharBetweenWords.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorAddTwoChar.java b/src/net/sourceforge/plantuml/suggest/VariatorAddTwoChar.java
index d875cf4..71ac930 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorAddTwoChar.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorAddTwoChar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorIteratorAdaptor.java b/src/net/sourceforge/plantuml/suggest/VariatorIteratorAdaptor.java
index cada29e..c2c7aba 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorIteratorAdaptor.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorIteratorAdaptor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorRemoveOneChar.java b/src/net/sourceforge/plantuml/suggest/VariatorRemoveOneChar.java
index 49f7377..0c66241 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorRemoveOneChar.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorRemoveOneChar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorSwapChar.java b/src/net/sourceforge/plantuml/suggest/VariatorSwapChar.java
index 563b880..f35a6be 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorSwapChar.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorSwapChar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/suggest/VariatorSwapLetter.java b/src/net/sourceforge/plantuml/suggest/VariatorSwapLetter.java
index caec47a..748a9c5 100644
--- a/src/net/sourceforge/plantuml/suggest/VariatorSwapLetter.java
+++ b/src/net/sourceforge/plantuml/suggest/VariatorSwapLetter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/AbstractEntityImage.java b/src/net/sourceforge/plantuml/svek/AbstractEntityImage.java
index 5dcf477..606e306 100644
--- a/src/net/sourceforge/plantuml/svek/AbstractEntityImage.java
+++ b/src/net/sourceforge/plantuml/svek/AbstractEntityImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,14 +37,16 @@ package net.sourceforge.plantuml.svek;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
-public abstract class AbstractEntityImage implements IEntityImage {
+public abstract class AbstractEntityImage extends AbstractTextBlock implements IEntityImage {
private final IEntity entity;
private final ISkinParam skinParam;
public AbstractEntityImage(IEntity entity, ISkinParam skinParam) {
+ // System.err.println("Creating abstractEntityImage "+getClass());
if (entity == null) {
throw new IllegalArgumentException("entity null");
}
diff --git a/src/net/sourceforge/plantuml/svek/AbstractExtremityFactory.java b/src/net/sourceforge/plantuml/svek/AbstractExtremityFactory.java
index 47a1f8a..5eac43a 100644
--- a/src/net/sourceforge/plantuml/svek/AbstractExtremityFactory.java
+++ b/src/net/sourceforge/plantuml/svek/AbstractExtremityFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,10 +36,15 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Point2D;
+import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
public abstract class AbstractExtremityFactory implements ExtremityFactory {
+ public UDrawable createUDrawable(Point2D p0, double angle) {
+ throw new UnsupportedOperationException(getClass().toString());
+ }
+
protected double atan2(Point2D p1, Point2D p0) {
double a = Math.atan2(p1.getY() - p0.getY(), p1.getX() - p0.getX());
if (a < 0) {
diff --git a/src/net/sourceforge/plantuml/svek/ArithmeticStrategy.java b/src/net/sourceforge/plantuml/svek/ArithmeticStrategy.java
index 589a2fb..e493f5b 100644
--- a/src/net/sourceforge/plantuml/svek/ArithmeticStrategy.java
+++ b/src/net/sourceforge/plantuml/svek/ArithmeticStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java b/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java
index 8641146..4701a44 100644
--- a/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java
+++ b/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/ArithmeticStrategySum.java b/src/net/sourceforge/plantuml/svek/ArithmeticStrategySum.java
index bddc8d5..f2fa34d 100644
--- a/src/net/sourceforge/plantuml/svek/ArithmeticStrategySum.java
+++ b/src/net/sourceforge/plantuml/svek/ArithmeticStrategySum.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/Bibliotekon.java b/src/net/sourceforge/plantuml/svek/Bibliotekon.java
index 3c3eaaa..7adb840 100644
--- a/src/net/sourceforge/plantuml/svek/Bibliotekon.java
+++ b/src/net/sourceforge/plantuml/svek/Bibliotekon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -181,4 +181,13 @@ public class Bibliotekon {
throw new IllegalArgumentException();
}
+ public IEntity getOnlyOther(IEntity entity) {
+ for (Line line : allLines) {
+ final IEntity other = line.getOther(entity);
+ if (other != null) {
+ return other;
+ }
+ }
+ return null;
+ }
}
diff --git a/src/net/sourceforge/plantuml/svek/Boundary.java b/src/net/sourceforge/plantuml/svek/Boundary.java
index 278c522..5e96c81 100644
--- a/src/net/sourceforge/plantuml/svek/Boundary.java
+++ b/src/net/sourceforge/plantuml/svek/Boundary.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,19 +37,15 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
-import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
-import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class Boundary implements TextBlock {
+public class Boundary extends AbstractTextBlock {
private final double margin = 4;
diff --git a/src/net/sourceforge/plantuml/svek/CircleAndArrow.java b/src/net/sourceforge/plantuml/svek/CircleAndArrow.java
index 1c37040..c50d4a5 100644
--- a/src/net/sourceforge/plantuml/svek/CircleAndArrow.java
+++ b/src/net/sourceforge/plantuml/svek/CircleAndArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/CircleInterface2.java b/src/net/sourceforge/plantuml/svek/CircleInterface2.java
index 715be88..e989492 100644
--- a/src/net/sourceforge/plantuml/svek/CircleInterface2.java
+++ b/src/net/sourceforge/plantuml/svek/CircleInterface2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -47,7 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class CircleInterface2 implements TextBlock {
+public class CircleInterface2 extends AbstractTextBlock implements TextBlock {
private final double margin = 1;
diff --git a/src/net/sourceforge/plantuml/svek/Cluster.java b/src/net/sourceforge/plantuml/svek/Cluster.java
index 6ccd02d..d43bb76 100644
--- a/src/net/sourceforge/plantuml/svek/Cluster.java
+++ b/src/net/sourceforge/plantuml/svek/Cluster.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -51,6 +51,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
+import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.EntityPosition;
@@ -69,6 +70,7 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
import net.sourceforge.plantuml.graphic.TextBlockWidth;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.posimo.Moveable;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.image.EntityImageState;
@@ -141,7 +143,7 @@ public class Cluster implements Moveable {
}
this.color = colorSequence.getValue();
this.colorTitle = colorSequence.getValue();
- this.skinParam = skinParam;
+ this.skinParam = group.getColors(skinParam).mute(skinParam);
}
@Override
@@ -291,16 +293,18 @@ public class Cluster implements Moveable {
this.yTitle = y;
}
- private static HtmlColor getColor(ColorParam colorParam, ISkinParam skinParam) {
- return new Rose().getHtmlColor(skinParam, colorParam);
+ private static HtmlColor getColor(ColorParam colorParam, ISkinParam skinParam, Stereotype stereotype) {
+ return SkinParamUtils.getColor(skinParam, colorParam, stereotype);
}
public void drawU(UGraphic ug, DotData dotData, UStroke stroke) {
+
+ final Stereotype stereotype = group.getStereotype();
HtmlColor borderColor;
if (dotData.getUmlDiagramType() == UmlDiagramType.STATE) {
- borderColor = getColor(ColorParam.stateBorder, dotData.getSkinParam());
+ borderColor = getColor(ColorParam.stateBorder, skinParam, stereotype);
} else {
- borderColor = getColor(ColorParam.packageBorder, dotData.getSkinParam());
+ borderColor = getColor(ColorParam.packageBorder, skinParam, stereotype);
}
final Url url = group.getUrl99();
@@ -317,11 +321,11 @@ public class Cluster implements Moveable {
}
final boolean isState = dotData.getUmlDiagramType() == UmlDiagramType.STATE;
if (isState) {
- if (group.getSpecificLineStroke() != null) {
- stroke = group.getSpecificLineStroke();
+ if (group.getColors(skinParam).getSpecificLineStroke() != null) {
+ stroke = group.getColors(skinParam).getSpecificLineStroke();
}
- if (group.getSpecificLineColor() != null) {
- borderColor = group.getSpecificLineColor();
+ if (group.getColors(skinParam).getColor(ColorType.LINE) != null) {
+ borderColor = group.getColors(skinParam).getColor(ColorType.LINE);
}
drawUState(ug, borderColor, dotData, stroke);
return;
@@ -331,26 +335,25 @@ public class Cluster implements Moveable {
style = dotData.getSkinParam().getPackageStyle();
}
if (border != null) {
- final HtmlColor tmp = dotData.getSkinParam().getHtmlColor(border, null, false);
+ final HtmlColor tmp = dotData.getSkinParam().getHtmlColor(border, group.getStereotype(), false);
if (tmp != null) {
borderColor = tmp;
}
}
if (ztitle != null || zstereo != null) {
- final HtmlColor stateBack = getStateBackColor(getBackColor(), dotData.getSkinParam(),
- group.getStereotype());
+ final HtmlColor back = getBackColor(getBackColor(), dotData.getSkinParam(), group.getStereotype());
final ClusterDecoration decoration = new ClusterDecoration(style, group.getUSymbol(), ztitle, zstereo,
- stateBack, minX, minY, maxX, maxY, getStroke(dotData.getSkinParam(), group.getStereotype()));
- decoration.drawU(ug, borderColor, dotData.getSkinParam().shadowing());
+ minX, minY, maxX, maxY, getStroke(dotData.getSkinParam(), group.getStereotype()));
+ decoration.drawU(ug, back, borderColor, dotData.getSkinParam().shadowing());
return;
}
final URectangle rect = new URectangle(maxX - minX, maxY - minY);
if (dotData.getSkinParam().shadowing()) {
rect.setDeltaShadow(3.0);
}
- final HtmlColor stateBack = getStateBackColor(getBackColor(), dotData.getSkinParam(), group.getStereotype());
- ug = ug.apply(new UChangeBackColor(stateBack)).apply(new UChangeColor(borderColor));
+ final HtmlColor backColor = getBackColor(getBackColor(), dotData.getSkinParam(), group.getStereotype());
+ ug = ug.apply(new UChangeBackColor(backColor)).apply(new UChangeColor(borderColor));
ug.apply(new UStroke(2)).apply(new UTranslate(minX, minY)).draw(rect);
} finally {
@@ -369,7 +372,7 @@ public class Cluster implements Moveable {
return stroke;
}
- private void manageEntryExitPoint(DotData dotData, StringBounder stringBounder) {
+ public void manageEntryExitPoint(DotData dotData, StringBounder stringBounder) {
final Collection<ClusterPosition> insides = new ArrayList<ClusterPosition>();
final List<Point2D> points = new ArrayList<Point2D>();
for (Shape sh : shapes) {
@@ -452,7 +455,7 @@ public class Cluster implements Moveable {
private TextBlockWidth getTextBlockAttribute(DotData dotData) {
final TextBlockWidth attribute;
- final List<Member> members = group.getFieldsToDisplay();
+ final List<Member> members = group.getBodier().getFieldsToDisplay();
if (members.size() == 0) {
attribute = new TextBlockEmpty();
} else {
@@ -792,7 +795,7 @@ public class Cluster implements Moveable {
if (EntityUtils.groupRoot(group)) {
return null;
}
- final HtmlColor result = group.getSpecificBackColor();
+ final HtmlColor result = group.getColors(skinParam).getColor(ColorType.BACK);
if (result != null) {
return result;
}
@@ -816,17 +819,17 @@ public class Cluster implements Moveable {
return group == ent;
}
- public static HtmlColor getStateBackColor(HtmlColor stateBack, ISkinParam skinParam, Stereotype stereotype) {
- if (stateBack == null) {
- stateBack = skinParam.getHtmlColor(ColorParam.packageBackground, stereotype, false);
+ public static HtmlColor getBackColor(HtmlColor backColor, ISkinParam skinParam, Stereotype stereotype) {
+ if (backColor == null) {
+ backColor = skinParam.getHtmlColor(ColorParam.packageBackground, stereotype, false);
}
- if (stateBack == null) {
- stateBack = skinParam.getHtmlColor(ColorParam.background, stereotype, false);
+ if (backColor == null) {
+ backColor = skinParam.getHtmlColor(ColorParam.background, stereotype, false);
}
- if (stateBack == null /* || stateBack instanceof HtmlColorTransparent */) {
- stateBack = new HtmlColorTransparent();
+ if (backColor == null /* || stateBack instanceof HtmlColorTransparent */) {
+ backColor = new HtmlColorTransparent();
}
- return stateBack;
+ return backColor;
}
public double checkFolderPosition(Point2D pt, StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/svek/ClusterDecoration.java b/src/net/sourceforge/plantuml/svek/ClusterDecoration.java
index 88191e0..490b7b0 100644
--- a/src/net/sourceforge/plantuml/svek/ClusterDecoration.java
+++ b/src/net/sourceforge/plantuml/svek/ClusterDecoration.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,45 +34,31 @@
*/
package net.sourceforge.plantuml.svek;
-import java.awt.geom.Dimension2D;
-
-import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
-import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
-import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.ULine;
-import net.sourceforge.plantuml.ugraphic.UPolygon;
-import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ClusterDecoration {
private final UStroke defaultStroke;// = new UStroke(2);
- final private PackageStyle style;
final private USymbol symbol;
final private TextBlock title;
final private TextBlock stereo;
- final private HtmlColor stateBack;
final private double minX;
final private double minY;
final private double maxX;
final private double maxY;
- public ClusterDecoration(PackageStyle style, USymbol symbol, TextBlock title, TextBlock stereo,
- HtmlColor stateBack, double minX, double minY, double maxX, double maxY, UStroke stroke) {
- this.symbol = symbol;
- this.style = style;
+ public ClusterDecoration(PackageStyle style, USymbol symbol, TextBlock title, TextBlock stereo, double minX,
+ double minY, double maxX, double maxY, UStroke stroke) {
+ this.symbol = guess(symbol, style);
this.stereo = stereo;
this.title = title;
- this.stateBack = stateBack;
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
@@ -83,146 +69,11 @@ public class ClusterDecoration {
// }
}
- public void drawU(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
+ private static USymbol guess(USymbol symbol, PackageStyle style) {
if (symbol != null) {
- final SymbolContext symbolContext = new SymbolContext(stateBack, borderColor).withShadow(shadowing)
- .withStroke(defaultStroke);
- symbol.asBig(title, stereo, maxX - minX, maxY - minY, symbolContext).drawU(
- ug.apply(new UTranslate(minX, minY)));
- // ug.getParam().resetStroke();
- return;
- }
- if (style == PackageStyle.NODE) {
- drawWithTitleNode(ug, borderColor, shadowing);
- } else if (style == PackageStyle.CARD) {
- drawWithTitleCard(ug, borderColor, shadowing);
- } else if (style == PackageStyle.DATABASE) {
- drawWithTitleDatabase(ug, borderColor, shadowing);
- } else if (style == PackageStyle.CLOUD) {
- drawWithTitleCloud(ug, borderColor, shadowing);
- } else if (style == PackageStyle.FRAME) {
- drawWithTitleFrame(ug, borderColor, shadowing);
- } else if (style == PackageStyle.RECT) {
- drawWithTitleRect(ug, borderColor, shadowing);
- } else {
- drawWithTitleFolder(ug, borderColor, shadowing);
+ return symbol;
}
- }
-
- // Cloud
- private void drawWithTitleCloud(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- final double width = maxX - minX;
- final double height = maxY - minY;
- ug = ug.apply(new UChangeBackColor(stateBack)).apply(new UChangeColor(borderColor));
- ug = ug.apply(defaultStroke);
- PackageStyle.CLOUD.drawU(ug.apply(new UTranslate(minX, minY)), new Dimension2DDouble(width, height), dimTitle,
- shadowing);
- ug = ug.apply(new UStroke());
- title.drawU(ug.apply(new UTranslate(minX + (width - dimTitle.getWidth()) / 2, minY + 10)));
-
- }
-
- // Database
- private void drawWithTitleDatabase(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- final double width = maxX - minX;
- final double height = maxY - minY;
- ug = ug.apply(defaultStroke);
- ug = ug.apply(new UChangeBackColor(stateBack)).apply(new UChangeColor(borderColor));
- PackageStyle.DATABASE.drawU(ug.apply(new UTranslate(minX, minY - 10)),
- new Dimension2DDouble(width, height + 10), dimTitle, shadowing);
- ug = ug.apply(new UStroke());
- title.drawU(ug.apply(new UTranslate(minX + marginTitleX1, minY + 10)));
-
- }
-
- // Corner
- private void drawWithTitleFrame(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- final double width = maxX - minX;
- final double height = maxY - minY;
- ug = ug.apply(new UChangeBackColor(stateBack)).apply(new UChangeColor(borderColor));
- ug = ug.apply(defaultStroke);
- PackageStyle.FRAME.drawU(ug.apply(new UTranslate(minX, minY)), new Dimension2DDouble(width, height), dimTitle,
- shadowing);
- ug = ug.apply(new UStroke());
- title.drawU(ug.apply(new UTranslate(minX + marginTitleX1, minY)));
-
- }
-
- // Card
- private void drawWithTitleCard(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final double width = maxX - minX;
- final double height = maxY - minY;
- final SymbolContext ctx = new SymbolContext(stateBack, borderColor).withStroke(defaultStroke).withShadow(
- shadowing);
- USymbol.CARD.asBig(title, TextBlockUtils.empty(0, 0), width + 10, height, ctx).drawU(
- ug.apply(new UTranslate(minX, minY)));
- }
-
- // Node
- private void drawWithTitleNode(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final double width = maxX - minX;
- final double height = maxY - minY;
- final SymbolContext ctx = new SymbolContext(stateBack, borderColor).withStroke(defaultStroke).withShadow(
- shadowing);
- USymbol.NODE.asBig(title, TextBlockUtils.empty(0, 0), width + 10, height, ctx).drawU(
- ug.apply(new UTranslate(minX, minY)));
- }
-
- // Folder
- private UPolygon getSpecificFrontierForFolder(StringBounder stringBounder) {
- final double width = maxX - minX;
- final double height = maxY - minY;
- final Dimension2D dimTitle = title.calculateDimension(stringBounder);
- final double wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
- final double htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
- final UPolygon shape = new UPolygon();
- shape.addPoint(0, 0);
- shape.addPoint(wtitle, 0);
- shape.addPoint(wtitle + marginTitleX3, htitle);
- shape.addPoint(width, htitle);
- shape.addPoint(width, height);
- shape.addPoint(0, height);
- shape.addPoint(0, 0);
- return shape;
- }
-
- private void drawWithTitleFolder(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- final double wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
- final double htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
- final UPolygon shape = getSpecificFrontierForFolder(ug.getStringBounder());
- if (shadowing) {
- shape.setDeltaShadow(3.0);
- }
-
- ug = ug.apply(new UChangeBackColor(stateBack)).apply(new UChangeColor(borderColor));
- ug = ug.apply(defaultStroke);
- ug.apply(new UTranslate(minX, minY)).draw(shape);
- ug.apply(new UTranslate(minX, minY + htitle)).draw(new ULine(wtitle + marginTitleX3, 0));
- ug = ug.apply(new UStroke());
- title.drawU(ug.apply(new UTranslate(minX + marginTitleX1, minY + marginTitleY1)));
- }
-
- // Rect
- private void drawWithTitleRect(UGraphic ug, HtmlColor borderColor, boolean shadowing) {
- final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
- final double width = maxX - minX;
- final double height = maxY - minY;
- final URectangle shape = new URectangle(width, height);
- if (shadowing) {
- shape.setDeltaShadow(3.0);
- }
-
- ug = ug.apply(new UChangeBackColor(stateBack)).apply(new UChangeColor(borderColor));
- ug = ug.apply(defaultStroke);
-
- ug.apply(new UTranslate(minX, minY)).draw(shape);
- ug = ug.apply(new UStroke());
- final double deltax = width - dimTitle.getWidth();
- title.drawU(ug.apply(new UTranslate(minX + deltax / 2, minY + 5)));
+ return style.toUSymbol();
}
public final static int marginTitleX1 = 3;
@@ -232,4 +83,146 @@ public class ClusterDecoration {
public final static int marginTitleY1 = 3;
public final static int marginTitleY2 = 3;
+ public void drawU(UGraphic ug, HtmlColor backColor, HtmlColor borderColor, boolean shadowing) {
+ final SymbolContext biColor = new SymbolContext(backColor, borderColor);
+ if (symbol == null) {
+ throw new UnsupportedOperationException();
+ }
+ final SymbolContext symbolContext = biColor.withShadow(shadowing).withStroke(defaultStroke);
+ symbol.asBig(title, stereo, maxX - minX, maxY - minY, symbolContext)
+ .drawU(ug.apply(new UTranslate(minX, minY)));
+ // return;
+ // }
+ // if (style == PackageStyle.NODE) {
+ // drawWithTitleNode(ug, biColor, shadowing);
+ // } else if (style == PackageStyle.CARD) {
+ // drawWithTitleCard(ug, biColor, shadowing);
+ // } else if (style == PackageStyle.DATABASE) {
+ // drawWithTitleDatabase(ug, biColor, shadowing);
+ // } else if (style == PackageStyle.CLOUD) {
+ // drawWithTitleCloud(ug, biColor, shadowing);
+ // } else if (style == PackageStyle.FRAME) {
+ // drawWithTitleFrame(ug, biColor, shadowing);
+ // } else if (style == PackageStyle.RECT) {
+ // drawWithTitleRect(ug, biColor, shadowing);
+ // } else {
+ // throw new UnsupportedOperationException();
+ // // drawWithTitleFolder(ug, biColor, shadowing);
+ // }
+ }
+
+ // // Cloud
+ // private void drawWithTitleCloud(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // ug = biColor.applyColors(ug);
+ // ug = ug.apply(defaultStroke);
+ // PackageStyle.CLOUD.drawU(ug.apply(new UTranslate(minX, minY)), new Dimension2DDouble(width, height), dimTitle,
+ // shadowing);
+ // ug = ug.apply(new UStroke());
+ // title.drawU(ug.apply(new UTranslate(minX + (width - dimTitle.getWidth()) / 2, minY + 10)));
+ //
+ // }
+ //
+ // // Database
+ // private void drawWithTitleDatabase(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // ug = ug.apply(defaultStroke);
+ // ug = biColor.applyColors(ug);
+ // PackageStyle.DATABASE.drawU(ug.apply(new UTranslate(minX, minY - 10)),
+ // new Dimension2DDouble(width, height + 10), dimTitle, shadowing);
+ // ug = ug.apply(new UStroke());
+ // title.drawU(ug.apply(new UTranslate(minX + marginTitleX1, minY + 10)));
+ //
+ // }
+ //
+ // // Corner
+ // private void drawWithTitleFrame(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // ug = biColor.applyColors(ug);
+ // ug = ug.apply(defaultStroke);
+ // PackageStyle.FRAME.drawU(ug.apply(new UTranslate(minX, minY)), new Dimension2DDouble(width, height), dimTitle,
+ // shadowing);
+ // ug = ug.apply(new UStroke());
+ // title.drawU(ug.apply(new UTranslate(minX + marginTitleX1, minY)));
+ //
+ // }
+ //
+ // // Card
+ // private void drawWithTitleCard(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // final SymbolContext ctx = biColor.withStroke(defaultStroke).withShadow(shadowing);
+ // USymbol.CARD.asBig(title, TextBlockUtils.empty(0, 0), width + 10, height, ctx).drawU(
+ // ug.apply(new UTranslate(minX, minY)));
+ // }
+ //
+ // // Node
+ // private void drawWithTitleNode(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // final SymbolContext ctx = biColor.withStroke(defaultStroke).withShadow(shadowing);
+ // USymbol.NODE.asBig(title, TextBlockUtils.empty(0, 0), width + 10, height, ctx).drawU(
+ // ug.apply(new UTranslate(minX, minY)));
+ // }
+ //
+ // // Folder
+ // private UPolygon getSpecificFrontierForFolder(StringBounder stringBounder) {
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // final Dimension2D dimTitle = title.calculateDimension(stringBounder);
+ // final double wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
+ // final double htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
+ // final UPolygon shape = new UPolygon();
+ // shape.addPoint(0, 0);
+ // shape.addPoint(wtitle, 0);
+ // shape.addPoint(wtitle + marginTitleX3, htitle);
+ // shape.addPoint(width, htitle);
+ // shape.addPoint(width, height);
+ // shape.addPoint(0, height);
+ // shape.addPoint(0, 0);
+ // return shape;
+ // }
+ //
+ // private void drawWithTitleFolder(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ // final double wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
+ // final double htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
+ // final UPolygon shape = getSpecificFrontierForFolder(ug.getStringBounder());
+ // if (shadowing) {
+ // shape.setDeltaShadow(3.0);
+ // }
+ //
+ // ug = biColor.applyColors(ug);
+ // ug = ug.apply(defaultStroke);
+ // ug.apply(new UTranslate(minX, minY)).draw(shape);
+ // ug.apply(new UTranslate(minX, minY + htitle)).draw(new ULine(wtitle + marginTitleX3, 0));
+ // ug = ug.apply(new UStroke());
+ // title.drawU(ug.apply(new UTranslate(minX + marginTitleX1, minY + marginTitleY1)));
+ // }
+ //
+ // // Rect
+ // private void drawWithTitleRect(UGraphic ug, SymbolContext biColor, boolean shadowing) {
+ // final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ // final double width = maxX - minX;
+ // final double height = maxY - minY;
+ // final URectangle shape = new URectangle(width, height);
+ // if (shadowing) {
+ // shape.setDeltaShadow(3.0);
+ // }
+ //
+ // ug = biColor.applyColors(ug);
+ // ug = ug.apply(defaultStroke);
+ //
+ // ug.apply(new UTranslate(minX, minY)).draw(shape);
+ // ug = ug.apply(new UStroke());
+ // final double deltax = width - dimTitle.getWidth();
+ // title.drawU(ug.apply(new UTranslate(minX + deltax / 2, minY + 5)));
+ // }
+
}
diff --git a/src/net/sourceforge/plantuml/svek/ClusterPosition.java b/src/net/sourceforge/plantuml/svek/ClusterPosition.java
index 63bb9a1..05de26d 100644
--- a/src/net/sourceforge/plantuml/svek/ClusterPosition.java
+++ b/src/net/sourceforge/plantuml/svek/ClusterPosition.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/ColorSequence.java b/src/net/sourceforge/plantuml/svek/ColorSequence.java
index 73c4b89..7dd0e65 100644
--- a/src/net/sourceforge/plantuml/svek/ColorSequence.java
+++ b/src/net/sourceforge/plantuml/svek/ColorSequence.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/ConditionStyle.java b/src/net/sourceforge/plantuml/svek/ConditionStyle.java
index 38e12aa..f196163 100644
--- a/src/net/sourceforge/plantuml/svek/ConditionStyle.java
+++ b/src/net/sourceforge/plantuml/svek/ConditionStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/Control.java b/src/net/sourceforge/plantuml/svek/Control.java
index 77589f4..4addca1 100644
--- a/src/net/sourceforge/plantuml/svek/Control.java
+++ b/src/net/sourceforge/plantuml/svek/Control.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
@@ -49,7 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class Control implements TextBlock {
+public class Control extends AbstractTextBlock implements TextBlock {
private final double margin = 4;
diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMaker.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMaker.java
index a25cfa4..4ba1fac 100644
--- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMaker.java
+++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java
index 81fca4e..458ee00 100644
--- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java
+++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,29 +41,23 @@ import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
+import net.sourceforge.plantuml.AnnotatedWorker;
import net.sourceforge.plantuml.EmptyImageBuilder;
-import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Scale;
import net.sourceforge.plantuml.UmlDiagramType;
-import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
-import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.CucaDiagramSimplifierActivity;
import net.sourceforge.plantuml.cucadiagram.dot.CucaDiagramSimplifierState;
import net.sourceforge.plantuml.cucadiagram.dot.DotData;
-import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.StringBounderUtils;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -117,11 +111,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
svek2 = buildCucaDiagramFileMakerSvek2(DotMode.NO_LEFT_RIGHT);
result = svek2.createFile(diagram.getDotStringSkek());
}
- result = addLegend(result);
- result = addTitle(result);
- result = addHeaderAndFooter(result);
-
- final FileFormat fileFormat = fileFormatOption.getFileFormat();
+ result = new AnnotatedWorker(diagram, diagram.getSkinParam()).addAdd(result);
final String widthwarning = diagram.getSkinParam().getValue("widthwarning");
if (widthwarning != null && widthwarning.matches("\\d+")) {
@@ -136,7 +126,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
result.getBackcolor(), fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null,
warningOrError, 0, 10, diagram.getAnimation(), diagram.getSkinParam().handwritten());
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormatOption, os);
}
@@ -172,56 +162,14 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
return warningOrError;
}
- private TextBlockBackcolored addHeaderAndFooter(TextBlockBackcolored original) {
- final Display footer = diagram.getFooter();
- final Display header = diagram.getHeader();
- if (footer == null && header == null) {
- return original;
- }
- final TextBlock textFooter = footer == null ? null : TextBlockUtils.create(footer, new FontConfiguration(
- getFont(FontParam.FOOTER), getFontColor(FontParam.FOOTER, null), diagram.getSkinParam()
- .getHyperlinkColor(), diagram.getSkinParam().useUnderlineForHyperlink()), diagram
- .getFooterAlignment(), diagram.getSkinParam());
- final TextBlock textHeader = header == null ? null : TextBlockUtils.create(header, new FontConfiguration(
- getFont(FontParam.HEADER), getFontColor(FontParam.HEADER, null), diagram.getSkinParam()
- .getHyperlinkColor(), diagram.getSkinParam().useUnderlineForHyperlink()), diagram
- .getHeaderAlignment(), diagram.getSkinParam());
-
- return new DecorateEntityImage(original, textHeader, diagram.getHeaderAlignment(), textFooter,
- diagram.getFooterAlignment());
- }
-
- private TextBlockBackcolored addTitle(TextBlockBackcolored original) {
- final Display title = diagram.getTitle();
- if (title == null) {
- return original;
- }
- final TextBlock text = TextBlockUtils.create(title, new FontConfiguration(getFont(FontParam.TITLE),
- getFontColor(FontParam.TITLE, null), diagram.getSkinParam().getHyperlinkColor(), diagram.getSkinParam()
- .useUnderlineForHyperlink()), HorizontalAlignment.CENTER, diagram.getSkinParam());
-
- return DecorateEntityImage.addTop(original, text, HorizontalAlignment.CENTER);
- }
-
- private TextBlockBackcolored addLegend(TextBlockBackcolored original) {
- final Display legend = diagram.getLegend();
- if (legend == null) {
- return original;
- }
- final TextBlock text = EntityImageLegend.create(legend, diagram.getSkinParam());
-
- return DecorateEntityImage.add(original, text, diagram.getLegendAlignment(),
- diagram.getLegendVerticalAlignment());
- }
-
private final UFont getFont(FontParam fontParam) {
final ISkinParam skinParam = diagram.getSkinParam();
- return skinParam.getFont(fontParam, null, false);
+ return skinParam.getFont(null, false, fontParam);
}
private final HtmlColor getFontColor(FontParam fontParam, Stereotype stereo) {
final ISkinParam skinParam = diagram.getSkinParam();
- return skinParam.getFontHtmlColor(fontParam, stereo);
+ return skinParam.getFontHtmlColor(stereo, fontParam);
}
private double getScale(FileFormatOption fileFormatOption, final Dimension2D dim) {
diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2.java
index 58083da..1343e86 100644
--- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2.java
+++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,6 +53,7 @@ import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.SkinParamForecolored;
import net.sourceforge.plantuml.SkinParamSameClassWidth;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.cucadiagram.Display;
@@ -86,6 +87,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockWidth;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.USymbolInterface;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.svek.image.EntityImageActivity;
import net.sourceforge.plantuml.svek.image.EntityImageArcCircle;
import net.sourceforge.plantuml.svek.image.EntityImageAssociation;
@@ -94,8 +96,8 @@ import net.sourceforge.plantuml.svek.image.EntityImageBranch;
import net.sourceforge.plantuml.svek.image.EntityImageCircleEnd;
import net.sourceforge.plantuml.svek.image.EntityImageCircleStart;
import net.sourceforge.plantuml.svek.image.EntityImageClass;
-import net.sourceforge.plantuml.svek.image.EntityImageComponent;
-import net.sourceforge.plantuml.svek.image.EntityImageEmptyPackage2;
+import net.sourceforge.plantuml.svek.image.EntityImageDescription;
+import net.sourceforge.plantuml.svek.image.EntityImageEmptyPackage;
import net.sourceforge.plantuml.svek.image.EntityImageGroup;
import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterface;
import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterfaceEye1;
@@ -108,6 +110,7 @@ import net.sourceforge.plantuml.svek.image.EntityImageState2;
import net.sourceforge.plantuml.svek.image.EntityImageStateBorder;
import net.sourceforge.plantuml.svek.image.EntityImageStateEmptyDescription;
import net.sourceforge.plantuml.svek.image.EntityImageSynchroBar;
+import net.sourceforge.plantuml.svek.image.EntityImageTips;
import net.sourceforge.plantuml.svek.image.EntityImageUseCase;
public final class CucaDiagramFileMakerSvek2 {
@@ -153,7 +156,6 @@ public final class CucaDiagramFileMakerSvek2 {
printGroups(dotData.getRootGroup());
printEntities(getUnpackagedEntities());
-
for (Link link : dotData.getLinks()) {
if (link.isRemoved()) {
continue;
@@ -162,22 +164,20 @@ public final class CucaDiagramFileMakerSvek2 {
final String shapeUid1 = getBibliotekon().getShapeUid((ILeaf) link.getEntity1());
final String shapeUid2 = getBibliotekon().getShapeUid((ILeaf) link.getEntity2());
- String ltail = null;
+ Cluster ltail = null;
if (shapeUid1.startsWith(Cluster.CENTER_ID)) {
// final Group g1 = ((IEntityMutable)
// link.getEntity1()).getContainerOrEquivalent();
- ltail = getCluster2((IEntity) link.getEntity1()).getClusterId();
+ ltail = getCluster2((IEntity) link.getEntity1());
}
- String lhead = null;
+ Cluster lhead = null;
if (shapeUid2.startsWith(Cluster.CENTER_ID)) {
// final Group g2 = ((IEntityMutable)
// link.getEntity2()).getContainerOrEquivalent();
- lhead = getCluster2((IEntity) link.getEntity2()).getClusterId();
+ lhead = getCluster2((IEntity) link.getEntity2());
}
final ISkinParam skinParam = dotData.getSkinParam();
- final FontConfiguration labelFont = new FontConfiguration(skinParam.getFont(FontParam.GENERIC_ARROW,
- null, false), skinParam.getFontHtmlColor(FontParam.GENERIC_ARROW, null),
- skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
+ final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.GENERIC_ARROW, null);
final Line line = new Line(shapeUid1, shapeUid2, link, colorSequence, ltail, lhead, skinParam,
stringBounder, labelFont, getBibliotekon(), dotStringFactory.getGraphvizVersion(),
@@ -188,13 +188,19 @@ public final class CucaDiagramFileMakerSvek2 {
if (link.getEntity1().isGroup() == false && link.getEntity1().getEntityType() == LeafType.NOTE
&& onlyOneLink(link.getEntity1())) {
final Shape shape = getBibliotekon().getShape(link.getEntity1());
- ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape);
- line.setOpale(true);
+ final Shape other = getBibliotekon().getShape(link.getEntity2());
+ if (other != null) {
+ ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
+ line.setOpale(true);
+ }
} else if (link.getEntity2().isGroup() == false && link.getEntity2().getEntityType() == LeafType.NOTE
&& onlyOneLink(link.getEntity2())) {
final Shape shape = getBibliotekon().getShape(link.getEntity2());
- ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape);
- line.setOpale(true);
+ final Shape other = getBibliotekon().getShape(link.getEntity1());
+ if (other != null) {
+ ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
+ line.setOpale(true);
+ }
}
} catch (IllegalStateException e) {
e.printStackTrace();
@@ -242,7 +248,7 @@ public final class CucaDiagramFileMakerSvek2 {
final Pattern pGraph = Pattern.compile("(?mi)!-- generated by graphviz(.*)");
final Matcher mGraph = pGraph.matcher(svg);
if (mGraph.find()) {
- return mGraph.group(1).trim();
+ return StringUtils.trin(mGraph.group(1));
}
return null;
}
@@ -389,7 +395,7 @@ public final class CucaDiagramFileMakerSvek2 {
final Cluster stateParent = bibliotekon.getCluster(leaf.getParentContainer());
return new EntityImageStateBorder(leaf, skinParam, stateParent, bibliotekon);
}
- if (isHideEmptyDescriptionForState && leaf.getFieldsToDisplay().size() == 0) {
+ if (isHideEmptyDescriptionForState && leaf.getBodier().getFieldsToDisplay().size() == 0) {
return new EntityImageStateEmptyDescription(leaf, skinParam);
}
if (leaf.getStereotype() != null && "<<sdlreceive>>".equals(leaf.getStereotype().getLabel(false))) {
@@ -424,7 +430,7 @@ public final class CucaDiagramFileMakerSvek2 {
} else if (OptionFlags.USE_INTERFACE_EYE2 && leaf.getUSymbol() instanceof USymbolInterface) {
return new EntityImageLollipopInterfaceEye2(leaf, skinParam, portionShower);
} else {
- return new EntityImageComponent(leaf, skinParam, portionShower);
+ return new EntityImageDescription(leaf, skinParam, portionShower);
}
}
if (leaf.getEntityType() == LeafType.USECASE) {
@@ -450,10 +456,10 @@ public final class CucaDiagramFileMakerSvek2 {
}
if (leaf.getEntityType() == LeafType.EMPTY_PACKAGE) {
if (leaf.getUSymbol() != null) {
- return new EntityImageComponent(leaf, new SkinParamForecolored(skinParam, HtmlColorUtils.BLACK),
+ return new EntityImageDescription(leaf, new SkinParamForecolored(skinParam, HtmlColorUtils.BLACK),
portionShower);
}
- return new EntityImageEmptyPackage2(leaf, skinParam);
+ return new EntityImageEmptyPackage(leaf, skinParam);
}
if (leaf.getEntityType() == LeafType.ASSOCIATION) {
return new EntityImageAssociation(leaf, skinParam);
@@ -461,6 +467,9 @@ public final class CucaDiagramFileMakerSvek2 {
if (leaf.getEntityType() == LeafType.PSEUDO_STATE) {
return new EntityImagePseudoState(leaf, skinParam);
}
+ if (leaf.getEntityType() == LeafType.TIPS) {
+ return new EntityImageTips(leaf, skinParam, bibliotekon);
+ }
throw new UnsupportedOperationException(leaf.getEntityType().toString());
}
@@ -484,12 +493,15 @@ public final class CucaDiagramFileMakerSvek2 {
g.getParentContainer(), null, dotData.getNamespaceSeparator());
final USymbol symbol = g.getUSymbol();
folder.setUSymbol(symbol);
- if (g.getSpecificBackColor() == null) {
+ folder.setStereotype(g.getStereotype());
+ if (g.getColors(dotData.getSkinParam()).getColor(ColorType.BACK) == null) {
final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack();
final HtmlColor c1 = dotData.getSkinParam().getHtmlColor(param, g.getStereotype(), false);
- folder.setSpecificBackcolor(c1 == null ? dotData.getSkinParam().getBackgroundColor() : c1);
+ folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? dotData.getSkinParam()
+ .getBackgroundColor() : c1);
} else {
- folder.setSpecificBackcolor(g.getSpecificBackColor());
+ folder.setSpecificColorTOBEREMOVED(ColorType.BACK,
+ g.getColors(dotData.getSkinParam()).getColor(ColorType.BACK));
}
printEntity(folder);
} else {
@@ -510,7 +522,7 @@ public final class CucaDiagramFileMakerSvek2 {
final TextBlock stereoAndTitle = TextBlockUtils.mergeTB(stereo, title, HorizontalAlignment.CENTER);
final Dimension2D dimLabel = stereoAndTitle.calculateDimension(stringBounder);
if (dimLabel.getWidth() > 0) {
- final List<Member> members = ((IEntity) g).getFieldsToDisplay();
+ final List<Member> members = ((IEntity) g).getBodier().getFieldsToDisplay();
final TextBlockWidth attribute;
if (members.size() == 0) {
attribute = new TextBlockEmpty();
@@ -539,25 +551,24 @@ public final class CucaDiagramFileMakerSvek2 {
private TextBlock getTitleBlock(IGroup g) {
final Display label = g.getDisplay();
- final Stereotype stereotype2 = g.getStereotype();
-
if (label == null) {
return TextBlockUtils.empty(0, 0);
}
- final FontParam fontParam = g.getTitleFontParam();
- return TextBlockUtils.create(label,
- new FontConfiguration(dotData.getSkinParam().getFont(fontParam, stereotype2, true), dotData
- .getSkinParam().getFontHtmlColor(fontParam, stereotype2), dotData.getSkinParam()
- .getHyperlinkColor(), dotData.getSkinParam().useUnderlineForHyperlink()),
- HorizontalAlignment.CENTER, dotData.getSkinParam());
+ final ISkinParam skinParam = dotData.getSkinParam();
+ final FontConfiguration fontConfiguration = g.getFontConfigurationForTitle(skinParam);
+ return label.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam);
}
private TextBlock getStereoBlock(IGroup g) {
- if (g.getStereotype() == null) {
+ final Stereotype stereotype = g.getStereotype();
+ if (stereotype == null) {
return TextBlockUtils.empty(0, 0);
}
- final List<String> stereos = g.getStereotype().getLabels(dotData.getSkinParam().useGuillemet());
+ if (stereotype.getSprite() != null) {
+ return dotData.getSkinParam().getSprite(stereotype.getSprite()).asTextBlock(stereotype.getHtmlColor());
+ }
+ final List<String> stereos = stereotype.getLabels(dotData.getSkinParam().useGuillemet());
if (stereos == null) {
return TextBlockUtils.empty(0, 0);
}
@@ -566,14 +577,8 @@ public final class CucaDiagramFileMakerSvek2 {
return TextBlockUtils.empty(0, 0);
}
- final Stereotype stereotype2 = g.getStereotype();
-
- final FontParam fontParam = FontParam.COMPONENT_STEREOTYPE;
- return TextBlockUtils.create(Display.create(stereos),
- new FontConfiguration(dotData.getSkinParam().getFont(fontParam, stereotype2, false), dotData
- .getSkinParam().getFontHtmlColor(fontParam, stereotype2), dotData.getSkinParam()
- .getHyperlinkColor(), dotData.getSkinParam().useUnderlineForHyperlink()),
+ final FontParam fontParam = FontParam.PACKAGE_STEREOTYPE;
+ return Display.create(stereos).create(new FontConfiguration(dotData.getSkinParam(), fontParam, stereotype),
HorizontalAlignment.CENTER, dotData.getSkinParam());
}
-
}
diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java
index d7d4ee3..afae001 100644
--- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java
+++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek2InternalImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -53,7 +54,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public final class CucaDiagramFileMakerSvek2InternalImage implements IEntityImage {
+public final class CucaDiagramFileMakerSvek2InternalImage extends AbstractTextBlock implements IEntityImage {
private final List<IEntityImage> inners = new ArrayList<IEntityImage>();
private final Separator separator;
diff --git a/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java b/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java
index 6bf5c2c..4661b54 100644
--- a/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java
+++ b/src/net/sourceforge/plantuml/svek/DecorateEntityImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -45,7 +46,7 @@ import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class DecorateEntityImage implements TextBlockBackcolored {
+public class DecorateEntityImage extends AbstractTextBlock implements TextBlockBackcolored {
private final TextBlock original;
private final HorizontalAlignment horizontal1;
diff --git a/src/net/sourceforge/plantuml/svek/DecorateEntityImage3.java b/src/net/sourceforge/plantuml/svek/DecorateEntityImage3.java
index fd7870e..caf5dba 100644
--- a/src/net/sourceforge/plantuml/svek/DecorateEntityImage3.java
+++ b/src/net/sourceforge/plantuml/svek/DecorateEntityImage3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,12 +36,13 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class DecorateEntityImage3 implements TextBlockBackcolored {
+public class DecorateEntityImage3 extends AbstractTextBlock implements TextBlockBackcolored {
private final TextBlock original;
private final HtmlColor color;
diff --git a/src/net/sourceforge/plantuml/svek/DecorateTextBlock.java b/src/net/sourceforge/plantuml/svek/DecorateTextBlock.java
deleted file mode 100644
index fa4a722..0000000
--- a/src/net/sourceforge/plantuml/svek/DecorateTextBlock.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2014, Arnaud Roques
- *
- * Project Info: http://plantuml.sourceforge.net
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.svek;
-
-import java.awt.geom.Dimension2D;
-
-import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UTranslate;
-
-public class DecorateTextBlock implements TextBlock {
-
- private final TextBlock original;
- private final HorizontalAlignment horizontal1;
- private final TextBlock text1;
- private final HorizontalAlignment horizontal2;
- private final TextBlock text2;
-
- private double deltaX;
- private double deltaY;
-
- public DecorateTextBlock(TextBlock original, TextBlock text, HorizontalAlignment horizontal) {
- this(original, text, horizontal, null, null);
- }
-
- public DecorateTextBlock(TextBlock original, TextBlock text1, HorizontalAlignment horizontal1, TextBlock text2,
- HorizontalAlignment horizontal2) {
- this.original = original;
- this.horizontal1 = horizontal1;
- this.text1 = text1;
- this.horizontal2 = horizontal2;
- this.text2 = text2;
- }
-
- public void drawU(UGraphic ug) {
- final StringBounder stringBounder = ug.getStringBounder();
- final Dimension2D dimOriginal = original.calculateDimension(stringBounder);
- final Dimension2D dimText1 = getTextDim(text1, stringBounder);
- final Dimension2D dimText2 = getTextDim(text2, stringBounder);
- final Dimension2D dimTotal = calculateDimension(stringBounder);
-
- final double yText1 = 0;
- final double yImage = yText1 + dimText1.getHeight();
- final double yText2 = yImage + dimOriginal.getHeight();
-
- final double xImage = (dimTotal.getWidth() - dimOriginal.getWidth()) / 2;
-
- if (text1 != null) {
- final double xText1 = getTextX(dimText1, dimTotal, horizontal1);
- text1.drawU(ug.apply(new UTranslate(xText1, yText1)));
- }
- original.drawU(ug.apply(new UTranslate(xImage, yImage)));
- deltaX = xImage;
- deltaY = yImage;
- if (text2 != null) {
- final double xText2 = getTextX(dimText2, dimTotal, horizontal2);
- text2.drawU(ug.apply(new UTranslate(xText2, yText2)));
- }
- }
-
- private Dimension2D getTextDim(TextBlock text, StringBounder stringBounder) {
- if (text == null) {
- return new Dimension2DDouble(0, 0);
- }
- return text.calculateDimension(stringBounder);
- }
-
- private double getTextX(final Dimension2D dimText, final Dimension2D dimTotal, HorizontalAlignment h) {
- if (h == HorizontalAlignment.CENTER) {
- return (dimTotal.getWidth() - dimText.getWidth()) / 2;
- } else if (h == HorizontalAlignment.LEFT) {
- return 0;
- } else if (h == HorizontalAlignment.RIGHT) {
- return dimTotal.getWidth() - dimText.getWidth();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public Dimension2D calculateDimension(StringBounder stringBounder) {
- final Dimension2D dimOriginal = original.calculateDimension(stringBounder);
- final Dimension2D dimText = Dimension2DDouble.mergeTB(getTextDim(text1, stringBounder),
- getTextDim(text2, stringBounder));
- return Dimension2DDouble.mergeTB(dimOriginal, dimText);
- }
-
- private double getDeltaX() {
- if (original instanceof DecorateTextBlock) {
- return deltaX + ((DecorateTextBlock) original).deltaX;
- }
- return deltaX;
- }
-
- private double getDeltaY() {
- if (original instanceof DecorateTextBlock) {
- return deltaY + ((DecorateTextBlock) original).deltaY;
- }
- return deltaY;
- }
-
-}
diff --git a/src/net/sourceforge/plantuml/svek/DotMode.java b/src/net/sourceforge/plantuml/svek/DotMode.java
index 988c79d..877051d 100644
--- a/src/net/sourceforge/plantuml/svek/DotMode.java
+++ b/src/net/sourceforge/plantuml/svek/DotMode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/DotStringFactory.java b/src/net/sourceforge/plantuml/svek/DotStringFactory.java
index 4dc92d9..afa6acd 100644
--- a/src/net/sourceforge/plantuml/svek/DotStringFactory.java
+++ b/src/net/sourceforge/plantuml/svek/DotStringFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,10 +46,12 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.cucadiagram.IGroup;
import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.dot.DotData;
+import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.cucadiagram.dot.Graphviz;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
@@ -161,8 +163,19 @@ public class DotStringFactory implements Moveable {
SvekUtils.println(sb);
sb.append("searchsize=500;");
SvekUtils.println(sb);
- sb.append("compound=true;");
- SvekUtils.println(sb);
+ if (OptionFlags.USE_COMPOUND) {
+ sb.append("compound=true;");
+ SvekUtils.println(sb);
+ }
+
+ final DotSplines dotSplines = dotData.getSkinParam().getDotSplines();
+ if (dotSplines == DotSplines.POLYLINE) {
+ sb.append("splines=polyline;");
+ SvekUtils.println(sb);
+ } else if (dotSplines == DotSplines.ORTHO) {
+ sb.append("splines=ortho;");
+ SvekUtils.println(sb);
+ }
if (dotData.getSkinParam().getRankdir() == Rankdir.LEFT_TO_RIGHT) {
sb.append("rankdir=LR;");
@@ -176,7 +189,8 @@ public class DotStringFactory implements Moveable {
line.appendLine(sb);
}
root.fillRankMin(rankMin);
- root.printCluster2(sb, bibliotekon.allLines(), stringBounder, dotData.getDotMode(), getGraphvizVersion(), dotData.getUmlDiagramType());
+ root.printCluster2(sb, bibliotekon.allLines(), stringBounder, dotData.getDotMode(), getGraphvizVersion(),
+ dotData.getUmlDiagramType());
printMinRanking(sb);
for (Line line : bibliotekon.lines1()) {
@@ -299,7 +313,8 @@ public class DotStringFactory implements Moveable {
for (Shape sh : bibliotekon.allShapes()) {
int idx = svg.indexOf("<title>" + sh.getUid() + "</title>");
- if (sh.getType() == ShapeType.RECTANGLE || sh.getType() == ShapeType.DIAMOND) {
+ if (sh.getType() == ShapeType.RECTANGLE || sh.getType() == ShapeType.FOLDER
+ || sh.getType() == ShapeType.DIAMOND) {
final List<Point2D.Double> points = SvekUtils.extractPointsList(svg, idx, fullHeight);
final double minX = SvekUtils.getMinX(points);
final double minY = SvekUtils.getMinY(points);
@@ -364,7 +379,7 @@ public class DotStringFactory implements Moveable {
}
for (Line line : bibliotekon.allLines()) {
- line.solveLine(svg, fullHeight, corner1);
+ line.solveLine(svg, fullHeight, corner1, dotData);
}
for (Line line : bibliotekon.allLines()) {
diff --git a/src/net/sourceforge/plantuml/svek/EmptySvgException.java b/src/net/sourceforge/plantuml/svek/EmptySvgException.java
index f15c6b2..a6c0726 100644
--- a/src/net/sourceforge/plantuml/svek/EmptySvgException.java
+++ b/src/net/sourceforge/plantuml/svek/EmptySvgException.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/EntityDomain.java b/src/net/sourceforge/plantuml/svek/EntityDomain.java
index a47bc47..676e3b5 100644
--- a/src/net/sourceforge/plantuml/svek/EntityDomain.java
+++ b/src/net/sourceforge/plantuml/svek/EntityDomain.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -45,7 +46,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class EntityDomain implements TextBlock {
+public class EntityDomain extends AbstractTextBlock implements TextBlock {
private final double margin = 4;
diff --git a/src/net/sourceforge/plantuml/svek/EntityImageProtected.java b/src/net/sourceforge/plantuml/svek/EntityImageProtected.java
index 16216ca..9d8c87b 100644
--- a/src/net/sourceforge/plantuml/svek/EntityImageProtected.java
+++ b/src/net/sourceforge/plantuml/svek/EntityImageProtected.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,20 +35,27 @@
package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public class EntityImageProtected implements IEntityImage, Untranslated {
+public class EntityImageProtected extends AbstractTextBlock implements IEntityImage, Untranslated {
private final IEntityImage orig;
private final double border;
private final Bibliotekon bibliotekon;
private final Neighborhood neighborhood;
+
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
public EntityImageProtected(IEntityImage orig, double border, Neighborhood neighborhood, Bibliotekon bibliotekon) {
this.orig = orig;
diff --git a/src/net/sourceforge/plantuml/svek/FrontierCalculator.java b/src/net/sourceforge/plantuml/svek/FrontierCalculator.java
index ad6573b..dff8848 100644
--- a/src/net/sourceforge/plantuml/svek/FrontierCalculator.java
+++ b/src/net/sourceforge/plantuml/svek/FrontierCalculator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java
index 62ca64f..5ac3f07 100644
--- a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java
+++ b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
import net.sourceforge.plantuml.fun.IconLoader;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -58,7 +59,7 @@ import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.version.Version;
-public class GraphvizCrash implements IEntityImage {
+public class GraphvizCrash extends AbstractTextBlock implements IEntityImage {
private static final UFont font = new UFont("SansSerif", Font.PLAIN, 12);
diff --git a/src/net/sourceforge/plantuml/svek/GroupPngMakerActivity.java b/src/net/sourceforge/plantuml/svek/GroupPngMakerActivity.java
index a2f447a..f4d056d 100644
--- a/src/net/sourceforge/plantuml/svek/GroupPngMakerActivity.java
+++ b/src/net/sourceforge/plantuml/svek/GroupPngMakerActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,6 +52,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotData;
import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.image.EntityImageState;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -96,7 +97,7 @@ public final class GroupPngMakerActivity {
public IEntityImage getImage() throws IOException, InterruptedException {
// final List<? extends CharSequence> display = group.getDisplay();
- // final TextBlock title = TextBlockUtils.create(display, new FontConfiguration(
+ // final TextBlock title = Display.create(display, new FontConfiguration(
// getFont(FontParam.STATE), HtmlColorUtils.BLACK), HorizontalAlignment.CENTER, diagram.getSkinParam());
if (group.size() == 0) {
@@ -117,8 +118,8 @@ public final class GroupPngMakerActivity {
if (group.getGroupType() == GroupType.INNER_ACTIVITY) {
final Stereotype stereo = group.getStereotype();
final HtmlColor borderColor = getColor(ColorParam.activityBorder, stereo);
- final HtmlColor backColor = group.getSpecificBackColor() == null ? getColor(ColorParam.background, stereo)
- : group.getSpecificBackColor();
+ final HtmlColor backColor = group.getColors(skinParam).getColor(ColorType.BACK) == null ? getColor(
+ ColorParam.background, stereo) : group.getColors(skinParam).getColor(ColorType.BACK);
return new InnerActivity(svek2.createFile(), borderColor, backColor, skinParam.shadowing());
}
@@ -128,7 +129,7 @@ public final class GroupPngMakerActivity {
private UFont getFont(FontParam fontParam) {
final ISkinParam skinParam = diagram.getSkinParam();
- return skinParam.getFont(fontParam, null, false);
+ return skinParam.getFont(null, false, fontParam);
}
private final Rose rose = new Rose();
diff --git a/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java b/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java
index c9ded6d..4d8e252 100644
--- a/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java
+++ b/src/net/sourceforge/plantuml/svek/GroupPngMakerState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,7 +34,6 @@
*/
package net.sourceforge.plantuml.svek;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -54,17 +53,15 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.Member;
import net.sourceforge.plantuml.cucadiagram.MethodsOrFieldsArea;
-import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotData;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.TextBlockWidth;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.image.EntityImageState;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -111,11 +108,11 @@ public final class GroupPngMakerState {
public IEntityImage getImage() {
final Display display = group.getDisplay();
final ISkinParam skinParam = diagram.getSkinParam();
- final TextBlock title = TextBlockUtils.create(display, new FontConfiguration(getFont(FontParam.STATE),
- HtmlColorUtils.BLACK, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink()),
- HorizontalAlignment.CENTER, diagram.getSkinParam());
+ final TextBlock title = display.create(
+ new FontConfiguration(skinParam, FontParam.STATE, group.getStereotype()), HorizontalAlignment.CENTER,
+ diagram.getSkinParam());
- if (group.size() == 0) {
+ if (group.size() == 0 && group.getChildren().size() == 0) {
return new EntityImageState(group, diagram.getSkinParam());
}
final List<Link> links = getPureInnerLinks();
@@ -134,7 +131,7 @@ public final class GroupPngMakerState {
final CucaDiagramFileMakerSvek2 svek2 = new CucaDiagramFileMakerSvek2(dotData, diagram.getEntityFactory(),
diagram.getSource(), diagram.getPragma());
- UStroke stroke = group.getSpecificLineStroke();
+ UStroke stroke = group.getColors(skinParam).getSpecificLineStroke();
if (stroke == null) {
stroke = new UStroke(1.5);
}
@@ -143,14 +140,14 @@ public final class GroupPngMakerState {
// return new InnerStateConcurrent(svek2.createFile());
return svek2.createFile();
} else if (group.getGroupType() == GroupType.STATE) {
- HtmlColor borderColor = group.getSpecificLineColor();
+ HtmlColor borderColor = group.getColors(skinParam).getColor(ColorType.LINE);
if (borderColor == null) {
borderColor = getColor(ColorParam.stateBorder, group.getStereotype());
}
final Stereotype stereo = group.getStereotype();
- final HtmlColor backColor = group.getSpecificBackColor() == null ? getColor(ColorParam.stateBackground,
- stereo) : group.getSpecificBackColor();
- final List<Member> members = ((IEntity) group).getFieldsToDisplay();
+ final HtmlColor backColor = group.getColors(skinParam).getColor(ColorType.BACK) == null ? getColor(
+ ColorParam.stateBackground, stereo) : group.getColors(skinParam).getColor(ColorType.BACK);
+ final List<Member> members = ((IEntity) group).getBodier().getFieldsToDisplay();
final TextBlockWidth attribute;
if (members.size() == 0) {
attribute = new TextBlockEmpty();
@@ -186,7 +183,7 @@ public final class GroupPngMakerState {
private UFont getFont(FontParam fontParam) {
final ISkinParam skinParam = diagram.getSkinParam();
- return skinParam.getFont(fontParam, null, false);
+ return skinParam.getFont(null, false, fontParam);
}
private final Rose rose = new Rose();
diff --git a/src/net/sourceforge/plantuml/svek/HeaderLayout.java b/src/net/sourceforge/plantuml/svek/HeaderLayout.java
index c20d995..1074ce0 100644
--- a/src/net/sourceforge/plantuml/svek/HeaderLayout.java
+++ b/src/net/sourceforge/plantuml/svek/HeaderLayout.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/IEntityImage.java b/src/net/sourceforge/plantuml/svek/IEntityImage.java
index 3eea03a..70a1e25 100644
--- a/src/net/sourceforge/plantuml/svek/IEntityImage.java
+++ b/src/net/sourceforge/plantuml/svek/IEntityImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/IShapePseudo.java b/src/net/sourceforge/plantuml/svek/IShapePseudo.java
index e4cd3df..3c2b750 100644
--- a/src/net/sourceforge/plantuml/svek/IShapePseudo.java
+++ b/src/net/sourceforge/plantuml/svek/IShapePseudo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/InnerActivity.java b/src/net/sourceforge/plantuml/svek/InnerActivity.java
index 8ea3257..a66841f 100644
--- a/src/net/sourceforge/plantuml/svek/InnerActivity.java
+++ b/src/net/sourceforge/plantuml/svek/InnerActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.svek;
import java.awt.geom.Dimension2D;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -44,7 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public final class InnerActivity implements IEntityImage {
+public final class InnerActivity extends AbstractTextBlock implements IEntityImage {
private final IEntityImage im;
private final HtmlColor borderColor;
diff --git a/src/net/sourceforge/plantuml/svek/InnerStateAutonom.java b/src/net/sourceforge/plantuml/svek/InnerStateAutonom.java
index 95521cb..05ed515 100644
--- a/src/net/sourceforge/plantuml/svek/InnerStateAutonom.java
+++ b/src/net/sourceforge/plantuml/svek/InnerStateAutonom.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -48,7 +49,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public final class InnerStateAutonom implements IEntityImage {
+public final class InnerStateAutonom extends AbstractTextBlock implements IEntityImage {
private final IEntityImage im;
private final TextBlock title;
diff --git a/src/net/sourceforge/plantuml/svek/Line.java b/src/net/sourceforge/plantuml/svek/Line.java
index 51ca366..70815a9 100644
--- a/src/net/sourceforge/plantuml/svek/Line.java
+++ b/src/net/sourceforge/plantuml/svek/Line.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,6 +43,7 @@ import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.Hideable;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
@@ -56,7 +57,9 @@ import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkHat;
import net.sourceforge.plantuml.cucadiagram.LinkMiddleDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
+import net.sourceforge.plantuml.cucadiagram.dot.DotData;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
@@ -67,6 +70,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.USymbolFolder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.posimo.BezierUtils;
import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.posimo.Moveable;
@@ -85,8 +89,8 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class Line implements Moveable, Hideable {
- private final String ltail;
- private final String lhead;
+ private final Cluster ltail;
+ private final Cluster lhead;
private final Link link;
private final String startUid;
@@ -94,7 +98,7 @@ public class Line implements Moveable, Hideable {
private final TextBlock startTailText;
private final TextBlock endHeadText;
- private final TextBlock noteLabelText;
+ private final TextBlock labelText;
private final int lineColor;
private final int noteLabelColor;
@@ -108,7 +112,7 @@ public class Line implements Moveable, Hideable {
private Positionable startTailLabelXY;
private Positionable endHeadLabelXY;
- private Positionable noteLabelXY;
+ private Positionable labelXY;
private UDrawable extremity2;
private UDrawable extremity1;
@@ -138,7 +142,7 @@ public class Line implements Moveable, Hideable {
return super.toString() + " color=" + lineColor;
}
- class DirectionalTextBlock implements TextBlock {
+ class DirectionalTextBlock extends AbstractTextBlock implements TextBlock {
private final TextBlock right;
private final TextBlock left;
@@ -202,12 +206,16 @@ public class Line implements Moveable, Hideable {
// return startUid.startsWith(Cluster.CENTER_ID);
// }
- public Line(String startUid, String endUid, Link link, ColorSequence colorSequence, String ltail, String lhead,
+ public Line(String startUid, String endUid, Link link, ColorSequence colorSequence, Cluster ltail, Cluster lhead,
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration labelFont, Bibliotekon bibliotekon,
GraphvizVersion graphvizVersion, Pragma pragma) {
if (startUid == null || endUid == null || link == null) {
throw new IllegalArgumentException();
}
+ if (link.getColors() != null) {
+ skinParam = link.getColors().mute(skinParam);
+ labelFont = labelFont.mute(link.getColors());
+ }
this.graphvizVersion = graphvizVersion;
this.pragma = pragma;
this.bibliotekon = bibliotekon;
@@ -224,7 +232,7 @@ public class Line implements Moveable, Hideable {
this.endHeadColor = colorSequence.getValue();
final TextBlock labelOnly;
- if (link.getLabel() == null) {
+ if (Display.isNull(link.getLabel())) {
if (getLinkArrow() == LinkArrow.NONE) {
labelOnly = null;
} else {
@@ -237,8 +245,8 @@ public class Line implements Moveable, Hideable {
} else {
final double marginLabel = startUid.equals(endUid) ? 6 : 1;
final TextBlock label = TextBlockUtils.withMargin(
- TextBlockUtils.create(link.getLabel(), labelFont, skinParam.getDefaultTextAlignment(), skinParam),
- marginLabel, marginLabel);
+ link.getLabel().create(labelFont, skinParam.getDefaultTextAlignment(), skinParam), marginLabel,
+ marginLabel);
if (getLinkArrow() == LinkArrow.NONE) {
labelOnly = label;
} else {
@@ -258,45 +266,45 @@ public class Line implements Moveable, Hideable {
if (link.getNote() == null) {
noteOnly = null;
} else {
- noteOnly = new EntityImageNoteLink(link.getNote(), link.getNoteColor(), skinParam);
+ noteOnly = new EntityImageNoteLink(link.getNote(), link.getNoteColors(), skinParam);
}
if (labelOnly != null && noteOnly != null) {
if (link.getNotePosition() == Position.LEFT) {
- noteLabelText = TextBlockUtils.mergeLR(noteOnly, labelOnly, VerticalAlignment.CENTER);
+ labelText = TextBlockUtils.mergeLR(noteOnly, labelOnly, VerticalAlignment.CENTER);
} else if (link.getNotePosition() == Position.RIGHT) {
- noteLabelText = TextBlockUtils.mergeLR(labelOnly, noteOnly, VerticalAlignment.CENTER);
+ labelText = TextBlockUtils.mergeLR(labelOnly, noteOnly, VerticalAlignment.CENTER);
} else if (link.getNotePosition() == Position.TOP) {
- noteLabelText = TextBlockUtils.mergeTB(noteOnly, labelOnly, HorizontalAlignment.CENTER);
+ labelText = TextBlockUtils.mergeTB(noteOnly, labelOnly, HorizontalAlignment.CENTER);
} else {
- noteLabelText = TextBlockUtils.mergeTB(labelOnly, noteOnly, HorizontalAlignment.CENTER);
+ labelText = TextBlockUtils.mergeTB(labelOnly, noteOnly, HorizontalAlignment.CENTER);
}
} else if (labelOnly != null) {
- noteLabelText = labelOnly;
+ labelText = labelOnly;
} else if (noteOnly != null) {
- noteLabelText = noteOnly;
+ labelText = noteOnly;
} else {
- noteLabelText = null;
+ labelText = null;
}
if (link.getQualifier1() == null) {
startTailText = null;
} else {
- startTailText = TextBlockUtils.create(Display.getWithNewlines(link.getQualifier1()), labelFont,
- HorizontalAlignment.CENTER, skinParam);
+ startTailText = Display.getWithNewlines(link.getQualifier1()).create(labelFont, HorizontalAlignment.CENTER,
+ skinParam);
}
if (link.getQualifier2() == null) {
endHeadText = null;
} else {
- endHeadText = TextBlockUtils.create(Display.getWithNewlines(link.getQualifier2()), labelFont,
- HorizontalAlignment.CENTER, skinParam);
+ endHeadText = Display.getWithNewlines(link.getQualifier2()).create(labelFont, HorizontalAlignment.CENTER,
+ skinParam);
}
}
public boolean hasNoteLabelText() {
- return noteLabelText != null;
+ return labelText != null;
}
private LinkArrow getLinkArrow() {
@@ -315,7 +323,7 @@ public class Line implements Moveable, Hideable {
sb.append(endUid);
// }
sb.append("[");
- final LinkType linkType = link.getType();
+ final LinkType linkType = link.getTypePatchCluster();
String decoration = linkType.getSpecificDecorationSvek();
if (decoration.endsWith(",") == false) {
decoration += ",";
@@ -331,10 +339,10 @@ public class Line implements Moveable, Hideable {
sb.append(",");
}
sb.append("color=\"" + StringUtils.getAsHtml(lineColor) + "\"");
- if (noteLabelText != null) {
+ if (labelText != null) {
sb.append(",");
sb.append("label=<");
- appendTable(sb, noteLabelText.calculateDimension(stringBounder), noteLabelColor);
+ appendTable(sb, labelText.calculateDimension(stringBounder), noteLabelColor);
sb.append(">");
// sb.append(",labelfloat=true");
}
@@ -354,15 +362,15 @@ public class Line implements Moveable, Hideable {
// sb.append(",labelangle=0");
}
- if (ltail != null) {
+ if (OptionFlags.USE_COMPOUND && ltail != null) {
sb.append(",");
sb.append("ltail=");
- sb.append(ltail);
+ sb.append(ltail.getClusterId());
}
- if (lhead != null) {
+ if (OptionFlags.USE_COMPOUND && lhead != null) {
sb.append(",");
sb.append("lhead=");
- sb.append(lhead);
+ sb.append(lhead.getClusterId());
}
if (link.isInvis()) {
sb.append(",");
@@ -426,9 +434,18 @@ public class Line implements Moveable, Hideable {
return endUid;
}
- public UDrawable getExtremity(LinkHat hat, LinkDecor decor, PointListIterator pointListIterator) {
+ private UDrawable getExtremity(LinkHat hat, LinkDecor decor, PointListIterator pointListIterator, Point2D center,
+ double angle, Cluster cluster, boolean isGroup) {
final ExtremityFactory extremityFactory = decor.getExtremityFactory();
+ if (OptionFlags.USE_COMPOUND == false && cluster != null) {
+ if (extremityFactory != null) {
+ // System.err.println("angle=" + angle * 180 / Math.PI);
+ return extremityFactory.createUDrawable(center, angle);
+ }
+ return null;
+ }
+
if (extremityFactory != null) {
final List<Point2D.Double> points = pointListIterator.next();
final Point2D p0 = points.get(0);
@@ -447,7 +464,7 @@ public class Line implements Moveable, Hideable {
}
- public void solveLine(final String svg, final int fullHeight, MinFinder corner1) {
+ public void solveLine(final String svg, final int fullHeight, MinFinder corner1, DotData dotData) {
if (this.link.isInvis()) {
return;
}
@@ -463,19 +480,34 @@ public class Line implements Moveable, Hideable {
}
final int end = svg.indexOf("\"", idx + 3);
final String path = svg.substring(idx + 3, end);
+
dotPath = new DotPath(path, fullHeight);
+ if (OptionFlags.USE_COMPOUND == false) {
+ if (projectionCluster != null) {
+ System.err.println("Line::solveLine1 projectionCluster=" + projectionCluster.getClusterPosition());
+ projectionCluster.manageEntryExitPoint(dotData, TextBlockUtils.getDummyStringBounder());
+ System.err.println("Line::solveLine2 projectionCluster=" + projectionCluster.getClusterPosition());
+ if (lhead != null)
+ System.err.println("Line::solveLine ltail=" + lhead.getClusterPosition());
+ if (ltail != null)
+ System.err.println("Line::solveLine ltail=" + ltail.getClusterPosition());
+ }
+ dotPath = dotPath.simulateCompound(lhead, ltail);
+ }
final PointListIterator pointListIterator = new PointListIterator(svg.substring(end), fullHeight);
final LinkType linkType = link.getType();
- this.extremity2 = getExtremity(linkType.getHat2(), linkType.getDecor2(), pointListIterator);
- this.extremity1 = getExtremity(linkType.getHat1(), linkType.getDecor1(), pointListIterator);
+ this.extremity2 = getExtremity(linkType.getHat2(), linkType.getDecor2(), pointListIterator,
+ dotPath.getStartPoint(), dotPath.getStartAngle() + Math.PI, ltail, link.getEntity1().isGroup());
+ this.extremity1 = getExtremity(linkType.getHat1(), linkType.getDecor1(), pointListIterator,
+ dotPath.getEndPoint(), dotPath.getEndAngle(), lhead, link.getEntity2().isGroup());
- if (this.noteLabelText != null) {
+ if (this.labelText != null) {
final Point2D pos = getXY(svg, this.noteLabelColor, fullHeight);
if (pos != null) {
corner1.manage(pos);
- this.noteLabelXY = TextBlockUtils.asPositionable(noteLabelText, stringBounder, pos);
+ this.labelXY = TextBlockUtils.asPositionable(labelText, stringBounder, pos);
}
}
@@ -492,6 +524,7 @@ public class Line implements Moveable, Hideable {
if (pos != null) {
corner1.manage(pos);
this.endHeadLabelXY = TextBlockUtils.asPositionable(endHeadText, stringBounder, pos);
+ corner1.manage(pos.getX() - 15, pos.getY());
}
}
@@ -558,18 +591,29 @@ public class Line implements Moveable, Hideable {
if (link.isInvis()) {
return;
}
- if (this.link.getSpecificColor() != null) {
+
+ if (this.link.getColors() != null) {
+ final HtmlColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE);
+ if (newColor != null) {
+ color = newColor;
+ }
+
+ } else if (this.link.getSpecificColor() != null) {
color = this.link.getSpecificColor();
}
ug = ug.apply(new UChangeBackColor(null)).apply(new UChangeColor(color));
final LinkType linkType = link.getType();
- ug = ug.apply(linkType.getStroke());
+ UStroke stroke = linkType.getStroke();
+ if (link.getColors() != null && link.getColors().getSpecificLineStroke() != null) {
+ stroke = link.getColors().getSpecificLineStroke();
+ }
+ ug = ug.apply(stroke);
double moveStartX = 0;
double moveStartY = 0;
double moveEndX = 0;
double moveEndY = 0;
- if (projectionCluster != null && link.getEntity1() == projectionCluster.getGroup()) {
+ if (OptionFlags.USE_COMPOUND && projectionCluster != null && link.getEntity1() == projectionCluster.getGroup()) {
final DotPath copy = new DotPath(dotPath);
final Point2D start = copy.getStartPoint();
final Point2D proj = projectionCluster.getClusterPosition().getProjectionOnFrontier(start);
@@ -577,7 +621,8 @@ public class Line implements Moveable, Hideable {
moveStartY = proj.getY() - start.getY();
copy.forceStartPoint(proj.getX(), proj.getY());
ug.apply(new UTranslate(x, y)).draw(copy);
- } else if (projectionCluster != null && link.getEntity2() == projectionCluster.getGroup()) {
+ } else if (OptionFlags.USE_COMPOUND && projectionCluster != null
+ && link.getEntity2() == projectionCluster.getGroup()) {
final DotPath copy = new DotPath(dotPath);
final Point2D end = copy.getEndPoint();
final Point2D proj = projectionCluster.getClusterPosition().getProjectionOnFrontier(end);
@@ -613,7 +658,12 @@ public class Line implements Moveable, Hideable {
} else {
ug = ug.apply(new UChangeBackColor(null));
}
- this.extremity1.drawU(ug.apply(new UTranslate(x + moveEndX, y + moveEndY)));
+ if (OptionFlags.USE_COMPOUND || lhead == null) {
+ this.extremity1.drawU(ug.apply(new UTranslate(x + moveEndX, y + moveEndY)));
+ } else {
+ // System.err.println("Line::draw EXTREMITY1");
+ this.extremity1.drawU(ug.apply(new UTranslate(x, y)));
+ }
}
if (this.extremity2 != null) {
if (linkType.getDecor2().isFill()) {
@@ -621,11 +671,18 @@ public class Line implements Moveable, Hideable {
} else {
ug = ug.apply(new UChangeBackColor(null));
}
- this.extremity2.drawU(ug.apply(new UTranslate(x + moveStartX, y + moveStartY)));
+ if (OptionFlags.USE_COMPOUND || ltail == null) {
+ this.extremity2.drawU(ug.apply(new UTranslate(x + moveStartX, y + moveStartY)));
+ } else {
+ // System.err.println("Line::draw EXTREMITY2");
+ this.extremity2.drawU(ug.apply(new UTranslate(x, y)));
+ // this.extremity2.drawU(ug.apply(new UTranslate(dotPath.getStartPoint())));
+
+ }
}
- if (this.noteLabelText != null && this.noteLabelXY != null) {
- this.noteLabelText.drawU(ug.apply(new UTranslate(x + this.noteLabelXY.getPosition().getX(), y
- + this.noteLabelXY.getPosition().getY())));
+ if (this.labelText != null && this.labelXY != null) {
+ this.labelText.drawU(ug.apply(new UTranslate(x + this.labelXY.getPosition().getX(), y
+ + this.labelXY.getPosition().getY())));
}
if (this.startTailText != null) {
this.startTailText.drawU(ug.apply(new UTranslate(x + this.startTailLabelXY.getPosition().getX(), y
@@ -670,8 +727,8 @@ public class Line implements Moveable, Hideable {
} else {
return 0;
}
- if (noteLabelText != null) {
- strategy.eat(noteLabelText.calculateDimension(stringBounder).getWidth());
+ if (labelText != null) {
+ strategy.eat(labelText.calculateDimension(stringBounder).getWidth());
}
if (startTailText != null) {
strategy.eat(startTailText.calculateDimension(stringBounder).getWidth());
@@ -694,8 +751,8 @@ public class Line implements Moveable, Hideable {
return 0;
}
final ArithmeticStrategy strategy = new ArithmeticStrategySum();
- if (noteLabelText != null) {
- strategy.eat(noteLabelText.calculateDimension(stringBounder).getHeight());
+ if (labelText != null) {
+ strategy.eat(labelText.calculateDimension(stringBounder).getHeight());
}
if (startTailText != null) {
strategy.eat(startTailText.calculateDimension(stringBounder).getHeight());
@@ -846,4 +903,11 @@ public class Line implements Moveable, Hideable {
return new Point2D.Double(dx + end.getX(), dy + end.getY());
}
+ public IEntity getOther(IEntity entity) {
+ if (link.contains(entity)) {
+ return link.getOther(entity);
+ }
+ return null;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/svek/MinFinder.java b/src/net/sourceforge/plantuml/svek/MinFinder.java
index 6305c9c..0b1de9d 100644
--- a/src/net/sourceforge/plantuml/svek/MinFinder.java
+++ b/src/net/sourceforge/plantuml/svek/MinFinder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/Oscillator.java b/src/net/sourceforge/plantuml/svek/Oscillator.java
index 579c066..1ef4117 100644
--- a/src/net/sourceforge/plantuml/svek/Oscillator.java
+++ b/src/net/sourceforge/plantuml/svek/Oscillator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/PackageStyle.java b/src/net/sourceforge/plantuml/svek/PackageStyle.java
index 67ff0e3..9a2dfb9 100644
--- a/src/net/sourceforge/plantuml/svek/PackageStyle.java
+++ b/src/net/sourceforge/plantuml/svek/PackageStyle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,7 @@ import java.awt.geom.Dimension2D;
import java.util.EnumSet;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPath;
@@ -59,6 +60,31 @@ public enum PackageStyle {
return null;
}
+ public USymbol toUSymbol() {
+ if (this == NODE) {
+ return USymbol.NODE;
+ }
+ if (this == CARD) {
+ return USymbol.CARD;
+ }
+ if (this == DATABASE) {
+ return USymbol.DATABASE;
+ }
+ if (this == CLOUD) {
+ return USymbol.CLOUD;
+ }
+ if (this == FRAME) {
+ return USymbol.FRAME;
+ }
+ if (this == RECT) {
+ return USymbol.RECTANGLE;
+ }
+ if (this == FOLDER) {
+ return USymbol.FOLDER;
+ }
+ return null;
+ }
+
public void drawU(UGraphic ug, Dimension2D dim, Dimension2D titleDim, boolean shadowing) {
if (titleDim == null) {
titleDim = new Dimension2DDouble(0, 0);
diff --git a/src/net/sourceforge/plantuml/svek/PointAndAngle.java b/src/net/sourceforge/plantuml/svek/PointAndAngle.java
index 2fc8860..0cf746a 100644
--- a/src/net/sourceforge/plantuml/svek/PointAndAngle.java
+++ b/src/net/sourceforge/plantuml/svek/PointAndAngle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/PointDirected.java b/src/net/sourceforge/plantuml/svek/PointDirected.java
index 810444b..bc0f5a0 100644
--- a/src/net/sourceforge/plantuml/svek/PointDirected.java
+++ b/src/net/sourceforge/plantuml/svek/PointDirected.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/RoundedContainer.java b/src/net/sourceforge/plantuml/svek/RoundedContainer.java
index a2e19d4..c03f4da 100644
--- a/src/net/sourceforge/plantuml/svek/RoundedContainer.java
+++ b/src/net/sourceforge/plantuml/svek/RoundedContainer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/Shape.java b/src/net/sourceforge/plantuml/svek/Shape.java
index 71340fa..f448ea1 100644
--- a/src/net/sourceforge/plantuml/svek/Shape.java
+++ b/src/net/sourceforge/plantuml/svek/Shape.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,13 +40,14 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Hideable;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.EntityPosition;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.posimo.Positionable;
+import net.sourceforge.plantuml.svek.image.EntityImageDescription;
import net.sourceforge.plantuml.svek.image.EntityImageStateBorder;
import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UPolygon;
-import net.sourceforge.plantuml.StringUtils;
public class Shape implements Positionable, IShapePseudo, Hideable {
@@ -80,6 +81,11 @@ public class Shape implements Positionable, IShapePseudo, Hideable {
this.cluster = cluster;
}
+ @Override
+ public String toString() {
+ return super.toString() + " " + image + " " + type;
+ }
+
public Shape(IEntityImage image, ShapeType type, double width, double height, ColorSequence colorSequence,
boolean top, int shield, EntityPosition entityPosition) {
this.entityPosition = entityPosition;
@@ -179,7 +185,7 @@ public class Shape implements Positionable, IShapePseudo, Hideable {
private void appendShapeInternal(StringBuilder sb) {
if (type == ShapeType.RECTANGLE && shield > 0) {
throw new UnsupportedOperationException();
- } else if (type == ShapeType.RECTANGLE) {
+ } else if (type == ShapeType.RECTANGLE || type == ShapeType.FOLDER) {
sb.append("shape=rect");
} else if (type == ShapeType.OCTAGON) {
sb.append("shape=octagon");
@@ -261,4 +267,22 @@ public class Shape implements Positionable, IShapePseudo, Hideable {
return octagon;
}
+ public Point2D getPoint2D(double x, double y) {
+ return new Point2D.Double(minX + x, minY + y);
+ }
+
+ public Point2D projection(Point2D pt, StringBounder stringBounder) {
+ if (getType() != ShapeType.FOLDER) {
+ return pt;
+ }
+ final ClusterPosition clusterPosition = new ClusterPosition(minX, minY, minX + width, minY + height);
+ if (clusterPosition.isPointJustUpper(pt)) {
+ final Dimension2D dimName = ((EntityImageDescription) image).getNameDimension(stringBounder);
+ if (pt.getX() < minX + dimName.getWidth()) {
+ return pt;
+ }
+ return new Point2D.Double(pt.getX(), pt.getY() + dimName.getHeight() + 4);
+ }
+ return pt;
+ }
}
diff --git a/src/net/sourceforge/plantuml/svek/ShapePseudoImpl.java b/src/net/sourceforge/plantuml/svek/ShapePseudoImpl.java
index e5b03af..7dac88d 100644
--- a/src/net/sourceforge/plantuml/svek/ShapePseudoImpl.java
+++ b/src/net/sourceforge/plantuml/svek/ShapePseudoImpl.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/ShapeType.java b/src/net/sourceforge/plantuml/svek/ShapeType.java
index 7164467..09964b2 100644
--- a/src/net/sourceforge/plantuml/svek/ShapeType.java
+++ b/src/net/sourceforge/plantuml/svek/ShapeType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,6 @@ package net.sourceforge.plantuml.svek;
public enum ShapeType {
- RECTANGLE, ROUND_RECTANGLE, CIRCLE, CIRCLE_IN_RECT, OVAL, DIAMOND, OCTAGON
+ RECTANGLE, ROUND_RECTANGLE, CIRCLE, CIRCLE_IN_RECT, OVAL, DIAMOND, OCTAGON, FOLDER
}
diff --git a/src/net/sourceforge/plantuml/svek/SingleStrategy.java b/src/net/sourceforge/plantuml/svek/SingleStrategy.java
index f1ac568..7a5f255 100644
--- a/src/net/sourceforge/plantuml/svek/SingleStrategy.java
+++ b/src/net/sourceforge/plantuml/svek/SingleStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Link;
@@ -64,11 +65,11 @@ public enum SingleStrategy {
final Link link;
if (dist == branch) {
final IEntity ent1 = standalones.get(headBranch);
- link = new Link(ent1, ent2, linkType, null, 2);
+ link = new Link(ent1, ent2, linkType, Display.NULL, 2);
headBranch = i;
} else {
final IEntity ent1 = standalones.get(i - 1);
- link = new Link(ent1, ent2, linkType, null, 1);
+ link = new Link(ent1, ent2, linkType, Display.NULL, 1);
}
result.add(link);
}
diff --git a/src/net/sourceforge/plantuml/svek/SvekResult.java b/src/net/sourceforge/plantuml/svek/SvekResult.java
index 803d6d7..12119eb 100644
--- a/src/net/sourceforge/plantuml/svek/SvekResult.java
+++ b/src/net/sourceforge/plantuml/svek/SvekResult.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,8 +39,8 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.cucadiagram.dot.DotData;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.posimo.Moveable;
import net.sourceforge.plantuml.skin.rose.Rose;
@@ -50,7 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UHidden;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-public final class SvekResult implements IEntityImage, Moveable {
+public final class SvekResult extends AbstractTextBlock implements IEntityImage, Moveable {
private final Rose rose = new Rose();
diff --git a/src/net/sourceforge/plantuml/svek/SvekUtils.java b/src/net/sourceforge/plantuml/svek/SvekUtils.java
index e1868c2..bb1caa4 100644
--- a/src/net/sourceforge/plantuml/svek/SvekUtils.java
+++ b/src/net/sourceforge/plantuml/svek/SvekUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/TextBlockBackcolored.java b/src/net/sourceforge/plantuml/svek/TextBlockBackcolored.java
index 0d8bf50..0f5b4ef 100644
--- a/src/net/sourceforge/plantuml/svek/TextBlockBackcolored.java
+++ b/src/net/sourceforge/plantuml/svek/TextBlockBackcolored.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java b/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java
index 2df1061..c16226b 100644
--- a/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java
+++ b/src/net/sourceforge/plantuml/svek/UGraphicForSnake.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/Untranslated.java b/src/net/sourceforge/plantuml/svek/Untranslated.java
index bfcb915..39c2a8f 100644
--- a/src/net/sourceforge/plantuml/svek/Untranslated.java
+++ b/src/net/sourceforge/plantuml/svek/Untranslated.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/Extremity.java b/src/net/sourceforge/plantuml/svek/extremity/Extremity.java
index e05b8e7..1fd6afb 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/Extremity.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/Extremity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrow.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrow.java
index f355ff9..f52d702 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrow.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,6 +50,24 @@ class ExtremityArrow extends Extremity {
public ExtremityArrow(Point2D p1, double angle, Point2D center) {
angle = manageround(angle);
+ final int xContact = buildPolygon();
+ polygon.rotate(angle + Math.PI / 2);
+ polygon = polygon.translate(p1.getX(), p1.getY());
+ contact = new Point2D.Double(p1.getX() - xContact * Math.cos(angle + Math.PI / 2), p1.getY() - xContact
+ * Math.sin(angle + Math.PI / 2));
+ this.line = new ULine(center.getX() - contact.getX(), center.getY() - contact.getY());
+ }
+
+ public ExtremityArrow(Point2D p0, double angle) {
+ this.line = null;
+ angle = manageround(angle);
+ buildPolygon();
+ polygon.rotate(angle);
+ polygon = polygon.translate(p0.getX(), p0.getY());
+ contact = p0;
+ }
+
+ private int buildPolygon() {
polygon.addPoint(0, 0);
final int xAile = 9;
final int yOuverture = 4;
@@ -58,17 +76,13 @@ class ExtremityArrow extends Extremity {
polygon.addPoint(-xContact, 0);
polygon.addPoint(-xAile, yOuverture);
polygon.addPoint(0, 0);
- polygon.rotate(angle + Math.PI / 2);
- polygon = polygon.translate(p1.getX(), p1.getY());
- contact = new Point2D.Double(p1.getX() - xContact * Math.cos(angle + Math.PI / 2), p1.getY() - xContact
- * Math.sin(angle + Math.PI / 2));
- this.line = new ULine(center.getX() - contact.getX(), center.getY() - contact.getY());
+ return xContact;
}
public void drawU(UGraphic ug) {
ug = ug.apply(new UChangeBackColor(ug.getParam().getColor()));
ug.draw(polygon);
- if (line.getLength() > 2) {
+ if (line != null && line.getLength() > 2) {
ug.apply(new UTranslate(contact.getX(), contact.getY())).draw(line);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrowAndCircle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrowAndCircle.java
index 2066d84..ab0b5e5 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrowAndCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityArrowAndCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java
index 55300cc..18afcb0 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleConnect.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleConnect.java
index ad27333..4fbea97 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleConnect.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleConnect.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleCross.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleCross.java
index c83beb8..d9f47c6 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleCross.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityCircleCross.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityDiamond.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityDiamond.java
index 1d7a8d2..71035d0 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityDiamond.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityDiamond.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.svek.extremity;
import java.awt.geom.Point2D;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
@@ -62,6 +63,8 @@ class ExtremityDiamond extends Extremity {
public void drawU(UGraphic ug) {
if (fill) {
ug = ug.apply(new UChangeBackColor(ug.getParam().getColor()));
+ } else {
+ ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
}
ug.draw(polygon);
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactory.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactory.java
index 00dbbb1..25c84cb 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactory.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,5 +41,7 @@ import net.sourceforge.plantuml.graphic.UDrawable;
public interface ExtremityFactory {
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2);
+
+ public UDrawable createUDrawable(Point2D p0, double angle);
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrow.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrow.java
index 3788900..48ab5a8 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrow.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,9 +41,14 @@ import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
public class ExtremityFactoryArrow extends AbstractExtremityFactory implements ExtremityFactory {
+ public UDrawable createUDrawable(Point2D p0, double angle) {
+ return new ExtremityArrow(p0, angle);
+ }
+
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2) {
final double ortho = atan2(p0, p2);
final Point2D center = new Point2D.Double((p0.getX() + p2.getX()) / 2, (p0.getY() + p2.getY()) / 2);
return new ExtremityArrow(p1, ortho, center);
}
+
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrowAndCircle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrowAndCircle.java
index 9e465e5..ededae6 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrowAndCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryArrowAndCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java
index bc88051..ccc1e47 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleConnect.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleConnect.java
index d145662..7e71cf5 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleConnect.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleConnect.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleCross.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleCross.java
index d678f0b..b999e2d 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleCross.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryCircleCross.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryDiamond.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryDiamond.java
index 8b3effa..41a693b 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryDiamond.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryDiamond.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -43,9 +43,15 @@ public class ExtremityFactoryDiamond extends AbstractExtremityFactory implements
private final boolean fill;
+ @Override
+ public UDrawable createUDrawable(Point2D p0, double angle) {
+ return new ExtremityDiamond(p0, angle - Math.PI / 2, fill);
+ }
+
public ExtremityFactoryDiamond(boolean fill) {
this.fill = fill;
}
+
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2) {
final double ortho = atan2(p0, p2);
return new ExtremityDiamond(p1, ortho, fill);
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryParenthesis.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryParenthesis.java
index 78e00cf..fe8f075 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryParenthesis.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryParenthesis.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryPlus.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryPlus.java
index ff5bf90..c486067 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryPlus.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryPlus.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,9 +41,14 @@ import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
public class ExtremityFactoryPlus extends AbstractExtremityFactory implements ExtremityFactory {
+ @Override
+ public UDrawable createUDrawable(Point2D center, double angle) {
+ return ExtremityPlus.create(center, angle - Math.PI / 2);
+ }
+
public UDrawable createUDrawable(Point2D p0, Point2D p1, Point2D p2) {
final double ortho = atan2(p0, p2);
- return new ExtremityPlus(p1, ortho);
+ return ExtremityPlus.create(p1, ortho);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactorySquarre.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactorySquarre.java
index f55138e..24c0843 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactorySquarre.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactorySquarre.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryTriangle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryTriangle.java
index a5e18a3..9dc55ac 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryTriangle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityFactoryTriangle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis.java
index 523d1cc..72868e1 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis2.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis2.java
index 00c82ce..42ea28a 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis2.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityParenthesis2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityPlus.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityPlus.java
index 520091c..74a957d 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityPlus.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityPlus.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,6 +37,7 @@ package net.sourceforge.plantuml.svek.extremity;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -48,14 +49,20 @@ class ExtremityPlus extends Extremity {
private final UEllipse circle;
private final double px;
private final double py;
- private final double radius = 8;
+ private static final double radius = 8;
private final double angle;
- public ExtremityPlus(Point2D p1, double angle) {
+ private ExtremityPlus(double x, double y, double angle) {
this.angle = angle;
this.circle = new UEllipse(2 * radius, 2 * radius);
- this.px = p1.getX() - radius + radius * Math.sin(angle);
- this.py = p1.getY() - radius - radius * Math.cos(angle);
+ this.px = x;
+ this.py = y;
+ }
+
+ public static UDrawable create(Point2D p1, double angle) {
+ final double x = p1.getX() - radius + radius * Math.sin(angle);
+ final double y = p1.getY() - radius - radius * Math.cos(angle);
+ return new ExtremityPlus(x, y, angle);
}
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremitySquarre.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremitySquarre.java
index 56c567b..a1a7353 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremitySquarre.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremitySquarre.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine1.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine1.java
index 5405b12..bd3d89c 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine1.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine2.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine2.java
index 0b9af5f..cb15e34 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine2.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityStateLine2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/ExtremityTriangle.java b/src/net/sourceforge/plantuml/svek/extremity/ExtremityTriangle.java
index 33a2eb0..697908a 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/ExtremityTriangle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/ExtremityTriangle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java
index 7be7dac..5009888 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java
index cabf357..0a41d45 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircled.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircledMode.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircledMode.java
index d658f44..5f97e0f 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircledMode.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleCircleCircledMode.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactory.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactory.java
index 4b583d7..0f5e635 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactory.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java
index 9168cb0..6d5e5a9 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java
index 9e64ae9..ef2d71b 100644
--- a/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java
+++ b/src/net/sourceforge/plantuml/svek/extremity/MiddleFactoryCircleCircled.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/Circle.java b/src/net/sourceforge/plantuml/svek/image/Circle.java
index a4a12fd..664d5b6 100644
--- a/src/net/sourceforge/plantuml/svek/image/Circle.java
+++ b/src/net/sourceforge/plantuml/svek/image/Circle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/ConnectedCircle.java b/src/net/sourceforge/plantuml/svek/image/ConnectedCircle.java
index 298eed2..2a6b784 100644
--- a/src/net/sourceforge/plantuml/svek/image/ConnectedCircle.java
+++ b/src/net/sourceforge/plantuml/svek/image/ConnectedCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/ContainingEllipse.java b/src/net/sourceforge/plantuml/svek/image/ContainingEllipse.java
index 50ea71a..82edaaf 100644
--- a/src/net/sourceforge/plantuml/svek/image/ContainingEllipse.java
+++ b/src/net/sourceforge/plantuml/svek/image/ContainingEllipse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageActivity.java b/src/net/sourceforge/plantuml/svek/image/EntityImageActivity.java
index f918a56..50b9b7f 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageActivity.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageActivity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -49,7 +49,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
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.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.svek.Shape;
@@ -75,9 +75,7 @@ public class EntityImageActivity extends AbstractEntityImage {
this.bibliotekon = bibliotekon;
final Stereotype stereotype = entity.getStereotype();
- this.desc = TextBlockUtils.create(entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(), FontParam.ACTIVITY, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.ACTIVITY, stereotype),
- getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()),
+ this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.ACTIVITY, stereotype),
HorizontalAlignment.CENTER, skinParam);
this.url = entity.getUrl99();
}
@@ -136,7 +134,7 @@ public class EntityImageActivity extends AbstractEntityImage {
private UGraphic applyColors(UGraphic ug) {
ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.activityBorder, getStereo())));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.activityBackground, getStereo());
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java b/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java
index c023fce..b56da18 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -65,20 +65,15 @@ public class EntityImageArcCircle extends AbstractEntityImage {
final Stereotype stereotype = entity.getStereotype();
- this.name = TextBlockUtils.create(
- entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.COMPONENT, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.COMPONENT, stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.name = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.COMPONENT, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
if (stereotype == null || stereotype.getLabel(false) == null) {
this.stereo = null;
} else {
- this.stereo = TextBlockUtils.create(
- Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.COMPONENT_STEREOTYPE, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.COMPONENT_STEREOTYPE, null), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), FontParam.COMPONENT_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
}
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageAssociation.java b/src/net/sourceforge/plantuml/svek/image/EntityImageAssociation.java
index a8c4d98..7fe9523 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageAssociation.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageAssociation.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageAssociationPoint.java b/src/net/sourceforge/plantuml/svek/image/EntityImageAssociationPoint.java
index 607174f..553dc66 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageAssociationPoint.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageAssociationPoint.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java
index 9d4987d..71ab384 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageBranch.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageCircleEnd.java b/src/net/sourceforge/plantuml/svek/image/EntityImageCircleEnd.java
index 4005d98..c625771 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageCircleEnd.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageCircleEnd.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageCircleStart.java b/src/net/sourceforge/plantuml/svek/image/EntityImageCircleStart.java
index fa4c1bf..5b862da 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageCircleStart.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageCircleStart.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java
index 8329cb3..a913668 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.svek.image;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
@@ -45,13 +46,14 @@ import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.Stencil;
+import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.Shadowable;
@@ -69,26 +71,21 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil {
final private int shield;
final private EntityImageClassHeader2 header;
final private Url url;
- final private TextBlock mouseOver;
final private double roundCorner;
final private LineConfigurable lineConfig;
public EntityImageClass(GraphvizVersion version, ILeaf entity, ISkinParam skinParam, PortionShower portionShower) {
- super(entity, skinParam);
+ super(entity, entity.getColors(skinParam).mute(skinParam));
this.lineConfig = entity;
- this.roundCorner = skinParam.getRoundCorner();
+ this.roundCorner = getSkinParam().getRoundCorner();
this.shield = version != null && version.useShield() && entity.hasNearDecoration() ? 16 : 0;
- this.body = entity.getBody(portionShower).asTextBlock(FontParam.CLASS_ATTRIBUTE, skinParam);
+ final boolean showMethods = portionShower.showPortion(EntityPortion.METHOD, entity);
+ final boolean showFields = portionShower.showPortion(EntityPortion.FIELD, entity);
+ this.body = entity.getBodier().getBody(FontParam.CLASS_ATTRIBUTE, getSkinParam(), showMethods, showFields);
- header = new EntityImageClassHeader2(entity, skinParam, portionShower);
+ header = new EntityImageClassHeader2(entity, getSkinParam(), portionShower);
this.url = entity.getUrl99();
- if (entity.getMouseOver() == null) {
- this.mouseOver = null;
- } else {
- this.mouseOver = entity.getMouseOver().asTextBlock(FontParam.CLASS_ATTRIBUTE, skinParam);
- }
-
}
// private int marginEmptyFieldsOrMethod = 13;
@@ -104,36 +101,22 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil {
return new Dimension2DDouble(width, height);
}
+ @Override
+ public Rectangle2D getInnerPosition(String member, StringBounder stringBounder) {
+ final Rectangle2D result = body.getInnerPosition(member, stringBounder);
+ if (result == null) {
+ return result;
+ }
+ final Dimension2D dimHeader = header.calculateDimension(stringBounder);
+ final UTranslate translate = new UTranslate(0, dimHeader.getHeight());
+ return translate.apply(result);
+ }
+
final public void drawU(UGraphic ug) {
if (url != null) {
ug.startUrl(url);
}
drawInternal(ug);
- if (mouseOver != null) {
- // final UGroup g = ug.createGroup();
- // ug = ug.apply(new UChangeBackColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.classBackground,
- // getStereo())));
- // final Dimension2D dim = mouseOver.calculateDimension(ug.getStringBounder());
- // final Shadowable rect = new URectangle(dim.getWidth(), dim.getHeight());
- // if (getSkinParam().shadowing()) {
- // rect.setDeltaShadow(4);
- // }
- //
- // final HtmlColor classBorder = SkinParamUtils.getColor(getSkinParam(), ColorParam.classBorder,
- // getStereo());
- // ug = ug.apply(
- // new UChangeBackColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.classBackground,
- // getStereo()))).apply(new UChangeColor(classBorder));
- //
- // final double x = 30;
- // final double y = 30;
- // // ug.getParam().setStroke(new UStroke(1.5));
- // // g.draw(x, y, rect);
- // // ug.getParam().resetStroke();
- // final UGraphic ug2 = new UGraphicHorizontalLine(ug, x, x + dim.getWidth(), getStroke());
- // mouseOver.drawUNewWayINLINED(ug2.apply(new UTranslate(x, y)));
- // g.close();
- }
if (url != null) {
ug.closeAction();
@@ -152,12 +135,12 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil {
rect.setDeltaShadow(4);
}
- HtmlColor classBorder = lineConfig.getSpecificLineColor();
+ HtmlColor classBorder = lineConfig.getColors(getSkinParam()).getColor(ColorType.LINE);
if (classBorder == null) {
classBorder = SkinParamUtils.getColor(getSkinParam(), ColorParam.classBorder, getStereo());
}
ug = ug.apply(new UChangeColor(classBorder));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.classBackground, getStereo());
}
@@ -166,7 +149,10 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil {
final UStroke stroke = getStroke();
ug.apply(stroke).draw(rect);
- final HtmlColor headerBackcolor = getSkinParam().getHtmlColor(ColorParam.classHeaderBackground, getStereo(), false);
+ HtmlColor headerBackcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.HEADER);
+ if (headerBackcolor == null) {
+ headerBackcolor = getSkinParam().getHtmlColor(ColorParam.classHeaderBackground, getStereo(), false);
+ }
if (headerBackcolor != null) {
final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight());
ug.apply(new UChangeBackColor(headerBackcolor)).apply(stroke).draw(rect2);
@@ -175,12 +161,13 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil {
if (body != null) {
final UGraphic ug2 = new UGraphicStencil(ug, this, stroke);
- body.drawU(ug2.apply(new UTranslate(0, dimHeader.getHeight())));
+ final UTranslate translate = new UTranslate(0, dimHeader.getHeight());
+ body.drawU(ug2.apply(translate));
}
}
private UStroke getStroke() {
- UStroke stroke = lineConfig.getSpecificLineStroke();
+ UStroke stroke = lineConfig.getColors(getSkinParam()).getSpecificLineStroke();
if (stroke == null) {
stroke = getSkinParam().getThickness(LineParam.classBorder, getStereo());
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java
index eedca73..7759835 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -40,6 +40,7 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils;
+import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
@@ -73,35 +74,32 @@ public class EntityImageClassHeader2 extends AbstractEntityImage {
final HtmlColor color = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS, getStereo());
final Stereotype stereotype = entity.getStereotype();
final String generic = entity.getGeneric();
- FontConfiguration fontConfigurationName = new FontConfiguration(SkinParamUtils.getFont(getSkinParam(), FontParam.CLASS, stereotype),
- color, getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink());
+ FontConfiguration fontConfigurationName = new FontConfiguration(getSkinParam(), FontParam.CLASS, stereotype);
if (italic) {
fontConfigurationName = fontConfigurationName.italic();
}
- final TextBlock name = TextBlockUtils.withMargin(TextBlockUtils.create(entity.getDisplay(),
- fontConfigurationName, HorizontalAlignment.CENTER, skinParam), 3, 3, 0, 0);
+ final TextBlock name = TextBlockUtils.withMargin(
+ entity.getDisplay().createWithNiceCreoleMode(fontConfigurationName, HorizontalAlignment.CENTER,
+ skinParam), 3, 3, 0, 0);
final TextBlock stereo;
if (stereotype == null || stereotype.getLabel(false) == null
|| portionShower.showPortion(EntityPortion.STEREOTYPE, entity) == false) {
stereo = null;
} else {
- stereo = TextBlockUtils.withMargin(TextBlockUtils.create(
- Display.create(stereotype.getLabels(skinParam.useGuillemet())),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.CLASS_STEREOTYPE, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.CLASS_STEREOTYPE, stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam), 1, 0);
+ stereo = TextBlockUtils.withMargin(
+ Display.create(stereotype.getLabels(skinParam.useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), FontParam.CLASS_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam), 1, 0);
}
TextBlock genericBlock;
if (generic == null) {
genericBlock = null;
} else {
- genericBlock = TextBlockUtils.create(
- Display.getWithNewlines(generic),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.CLASS_STEREOTYPE, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.CLASS_STEREOTYPE, stereotype), skinParam.getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ genericBlock = Display.getWithNewlines(generic).create(
+ new FontConfiguration(getSkinParam(), FontParam.CLASS_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
genericBlock = TextBlockUtils.withMargin(genericBlock, 1, 1);
final HtmlColor classBackground = SkinParamUtils
.getColor(getSkinParam(), ColorParam.background, stereotype);
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageComponent.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java
index 1bc8db7..5b6dddf 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageComponent.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,33 +53,42 @@ import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.USymbolFolder;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public class EntityImageComponent extends AbstractEntityImage {
+public class EntityImageDescription extends AbstractEntityImage {
+
+ private final ShapeType shapeType;
final private Url url;
private final TextBlock asSmall;
- public EntityImageComponent(ILeaf entity, ISkinParam skinParam, PortionShower portionShower) {
- super(entity, skinParam);
+ private final TextBlock name;
+
+ public EntityImageDescription(ILeaf entity, ISkinParam skinParam, PortionShower portionShower) {
+ super(entity, entity.getColors(skinParam).mute(skinParam));
final Stereotype stereotype = entity.getStereotype();
- final USymbol symbol = entity.getUSymbol() == null ? (skinParam.useUml2ForComponent() ? USymbol.COMPONENT2
+ USymbol symbol = entity.getUSymbol() == null ? (getSkinParam().useUml2ForComponent() ? USymbol.COMPONENT2
: USymbol.COMPONENT1) : entity.getUSymbol();
if (symbol == null) {
throw new IllegalArgumentException();
}
+ shapeType = symbol == USymbol.FOLDER ? ShapeType.FOLDER : ShapeType.RECTANGLE;
- final TextBlock desc = entity.getDisplay().isWhite() ? TextBlockUtils.empty(0, 0) : new BodyEnhanced(
- entity.getDisplay(), symbol.getFontParam(), skinParam, HorizontalAlignment.CENTER, stereotype,
- symbol.manageHorizontalLine(), false);
+ final Display codeDisplay = Display.getWithNewlines(entity.getCode());
+ final TextBlock desc = (entity.getDisplay().equals(codeDisplay) && symbol instanceof USymbolFolder)
+ || entity.getDisplay().isWhite() ? TextBlockUtils.empty(0, 0) : new BodyEnhanced(entity.getDisplay(),
+ symbol.getFontParam(), getSkinParam(), HorizontalAlignment.CENTER, stereotype,
+ symbol.manageHorizontalLine(), false, false);
this.url = entity.getUrl99();
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBack(), getStereo());
}
@@ -90,17 +99,25 @@ public class EntityImageComponent extends AbstractEntityImage {
TextBlock stereo = TextBlockUtils.empty(0, 0);
- if (stereotype != null && stereotype.getLabel(false) != null
+ if (stereotype != null && stereotype.getSprite() != null
+ && getSkinParam().getSprite(stereotype.getSprite()) != null) {
+ symbol = symbol.withStereoAlignment(HorizontalAlignment.RIGHT);
+ stereo = getSkinParam().getSprite(stereotype.getSprite()).asTextBlock(stereotype.getHtmlColor());
+ } else if (stereotype != null && stereotype.getLabel(false) != null
&& portionShower.showPortion(EntityPortion.STEREOTYPE, entity)) {
- stereo = TextBlockUtils.create(
- Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(), symbol.getFontParamStereotype(),
- stereotype), SkinParamUtils.getFontColor(getSkinParam(), symbol.getFontParamStereotype(),
- null), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()),
- HorizontalAlignment.CENTER, skinParam);
+ stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), symbol.getFontParamStereotype(), stereotype),
+ HorizontalAlignment.CENTER, getSkinParam());
}
- asSmall = symbol.asSmall(desc, stereo, ctx);
+ name = new BodyEnhanced(codeDisplay, symbol.getFontParam(), getSkinParam(), HorizontalAlignment.CENTER,
+ stereotype, symbol.manageHorizontalLine(), false, false);
+
+ asSmall = symbol.asSmall(name, desc, stereo, ctx);
+ }
+
+ public Dimension2D getNameDimension(StringBounder stringBounder) {
+ return name.calculateDimension(stringBounder);
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
@@ -119,7 +136,7 @@ public class EntityImageComponent extends AbstractEntityImage {
}
public ShapeType getShapeType() {
- return ShapeType.RECTANGLE;
+ return shapeType;
}
public int getShield() {
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java
index 6ece031..3d7481e 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage2.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,6 +50,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
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.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Cluster;
import net.sourceforge.plantuml.svek.ClusterDecoration;
@@ -57,7 +58,7 @@ import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
-public class EntityImageEmptyPackage2 extends AbstractEntityImage {
+public class EntityImageEmptyPackage extends AbstractEntityImage {
final private TextBlock desc;
final private static int MARGIN = 10;
@@ -65,15 +66,13 @@ public class EntityImageEmptyPackage2 extends AbstractEntityImage {
final private ISkinParam skinParam;
final private Stereotype stereotype;
- public EntityImageEmptyPackage2(ILeaf entity, ISkinParam skinParam) {
+ public EntityImageEmptyPackage(ILeaf entity, ISkinParam skinParam) {
super(entity, skinParam);
this.skinParam = skinParam;
- this.specificBackColor = entity.getSpecificBackColor();
+ this.specificBackColor = entity.getColors(skinParam).getColor(ColorType.BACK);
this.stereotype = entity.getStereotype();
- this.desc = TextBlockUtils.create(entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(), FontParam.PACKAGE, stereotype),
- SkinParamUtils.getFontColor(getSkinParam(), FontParam.PACKAGE, stereotype), getSkinParam()
- .getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()),
+ this.desc = entity.getDisplay().create(
+ new FontConfiguration(getSkinParam(), FontParam.PACKAGE, stereotype),
HorizontalAlignment.CENTER, skinParam);
}
@@ -97,13 +96,13 @@ public class EntityImageEmptyPackage2 extends AbstractEntityImage {
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
- final HtmlColor stateBack = Cluster.getStateBackColor(specificBackColor, skinParam, stereotype);
+ final HtmlColor back = Cluster.getBackColor(specificBackColor, skinParam, stereotype);
final ClusterDecoration decoration = new ClusterDecoration(getSkinParam().getPackageStyle(), null, desc,
- TextBlockUtils.empty(0, 0), stateBack, 0, 0, widthTotal, heightTotal, getStroke());
+ TextBlockUtils.empty(0, 0), 0, 0, widthTotal, heightTotal, getStroke());
- decoration.drawU(ug, SkinParamUtils.getColor(getSkinParam(), ColorParam.packageBorder, getStereo()),
- getSkinParam().shadowing());
+ decoration.drawU(ug, back,
+ SkinParamUtils.getColor(getSkinParam(), ColorParam.packageBorder, getStereo()), getSkinParam().shadowing());
}
public ShapeType getShapeType() {
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java b/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java
index d5110b4..177af36 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -51,7 +51,7 @@ public class EntityImageGroup extends AbstractEntityImage {
public EntityImageGroup(ILeaf entity, ISkinParam skinParam) {
super(entity, skinParam);
- // this.desc = TextBlockUtils.create(StringUtils.getWithNewlines(entity.getDisplay()), new FontConfiguration(
+ // this.desc = Display.create(StringUtils.getWithNewlines(entity.getDisplay()), new FontConfiguration(
// getFont(FontParam.ACTIVITY), HtmlColorUtils.BLACK), HorizontalAlignment.CENTER);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java
index 910b7c8..e877dec 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterface.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -48,7 +48,6 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -67,11 +66,8 @@ public class EntityImageLollipopInterface extends AbstractEntityImage {
public EntityImageLollipopInterface(ILeaf entity, ISkinParam skinParam) {
super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype();
- this.desc = TextBlockUtils.create(
- entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.CLASS, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS,
- stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.CLASS, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
this.url = entity.getUrl99();
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java
index 74fa248..5b4c416 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye1.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,7 +50,6 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.svek.Line;
@@ -73,11 +72,8 @@ public class EntityImageLollipopInterfaceEye1 extends AbstractEntityImage {
super(entity, skinParam);
this.bibliotekon = bibliotekon;
final Stereotype stereotype = entity.getStereotype();
- this.desc = TextBlockUtils.create(
- entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.CLASS, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS,
- stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.CLASS, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
this.url = entity.getUrl99();
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java
index 451dc39..730cad3 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageLollipopInterfaceEye2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -54,6 +54,7 @@ import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UEllipse;
@@ -80,11 +81,11 @@ public class EntityImageLollipopInterfaceEye2 extends AbstractEntityImage {
}
this.desc = new BodyEnhanced(entity.getDisplay(), symbol.getFontParam(), skinParam, HorizontalAlignment.CENTER,
- stereotype, symbol.manageHorizontalLine(), false);
+ stereotype, symbol.manageHorizontalLine(), false, false);
this.url = entity.getUrl99();
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBack(), getStereo());
}
@@ -95,11 +96,9 @@ public class EntityImageLollipopInterfaceEye2 extends AbstractEntityImage {
if (stereotype != null && stereotype.getLabel(false) != null
&& portionShower.showPortion(EntityPortion.STEREOTYPE, entity)) {
- stereo = TextBlockUtils.create(
- Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- symbol.getFontParamStereotype(), stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- symbol.getFontParamStereotype(), null), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), symbol.getFontParamStereotype(), stereotype),
+ HorizontalAlignment.CENTER, skinParam);
} else {
stereo = TextBlockUtils.empty(0, 0);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java
index 64c0995..4b5363e 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageNote.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
+import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.BodyEnhanced2;
@@ -58,6 +59,8 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
@@ -66,7 +69,6 @@ import net.sourceforge.plantuml.svek.Shape;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
-import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.ULine;
@@ -88,35 +90,42 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
private final TextBlock textBlock;
public EntityImageNote(ILeaf entity, ISkinParam skinParam) {
- super(entity, getSkin(skinParam, entity));
- this.skinParam = skinParam;
+ super(entity, getSkin(getISkinParam(skinParam, entity), entity));
+ this.skinParam = getISkinParam(skinParam, entity);
- this.withShadow = skinParam.shadowing();
+ this.withShadow = getSkinParam().shadowing();
final Display strings = entity.getDisplay();
final Rose rose = new Rose();
- if (entity.getSpecificBackColor() == null) {
- noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
+ if (entity.getColors(getSkinParam()).getColor(ColorType.BACK) == null) {
+ noteBackgroundColor = rose.getHtmlColor(getSkinParam(), ColorParam.noteBackground);
} else {
- noteBackgroundColor = entity.getSpecificBackColor();
+ noteBackgroundColor = entity.getColors(getSkinParam()).getColor(ColorType.BACK);
}
- borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
- final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
- final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
+ // this.borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
+ this.borderColor = SkinParamUtils.getColor(getSkinParam(), ColorParam.noteBorder, null);
+ // final HtmlColor fontColor = rose.getFontColor(getSkinParam(), FontParam.NOTE);
+ // final UFont fontNote = getSkinParam().getFont(FontParam.NOTE, null, false);
if (strings.size() == 1 && strings.get(0).length() == 0) {
textBlock = new TextBlockEmpty();
} else {
- textBlock = new BodyEnhanced2(strings, FontParam.NOTE, skinParam, HorizontalAlignment.LEFT,
- new FontConfiguration(fontNote, fontColor, skinParam.getHyperlinkColor(),
- skinParam.useUnderlineForHyperlink()));
+ textBlock = new BodyEnhanced2(strings, FontParam.NOTE, getSkinParam(), HorizontalAlignment.LEFT,
+ new FontConfiguration(getSkinParam(), FontParam.NOTE, null));
}
}
- private static ISkinParam getSkin(ISkinParam skinParam, IEntity entity) {
+ private static ISkinParam getISkinParam(ISkinParam skinParam, IEntity entity) {
+ if (entity.getColors(skinParam) != null) {
+ return entity.getColors(skinParam).mute(skinParam);
+ }
+ return skinParam;
+ }
+
+ static ISkinParam getSkin(ISkinParam skinParam, IEntity entity) {
final Stereotype stereotype = entity.getStereotype();
- HtmlColor back = entity.getSpecificBackColor();
+ HtmlColor back = entity.getColors(skinParam).getColor(ColorType.BACK);
if (back != null) {
return new SkinParamBackcolored(skinParam, back);
}
@@ -191,20 +200,27 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
if (p1.distance(center) > p2.distance(center)) {
path = path.reverse();
p1 = path.getStartPoint();
- p2 = path.getEndPoint();
+ // p2 = path.getEndPoint();
}
final Direction strategy = getOpaleStrategy(textWidth, textHeight, p1);
final Point2D pp1 = path.getStartPoint();
final Point2D pp2 = path.getEndPoint();
+ final Point2D newRefpp2 = move(pp2, shape.getMinX(), shape.getMinY());
+ final Point2D projection = move(other.projection(newRefpp2, stringBounder), -shape.getMinX(),
+ -shape.getMinY());
final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(), true);
- opale.setOpale(strategy, pp1, pp2);
- opale.drawU(ug2);
+ opale.setOpale(strategy, pp1, projection);
+ opale.drawU(Colors.applyStroke(ug2, getEntity().getColors(skinParam)));
}
if (url != null) {
ug.closeAction();
}
}
+ private static Point2D move(Point2D pt, double dx, double dy) {
+ return new Point2D.Double(pt.getX() + dx, pt.getY() + dy);
+ }
+
private void drawNormal(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final UPolygon polygon = getPolygonNormal(stringBounder);
@@ -261,11 +277,15 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
private Line opaleLine;
private Shape shape;
+ private Shape other;
- public void setOpaleLine(Line line, Shape shape) {
+ public void setOpaleLine(Line line, Shape shape, Shape other) {
+ if (other == null) {
+ throw new IllegalArgumentException();
+ }
this.opaleLine = line;
this.shape = shape;
-
+ this.other = other;
}
public double getStartingX(StringBounder stringBounder, double y) {
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java b/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java
index ff3e6d7..d3d7a3e 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageNoteLink.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,10 +38,11 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
@@ -51,13 +52,13 @@ import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-public class EntityImageNoteLink implements IEntityImage {
+public class EntityImageNoteLink extends AbstractTextBlock implements IEntityImage {
private final Component comp;
- public EntityImageNoteLink(Display note, HtmlColor htmlColor, ISkinParam skinParam) {
+ public EntityImageNoteLink(Display note, Colors colors, ISkinParam skinParam) {
final Rose skin = new Rose();
- comp = skin.createComponent(ComponentType.NOTE, null, new SkinParamBackcolored(skinParam, htmlColor), note);
+ comp = skin.createComponent(ComponentType.NOTE, null, colors.mute(skinParam), note);
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java
index adbe934..5107c78 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageObject.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,10 +46,7 @@ import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.cucadiagram.EntityPortion;
-import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
-import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -59,6 +56,7 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
import net.sourceforge.plantuml.graphic.TextBlockLineBefore;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2;
@@ -87,33 +85,21 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
this.lineConfig = entity;
final Stereotype stereotype = entity.getStereotype();
this.roundCorner = skinParam.getRoundCorner();
- this.name = TextBlockUtils.withMargin(TextBlockUtils.create(
- entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.OBJECT, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.OBJECT,
- stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam), 2, 2);
+ this.name = TextBlockUtils.withMargin(
+ entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.OBJECT, stereotype),
+ HorizontalAlignment.CENTER, skinParam), 2, 2);
if (stereotype == null || stereotype.getLabel(false) == null) {
this.stereo = null;
} else {
- this.stereo = TextBlockUtils.create(
- Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.OBJECT_STEREOTYPE, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.OBJECT_STEREOTYPE, stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())).create(
+ new FontConfiguration(getSkinParam(), FontParam.OBJECT_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
}
- if (entity.getFieldsToDisplay().size() == 0) {
+ if (entity.getBodier().getFieldsToDisplay().size() == 0) {
this.fields = new TextBlockLineBefore(new TextBlockEmpty(10, 16));
} else {
- // this.fields =
- // entity.getFieldsToDisplay().asTextBlock(FontParam.OBJECT_ATTRIBUTE,
- // skinParam);
- this.fields = entity.getBody(new PortionShower() {
- public boolean showPortion(EntityPortion portion, IEntity entity) {
- return true;
- }
- }).asTextBlock(FontParam.OBJECT_ATTRIBUTE, skinParam);
-
+ this.fields = entity.getBodier().getBody(FontParam.OBJECT_ATTRIBUTE, skinParam, false, true);
}
this.url = entity.getUrl99();
@@ -143,7 +129,7 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
}
ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.objectBorder, getStereo())));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.objectBackground, getStereo());
}
@@ -160,7 +146,7 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
header.add(stereo);
}
header.add(name);
- header.drawU(ug, 0, 0, dimTotal.getWidth(), dimTitle.getHeight());
+ header.drawU(ug, dimTotal.getWidth(), dimTitle.getHeight());
final UGraphic ug2 = new UGraphicStencil(ug, this, stroke);
fields.drawU(ug2.apply(new UTranslate(0, dimTitle.getHeight())));
@@ -171,7 +157,7 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
}
private UStroke getStroke() {
- UStroke stroke = lineConfig.getSpecificLineStroke();
+ UStroke stroke = lineConfig.getColors(getSkinParam()).getSpecificLineStroke();
if (stroke == null) {
stroke = getSkinParam().getThickness(LineParam.objectBorder, getStereo());
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImagePseudoState.java b/src/net/sourceforge/plantuml/svek/image/EntityImagePseudoState.java
index e50ad6e..8d93160 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImagePseudoState.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImagePseudoState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -48,7 +48,6 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -66,10 +65,7 @@ public class EntityImagePseudoState extends AbstractEntityImage {
public EntityImagePseudoState(ILeaf entity, ISkinParam skinParam) {
super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype();
- this.desc = TextBlockUtils.create(Display.create("H"),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.STATE, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.STATE,
- stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()),
+ this.desc = Display.create("H").create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype),
HorizontalAlignment.CENTER, skinParam);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageState.java b/src/net/sourceforge/plantuml/svek/image/EntityImageState.java
index ea5041f..be18efa 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageState.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageState.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,6 +53,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
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.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.Shadowable;
@@ -89,24 +90,18 @@ public class EntityImageState extends AbstractEntityImage {
final Stereotype stereotype = entity.getStereotype();
this.withSymbol = stereotype != null && stereotype.isWithOOSymbol();
- this.desc = TextBlockUtils.create(
- entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.STATE, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.STATE,
- stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
Display list = Display.empty();
- for (Member att : entity.getFieldsToDisplay()) {
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
list = list.addAll(Display.getWithNewlines(att.getDisplay(true)));
}
this.url = entity.getUrl99();
- this.fields = TextBlockUtils.create(
- list,
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.STATE_ATTRIBUTE, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.STATE_ATTRIBUTE, stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.LEFT, skinParam);
+ this.fields = list.create(new FontConfiguration(getSkinParam(), FontParam.STATE_ATTRIBUTE, stereotype),
+ HorizontalAlignment.LEFT, skinParam);
}
@@ -136,12 +131,12 @@ public class EntityImageState extends AbstractEntityImage {
rect.setDeltaShadow(4);
}
- HtmlColor classBorder = lineConfig.getSpecificLineColor();
+ HtmlColor classBorder = lineConfig.getColors(getSkinParam()).getColor(ColorType.LINE);
if (classBorder == null) {
classBorder = SkinParamUtils.getColor(getSkinParam(), ColorParam.stateBorder, getStereo());
}
ug = ug.apply(getStroke()).apply(new UChangeColor(classBorder));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.stateBackground, getStereo());
}
@@ -174,7 +169,7 @@ public class EntityImageState extends AbstractEntityImage {
}
private UStroke getStroke() {
- UStroke stroke = lineConfig.getSpecificLineStroke();
+ UStroke stroke = lineConfig.getColors(getSkinParam()).getSpecificLineStroke();
if (stroke == null) {
stroke = new UStroke(1.5);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java b/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java
index de9ac78..c4b7c44 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageState2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,6 +52,7 @@ import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
+import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -71,13 +72,13 @@ public class EntityImageState2 extends AbstractEntityImage {
final Stereotype stereotype = entity.getStereotype();
Display list = Display.empty();
- for (Member att : entity.getFieldsToDisplay()) {
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
list = list.addAll(Display.getWithNewlines(att.getDisplay(true)));
}
final USymbol symbol = USymbol.FRAME;
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBack(), getStereo());
}
@@ -91,9 +92,9 @@ public class EntityImageState2 extends AbstractEntityImage {
TextBlock stereo = TextBlockUtils.empty(0, 0);
final TextBlock desc = new BodyEnhanced(entity.getDisplay(), symbol.getFontParam(), skinParam,
- HorizontalAlignment.CENTER, stereotype, symbol.manageHorizontalLine(), false);
+ HorizontalAlignment.CENTER, stereotype, symbol.manageHorizontalLine(), false, false);
- asSmall = symbol.asSmall(desc, stereo, ctx);
+ asSmall = symbol.asSmall(null, desc, stereo, ctx);
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageStateBorder.java b/src/net/sourceforge/plantuml/svek/image/EntityImageStateBorder.java
index a5d2217..0d47a1e 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageStateBorder.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageStateBorder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -50,7 +50,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
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.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.svek.Cluster;
@@ -84,9 +84,7 @@ public class EntityImageStateBorder extends AbstractEntityImage {
this.stateParent = stateParent;
final Stereotype stereotype = leaf.getStereotype();
- this.desc = TextBlockUtils.create(leaf.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(), FontParam.STATE, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.STATE, stereotype),
- getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()),
+ this.desc = leaf.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype),
HorizontalAlignment.CENTER, skinParam);
}
@@ -123,7 +121,7 @@ public class EntityImageStateBorder extends AbstractEntityImage {
ug = ug.apply(new UStroke(1.5)).apply(
new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.stateBorder, getStereo())));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.stateBackground, getStereo());
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java
index b0eedec..a2e9018 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -51,7 +51,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
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.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.Shadowable;
@@ -74,14 +74,11 @@ public class EntityImageStateEmptyDescription extends AbstractEntityImage {
super(entity, skinParam);
final Stereotype stereotype = entity.getStereotype();
- this.desc = TextBlockUtils.create(
- entity.getDisplay(),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.STATE, stereotype), SkinParamUtils.getFontColor(getSkinParam(), FontParam.STATE,
- stereotype), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
Display list = Display.empty();
- for (Member att : entity.getFieldsToDisplay()) {
+ for (Member att : entity.getBodier().getFieldsToDisplay()) {
list = list.addAll(Display.getWithNewlines(att.getDisplay(true)));
}
@@ -112,7 +109,7 @@ public class EntityImageStateEmptyDescription extends AbstractEntityImage {
ug = ug.apply(new UStroke(1.5)).apply(
new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.stateBorder, getStereo())));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.stateBackground, getStereo());
}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageSynchroBar.java b/src/net/sourceforge/plantuml/svek/image/EntityImageSynchroBar.java
index b252672..c3233d1 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageSynchroBar.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageSynchroBar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java b/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java
new file mode 100644
index 0000000..19c82a1
--- /dev/null
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageTips.java
@@ -0,0 +1,165 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.svek.image;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.Map;
+
+import net.sourceforge.plantuml.ColorParam;
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.command.Position;
+import net.sourceforge.plantuml.cucadiagram.BodyEnhanced2;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.cucadiagram.IEntity;
+import net.sourceforge.plantuml.cucadiagram.ILeaf;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.svek.AbstractEntityImage;
+import net.sourceforge.plantuml.svek.Bibliotekon;
+import net.sourceforge.plantuml.svek.Shape;
+import net.sourceforge.plantuml.svek.ShapeType;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class EntityImageTips extends AbstractEntityImage {
+
+ final private Rose rose = new Rose();
+ private final ISkinParam skinParam;
+
+ private final HtmlColor noteBackgroundColor;
+ private final HtmlColor borderColor;
+
+ private final Bibliotekon bibliotekon;
+
+ private final double ySpacing = 10;
+
+ public EntityImageTips(ILeaf entity, ISkinParam skinParam, Bibliotekon bibliotekon) {
+ super(entity, EntityImageNote.getSkin(skinParam, entity));
+ this.skinParam = skinParam;
+ this.bibliotekon = bibliotekon;
+
+ if (entity.getColors(skinParam).getColor(ColorType.BACK) == null) {
+ noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
+ } else {
+ noteBackgroundColor = entity.getColors(skinParam).getColor(ColorType.BACK);
+ }
+ this.borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
+ }
+
+ private Position getPosition() {
+ if (getEntity().getCode().getFullName().endsWith(Position.RIGHT.name())) {
+ return Position.RIGHT;
+ }
+ return Position.LEFT;
+ }
+
+ public ShapeType getShapeType() {
+ return ShapeType.RECTANGLE;
+ }
+
+ public int getShield() {
+ return 0;
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ double width = 0;
+ double height = 0;
+ for (Map.Entry<String, Display> ent : getEntity().getTips().entrySet()) {
+ final Display display = ent.getValue();
+ final Dimension2D dim = getOpale(display).calculateDimension(stringBounder);
+ height += dim.getHeight();
+ height += ySpacing;
+ width = Math.max(width, dim.getWidth());
+ }
+ return new Dimension2DDouble(width, height);
+ }
+
+ public void drawU(UGraphic ug) {
+ final StringBounder stringBounder = ug.getStringBounder();
+
+ final IEntity other = bibliotekon.getOnlyOther(getEntity());
+
+ final Shape shapeMe = bibliotekon.getShape(getEntity());
+ final Shape shapeOther = bibliotekon.getShape(other);
+ final Point2D positionMe = shapeMe.getPosition();
+ final Point2D positionOther = shapeOther.getPosition();
+ bibliotekon.getShape(getEntity());
+ final Position position = getPosition();
+ double height = 0;
+ for (Map.Entry<String, Display> ent : getEntity().getTips().entrySet()) {
+ final Display display = ent.getValue();
+ final Rectangle2D memberPosition = shapeOther.getImage().getInnerPosition(ent.getKey(), stringBounder);
+ final Opale opale = getOpale(display);
+ final Dimension2D dim = opale.calculateDimension(stringBounder);
+ final Point2D pp1 = new Point2D.Double(0, dim.getHeight() / 2);
+ double x = positionOther.getX() - positionMe.getX();
+ if (position == Position.RIGHT) {
+ x += memberPosition.getMaxX();
+ } else {
+ x += 4;
+ }
+ if (memberPosition == null) {
+ return;
+ }
+ final double y = positionOther.getY() - positionMe.getY() - height + memberPosition.getCenterY();
+ final Point2D pp2 = new Point2D.Double(x, y);
+ opale.setOpale(position.reverseDirection(), pp1, pp2);
+ opale.drawU(ug);
+ ug = ug.apply(new UTranslate(0, dim.getHeight() + ySpacing));
+ height += dim.getHeight();
+ height += ySpacing;
+ }
+
+ }
+
+ private Opale getOpale(final Display display) {
+ // final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
+ // final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
+ final TextBlock textBlock = new BodyEnhanced2(display, FontParam.NOTE, skinParam, HorizontalAlignment.LEFT,
+ new FontConfiguration(skinParam, FontParam.NOTE, null));
+ final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(), true);
+ return opale;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java
index 2170946..86b450e 100644
--- a/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java
+++ b/src/net/sourceforge/plantuml/svek/image/EntityImageUseCase.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,6 +52,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
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.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine;
@@ -77,16 +78,14 @@ public class EntityImageUseCase extends AbstractEntityImage {
final Stereotype stereotype = entity.getStereotype();
final TextBlock tmp = new BodyEnhanced(entity.getDisplay(), FontParam.USECASE, skinParam,
- HorizontalAlignment.CENTER, stereotype, true, false);
+ HorizontalAlignment.CENTER, stereotype, true, false, false);
if (stereotype == null || stereotype.getLabel(false) == null) {
this.desc = tmp;
} else {
- final TextBlock stereo = TextBlockUtils.create(
- Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet())),
- new FontConfiguration(SkinParamUtils.getFont(getSkinParam(),
- FontParam.ACTOR_STEREOTYPE, stereotype), SkinParamUtils.getFontColor(getSkinParam(),
- FontParam.ACTOR_STEREOTYPE, null), getSkinParam().getHyperlinkColor(), getSkinParam().useUnderlineForHyperlink()), HorizontalAlignment.CENTER, skinParam);
+ final TextBlock stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().useGuillemet()))
+ .create(new FontConfiguration(getSkinParam(), FontParam.ACTOR_STEREOTYPE, stereotype),
+ HorizontalAlignment.CENTER, skinParam);
this.desc = TextBlockUtils.mergeTB(stereo, tmp, HorizontalAlignment.CENTER);
}
this.url = entity.getUrl99();
@@ -110,7 +109,7 @@ public class EntityImageUseCase extends AbstractEntityImage {
ug = ug.apply(stroke).apply(
new UChangeColor(SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBorder, getStereo())));
- HtmlColor backcolor = getEntity().getSpecificBackColor();
+ HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), ColorParam.usecaseBackground, getStereo());
}
diff --git a/src/net/sourceforge/plantuml/svek/image/Footprint.java b/src/net/sourceforge/plantuml/svek/image/Footprint.java
index f913a43..480600c 100644
--- a/src/net/sourceforge/plantuml/svek/image/Footprint.java
+++ b/src/net/sourceforge/plantuml/svek/image/Footprint.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/Opale.java b/src/net/sourceforge/plantuml/svek/image/Opale.java
index 5e207a6..fadb52a 100644
--- a/src/net/sourceforge/plantuml/svek/image/Opale.java
+++ b/src/net/sourceforge/plantuml/svek/image/Opale.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -39,6 +39,7 @@ import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -51,7 +52,7 @@ import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.utils.MathUtils;
-public class Opale implements TextBlock {
+public class Opale extends AbstractTextBlock implements TextBlock {
private final int cornersize = 10;
private final HtmlColor noteBackgroundColor;
diff --git a/src/net/sourceforge/plantuml/svek/image/SmallestEnclosingCircle.java b/src/net/sourceforge/plantuml/svek/image/SmallestEnclosingCircle.java
index 9adf31c..6c904b6 100644
--- a/src/net/sourceforge/plantuml/svek/image/SmallestEnclosingCircle.java
+++ b/src/net/sourceforge/plantuml/svek/image/SmallestEnclosingCircle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svek/image/YTransformer.java b/src/net/sourceforge/plantuml/svek/image/YTransformer.java
index 1d49cdb..3954467 100644
--- a/src/net/sourceforge/plantuml/svek/image/YTransformer.java
+++ b/src/net/sourceforge/plantuml/svek/image/YTransformer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/svg/SvgData.java b/src/net/sourceforge/plantuml/svg/SvgData.java
index 5f2759b..c70e2bd 100644
--- a/src/net/sourceforge/plantuml/svg/SvgData.java
+++ b/src/net/sourceforge/plantuml/svg/SvgData.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -38,6 +38,8 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.StringUtils;
+
public final class SvgData {
private String svg;
@@ -93,8 +95,8 @@ public final class SvgData {
while (st.hasMoreTokens()) {
final String token = st.nextToken();
final StringTokenizer st2 = new StringTokenizer(token, ",");
- final double x = Double.parseDouble(st2.nextToken().trim());
- final double y = Double.parseDouble(st2.nextToken().trim());
+ final double x = Double.parseDouble(StringUtils.trin(st2.nextToken()));
+ final double y = Double.parseDouble(StringUtils.trin(st2.nextToken()));
if (x < minX) {
minX = x;
}
diff --git a/src/net/sourceforge/plantuml/svg/SvgGraphics.java b/src/net/sourceforge/plantuml/svg/SvgGraphics.java
index 7f3ffe2..4b95406 100644
--- a/src/net/sourceforge/plantuml/svg/SvgGraphics.java
+++ b/src/net/sourceforge/plantuml/svg/SvgGraphics.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -56,6 +56,7 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.code.Base64Coder;
import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.graphic.HtmlColorGradient;
@@ -63,7 +64,6 @@ import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.USegment;
import net.sourceforge.plantuml.ugraphic.USegmentType;
-import net.sourceforge.plantuml.StringUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -271,23 +271,31 @@ public class SvgGraphics {
}
public void closeLink() {
- final Element element = pendingLink2.get(0);
- pendingLink2.remove(0);
- getG().appendChild(element);
+ if (pendingLink2.size() > 0) {
+ final Element element = pendingLink2.get(0);
+ pendingLink2.remove(0);
+ getG().appendChild(element);
+ }
}
private final List<Element> pendingLink2 = new ArrayList<Element>();
- public void openLink(String url, String title) {
+ public void openLink(String url, String title, String target) {
if (url == null) {
throw new IllegalArgumentException();
}
+ if (pendingLink2.size() > 0) {
+ closeLink();
+ }
+
pendingLink2.add(0, (Element) document.createElement("a"));
+ pendingLink2.get(0).setAttribute("target", target);
pendingLink2.get(0).setAttribute("xlink:href", url);
if (title == null) {
pendingLink2.get(0).setAttribute("xlink:title", url);
} else {
+ title = title.replaceAll("\\\\n", "\n");
pendingLink2.get(0).setAttribute("xlink:title", title);
}
}
@@ -387,7 +395,8 @@ public class SvgGraphics {
}
public void text(String text, double x, double y, String fontFamily, int fontSize, String fontWeight,
- String fontStyle, String textDecoration, double textLength, Map<String, String> attributes) {
+ String fontStyle, String textDecoration, double textLength, Map<String, String> attributes,
+ String textBackColor) {
if (hidden == false) {
final Element elt = (Element) document.createElement("text");
elt.setAttribute("x", format(x));
@@ -409,6 +418,10 @@ public class SvgGraphics {
if (fontFamily != null) {
elt.setAttribute("font-family", fontFamily);
}
+ if (textBackColor != null) {
+ final String backFilterId = getFilterBackColor(textBackColor);
+ elt.setAttribute("filter", "url(#" + backFilterId + ")");
+ }
for (Map.Entry<String, String> ent : attributes.entrySet()) {
elt.setAttribute(ent.getKey(), ent.getValue());
}
@@ -431,8 +444,33 @@ public class SvgGraphics {
ensureVisible(x + textLength, y);
}
- public final Element getDefs() {
- return defs;
+ private final Map<String, String> filterBackColor = new HashMap<String, String>();
+
+ private String getIdFilterBackColor(String color) {
+ String result = filterBackColor.get(color);
+ if (result == null) {
+ result = "b" + filterBackColor.size();
+ filterBackColor.put(color, result);
+ }
+ return result;
+ }
+
+ private String getFilterBackColor(String color) {
+ String id = filterBackColor.get(color);
+ if (id != null) {
+ return id;
+ }
+ id = getIdFilterBackColor(color);
+ final Element filter = (Element) document.createElement("filter");
+ filter.setAttribute("id", id);
+ filter.setAttribute("x", "0");
+ filter.setAttribute("y", "0");
+ filter.setAttribute("width", "1");
+ filter.setAttribute("height", "1");
+ addFilter(filter, "feFlood", "flood-color", color);
+ addFilter(filter, "feComposite", "in", "SourceGraphic");
+ defs.appendChild(filter);
+ return id;
}
private Transformer getTransformer() throws TransformerException {
diff --git a/src/net/sourceforge/plantuml/swing/AboutWindow.java b/src/net/sourceforge/plantuml/swing/AboutWindow.java
index 0d671bf..7a29766 100644
--- a/src/net/sourceforge/plantuml/swing/AboutWindow.java
+++ b/src/net/sourceforge/plantuml/swing/AboutWindow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/swing/ImageHelper.java b/src/net/sourceforge/plantuml/swing/ImageHelper.java
index 10a8111..23e533f 100644
--- a/src/net/sourceforge/plantuml/swing/ImageHelper.java
+++ b/src/net/sourceforge/plantuml/swing/ImageHelper.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/swing/ImageWindow2.java b/src/net/sourceforge/plantuml/swing/ImageWindow2.java
index 65e923d..672adf7 100644
--- a/src/net/sourceforge/plantuml/swing/ImageWindow2.java
+++ b/src/net/sourceforge/plantuml/swing/ImageWindow2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,11 @@ import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
@@ -60,11 +65,14 @@ import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
+import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.ListModel;
+import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.GeneratedImage;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
@@ -73,15 +81,16 @@ import net.sourceforge.plantuml.version.PSystemVersion;
class ImageWindow2 extends JFrame {
- final private static Preferences prefs = Preferences.userNodeForPackage(ImageWindow2.class);
- final private static String KEY_ZOOM_FIT = "zoomfit";
+ private final static Preferences prefs = Preferences.userNodeForPackage(ImageWindow2.class);
+ private final static String KEY_ZOOM_FIT = "zoomfit";
private SimpleLine2 simpleLine2;
- final private JScrollPane scrollPane;
+ private final JScrollPane scrollPane;
private final JButton next = new JButton("Next");
private final JButton copy = new JButton("Copy");
private final JButton previous = new JButton("Previous");
private final JCheckBox zoomFitButt = new JCheckBox("Zoom fit");
+ private final MainWindow2 main;
private final ListModel listModel;
private int index;
@@ -92,33 +101,40 @@ class ImageWindow2 extends JFrame {
private SizeMode sizeMode = SizeMode.FULL_SIZE;
+ private int startX, startY;
+
public ImageWindow2(SimpleLine2 simpleLine, final MainWindow2 main, ListModel listModel, int index) {
super(simpleLine.toString());
setIconImage(PSystemVersion.getPlantumlSmallIcon2());
this.simpleLine2 = simpleLine;
this.listModel = listModel;
this.index = index;
+ this.main = main;
final JPanel north = new JPanel();
north.add(previous);
north.add(copy);
north.add(next);
north.add(zoomFitButt);
+ copy.setFocusable(false);
copy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
copy();
}
});
+ next.setFocusable(false);
next.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
next();
}
});
+ previous.setFocusable(false);
previous.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
previous();
}
});
+ zoomFitButt.setFocusable(false);
zoomFitButt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
zoomFit();
@@ -140,10 +156,11 @@ class ImageWindow2 extends JFrame {
}
});
+
this.addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent e) {
super.componentResized(e);
- refreshImage();
+ refreshImage(false);
}
});
@@ -153,6 +170,34 @@ class ImageWindow2 extends JFrame {
sizeMode = SizeMode.ZOOM_FIT;
}
+ this.setFocusable(true);
+ this.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent evt) {
+ if (evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_RIGHT) {
+ next();
+ } else if (evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_LEFT) {
+ previous();
+ } else if (evt.isAltDown() && evt.getKeyCode() == KeyEvent.VK_RIGHT) {
+ next();
+ } else if (evt.isAltDown() && evt.getKeyCode() == KeyEvent.VK_LEFT) {
+ previous();
+ } else if (evt.getKeyCode() == KeyEvent.VK_RIGHT) {
+ imageRight();
+ } else if (evt.getKeyCode() == KeyEvent.VK_LEFT) {
+ imageLeft();
+ } else if (evt.getKeyCode() == KeyEvent.VK_DOWN) {
+ imageDown();
+ } else if (evt.getKeyCode() == KeyEvent.VK_UP) {
+ imageUp();
+ } else if (evt.getKeyCode() == KeyEvent.VK_C) {
+ copy();
+ } else if (evt.getKeyCode() == KeyEvent.VK_Z) {
+ zoomFitButt.setSelected(!zoomFitButt.isSelected());
+ zoomFit();
+ }
+ }
+ });
+
}
private void next() {
@@ -165,6 +210,26 @@ class ImageWindow2 extends JFrame {
updateSimpleLine();
}
+ private void imageDown() {
+ final JScrollBar bar = scrollPane.getVerticalScrollBar();
+ bar.setValue(bar.getValue() + bar.getBlockIncrement());
+ }
+
+ private void imageUp() {
+ final JScrollBar bar = scrollPane.getVerticalScrollBar();
+ bar.setValue(bar.getValue() - bar.getBlockIncrement());
+ }
+
+ private void imageLeft() {
+ final JScrollBar bar = scrollPane.getHorizontalScrollBar();
+ bar.setValue(bar.getValue() - bar.getBlockIncrement());
+ }
+
+ private void imageRight() {
+ final JScrollBar bar = scrollPane.getHorizontalScrollBar();
+ bar.setValue(bar.getValue() + bar.getBlockIncrement());
+ }
+
private void zoomFit() {
final boolean selected = zoomFitButt.isSelected();
prefs.putBoolean(KEY_ZOOM_FIT, selected);
@@ -173,7 +238,7 @@ class ImageWindow2 extends JFrame {
} else {
sizeMode = SizeMode.FULL_SIZE;
}
- refreshImage();
+ refreshImage(false);
}
private void updateSimpleLine() {
@@ -185,7 +250,16 @@ class ImageWindow2 extends JFrame {
}
simpleLine2 = (SimpleLine2) listModel.getElementAt(index);
setTitle(simpleLine2.toString());
- refreshImage();
+ refreshImage(false);
+ }
+
+ private void refreshSimpleLine() {
+ for (SimpleLine2 line : main.getCurrentDirectoryListing2()) {
+ if (line.getFile().equals(simpleLine2.getFile())) {
+ simpleLine2 = line;
+ setTitle(simpleLine2.toString());
+ }
+ }
}
private ScrollablePicture buildScrollablePicture() {
@@ -215,7 +289,7 @@ class ImageWindow2 extends JFrame {
imageBuilder.addUDrawable(error);
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
- imageBuilder.writeImageTOBEMOVED(FileFormat.PNG, baos);
+ imageBuilder.writeImageTOBEMOVED(new FileFormatOption(FileFormat.PNG), baos);
baos.close();
image = ImageIO.read(new ByteArrayInputStream(baos.toByteArray()));
} catch (IOException e) {
@@ -224,6 +298,28 @@ class ImageWindow2 extends JFrame {
}
final ImageIcon imageIcon = new ImageIcon(image, simpleLine2.toString());
final ScrollablePicture scrollablePicture = new ScrollablePicture(imageIcon, 1);
+
+ scrollablePicture.addMouseListener(new MouseAdapter() {
+ public void mousePressed(MouseEvent me) {
+ super.mousePressed(me);
+ startX = me.getX();
+ startY = me.getY();
+ }
+ });
+ scrollablePicture.addMouseMotionListener(new MouseMotionAdapter() {
+ public void mouseDragged(MouseEvent me) {
+ super.mouseDragged(me);
+ final int diffX = me.getX() - startX;
+ final int diffY = me.getY() - startY;
+
+ final JScrollBar hbar = scrollPane.getHorizontalScrollBar();
+ hbar.setValue(hbar.getValue() - diffX);
+ final JScrollBar vbar = scrollPane.getVerticalScrollBar();
+ vbar.setValue(vbar.getValue() - diffY);
+ }
+ });
+
+
return scrollablePicture;
}
@@ -242,9 +338,34 @@ class ImageWindow2 extends JFrame {
return simpleLine2;
}
- public void refreshImage() {
+ private int v1;
+ private int v2;
+
+ public void refreshImage(boolean external) {
+ final JScrollBar bar1 = scrollPane.getVerticalScrollBar();
+ final JScrollBar bar2 = scrollPane.getHorizontalScrollBar();
+ if (external && isError() == false) {
+ v1 = bar1.getValue();
+ v2 = bar2.getValue();
+ }
scrollPane.setViewportView(buildScrollablePicture());
force();
+ if (external) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ refreshSimpleLine();
+ if (isError() == false) {
+ bar1.setValue(v1);
+ bar2.setValue(v2);
+ }
+ }
+ });
+ }
+ }
+
+ private boolean isError() {
+ return simpleLine2.getGeneratedImage() != null && simpleLine2.getGeneratedImage().lineErrorRaw() != -1;
+
}
private void force() {
diff --git a/src/net/sourceforge/plantuml/swing/LicenseWindow.java b/src/net/sourceforge/plantuml/swing/LicenseWindow.java
index 726db0f..48a61c4 100644
--- a/src/net/sourceforge/plantuml/swing/LicenseWindow.java
+++ b/src/net/sourceforge/plantuml/swing/LicenseWindow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/swing/MainWindow2.java b/src/net/sourceforge/plantuml/swing/MainWindow2.java
index 52fa147..7303c66 100644
--- a/src/net/sourceforge/plantuml/swing/MainWindow2.java
+++ b/src/net/sourceforge/plantuml/swing/MainWindow2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -354,7 +354,7 @@ public class MainWindow2 extends JFrame {
final File file = ent.getKey();
removeAllThatUseThisFile(file);
final Future<List<GeneratedImage>> future = ent.getValue();
- final SimpleLine2 simpleLine = new SimpleLine2(file, null, future);
+ final SimpleLine2 simpleLine = SimpleLine2.fromFuture(file, future);
currentDirectoryListing2.add(simpleLine);
changed = true;
}
@@ -366,7 +366,7 @@ public class MainWindow2 extends JFrame {
final Future<List<GeneratedImage>> future = line.getFuture();
for (GeneratedImage im : future.get()) {
mayRefreshImageWindow(im.getPngFile());
- final SimpleLine2 simpleLine = new SimpleLine2(line.getFile(), im, null);
+ final SimpleLine2 simpleLine = SimpleLine2.fromGeneratedImage(line.getFile(), im);
currentDirectoryListing2.add(simpleLine);
}
}
@@ -390,7 +390,7 @@ public class MainWindow2 extends JFrame {
continue;
}
if (pngFile.equals(win.getSimpleLine().getGeneratedImage().getPngFile())) {
- win.refreshImage();
+ win.refreshImage(true);
}
}
@@ -403,4 +403,8 @@ public class MainWindow2 extends JFrame {
}
}
+ public List<SimpleLine2> getCurrentDirectoryListing2() {
+ return Collections.unmodifiableList(currentDirectoryListing2);
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/swing/ScrollablePicture.java b/src/net/sourceforge/plantuml/swing/ScrollablePicture.java
index babb3c1..2a44909 100644
--- a/src/net/sourceforge/plantuml/swing/ScrollablePicture.java
+++ b/src/net/sourceforge/plantuml/swing/ScrollablePicture.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/swing/SimpleLine2.java b/src/net/sourceforge/plantuml/swing/SimpleLine2.java
index cc2e500..3499cd1 100644
--- a/src/net/sourceforge/plantuml/swing/SimpleLine2.java
+++ b/src/net/sourceforge/plantuml/swing/SimpleLine2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -46,7 +46,15 @@ class SimpleLine2 implements Comparable<SimpleLine2> {
private final GeneratedImage generatedImage;
private final Future<List<GeneratedImage>> future;
- public SimpleLine2(File file, GeneratedImage generatedImage, Future<List<GeneratedImage>> future) {
+ public static SimpleLine2 fromFuture(File file, Future<List<GeneratedImage>> future) {
+ return new SimpleLine2(file, null, future);
+ }
+
+ public static SimpleLine2 fromGeneratedImage(File file, GeneratedImage generatedImage) {
+ return new SimpleLine2(file, generatedImage, null);
+ }
+
+ private SimpleLine2(File file, GeneratedImage generatedImage, Future<List<GeneratedImage>> future) {
this.generatedImage = generatedImage;
this.file = file;
this.future = future;
diff --git a/src/net/sourceforge/plantuml/swing/SpriteWindow.java b/src/net/sourceforge/plantuml/swing/SpriteWindow.java
index c414286..572750d 100644
--- a/src/net/sourceforge/plantuml/swing/SpriteWindow.java
+++ b/src/net/sourceforge/plantuml/swing/SpriteWindow.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -52,8 +52,8 @@ import javax.swing.SwingUtilities;
import javax.swing.Timer;
import net.sourceforge.plantuml.Log;
-import net.sourceforge.plantuml.ugraphic.SpriteGrayLevel;
-import net.sourceforge.plantuml.ugraphic.SpriteUtils;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel;
+import net.sourceforge.plantuml.ugraphic.sprite.SpriteUtils;
import net.sourceforge.plantuml.version.PSystemVersion;
public class SpriteWindow extends JFrame {
diff --git a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
index fb269f8..f02a5cf 100644
--- a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
+++ b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -79,6 +79,7 @@ public class LanguageDescriptor {
keyword.add("as");
keyword.add("also");
keyword.add("autonumber");
+ keyword.add("caption");
keyword.add("title");
keyword.add("newpage");
keyword.add("box");
@@ -90,6 +91,9 @@ public class LanguageDescriptor {
keyword.add("break");
keyword.add("critical");
keyword.add("note");
+ keyword.add("rnote");
+ keyword.add("hnote");
+ keyword.add("legend");
keyword.add("group");
keyword.add("left");
keyword.add("right");
diff --git a/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java b/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java
index 21ae703..010beca 100644
--- a/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java
+++ b/src/net/sourceforge/plantuml/syntax/SyntaxChecker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -96,6 +96,7 @@ public class SyntaxChecker {
result.setError(true);
final PSystemError sys = (PSystemError) system;
result.setErrorLinePosition(sys.getHigherErrorPosition());
+ result.setLineLocation(sys.getLineLocation());
for (ErrorUml er : sys.getErrorsUml()) {
result.addErrorText(er.getError());
}
@@ -129,6 +130,7 @@ public class SyntaxChecker {
result.setError(true);
final PSystemError sys = (PSystemError) system;
result.setErrorLinePosition(sys.getHigherErrorPosition());
+ result.setLineLocation(sys.getLineLocation());
for (ErrorUml er : sys.getErrorsUml()) {
result.addErrorText(er.getError());
}
diff --git a/src/net/sourceforge/plantuml/syntax/SyntaxResult.java b/src/net/sourceforge/plantuml/syntax/SyntaxResult.java
index 27ca296..1915176 100644
--- a/src/net/sourceforge/plantuml/syntax/SyntaxResult.java
+++ b/src/net/sourceforge/plantuml/syntax/SyntaxResult.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -42,6 +42,7 @@ import java.util.List;
import java.util.TreeSet;
import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.PSystemError;
import net.sourceforge.plantuml.UmlDiagramType;
@@ -55,6 +56,7 @@ public class SyntaxResult {
private List<String> suggest;
private boolean hasCmapData;
private PSystemError systemError;
+ private LineLocation lineLocation;
public UmlDiagramType getUmlDiagramType() {
return umlDiagramType;
@@ -124,4 +126,12 @@ public class SyntaxResult {
systemError.exportDiagram(os, 0, fileFormatOption);
}
+ public void setLineLocation(LineLocation lineLocation) {
+ this.lineLocation = lineLocation;
+ }
+
+ public LineLocation getLineLocation() {
+ return lineLocation;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java b/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java
index 111c632..60797c1 100644
--- a/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java
+++ b/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/telnet/TelnetServer.java b/src/net/sourceforge/plantuml/telnet/TelnetServer.java
index 9dd9841..55a3357 100644
--- a/src/net/sourceforge/plantuml/telnet/TelnetServer.java
+++ b/src/net/sourceforge/plantuml/telnet/TelnetServer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java
index 5cbf18e..6466b1b 100644
--- a/src/net/sourceforge/plantuml/tikz/TikzGraphics.java
+++ b/src/net/sourceforge/plantuml/tikz/TikzGraphics.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -44,6 +44,7 @@ import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Log;
+import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.USegment;
@@ -82,9 +83,47 @@ public class TikzGraphics {
out(os, "\\documentclass{article}");
out(os, "\\usepackage{tikz}");
out(os, "\\usepackage{aeguill}");
+ if (hasUrl) {
+ out(os, "\\usetikzlibrary{calc}");
+ out(os, "\\usepackage{hyperref}");
+ }
// out(os, "\\usetikzlibrary{trees}");
out(os, "\\begin{document}");
out(os, "% generated by Plantuml " + Version.versionString(10));
+ if (hasUrl) {
+ out(os, "\\tikzset{");
+ out(os, " href node/.style={");
+ out(os, " alias=sourcenode,");
+ out(os, " append after command={");
+ out(os, " let \\p1 = (sourcenode.north west),");
+ out(os, " \\p2=(sourcenode.south east),");
+ out(os, " \\n1={\\x2-\\x1},");
+ out(os, " \\n2={\\y2-\\y1} in");
+ out(os,
+ " node [inner sep=0pt, outer sep=0pt,anchor=north west,at=(\\p1)] {\\href{#1}{\\XeTeXLinkBox{\\phantom{\\rule{\\n1}{\\n2}}}}}");
+ out(os, " %xelatex needs \\XeTeXLinkBox, won't create a link unless it");
+ out(os, " %finds text --- rules don't work without \\XeTeXLinkBox.");
+ out(os, " %Still builds correctly with pdflatex and lualatex");
+ out(os, " }");
+ out(os, " }");
+ out(os, "}");
+ out(os, "\\tikzset{");
+ out(os, " hyperref node/.style={");
+ out(os, " alias=sourcenode,");
+ out(os, " append after command={");
+ out(os, " let \\p1 = (sourcenode.north west),");
+ out(os, " \\p2=(sourcenode.south east),");
+ out(os, " \\n1={\\x2-\\x1},");
+ out(os, " \\n2={\\y2-\\y1} in");
+ out(os,
+ " node [inner sep=0pt, outer sep=0pt,anchor=north west,at=(\\p1)] {\\hyperref [#1]{\\XeTeXLinkBox{\\phantom{\\rule{\\n1}{\\n2}}}}}");
+ out(os, " %xelatex needs \\XeTeXLinkBox, won't create a link unless it");
+ out(os, " %finds text --- rules don't work without \\XeTeXLinkBox.");
+ out(os, " %Still builds correctly with pdflatex and lualatex");
+ out(os, " }");
+ out(os, " }");
+ out(os, "}");
+ }
for (Map.Entry<Color, String> ent : colornames.entrySet()) {
out(os, definecolor(ent.getValue(), ent.getKey()));
@@ -104,19 +143,45 @@ public class TikzGraphics {
public void rectangle(double x, double y, double width, double height) {
final StringBuilder sb = new StringBuilder();
- sb.append("\\draw[");
- if (color != null) {
- sb.append("color=" + getColorName(color) + ",");
- }
- if (fillcolor != null) {
- sb.append("fill=" + getColorName(fillcolor) + ",");
- if (color == null) {
- sb.append("color=" + getColorName(fillcolor) + ",");
+ if (pendingUrl == null) {
+ sb.append("\\draw[");
+ if (color != null) {
+ sb.append("color=" + getColorName(color) + ",");
}
+ if (fillcolor != null) {
+ sb.append("fill=" + getColorName(fillcolor) + ",");
+ if (color == null) {
+ sb.append("color=" + getColorName(fillcolor) + ",");
+ }
+ }
+ sb.append("line width=" + thickness + "pt] ");
+ sb.append(couple(x, y) + " rectangle " + couple(x + width, y + height));
+ sb.append(";");
+ } else {
+ sb.append("\\node at " + couple(x, y) + "[draw, ");
+ if (color != null) {
+ sb.append("color=" + getColorName(color) + ",");
+ }
+ if (fillcolor != null) {
+ sb.append("fill=" + getColorName(fillcolor) + ",");
+ if (color == null) {
+ sb.append("color=" + getColorName(fillcolor) + ",");
+ }
+ }
+ sb.append("line width=" + thickness + "pt,");
+ sb.append("below right,");
+ sb.append("inner sep=2ex,");
+ sb.append("minimum width=" + format(width) + "pt,");
+ sb.append("minimum height=" + format(height) + "pt,");
+ if (Url.isLatex(pendingUrl)) {
+ sb.append("hyperref node=" + extractInternalHref(pendingUrl));
+ } else {
+ sb.append("href node=" + pendingUrl);
+ }
+ sb.append("] ");
+ sb.append(" {};");
+ urlIgnoreText = true;
}
- sb.append("line width=" + thickness + "pt] ");
- sb.append(couple(x, y) + " rectangle " + couple(x + width, y + height));
- sb.append(";");
cmd.add(sb.toString());
}
@@ -134,8 +199,36 @@ public class TikzGraphics {
}
public void text(double x, double y, String text) {
- final String s = "\\node at " + couple(x, y) + "[below right]{" + protectText(text) + "};";
- cmd.add(s);
+ final StringBuilder sb = new StringBuilder("\\node at " + couple(x, y) + "[below right]{");
+ if (pendingUrl == null || urlIgnoreText) {
+ sb.append(protectText(text));
+ } else {
+ appendPendingUrl(sb);
+ sb.append("{");
+ sb.append(protectText(text));
+ sb.append("}");
+ }
+ sb.append("};");
+ cmd.add(sb.toString());
+ }
+
+ private void appendPendingUrl(final StringBuilder sb) {
+ if (Url.isLatex(pendingUrl)) {
+ sb.append("\\hyperref[");
+ sb.append(extractInternalHref(pendingUrl));
+ sb.append("]");
+ } else {
+ sb.append("\\href{");
+ sb.append(pendingUrl);
+ sb.append("}");
+ }
+ }
+
+ private static String extractInternalHref(String pendingUrl) {
+ if (Url.isLatex(pendingUrl) == false) {
+ throw new IllegalArgumentException();
+ }
+ return pendingUrl.substring("latex://".length());
}
private String protectText(String text) {
@@ -299,4 +392,34 @@ public class TikzGraphics {
this.dash = dash;
}
+ private String pendingUrl = null;
+ private boolean urlIgnoreText = false;
+ private boolean hasUrl = false;
+
+ public void openLink(String url, String title) {
+ if (url == null) {
+ throw new IllegalArgumentException();
+ }
+ this.hasUrl = true;
+ this.urlIgnoreText = false;
+ this.pendingUrl = url;
+ //
+ // if (pendingLink2.size() > 0) {
+ // closeLink();
+ // }
+ //
+ // pendingLink2.add(0, (Element) document.createElement("a"));
+ // pendingLink2.get(0).setAttribute("target", target);
+ // pendingLink2.get(0).setAttribute("xlink:href", url);
+ // if (title == null) {
+ // pendingLink2.get(0).setAttribute("xlink:title", url);
+ // } else {
+ // pendingLink2.get(0).setAttribute("xlink:title", title);
+ // }
+ }
+
+ public void closeLink() {
+ this.pendingUrl = null;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java b/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java
index 5c0de1b..2b13f0d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java
+++ b/src/net/sourceforge/plantuml/ugraphic/AbstractCommonUGraphic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractPlacementStrategy.java b/src/net/sourceforge/plantuml/ugraphic/AbstractPlacementStrategy.java
index 760246b..1cb6b05 100644
--- a/src/net/sourceforge/plantuml/ugraphic/AbstractPlacementStrategy.java
+++ b/src/net/sourceforge/plantuml/ugraphic/AbstractPlacementStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractShadowable.java b/src/net/sourceforge/plantuml/ugraphic/AbstractShadowable.java
index 693bf64..a36f43a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/AbstractShadowable.java
+++ b/src/net/sourceforge/plantuml/ugraphic/AbstractShadowable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphic.java b/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphic.java
index 0db6067..32686dc 100644
--- a/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphic.java
+++ b/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java b/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java
index 54739f6..0d1a19b 100644
--- a/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java
+++ b/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,9 +34,6 @@
*/
package net.sourceforge.plantuml.ugraphic;
-import java.io.IOException;
-import java.io.OutputStream;
-
import net.sourceforge.plantuml.graphic.UGraphicDelegator;
public abstract class AbstractUGraphicHorizontalLine extends UGraphicDelegator {
diff --git a/src/net/sourceforge/plantuml/ugraphic/ClipContainer.java b/src/net/sourceforge/plantuml/ugraphic/ClipContainer.java
index e8d460b..cb415ee 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ClipContainer.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ClipContainer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ColorChangerMonochrome.java b/src/net/sourceforge/plantuml/ugraphic/ColorChangerMonochrome.java
index a1754c7..f36e23e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ColorChangerMonochrome.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ColorChangerMonochrome.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ColorMapper.java b/src/net/sourceforge/plantuml/ugraphic/ColorMapper.java
index 0154e03..12ee306 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ColorMapper.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ColorMapper.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ColorMapperIdentity.java b/src/net/sourceforge/plantuml/ugraphic/ColorMapperIdentity.java
index 0aa7765..e83440b 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ColorMapperIdentity.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ColorMapperIdentity.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ColorMapperMonochrome.java b/src/net/sourceforge/plantuml/ugraphic/ColorMapperMonochrome.java
index d2a0e2b..5ded726 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ColorMapperMonochrome.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ColorMapperMonochrome.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ColorMapperTransparentWrapper.java b/src/net/sourceforge/plantuml/ugraphic/ColorMapperTransparentWrapper.java
index 954b783..088197d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ColorMapperTransparentWrapper.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ColorMapperTransparentWrapper.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java b/src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java
index 9f8268b..3add0ba 100644
--- a/src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java
+++ b/src/net/sourceforge/plantuml/ugraphic/CompressionTransform.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
index c234d28..4a00609 100644
--- a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
+++ b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -53,6 +53,7 @@ import javax.imageio.ImageIO;
import javax.xml.transform.TransformerException;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -165,7 +166,8 @@ public class FontChecker {
public BufferedImage getBufferedImage(final char c) throws IOException {
assert c != '\t';
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1, null, null, null, 0, 0, null, false);
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1, null, null, null, 0, 0, null,
+ false);
final double dim = 20;
imageBuilder.addUDrawable(new UDrawable() {
public void drawU(UGraphic ug) {
@@ -173,14 +175,13 @@ public class FontChecker {
ug.draw(new URectangle(dim - 1, dim - 1));
if (ug instanceof UGraphic2) {
ug = (UGraphic2) ug.apply(new UTranslate(dim / 3, 2 * dim / 3));
- final UText text = new UText("" + c, new FontConfiguration(font, HtmlColorUtils.BLACK,
- HtmlColorUtils.BLUE, true));
+ final UText text = new UText("" + c, FontConfiguration.blackBlueTrue(font));
ug.draw(text);
}
}
});
final ByteArrayOutputStream os = new ByteArrayOutputStream();
- imageBuilder.writeImageTOBEMOVED(FileFormat.PNG, os);
+ imageBuilder.writeImageTOBEMOVED(new FileFormatOption(FileFormat.PNG), os);
os.close();
return ImageIO.read(new ByteArrayInputStream(os.toByteArray()));
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
index 57fd164..a9925ec 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -55,7 +55,10 @@ import net.sourceforge.plantuml.CMapData;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmptyImageBuilder;
import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.FileUtils;
+import net.sourceforge.plantuml.OptionFlags;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.anim.AffineTransformation;
import net.sourceforge.plantuml.anim.Animation;
@@ -70,6 +73,7 @@ import net.sourceforge.plantuml.graphic.HtmlColorTransparent;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.mjpeg.MJPEGGenerator;
+import net.sourceforge.plantuml.ugraphic.crossing.UGraphicCrossing;
import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
import net.sourceforge.plantuml.ugraphic.hand.UGraphicHandwritten;
@@ -77,7 +81,6 @@ import net.sourceforge.plantuml.ugraphic.html5.UGraphicHtml5;
import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz;
import net.sourceforge.plantuml.ugraphic.visio.UGraphicVdx;
-import net.sourceforge.plantuml.StringUtils;
public class ImageBuilder {
@@ -115,16 +118,17 @@ public class ImageBuilder {
this.udrawable = udrawable;
}
- public ImageData writeImageTOBEMOVED(FileFormat fileFormat, OutputStream os) throws IOException {
+ public ImageData writeImageTOBEMOVED(FileFormatOption fileFormatOption, OutputStream os) throws IOException {
+ final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.MJPEG) {
return writeImageMjpeg(os);
} else if (fileFormat == FileFormat.ANIMATED_GIF) {
return writeImageAnimatedGif(os);
}
- return writeImageTOBEMOVED(fileFormat, os, affineTransformations);
+ return writeImageTOBEMOVED(fileFormatOption, os, affineTransformations);
}
- private ImageData writeImageTOBEMOVED(FileFormat fileFormat, OutputStream os, Animation affineTransforms)
+ private ImageData writeImageTOBEMOVED(FileFormatOption fileFormatOption, OutputStream os, Animation affineTransforms)
throws IOException {
final LimitFinder limitFinder = new LimitFinder(TextBlockUtils.getDummyStringBounder(), true);
udrawable.drawU(limitFinder);
@@ -140,8 +144,10 @@ public class ImageBuilder {
dy = -minmax.getMinY();
}
- final UGraphic2 ug = createUGraphic(fileFormat, dim, affineTransforms, dx, dy);
- udrawable.drawU(handwritten(ug.apply(new UTranslate(margin1, margin1))));
+ final UGraphic2 ug = createUGraphic(fileFormatOption, dim, affineTransforms, dx, dy);
+ final UGraphic ugDecored = handwritten(ug.apply(new UTranslate(margin1, margin1)));
+ udrawable.drawU(ugDecored);
+ ugDecored.flushUg();
ug.writeImageTOBEMOVED(os, metadata, 96);
os.flush();
@@ -160,7 +166,11 @@ public class ImageBuilder {
if (useHandwritten) {
return new UGraphicHandwritten(ug);
}
- return ug;
+ if (OptionFlags.OMEGA_CROSSING) {
+ return new UGraphicCrossing(ug);
+ } else {
+ return ug;
+ }
}
private ImageData writeImageMjpeg(OutputStream os) throws IOException {
@@ -223,7 +233,7 @@ public class ImageBuilder {
private Image getAviImage(AffineTransformation affineTransform) throws IOException {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- writeImageTOBEMOVED(FileFormat.PNG, baos, Animation.singleton(affineTransform));
+ writeImageTOBEMOVED(new FileFormatOption(FileFormat.PNG), baos, Animation.singleton(affineTransform));
baos.close();
final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
@@ -232,13 +242,14 @@ public class ImageBuilder {
return im;
}
- private UGraphic2 createUGraphic(FileFormat fileFormat, final Dimension2D dim, Animation affineTransforms,
- double dx, double dy) {
+ private UGraphic2 createUGraphic(FileFormatOption fileFormatOption, final Dimension2D dim,
+ Animation affineTransforms, double dx, double dy) {
+ final FileFormat fileFormat = fileFormatOption.getFileFormat();
switch (fileFormat) {
case PNG:
return createUGraphicPNG(colorMapper, dpiFactor, dim, mybackcolor, affineTransforms, dx, dy);
case SVG:
- return createUGraphicSVG(colorMapper, dpiFactor, dim, mybackcolor);
+ return createUGraphicSVG(colorMapper, dpiFactor, dim, mybackcolor, fileFormatOption.getSvgLinkTarget());
case EPS:
return new UGraphicEps(colorMapper, EpsStrategy.getDefault2());
case EPS_TEXT:
@@ -254,18 +265,19 @@ public class ImageBuilder {
}
}
- private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale, Dimension2D dim, HtmlColor mybackcolor) {
+ private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale, Dimension2D dim, HtmlColor mybackcolor,
+ String svgLinkTarget) {
Color backColor = Color.WHITE;
if (mybackcolor instanceof HtmlColorSimple) {
backColor = colorMapper.getMappedColor(mybackcolor);
}
final UGraphicSvg ug;
if (mybackcolor instanceof HtmlColorGradient) {
- ug = new UGraphicSvg(colorMapper, (HtmlColorGradient) mybackcolor, false, scale);
+ ug = new UGraphicSvg(colorMapper, (HtmlColorGradient) mybackcolor, false, scale, svgLinkTarget);
} else if (backColor == null || backColor.equals(Color.WHITE)) {
- ug = new UGraphicSvg(colorMapper, false, scale);
+ ug = new UGraphicSvg(colorMapper, false, scale, svgLinkTarget);
} else {
- ug = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(backColor), false, scale);
+ ug = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(backColor), false, scale, svgLinkTarget);
}
return ug;
diff --git a/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java b/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java
index 64cc1b1..93ff308 100644
--- a/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java
+++ b/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java b/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java
index b1034aa..40f9038 100644
--- a/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/LimitFinder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/MinMax.java b/src/net/sourceforge/plantuml/ugraphic/MinMax.java
index a8dec9d..625d0a8 100644
--- a/src/net/sourceforge/plantuml/ugraphic/MinMax.java
+++ b/src/net/sourceforge/plantuml/ugraphic/MinMax.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/MinMaxMutable.java b/src/net/sourceforge/plantuml/ugraphic/MinMaxMutable.java
index 3c45961..cc1eb9a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/MinMaxMutable.java
+++ b/src/net/sourceforge/plantuml/ugraphic/MinMaxMutable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategy.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategy.java
index 55c7a22..86784a6 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategy.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyVisibility.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyVisibility.java
index 0ee98e7..e4f8035 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyVisibility.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyVisibility.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1X2.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1X2.java
index fd29ef6..38e3ded 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1X2.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1X2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1Y2Y3.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1Y2Y3.java
index e36e707..3fb29a8 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1Y2Y3.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyX1Y2Y3.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2.java
index de64e95..657d715 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Center.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Center.java
index 1e47e2d..867da91 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Center.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Center.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Left.java b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Left.java
index c80acc5..3d6cec2 100644
--- a/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Left.java
+++ b/src/net/sourceforge/plantuml/ugraphic/PlacementStrategyY1Y2Left.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/Scalable.java b/src/net/sourceforge/plantuml/ugraphic/Scalable.java
index 4aef956..fb22fef 100644
--- a/src/net/sourceforge/plantuml/ugraphic/Scalable.java
+++ b/src/net/sourceforge/plantuml/ugraphic/Scalable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ShadowManager.java b/src/net/sourceforge/plantuml/ugraphic/ShadowManager.java
index b7b9bb4..73d48ab 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ShadowManager.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ShadowManager.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/Shadowable.java b/src/net/sourceforge/plantuml/ugraphic/Shadowable.java
index a6ca149..50cfd8e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/Shadowable.java
+++ b/src/net/sourceforge/plantuml/ugraphic/Shadowable.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/Slot.java b/src/net/sourceforge/plantuml/ugraphic/Slot.java
index 6bdff47..bac171d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/Slot.java
+++ b/src/net/sourceforge/plantuml/ugraphic/Slot.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/SlotFinder.java b/src/net/sourceforge/plantuml/ugraphic/SlotFinder.java
index 8474246..9aea2a7 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SlotFinder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/SlotFinder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java b/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java
index 4b8889f..162eaba 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java
+++ b/src/net/sourceforge/plantuml/ugraphic/SlotFinderX.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/SlotSet.java b/src/net/sourceforge/plantuml/ugraphic/SlotSet.java
index bf31fd9..f631e07 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SlotSet.java
+++ b/src/net/sourceforge/plantuml/ugraphic/SlotSet.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/TextBlockInEllipse.java b/src/net/sourceforge/plantuml/ugraphic/TextBlockInEllipse.java
index af93e63..9d429db 100644
--- a/src/net/sourceforge/plantuml/ugraphic/TextBlockInEllipse.java
+++ b/src/net/sourceforge/plantuml/ugraphic/TextBlockInEllipse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,12 +37,13 @@ package net.sourceforge.plantuml.ugraphic;
import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.image.ContainingEllipse;
import net.sourceforge.plantuml.svek.image.Footprint;
-public class TextBlockInEllipse implements TextBlock {
+public class TextBlockInEllipse extends AbstractTextBlock implements TextBlock {
private final TextBlock text;
private final ContainingEllipse ellipse;
diff --git a/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java b/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java
index 4e3a04f..3c49f9d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java
+++ b/src/net/sourceforge/plantuml/ugraphic/TextLimitFinder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UAntiAliasing.java b/src/net/sourceforge/plantuml/ugraphic/UAntiAliasing.java
index 1b4c01c..c20b6d2 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UAntiAliasing.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UAntiAliasing.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UCenteredCharacter.java b/src/net/sourceforge/plantuml/ugraphic/UCenteredCharacter.java
index 6ed6abf..96752ae 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UCenteredCharacter.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UCenteredCharacter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UChange.java b/src/net/sourceforge/plantuml/ugraphic/UChange.java
index ecc9e5c..d3ea723 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UChange.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UChange.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UChangeBackColor.java b/src/net/sourceforge/plantuml/ugraphic/UChangeBackColor.java
index b47460f..e56f10f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UChangeBackColor.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UChangeBackColor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UChangeColor.java b/src/net/sourceforge/plantuml/ugraphic/UChangeColor.java
index 8b312b8..9820c6d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UChangeColor.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UChangeColor.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UClip.java b/src/net/sourceforge/plantuml/ugraphic/UClip.java
index 9b738b4..3f62273 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UClip.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UClip.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UDriver.java b/src/net/sourceforge/plantuml/ugraphic/UDriver.java
index c7bff33..9e3a2df 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UDriver.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UDriver.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UEllipse.java b/src/net/sourceforge/plantuml/ugraphic/UEllipse.java
index 32990e7..aea5455 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UEllipse.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UEllipse.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UEmpty.java b/src/net/sourceforge/plantuml/ugraphic/UEmpty.java
index d5b1fdf..8fe8981 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UEmpty.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UEmpty.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UFont.java b/src/net/sourceforge/plantuml/ugraphic/UFont.java
index d5aec22..2f1ab13 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UFont.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UFont.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -62,8 +62,9 @@ public class UFont {
return font;
}
- public FontConfiguration toFont2(HtmlColor color, boolean useUnderlineForHyperlink, HtmlColor hyperlinkColor) {
- return new FontConfiguration(this, color, hyperlinkColor, useUnderlineForHyperlink);
+ public FontConfiguration toFont2(HtmlColor color, boolean useUnderlineForHyperlink, HtmlColor hyperlinkColor,
+ int tabSize) {
+ return new FontConfiguration(this, color, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public UFont scaled(double scale) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/UFontContext.java b/src/net/sourceforge/plantuml/ugraphic/UFontContext.java
index 76f827e..da6d621 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UFontContext.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UFontContext.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UFontUser.java b/src/net/sourceforge/plantuml/ugraphic/UFontUser.java
index 6007947..98757cb 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UFontUser.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UFontUser.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java
index a6c8d8b..6105673 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java b/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java
index ed92e2a..637ba42 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java
index b9f9b09..6ed1d7d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -79,11 +79,20 @@ public class UGraphicCompress extends UGraphicDelegator {
}
private void drawLine(double x1, double y1, double x2, double y2) {
+ if (y1 > y2) {
+ drawLine(x2, y2, x1, y1);
+ return;
+ }
+ assert y1 <= y2;
final double xmin = Math.min(x1, x2);
final double xmax = Math.max(x1, x2);
final double ymin = Math.min(y1, y2);
final double ymax = Math.max(y1, y2);
- getUg().apply(new UTranslate(xmin, ymin)).draw(new ULine(xmax - xmin, ymax - ymin));
+ if (x2 >= x1) {
+ getUg().apply(new UTranslate(xmin, ymin)).draw(new ULine(xmax - xmin, ymax - ymin));
+ } else {
+ getUg().apply(new UTranslate(xmax, ymin)).draw(new ULine(-(xmax - xmin), ymax - ymin));
+ }
}
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java
index 664f5ae..a9ba063 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicCompress2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicFilter.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicFilter.java
index f6f7cc2..39d721b 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicFilter.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicFilter.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java
index f1f665e..4aa0b56 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicStencil.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicStencil.java
index a68de23..683edb8 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicStencil.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicStencil.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
index 6d35f62..ba4d79d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -72,7 +72,7 @@ public abstract class UGraphicUtils {
PngIO.write(im, os, fileFormatOption.isWithMetadata() ? metadata : null, 96);
} else if (fileFormat == FileFormat.SVG) {
final UGraphicSvg svg = new UGraphicSvg(colorMapper, StringUtils.getAsHtml(colorMapper
- .getMappedColor(background)), false, 1.0);
+ .getMappedColor(background)), false, 1.0, fileFormatOption.getSvgLinkTarget());
image.drawU(svg);
svg.createXml(os);
} else if (fileFormat == FileFormat.EPS) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/UHidden.java b/src/net/sourceforge/plantuml/ugraphic/UHidden.java
index 3ab0698..d1cd753 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UHidden.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UHidden.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java b/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java
index f82749a..15ac7d2 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UHorizontalLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UImage.java b/src/net/sourceforge/plantuml/ugraphic/UImage.java
index 20be1e9..9834de0 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UImage.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UImageSvg.java b/src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
index d431a2f..18d7ede 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/ULayoutGroup.java b/src/net/sourceforge/plantuml/ugraphic/ULayoutGroup.java
index 9a9718c..384a1df 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ULayoutGroup.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ULayoutGroup.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,8 +35,10 @@
package net.sourceforge.plantuml.ugraphic;
import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
import java.util.Map;
+import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
public class ULayoutGroup {
@@ -47,11 +49,11 @@ public class ULayoutGroup {
this.placementStrategy = placementStrategy;
}
- public void drawU(UGraphic ug, double x, double y, double width, double height) {
+ public void drawU(UGraphic ug, double width, double height) {
for (Map.Entry<TextBlock, Point2D> ent : placementStrategy.getPositions(width, height).entrySet()) {
final TextBlock block = ent.getKey();
final Point2D pos = ent.getValue();
- block.drawU(ug.apply(new UTranslate((x + pos.getX()), (y + pos.getY()))));
+ block.drawU(ug.apply(new UTranslate(pos)));
}
}
@@ -60,4 +62,16 @@ public class ULayoutGroup {
}
+ public Rectangle2D getInnerPosition(String member, double width, double height, StringBounder stringBounder) {
+ for (Map.Entry<TextBlock, Point2D> ent : placementStrategy.getPositions(width, height).entrySet()) {
+ final TextBlock block = ent.getKey();
+ final Rectangle2D result = block.getInnerPosition(member, stringBounder);
+ if (result != null) {
+ final UTranslate translate = new UTranslate(ent.getValue());
+ return translate.apply(result);
+ }
+ }
+ return null;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/ULine.java b/src/net/sourceforge/plantuml/ugraphic/ULine.java
index 23cf32e..5c082ec 100644
--- a/src/net/sourceforge/plantuml/ugraphic/ULine.java
+++ b/src/net/sourceforge/plantuml/ugraphic/ULine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UMotif.java b/src/net/sourceforge/plantuml/ugraphic/UMotif.java
index 20094eb..467743f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UMotif.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UMotif.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UParam.java b/src/net/sourceforge/plantuml/ugraphic/UParam.java
index c13acda..99c13be 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UParam.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UParam.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UParamNull.java b/src/net/sourceforge/plantuml/ugraphic/UParamNull.java
index 78c16b4..8d34a64 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UParamNull.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UParamNull.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UPath.java b/src/net/sourceforge/plantuml/ugraphic/UPath.java
index 3bd6a98..9396040 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UPath.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UPattern.java b/src/net/sourceforge/plantuml/ugraphic/UPattern.java
index a51f772..e8fafff 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UPattern.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UPattern.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UPixel.java b/src/net/sourceforge/plantuml/ugraphic/UPixel.java
index d7f428e..3e7c5ab 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UPixel.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UPixel.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UPolygon.java b/src/net/sourceforge/plantuml/ugraphic/UPolygon.java
index 2cfdf0d..337487a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UPolygon.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UPolygon.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/URectangle.java b/src/net/sourceforge/plantuml/ugraphic/URectangle.java
index 658632c..91918d3 100644
--- a/src/net/sourceforge/plantuml/ugraphic/URectangle.java
+++ b/src/net/sourceforge/plantuml/ugraphic/URectangle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UScale.java b/src/net/sourceforge/plantuml/ugraphic/UScale.java
index f9676d2..30c6760 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UScale.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UScale.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/USegment.java b/src/net/sourceforge/plantuml/ugraphic/USegment.java
index 0b27ca3..59532fc 100644
--- a/src/net/sourceforge/plantuml/ugraphic/USegment.java
+++ b/src/net/sourceforge/plantuml/ugraphic/USegment.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/USegmentType.java b/src/net/sourceforge/plantuml/ugraphic/USegmentType.java
index 36f4e05..7e4ccee 100644
--- a/src/net/sourceforge/plantuml/ugraphic/USegmentType.java
+++ b/src/net/sourceforge/plantuml/ugraphic/USegmentType.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UShape.java b/src/net/sourceforge/plantuml/ugraphic/UShape.java
index 18a77c7..2d10623 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UShape.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UShape.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UStroke.java b/src/net/sourceforge/plantuml/ugraphic/UStroke.java
index cc4bf86..85e70e8 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UStroke.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UStroke.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UText.java b/src/net/sourceforge/plantuml/ugraphic/UText.java
index ee458e7..3829647 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UText.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/UTranslate.java b/src/net/sourceforge/plantuml/ugraphic/UTranslate.java
index c6349f6..70d7b69 100644
--- a/src/net/sourceforge/plantuml/ugraphic/UTranslate.java
+++ b/src/net/sourceforge/plantuml/ugraphic/UTranslate.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -35,6 +35,7 @@
package net.sourceforge.plantuml.ugraphic;
import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
public class UTranslate implements UChange {
@@ -86,4 +87,8 @@ public class UTranslate implements UChange {
return new UTranslate(-dx, -dy);
}
+ public Rectangle2D apply(Rectangle2D rect) {
+ return new Rectangle2D.Double(rect.getX() + dx, rect.getY() + dy, rect.getWidth(), rect.getHeight());
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedGeneralPath.java b/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedGeneralPath.java
index 579ce51..afa1201 100644
--- a/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedGeneralPath.java
+++ b/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedGeneralPath.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedPathIterator.java b/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedPathIterator.java
index 2a7ab22..43b9a9c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedPathIterator.java
+++ b/src/net/sourceforge/plantuml/ugraphic/arc/ExtendedPathIterator.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java b/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java
new file mode 100644
index 0000000..cb62a9d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/crossing/UGraphicCrossing.java
@@ -0,0 +1,194 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.ugraphic.crossing;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.cute.Balloon;
+import net.sourceforge.plantuml.cute.CrossingSegment;
+import net.sourceforge.plantuml.geom.LineSegmentDouble;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.posimo.DotPath;
+import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.UChange;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UEllipse;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UParam;
+import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+
+public class UGraphicCrossing implements UGraphic {
+
+ private final UGraphic ug;
+ private final List<Pending> lines;
+ private final UTranslate translate;
+
+ static class Pending {
+ final UGraphic ug;
+ final LineSegmentDouble segment;
+ final UTranslate translate;
+
+ Pending(UGraphic ug, UTranslate translate, LineSegmentDouble segment) {
+ this.ug = ug;
+ this.segment = segment;
+ this.translate = translate;
+ }
+
+ void drawNow(HtmlColor color) {
+ if (color == null) {
+ segment.draw(ug);
+ } else {
+ segment.draw(ug.apply(new UChangeColor(color)));
+ }
+ }
+
+ List<Point2D> getCollisionsWith(List<Pending> others) {
+ final List<Point2D> result = new ArrayList<Point2D>();
+ for (Pending other : others) {
+ if (isClose(segment.getP1(), other.segment.getP1()) || isClose(segment.getP1(), other.segment.getP2())
+ || isClose(segment.getP2(), other.segment.getP1())
+ || isClose(segment.getP2(), other.segment.getP2())) {
+ continue;
+ }
+ final Point2D inter = segment.getSegIntersection(other.segment);
+ if (inter != null) {
+ result.add(inter);
+ }
+ }
+ return result;
+ }
+ }
+
+ public UGraphicCrossing(UGraphic ug) {
+ this(ug, new UTranslate(), new ArrayList<Pending>());
+ }
+
+ private static boolean isClose(Point2D p1, Point2D p2) {
+ return p1.distance(p2) < 0.1;
+ }
+
+ private UGraphicCrossing(UGraphic ug, UTranslate translate, List<Pending> lines) {
+ this.ug = ug;
+ this.translate = translate;
+ this.lines = lines;
+ }
+
+ public StringBounder getStringBounder() {
+ return ug.getStringBounder();
+ }
+
+ public UParam getParam() {
+ return ug.getParam();
+ }
+
+ public void draw(UShape shape) {
+ if (shape instanceof DotPath) {
+ drawDotPath((DotPath) shape);
+ } else {
+ ug.draw(shape);
+ }
+ }
+
+ private void drawDotPath(DotPath dotPath) {
+ if (dotPath.isLine()) {
+ for (LineSegmentDouble seg : dotPath.getLineSegments()) {
+ lines.add(new Pending(ug.apply(translate.reverse()), translate, seg.translate(translate)));
+ }
+ } else {
+ ug.draw(dotPath);
+ }
+ }
+
+ public UGraphic apply(UChange change) {
+ if (change instanceof UTranslate) {
+ return new UGraphicCrossing(ug.apply(change), translate.compose((UTranslate) change), lines);
+ } else {
+ return new UGraphicCrossing(ug.apply(change), translate, lines);
+ }
+ }
+
+ public ColorMapper getColorMapper() {
+ return ug.getColorMapper();
+ }
+
+ public void startUrl(Url url) {
+ ug.startUrl(url);
+ }
+
+ public void closeAction() {
+ ug.closeAction();
+ }
+
+ public void flushUg() {
+ final List<Pending> pendings = new ArrayList<Pending>();
+ final List<Balloon> balloons = new ArrayList<Balloon>();
+ for (Pending p : lines) {
+ final List<Point2D> tmp = p.getCollisionsWith(lines);
+ for (Point2D pt : tmp) {
+ balloons.add(new Balloon(pt, 5));
+ }
+ // if (tmp.size() == 0) {
+ // p.drawNow(null);
+ // } else {
+ // pendings.add(p);
+ // }
+ }
+ for (Balloon b : balloons) {
+ b.drawU(ug.apply(new UChangeBackColor(HtmlColorUtils.GREEN)).apply(new UChangeColor(HtmlColorUtils.GREEN)));
+ }
+ for (Pending p : lines) {
+ for (Balloon b : balloons) {
+ List<Point2D> pts = new CrossingSegment(b, p.segment).intersection();
+ for (Point2D pt : pts) {
+ final Balloon s2 = new Balloon(pt, 2);
+ s2.drawU(ug.apply(new UChangeBackColor(HtmlColorUtils.BLUE)).apply(new UChangeColor(HtmlColorUtils.BLUE)));
+ }
+ }
+ }
+ ug.flushUg();
+ }
+
+ public boolean isSpecialTxt() {
+ return false;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverCenteredCharacterEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverCenteredCharacterEps.java
index ed3cc6f..26ffedd 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverCenteredCharacterEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverCenteredCharacterEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverDotPathEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverDotPathEps.java
index b9ca820..1238eb2 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverDotPathEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverDotPathEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverEllipseEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverEllipseEps.java
index da7961a..6735c10 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverEllipseEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverEllipseEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverImageEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverImageEps.java
index 7beeebe..9942d62 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverImageEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverImageEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverLineEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverLineEps.java
index 69e7d2b..902adfa 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverLineEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverLineEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverPathEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverPathEps.java
index f7f5ad9..9eeff07 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverPathEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverPathEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverPolygonEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverPolygonEps.java
index dbd6296..65d817a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverPolygonEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverPolygonEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverRectangleEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverRectangleEps.java
index 2707e58..c972cc6 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverRectangleEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverRectangleEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java
index 8cc6e2c..63348a9 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/DriverTextEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java
index 2762ba8..c160fe9 100644
--- a/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java
+++ b/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverCenteredCharacterG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverCenteredCharacterG2d.java
index e206fc2..f6eabd2 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverCenteredCharacterG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverCenteredCharacterG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverDotPathG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverDotPathG2d.java
index 862b943..f9246f8 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverDotPathG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverDotPathG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java
index 277a65d..0775c0e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverEllipseG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java
index f63979e..b25136e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverImageG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java
index 26472f3..2bdc7b5 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverLineG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java
index 6982ade..19abc23 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2dLegacy.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2dLegacy.java
index 7a5a324..9aa3b99 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2dLegacy.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathG2dLegacy.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathOldG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathOldG2d.java
index 02a9e96..78199f2 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathOldG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPathOldG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPixelG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPixelG2d.java
index d3c376e..b79d156 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPixelG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPixelG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPolygonG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPolygonG2d.java
index 90feb50..9ddc52e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPolygonG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverPolygonG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java
index 9c9faff..d97d93d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverRectangleG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverShadowedG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverShadowedG2d.java
index 6a88f9a..42f4d21 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverShadowedG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverShadowedG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -100,6 +100,8 @@ public class DriverShadowedG2d {
destination = simpleBlur.filter(destination, null);
} catch (OutOfMemoryError error) {
Log.info("Warning: Cannot draw shadow, image too big.");
+ } catch (Exception e) {
+ Log.info("Warning: Cannot draw shadow: " + e);
}
if (destination != null) {
final AffineTransform at = g2d.getTransform();
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java
index 697242b..0d1259d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextAsPathG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java
index baf7b48..28c6b9c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/DriverTextG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java
index 1650c8e..7b0d0af 100644
--- a/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java
+++ b/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/HandJiggle.java b/src/net/sourceforge/plantuml/ugraphic/hand/HandJiggle.java
index 7a3b628..22b0a62 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/HandJiggle.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/HandJiggle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UDotPathHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/UDotPathHand.java
index 739868e..9c9911a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UDotPathHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UDotPathHand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UEllipseHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/UEllipseHand.java
index 4ef0bca..ed49c91 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UEllipseHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UEllipseHand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java b/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java
index a85c35f..3f7dd79 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UGraphicHandwritten.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/ULineHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/ULineHand.java
index 85f2915..9658b89 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/ULineHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/ULineHand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java
index 4525aff..d038c71 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UPathHand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/UPolygonHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/UPolygonHand.java
index 874fa40..8e5ae17 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/UPolygonHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/UPolygonHand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/hand/URectangleHand.java b/src/net/sourceforge/plantuml/ugraphic/hand/URectangleHand.java
index 4508cbb..360cd34 100644
--- a/src/net/sourceforge/plantuml/ugraphic/hand/URectangleHand.java
+++ b/src/net/sourceforge/plantuml/ugraphic/hand/URectangleHand.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -48,7 +48,7 @@ public class URectangleHand {
final HandJiggle jiggle;
final double rx = Math.min(rectangle.getRx() / 2, width / 2);
final double ry = Math.min(rectangle.getRy() / 2, height / 2);
- System.err.println("rx=" + rx + " ry=" + ry);
+ // System.err.println("rx=" + rx + " ry=" + ry);
if (rx == 0 && ry == 0) {
jiggle = new HandJiggle(0, 0, 1.5);
jiggle.lineTo(width, 0);
diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/DriverLineHtml5.java b/src/net/sourceforge/plantuml/ugraphic/html5/DriverLineHtml5.java
index c629b37..50e7aa4 100644
--- a/src/net/sourceforge/plantuml/ugraphic/html5/DriverLineHtml5.java
+++ b/src/net/sourceforge/plantuml/ugraphic/html5/DriverLineHtml5.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/DriverNopHtml5.java b/src/net/sourceforge/plantuml/ugraphic/html5/DriverNopHtml5.java
index b0ec476..19f8e58 100644
--- a/src/net/sourceforge/plantuml/ugraphic/html5/DriverNopHtml5.java
+++ b/src/net/sourceforge/plantuml/ugraphic/html5/DriverNopHtml5.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/DriverRectangleHtml5.java b/src/net/sourceforge/plantuml/ugraphic/html5/DriverRectangleHtml5.java
index 8cf3095..6f905bf 100644
--- a/src/net/sourceforge/plantuml/ugraphic/html5/DriverRectangleHtml5.java
+++ b/src/net/sourceforge/plantuml/ugraphic/html5/DriverRectangleHtml5.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/Html5Drawer.java b/src/net/sourceforge/plantuml/ugraphic/html5/Html5Drawer.java
index 5b9e76d..2987e6c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/html5/Html5Drawer.java
+++ b/src/net/sourceforge/plantuml/ugraphic/html5/Html5Drawer.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java b/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java
index 37b94f2..cdbabfe 100644
--- a/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java
+++ b/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSprites.java b/src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSprites.java
new file mode 100644
index 0000000..bf608c0
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSprites.java
@@ -0,0 +1,94 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.ugraphic.sprite;
+
+import java.awt.Font;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.core.DiagramDescription;
+import net.sourceforge.plantuml.core.DiagramDescriptionImpl;
+import net.sourceforge.plantuml.core.ImageData;
+import net.sourceforge.plantuml.graphic.GraphicStrings;
+import net.sourceforge.plantuml.graphic.HtmlColorUtils;
+import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
+import net.sourceforge.plantuml.ugraphic.UFont;
+
+public class PSystemListInternalSprites extends AbstractPSystem {
+
+ public ImageData exportDiagram(OutputStream os, int num, FileFormatOption fileFormat) throws IOException {
+ final GraphicStrings result = getGraphicStrings();
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
+ getMetadata(), null, 0, 0, null, false);
+ imageBuilder.addUDrawable(result);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
+ }
+
+ private GraphicStrings getGraphicStrings() throws IOException {
+ final List<String> lines = new ArrayList<String>();
+ lines.add("<b>List Current Sprits");
+ lines.add("<i>Credit to");
+ lines.add("http://www.archimatetool.com");
+ lines.add(" ");
+ for (String folder : RessourcesUtils.getJarFile("sprites", true)) {
+ lines.add("<u>" + folder + "</u> :");
+ lines.add(" ");
+ for (String png : RessourcesUtils.getJarFile("sprites/" + folder, false)) {
+ if (png.endsWith(".png")) {
+ final String spriteName = png.substring(0, png.length() - 4);
+ lines.add("<$archimate/" + spriteName + "> " + spriteName);
+ }
+ }
+ }
+
+ final UFont font = new UFont("SansSerif", Font.PLAIN, 12);
+ final GraphicStrings graphicStrings = new GraphicStrings(lines, font, HtmlColorUtils.BLACK,
+ HtmlColorUtils.WHITE, UAntiAliasing.ANTI_ALIASING_ON);
+ graphicStrings.setMaxLine(35);
+ return graphicStrings;
+ }
+
+ public DiagramDescription getDescription() {
+ return new DiagramDescriptionImpl("(Sprites)", getClass());
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSpritesFactory.java b/src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSpritesFactory.java
new file mode 100644
index 0000000..1954aaf
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/PSystemListInternalSpritesFactory.java
@@ -0,0 +1,52 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.ugraphic.sprite;
+
+import net.sourceforge.plantuml.AbstractPSystem;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.PSystemSingleLineFactory;
+
+public class PSystemListInternalSpritesFactory extends PSystemSingleLineFactory {
+
+ @Override
+ protected AbstractPSystem executeLine(String line) {
+ final String lineLower = StringUtils.goLowerCase(line);
+ if (lineLower.startsWith("listsprite")) {
+ return new PSystemListInternalSprites();
+ }
+ return null;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java b/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java
new file mode 100644
index 0000000..b2bcbdf
--- /dev/null
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/RessourcesUtils.java
@@ -0,0 +1,118 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.ugraphic.sprite;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import net.sourceforge.plantuml.version.Version;
+
+public class RessourcesUtils {
+
+ public static Set<String> getJarFile(String path, boolean folder) throws IOException {
+ if (path.startsWith("/") || path.endsWith("/")) {
+ throw new IllegalArgumentException();
+ }
+ final URL resource = Version.class.getClassLoader().getResource("net/sourceforge/plantuml/version/logo.png");
+ final String protocol = resource.getProtocol();
+ if ("file".equals(protocol)) {
+ final URL local = Version.class.getClassLoader().getResource(path);
+ try {
+ return listEntry(new File(local.toURI()));
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ if ("jar".equals(protocol)) {
+ final String classFile = Version.class.getName().replace(".", "/") + ".class";
+ final URL versionURL = Version.class.getClassLoader().getResource(classFile);
+ final String jarPath = versionURL.getPath().substring(5, versionURL.getPath().indexOf("!"));
+ if (folder) {
+ return listFolders(new JarFile(URLDecoder.decode(jarPath, "UTF-8")), path + "/");
+ } else {
+ return listFiles(new JarFile(URLDecoder.decode(jarPath, "UTF-8")), path + "/");
+
+ }
+ }
+ return Collections.<String> emptySet();
+ }
+
+ private static Set<String> listFiles(JarFile jarFile, String path) {
+ final Enumeration<JarEntry> entries = jarFile.entries();
+ final Set<String> result = new TreeSet<String>();
+ while (entries.hasMoreElements()) {
+ final String name = entries.nextElement().getName();
+ if (name.startsWith(path)) {
+ result.add(name.substring(path.length()));
+ }
+ }
+ return result;
+ }
+
+ private static Set<String> listFolders(JarFile jarFile, String path) {
+ final Enumeration<JarEntry> entries = jarFile.entries();
+ final Set<String> result = new TreeSet<String>();
+ while (entries.hasMoreElements()) {
+ final String name = entries.nextElement().getName();
+ if (name.startsWith(path)) {
+ final String folder = name.substring(path.length());
+ final int x = folder.indexOf('/');
+ if (x != -1) {
+ result.add(folder.substring(0, x));
+ }
+ }
+ }
+ return result;
+ }
+
+ private static Set<String> listEntry(File dir) {
+ final Set<String> result = new TreeSet<String>();
+ for (String n : dir.list()) {
+ result.add(n);
+ }
+ return result;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/ugraphic/Sprite.java b/src/net/sourceforge/plantuml/ugraphic/sprite/Sprite.java
index 3e657db..a32a62f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/Sprite.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/Sprite.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,7 +32,7 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.sprite;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock;
diff --git a/src/net/sourceforge/plantuml/ugraphic/SpriteGrayLevel.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java
index d69f478..a6c07b0 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SpriteGrayLevel.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,7 +32,7 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.sprite;
import java.awt.Color;
import java.awt.image.BufferedImage;
@@ -44,6 +44,7 @@ import java.util.List;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.code.AsciiEncoder;
import net.sourceforge.plantuml.code.CompressionZlib;
+import net.sourceforge.plantuml.ugraphic.ColorChangerMonochrome;
public enum SpriteGrayLevel {
@@ -165,7 +166,7 @@ public enum SpriteGrayLevel {
return grey / 16;
}
- public Sprite buildSprite(int width, int height, List<String> strings) {
+ public Sprite buildSprite(int width, int height, List<CharSequence> strings) {
if (this == SpriteGrayLevel.GRAY_16) {
return buildSprite16(strings);
}
@@ -178,7 +179,7 @@ public enum SpriteGrayLevel {
throw new UnsupportedOperationException(toString());
}
- private Sprite buildSprite16(List<String> strings) {
+ private Sprite buildSprite16(List<CharSequence> strings) {
final SpriteMonochrome result = new SpriteMonochrome(strings.get(0).length(), strings.size(), 16);
for (int col = 0; col < result.getWidth(); col++) {
for (int line = 0; line < result.getHeight(); line++) {
@@ -195,7 +196,7 @@ public enum SpriteGrayLevel {
return result;
}
- private Sprite buildSprite8(int width, int height, List<String> strings) {
+ private Sprite buildSprite8(int width, int height, List<CharSequence> strings) {
final AsciiEncoder encoder = new AsciiEncoder();
final SpriteMonochrome result = new SpriteMonochrome(width, height, 8);
for (int col = 0; col < result.getWidth(); col++) {
@@ -214,7 +215,7 @@ public enum SpriteGrayLevel {
return result;
}
- private Sprite buildSprite4(int width, int height, List<String> strings) {
+ private Sprite buildSprite4(int width, int height, List<CharSequence> strings) {
final AsciiEncoder encoder = new AsciiEncoder();
final SpriteMonochrome result = new SpriteMonochrome(width, height, 4);
for (int col = 0; col < result.getWidth(); col++) {
diff --git a/src/net/sourceforge/plantuml/ugraphic/SpriteImage.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteImage.java
index 1380e5d..8eb6653 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SpriteImage.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteImage.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,15 +32,22 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.sprite;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.imageio.ImageIO;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UImage;
public class SpriteImage implements Sprite {
@@ -51,7 +58,7 @@ public class SpriteImage implements Sprite {
}
public TextBlock asTextBlock(final HtmlColor color) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
ug.draw(img);
@@ -63,4 +70,27 @@ public class SpriteImage implements Sprite {
};
}
+ public static Sprite fromInternal(String name) {
+ if (name.endsWith(".png")) {
+ throw new IllegalArgumentException();
+ }
+ final InputStream is = getInternalSprite(name + ".png");
+ if (is == null) {
+ return null;
+ }
+ try {
+ return new SpriteImage(ImageIO.read(is));
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ }
+
+ public static InputStream getInternalSprite(final String inner) {
+ final String path = "/sprites/" + inner;
+ final InputStream is = SpriteImage.class.getResourceAsStream(path);
+ return is;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/SpriteMonochrome.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java
index 4015d1e..d7b9749 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SpriteMonochrome.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteMonochrome.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,18 +32,22 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.sprite;
import java.awt.Color;
import java.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UImage;
public class SpriteMonochrome implements Sprite {
@@ -90,7 +94,7 @@ public class SpriteMonochrome implements Sprite {
backcolor = HtmlColorUtils.WHITE;
}
if (color == null) {
- backcolor = HtmlColorUtils.BLACK;
+ color = HtmlColorUtils.BLACK;
}
final HtmlColorGradient gradient = new HtmlColorGradient(backcolor, color, '\0');
for (int col = 0; col < width; col++) {
@@ -104,7 +108,7 @@ public class SpriteMonochrome implements Sprite {
}
public TextBlock asTextBlock(final HtmlColor color) {
- return new TextBlock() {
+ return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
ug.draw(toUImage(ug.getColorMapper(), ug.getParam().getBackcolor(), color));
diff --git a/src/net/sourceforge/plantuml/ugraphic/SpriteUtils.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java
index 5871057..d5fd87d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/SpriteUtils.java
+++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,13 +32,15 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.ugraphic;
+package net.sourceforge.plantuml.ugraphic.sprite;
import java.awt.image.BufferedImage;
import java.util.List;
public class SpriteUtils {
+ public static final String SPRITE_NAME = "[-\\p{L}0-9_/]+";
+
private SpriteUtils() {
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverCenteredCharacterSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverCenteredCharacterSvg.java
index 0cf7fce..3adcd70 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverCenteredCharacterSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverCenteredCharacterSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverDotPathSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverDotPathSvg.java
index 28659d1..c4b7804 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverDotPathSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverDotPathSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java
index 399d984..60153e4 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverEllipseSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverImagePng.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverImagePng.java
index 74836d1..955596b 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverImagePng.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverImagePng.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverImageSvgSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverImageSvgSvg.java
index c02c31d..0fc8d3f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverImageSvgSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverImageSvgSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java
index 2007978..d5a8c10 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverLineSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverPathSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverPathSvg.java
index 586f691..e3021f4 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverPathSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverPathSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverPolygonSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverPolygonSvg.java
index a3db97b..875ff62 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverPolygonSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverPolygonSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java
index 67bfece..e6ddf7e 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverRectangleSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextAsPathSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextAsPathSvg.java
index 878bb17..e4950ea 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextAsPathSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextAsPathSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextSvg.java
index e5816b4..5a2d448 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/DriverTextSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,7 +34,9 @@
*/
package net.sourceforge.plantuml.ugraphic.svg;
+import java.awt.Color;
import java.awt.geom.Dimension2D;
+import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.FontStyle;
@@ -86,6 +88,11 @@ public class DriverTextSvg implements UDriver<SvgGraphics> {
textDecoration = "line-through";
}
+ String backColor = null;
+ if (fontConfiguration.containsStyle(FontStyle.BACKCOLOR)) {
+ backColor = StringUtils.getAsHtml(mapper.getMappedColor(fontConfiguration.getExtendedColor()));
+ }
+
svg.setFillColor(StringUtils.getAsHtml(mapper.getMappedColor(fontConfiguration.getColor())));
String text = shape.getText();
if (text.startsWith(" ")) {
@@ -95,9 +102,9 @@ public class DriverTextSvg implements UDriver<SvgGraphics> {
text = text.substring(1);
}
}
- text = text.trim();
+ text = StringUtils.trin(text);
final Dimension2D dim = stringBounder.calculateDimension(font, text);
svg.text(text, x, y, font.getFamily(UFontContext.SVG), font.getSize(), fontWeight, fontStyle, textDecoration,
- dim.getWidth(), fontConfiguration.getAttributes());
+ dim.getWidth(), fontConfiguration.getAttributes(), backColor);
}
}
diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
index 2ce5faf..b8f4973 100644
--- a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
+++ b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -64,6 +64,7 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
private final StringBounder stringBounder;
private final boolean textAsPath2;
+ private final String target;
@Override
protected AbstractCommonUGraphic copyUGraphic() {
@@ -74,19 +75,20 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
super(other);
this.stringBounder = other.stringBounder;
this.textAsPath2 = other.textAsPath2;
+ this.target = other.target;
register();
}
- public UGraphicSvg(ColorMapper colorMapper, String backcolor, boolean textAsPath, double scale) {
- this(colorMapper, new SvgGraphics(backcolor, scale), textAsPath);
+ public UGraphicSvg(ColorMapper colorMapper, String backcolor, boolean textAsPath, double scale, String linkTarget) {
+ this(colorMapper, new SvgGraphics(backcolor, scale), textAsPath, linkTarget);
}
- public UGraphicSvg(ColorMapper colorMapper, boolean textAsPath, double scale) {
- this(colorMapper, new SvgGraphics(scale), textAsPath);
+ public UGraphicSvg(ColorMapper colorMapper, boolean textAsPath, double scale, String linkTarget) {
+ this(colorMapper, new SvgGraphics(scale), textAsPath, linkTarget);
}
- public UGraphicSvg(ColorMapper mapper, HtmlColorGradient gr, boolean textAsPath, double scale) {
- this(mapper, new SvgGraphics(scale), textAsPath);
+ public UGraphicSvg(ColorMapper mapper, HtmlColorGradient gr, boolean textAsPath, double scale, String linkTarget) {
+ this(mapper, new SvgGraphics(scale), textAsPath, linkTarget);
final SvgGraphics svg = getGraphicObject();
svg.paintBackcolorGradient(mapper, gr);
@@ -107,10 +109,11 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
getGraphicObject().setHidden(false);
}
- private UGraphicSvg(ColorMapper colorMapper, SvgGraphics svg, boolean textAsPath) {
+ private UGraphicSvg(ColorMapper colorMapper, SvgGraphics svg, boolean textAsPath, String linkTarget) {
super(colorMapper, svg);
- stringBounder = TextBlockUtils.getDummyStringBounder();
+ this.stringBounder = TextBlockUtils.getDummyStringBounder();
this.textAsPath2 = textAsPath;
+ this.target = linkTarget;
register();
}
@@ -148,7 +151,7 @@ public class UGraphicSvg extends AbstractUGraphic<SvgGraphics> implements ClipCo
}
public void startUrl(Url url) {
- getGraphicObject().openLink(url.getUrl(), url.getTooltip());
+ getGraphicObject().openLink(url.getUrl(), url.getTooltip(), target);
}
public void closeAction() {
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java
index b2ac3bb..9687088 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverAtomTextTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz.java
index 087d994..a99e967 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverCenteredCharacterTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java
index a49a762..fce56cf 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverDotPathTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
index 16acdd4..a33768a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverLineTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverLineTikz.java
index 20dd8b7..a21435f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverLineTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverLineTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverNoneTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverNoneTikz.java
index 1c1754c..a9cbb00 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverNoneTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverNoneTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java
index 6aea91d..a9d729d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverPolygonTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java
index 84b8dc3..d44c26d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverRectangleTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java
index a9e3b3a..73935d9 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUPathTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java
index 9507fd8..9e2690f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverUTextTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java
index 9303cc9..74a74dc 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -104,9 +104,11 @@ public class UGraphicTikz extends AbstractUGraphic<TikzGraphics> implements Clip
}
public void startUrl(Url url) {
+ getGraphicObject().openLink(url.getUrl(), url.getTooltip());
}
public void closeAction() {
+ getGraphicObject().closeLink();
}
public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException {
diff --git a/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java b/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java
index 528259a..f34d250 100644
--- a/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java
+++ b/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverDotPathVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverDotPathVdx.java
index 0df19b1..d9af36f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverDotPathVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverDotPathVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverLineVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverLineVdx.java
index 9e7ed05..0696f8c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverLineVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverLineVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverNoneVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverNoneVdx.java
index 0c55c5f..1170c4d 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverNoneVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverNoneVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverPolygonVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverPolygonVdx.java
index 69c29ba..628131c 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverPolygonVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverPolygonVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverRectangleVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverRectangleVdx.java
index 147a989..ae26714 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverRectangleVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverRectangleVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverTextVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverTextVdx.java
index 90419ff..c8a9576 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverTextVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverTextVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -36,6 +36,7 @@ package net.sourceforge.plantuml.ugraphic.visio;
import java.awt.geom.Dimension2D;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.ColorMapper;
@@ -70,7 +71,7 @@ public class DriverTextVdx implements UDriver<VisioGraphics> {
}
}
- text = text.trim();
+ text = StringUtils.trin(text);
final Dimension2D dim = stringBounder.calculateDimension(font, text);
visio.text(text, x, y, font.getFamily(UFontContext.SVG), font.getSize(), dim.getWidth(), dim.getHeight(),
fontConfiguration.getAttributes());
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/DriverUPathVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/DriverUPathVdx.java
index 6f04eb4..1ab625a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/DriverUPathVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/DriverUPathVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java
index f4966f1..45ec588 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/VisioGraphics.java b/src/net/sourceforge/plantuml/ugraphic/visio/VisioGraphics.java
index 2cc4e43..09cd05f 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/VisioGraphics.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/VisioGraphics.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/VisioLine.java b/src/net/sourceforge/plantuml/ugraphic/visio/VisioLine.java
index c2481ad..93ab980 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/VisioLine.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/VisioLine.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/VisioRectangle.java b/src/net/sourceforge/plantuml/ugraphic/visio/VisioRectangle.java
index 11cfd9f..5807723 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/VisioRectangle.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/VisioRectangle.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/VisioShape.java b/src/net/sourceforge/plantuml/ugraphic/visio/VisioShape.java
index 47f4da3..fd2d2cb 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/VisioShape.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/VisioShape.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/VisioText.java b/src/net/sourceforge/plantuml/ugraphic/visio/VisioText.java
index d06cb12..6f9c6f0 100644
--- a/src/net/sourceforge/plantuml/ugraphic/visio/VisioText.java
+++ b/src/net/sourceforge/plantuml/ugraphic/visio/VisioText.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/utils/CharHidder.java b/src/net/sourceforge/plantuml/utils/CharHidder.java
index 2295ad7..dcdf340 100644
--- a/src/net/sourceforge/plantuml/utils/CharHidder.java
+++ b/src/net/sourceforge/plantuml/utils/CharHidder.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -59,11 +59,13 @@ public class CharHidder {
result.append(c);
}
}
+ // System.err.println("---> " + result);
return result.toString();
}
private static boolean isToBeHidden(final char c) {
- if (c == '_' || c == '\"' || c == '#' || c == ']' || c == '[' || c == '*' || c == '.' || c == '/') {
+ if (c == '_' || c == '-' || c == '\"' || c == '#' || c == ']' || c == '[' || c == '*' || c == '.' || c == '/'
+ || c == '<') {
return true;
}
return false;
diff --git a/src/net/sourceforge/plantuml/utils/MathUtils.java b/src/net/sourceforge/plantuml/utils/MathUtils.java
index 69c21f4..59c234f 100644
--- a/src/net/sourceforge/plantuml/utils/MathUtils.java
+++ b/src/net/sourceforge/plantuml/utils/MathUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -41,11 +41,15 @@ public class MathUtils {
}
public static double max(double a, double b, double c) {
- return Math.max(Math.max(a, b), c);
+ return max(max(a, b), c);
}
public static double max(double a, double b, double c, double d) {
- return Math.max(Math.max(a, b), Math.max(c, d));
+ return max(max(a, b), max(c, d));
+ }
+
+ public static double max(double a, double b, double c, double d, double e) {
+ return max(max(a, b, c), max(d, e));
}
public static double limitation(double v, double min, double max) {
diff --git a/src/net/sourceforge/plantuml/utils/StartUtils.java b/src/net/sourceforge/plantuml/utils/StartUtils.java
index a6e878c..66d0e5d 100644
--- a/src/net/sourceforge/plantuml/utils/StartUtils.java
+++ b/src/net/sourceforge/plantuml/utils/StartUtils.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -37,36 +37,39 @@ package net.sourceforge.plantuml.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import net.sourceforge.plantuml.CharSequence2;
+import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.MyPattern;
public class StartUtils {
- public static boolean isArobaseStartDiagram(String s) {
- s = s.trim();
- return s.startsWith("@start");
+ public static final String PAUSE_PATTERN = "(?i)((?:\\W|\\<[^<>]*\\>)*)@unpause";
+ public static final String START_PATTERN = "(?i)((?:[^\\w~]|\\<[^<>]*\\>)*)@start";
+
+
+ public static boolean isArobaseStartDiagram(CharSequence s) {
+ return StringUtils.trinNoTrace(s).startsWith("@start");
}
- public static boolean isArobaseEndDiagram(String s) {
- s = s.trim();
- return s.startsWith("@end");
+ public static boolean isArobaseEndDiagram(CharSequence s) {
+ return StringUtils.trinNoTrace(s).startsWith("@end");
}
- public static boolean isArobasePauseDiagram(String s) {
- s = s.trim();
- return s.startsWith("@pause");
+ public static boolean isArobasePauseDiagram(CharSequence s) {
+ return StringUtils.trinNoTrace(s).startsWith("@pause");
}
- public static boolean isArobaseUnpauseDiagram(String s) {
- s = s.trim();
- return s.startsWith("@unpause");
+ public static boolean isArobaseUnpauseDiagram(CharSequence s) {
+ return StringUtils.trinNoTrace(s).startsWith("@unpause");
}
private static final Pattern append = MyPattern.cmpile("^\\W*@append");
- public static String getPossibleAppend(String s) {
+ public static CharSequence2 getPossibleAppend(CharSequence2 s) {
final Matcher m = append.matcher(s);
if (m.find()) {
- return s.substring(m.group(0).length()).trim();
+ return s.subSequence(m.group(0).length(), s.length()).trin();
+ //return StringUtils.trin(s.toString().substring(m.group(0).length()));
}
return null;
}
diff --git a/src/net/sourceforge/plantuml/utils/UniqueSequence.java b/src/net/sourceforge/plantuml/utils/UniqueSequence.java
index 6bc9e7e..5d30266 100644
--- a/src/net/sourceforge/plantuml/utils/UniqueSequence.java
+++ b/src/net/sourceforge/plantuml/utils/UniqueSequence.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/preproc/StackReadLine.java b/src/net/sourceforge/plantuml/version/IteratorCounter2.java
index 128ab9b..f6e58f5 100644
--- a/src/net/sourceforge/plantuml/preproc/StackReadLine.java
+++ b/src/net/sourceforge/plantuml/version/IteratorCounter2.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -32,27 +32,20 @@
*
* Original Author: Arnaud Roques
*/
-package net.sourceforge.plantuml.preproc;
+package net.sourceforge.plantuml.version;
-import java.util.Collection;
import java.util.Iterator;
-public class StackReadLine implements ReadLine {
+import net.sourceforge.plantuml.CharSequence2;
- final private Iterator<String> it;
+public interface IteratorCounter2 extends Iterator<CharSequence2> {
- public StackReadLine(Collection<String> all) {
- this.it = all.iterator();
- }
+ public int currentNum();
- public void close() {
- }
+ public IteratorCounter2 cloneMe();
- public String readLine() {
- if (it.hasNext()) {
- return it.next();
- }
- return null;
- }
+ public CharSequence2 peek();
+
+ public CharSequence2 peekPrevious();
}
diff --git a/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java b/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java
new file mode 100644
index 0000000..aaca2d4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/version/IteratorCounter2Impl.java
@@ -0,0 +1,86 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.version;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.CharSequence2;
+
+public class IteratorCounter2Impl implements IteratorCounter2 {
+
+ private final List<CharSequence2> data;
+ private int nb;
+
+ public IteratorCounter2Impl(List<CharSequence2> data) {
+ this(data, 0);
+ }
+
+ private IteratorCounter2Impl(List<CharSequence2> data, int nb) {
+ this.data = data;
+ this.nb = nb;
+ }
+
+ public int currentNum() {
+ return nb;
+ }
+
+ public boolean hasNext() {
+ return nb < data.size();
+ }
+
+ public CharSequence2 next() {
+ return data.get(nb++);
+ }
+
+ public CharSequence2 peek() {
+ return data.get(nb);
+ }
+
+ public CharSequence2 peekPrevious() {
+ if (nb == 0) {
+ return null;
+ }
+ return data.get(nb - 1);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ public IteratorCounter2 cloneMe() {
+ return new IteratorCounter2Impl(data, nb);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/version/License.java b/src/net/sourceforge/plantuml/version/License.java
index 254c368..f696f64 100644
--- a/src/net/sourceforge/plantuml/version/License.java
+++ b/src/net/sourceforge/plantuml/version/License.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -213,9 +213,9 @@ public enum License {
text.add("PlantUML : a free UML diagram generator");
text.add("========================================================================");
text.add("");
- text.add("(C) Copyright 2009-2014, Arnaud Roques");
+ text.add("(C) Copyright 2009-2017, Arnaud Roques");
text.add("");
- text.add("Project Info: http://plantuml.sourceforge.net");
+ text.add("Project Info: http://plantuml.com");
text.add("");
return text;
}
@@ -226,9 +226,9 @@ public enum License {
h.add(" * PlantUML : a free UML diagram generator");
h.add(" * ========================================================================");
h.add(" *");
- h.add(" * (C) Copyright 2009-2014, Arnaud Roques");
+ h.add(" * (C) Copyright 2009-2017, Arnaud Roques");
h.add(" *");
- h.add(" * Project Info: http://plantuml.sourceforge.net");
+ h.add(" * Project Info: http://plantuml.com");
h.add(" * ");
h.add(" * This file is part of PlantUML.");
h.add(" *");
@@ -323,7 +323,8 @@ public enum License {
throw new IllegalStateException();
}
text.add("");
- text.add("Icon provided by OpenIconic : https://useiconic.com/open/");
+ text.add("Icons provided by OpenIconic : https://useiconic.com/open");
+ text.add("Archimate sprites provided by Archi : http://www.archimatetool.com");
text.add("");
return text;
}
diff --git a/src/net/sourceforge/plantuml/version/PSystemLicense.java b/src/net/sourceforge/plantuml/version/PSystemLicense.java
index d2563b8..3a7d062 100644
--- a/src/net/sourceforge/plantuml/version/PSystemLicense.java
+++ b/src/net/sourceforge/plantuml/version/PSystemLicense.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -66,7 +66,7 @@ public class PSystemLicense extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
public static PSystemLicense create() throws IOException {
diff --git a/src/net/sourceforge/plantuml/version/PSystemLicenseFactory.java b/src/net/sourceforge/plantuml/version/PSystemLicenseFactory.java
index affcc05..89fdd5e 100644
--- a/src/net/sourceforge/plantuml/version/PSystemLicenseFactory.java
+++ b/src/net/sourceforge/plantuml/version/PSystemLicenseFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/version/PSystemVersion.java b/src/net/sourceforge/plantuml/version/PSystemVersion.java
index d319cab..56e4972 100644
--- a/src/net/sourceforge/plantuml/version/PSystemVersion.java
+++ b/src/net/sourceforge/plantuml/version/PSystemVersion.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -142,13 +142,14 @@ public class PSystemVersion extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(),
getMetadata(), null, 0, 0, null, false);
imageBuilder.addUDrawable(result);
- return imageBuilder.writeImageTOBEMOVED(fileFormat.getFileFormat(), os);
+ return imageBuilder.writeImageTOBEMOVED(fileFormat, os);
}
public static PSystemVersion createShowVersion() {
final List<String> strings = new ArrayList<String>();
strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")");
strings.add("(" + License.getCurrent() + " source distribution)");
+ strings.add("Loaded from " + Version.getJarPath());
strings.add(" ");
strings.addAll(GraphvizUtils.getTestDotStrings(true));
@@ -191,7 +192,7 @@ public class PSystemVersion extends AbstractPSystem {
int lim = 7;
if (lastversion == -1) {
strings.add("<b><color:red>Error</b>");
- strings.add("<color:red>Cannot connect to http://plantuml.sourceforge.net/</b>");
+ strings.add("<color:red>Cannot connect to http://plantuml.com/</b>");
strings.add("Maybe you should set your proxy ?");
strings.add("@startuml");
strings.add("checkversion(proxy=myproxy.com,port=8080)");
@@ -199,7 +200,7 @@ public class PSystemVersion extends AbstractPSystem {
lim = 9;
} else if (lastversion == 0) {
strings.add("<b><color:red>Error</b>");
- strings.add("Cannot retrieve last version from http://plantuml.sourceforge.net/</b>");
+ strings.add("Cannot retrieve last version from http://plantuml.com/</b>");
} else {
strings.add("<b>Last available version for download</b> : " + lastversion);
strings.add(" ");
@@ -224,7 +225,7 @@ public class PSystemVersion extends AbstractPSystem {
}
try {
- final URL url = new URL("http://plantuml.sourceforge.net/download.html");
+ final URL url = new URL("http://plantuml.com/download.html");
final HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setUseCaches(false);
urlConnection.connect();
@@ -262,8 +263,8 @@ public class PSystemVersion extends AbstractPSystem {
private GraphicStrings getGraphicStrings() throws IOException {
final UFont font = new UFont("SansSerif", Font.PLAIN, 12);
- return new GraphicStrings(strings, font, HtmlColorUtils.BLACK, HtmlColorUtils.WHITE, UAntiAliasing.ANTI_ALIASING_ON,
- image, GraphicPosition.BACKGROUND_CORNER_BOTTOM_RIGHT);
+ return new GraphicStrings(strings, font, HtmlColorUtils.BLACK, HtmlColorUtils.WHITE,
+ UAntiAliasing.ANTI_ALIASING_ON, image, GraphicPosition.BACKGROUND_CORNER_BOTTOM_RIGHT);
}
public DiagramDescription getDescription() {
diff --git a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java
index 841b19d..d3c7958 100644
--- a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java
+++ b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java
index eb0bc15..386c3b2 100644
--- a/src/net/sourceforge/plantuml/version/Version.java
+++ b/src/net/sourceforge/plantuml/version/Version.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -34,12 +34,13 @@
*/
package net.sourceforge.plantuml.version;
+import java.net.URL;
import java.util.Date;
public class Version {
public static int version() {
- return 8024;
+ return 8036;
}
public static String versionString() {
@@ -63,7 +64,7 @@ public class Version {
}
private static long compileTime() {
- return 1430665511202L;
+ return 1454874605178L;
}
public static String compileTimeString() {
@@ -73,4 +74,23 @@ public class Version {
return new Date(Version.compileTime()).toString();
}
+ public static String getJarPath() {
+ try {
+ final ClassLoader loader = Version.class.getClassLoader();
+ if (loader == null) {
+ return "No ClassLoader?";
+ }
+ final URL url = loader.getResource("net/sourceforge/plantuml/version/Version.class");
+ if (url == null) {
+ return "No URL?";
+ }
+ String fullpath = url.toString();
+ fullpath = fullpath.replaceAll("net/sourceforge/plantuml/version/Version\\.class", "");
+ return fullpath;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ return t.toString();
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/version/out.png b/src/net/sourceforge/plantuml/version/out.png
new file mode 100644
index 0000000..4bd1fac
--- /dev/null
+++ b/src/net/sourceforge/plantuml/version/out.png
Binary files differ
diff --git a/src/net/sourceforge/plantuml/webp/BoolDecoder.java b/src/net/sourceforge/plantuml/webp/BoolDecoder.java
new file mode 100644
index 0000000..9b1f1a4
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/BoolDecoder.java
@@ -0,0 +1,169 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.io.IOException;
+
+import javax.imageio.stream.ImageInputStream;
+
+public class BoolDecoder {
+ int bit_count; /* # of bits shifted out of value, at most 7 */
+ ImageInputStream data;
+ private long offset; /* pointer to next compressed data byte */
+ private int range; /* always identical to encoder's range */
+ private int value; /* contains at least 24 significant bits */
+
+ BoolDecoder(ImageInputStream frame, long offset) throws IOException {
+ this.data = frame;
+ this.offset = offset;
+ initBoolDecoder();
+ }
+
+ private void initBoolDecoder() throws IOException {
+
+ value = 0; /* value = first 16 input bits */
+
+ data.seek(offset);
+ value = data.readUnsignedByte() << 8;
+ // value = (data[offset]) << 8;
+ offset++;
+
+ range = 255; /* initial range is full */
+ bit_count = 0; /* have not yet shifted out any bits */
+ }
+
+ public int readBit() throws IOException {
+ return readBool(128);
+ }
+
+ public int readBool(int probability) throws IOException {
+
+ int bit = 0;
+ int split;
+ int bigsplit;
+ int range = this.range;
+ int value = this.value;
+ split = 1 + (((range - 1) * probability) >> 8);
+ bigsplit = (split << 8);
+ range = split;
+
+ if (value >= bigsplit) {
+ range = this.range - split;
+ value = value - bigsplit;
+ bit = 1;
+ }
+
+ {
+ int count = this.bit_count;
+ int shift = Globals.vp8dxBitreaderNorm[range];
+ range <<= shift;
+ value <<= shift;
+ count -= shift;
+
+ if (count <= 0) {
+ // data.seek(offset);
+ value |= data.readUnsignedByte() << (-count);
+ // value |= data[offset] << (-count);
+ offset++;
+ count += 8;
+ }
+
+ this.bit_count = count;
+ }
+ this.value = value;
+ this.range = range;
+ return bit;
+ }
+
+ /*
+ * Convenience function reads a "literal", that is, a "num_bits" wide
+ * unsigned value whose bits come high- to low-order, with each bit encoded
+ * at probability 128 (i.e., 1/2).
+ */
+ public int readLiteral(int num_bits) throws IOException {
+ int v = 0;
+ while (num_bits-- > 0)
+ v = (v << 1) + readBool(128);
+ return v;
+ }
+
+ int readTree(int t[], /* tree specification */
+ int p[] /* corresponding interior node probabilities */
+ ) throws IOException {
+ int i = 0; /* begin at root */
+
+ /* Descend tree until leaf is reached */
+ while ((i = t[i + readBool(p[i >> 1])]) > 0) {
+ }
+ return -i; /* return value is negation of nonpositive index */
+
+ }
+
+ int readTreeSkip(int t[], /* tree specification */
+ int p[], /* corresponding interior node probabilities */
+ int skip_branches) throws IOException {
+ int i = skip_branches * 2; /* begin at root */
+
+ /* Descend tree until leaf is reached */
+ while ((i = t[i + readBool(p[i >> 1])]) > 0) {
+ }
+ return -i; /* return value is negation of nonpositive index */
+
+ }
+
+ public void seek() throws IOException {
+ data.seek(offset);
+ }
+
+ public String toString() {
+ return "bc: " + value;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/webp/DeltaQ.java b/src/net/sourceforge/plantuml/webp/DeltaQ.java
new file mode 100644
index 0000000..ef450b6
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/DeltaQ.java
@@ -0,0 +1,56 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.sourceforge.plantuml.webp;
+
+public class DeltaQ {
+ public boolean update = false;
+ public int v = 0;
+}
diff --git a/src/net/sourceforge/plantuml/webp/Globals.java b/src/net/sourceforge/plantuml/webp/Globals.java
new file mode 100644
index 0000000..d7aae3c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/Globals.java
@@ -0,0 +1,854 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+public class Globals {
+
+ public static final int DC_PRED = 0; /*
+ * predict DC using row above and column
+ * to the left
+ */
+ public static final int V_PRED = 1; /* predict rows using row above */
+ public static final int H_PRED = 2; /*
+ * predict columns using column to the
+ * left
+ */
+ public static final int TM_PRED = 3; /*
+ * propagate second differences a la
+ * "true motion"
+ */
+ public static final int B_PRED = 4; /*
+ * each Y subblock is independently
+ * predicted
+ */
+
+ public static String getModeAsString(int mode) {
+ switch (mode) {
+ case DC_PRED:
+ return "DC_PRED";
+ case V_PRED:
+ return "V_PRED";
+ case H_PRED:
+ return "H_PRED";
+ case TM_PRED:
+ return "TM_PRED";
+ case B_PRED:
+ return "B_PRED";
+ }
+ return "not found";
+ }
+
+ /* intra_bmode */
+ public static final int B_DC_PRED = 0; /*
+ * predict DC using row above and
+ * column to the left
+ */
+ public static final int B_TM_PRED = 1; /*
+ * propagate second differences a la
+ * "true motion"
+ */
+ public static final int B_VE_PRED = 2; /* predict rows using row above */
+ public static final int B_HE_PRED = 3; /*
+ * predict columns using column to
+ * the left
+ */
+ public static final int B_LD_PRED = 4; /*
+ * southwest (left and down) 45
+ * degree diagonal prediction
+ */
+ public static final int B_RD_PRED = 5; /* southeast (right and down) "" */
+ public static final int B_VR_PRED = 6; /*
+ * SSE (vertical right) diagonal
+ * prediction
+ */
+ public static final int B_VL_PRED = 7; /* SSW (vertical left) "" */
+ public static final int B_HD_PRED = 8; /* ESE (horizontal down) "" */
+ public static final int B_HU_PRED = 9; /* ENE (horizontal up) "" */
+
+ public static String getSubBlockModeAsString(int mode) {
+ switch (mode) {
+ case B_DC_PRED:
+ return "B_DC_PRED";
+ case B_TM_PRED:
+ return "B_TM_PRED";
+ case B_VE_PRED:
+ return "B_VE_PRED";
+ case B_HE_PRED:
+ return "B_HE_PRED";
+ case B_LD_PRED:
+ return "B_LD_PRED";
+ case B_RD_PRED:
+ return "B_RD_PRED";
+ case B_VR_PRED:
+ return "B_VR_PRED";
+ case B_VL_PRED:
+ return "B_VL_PRED";
+ case B_HD_PRED:
+ return "B_HD_PRED";
+ case B_HU_PRED:
+ return "B_HU_PRED";
+ }
+ return "not found";
+ }
+
+ public static final int MAX_MB_SEGMENTS = 4;
+ public static final int MB_LVL_MAX = 2;
+ public static int[] vp8MacroBlockFeatureDataBits = { 7, 6 };
+ public static final int MB_FEATURE_TREE_PROBS = 3;
+
+ public static int macroBlockSegmentTree[] = { 2, 4,
+ /* root: "0", "1" subtrees */
+ -0, -1,
+ /* "00" = 0th value, "01" = 1st value */
+ -2, -3
+ /* "10" = 2nd value, "11" = 3rd value */
+ };
+
+ public static int vp8KeyFrameYModeTree[] = { -B_PRED, 2, 4, 6, -DC_PRED,
+ -V_PRED, -H_PRED, -TM_PRED };
+
+ public static int vp8SubBlockModeTree[] = { -B_DC_PRED, 2, /*
+ * B_DC_PRED =
+ * "0"
+ */
+ -B_TM_PRED, 4, /* B_TM_PRED = "10" */
+ -B_VE_PRED, 6, /* B_VE_PRED = "110" */
+ 8, 12, -B_HE_PRED, 10, /* B_HE_PRED = "1110" */
+ -B_RD_PRED, -B_VR_PRED, /* B_RD_PRED = "111100", B_VR_PRED = "111101" */
+ -B_LD_PRED, 14, /* B_LD_PRED = "111110" */
+ -B_VL_PRED, 16, /* B_VL_PRED = "1111110" */
+ -B_HD_PRED, -B_HU_PRED /* HD = "11111110", HU = "11111111" */
+ };
+
+ public static int vp8KeyFrameYModeProb[] = { 145, 156, 163, 128 };
+
+ // uv
+ public static int vp8UVModeTree[] = { -DC_PRED, 2, /*
+ * root: DC_PRED = "0",
+ * "1" subtree
+ */
+ -V_PRED, 4, /* "1" subtree: V_PRED = "10", "11" subtree */
+ -H_PRED, -TM_PRED /* "11" subtree: H_PRED = "110", TM_PRED = "111" */
+ };
+ public static int vp8KeyFrameUVModeProb[] = { 142, 114, 183 };
+
+ public static int vp8KeyFrameSubBlockModeProb[][][] = {
+ { { 231, 120, 48, 89, 115, 113, 120, 152, 112 },
+ { 152, 179, 64, 126, 170, 118, 46, 70, 95 },
+ { 175, 69, 143, 80, 85, 82, 72, 155, 103 },
+ { 56, 58, 10, 171, 218, 189, 17, 13, 152 },
+ { 144, 71, 10, 38, 171, 213, 144, 34, 26 },
+ { 114, 26, 17, 163, 44, 195, 21, 10, 173 },
+ { 121, 24, 80, 195, 26, 62, 44, 64, 85 },
+ { 170, 46, 55, 19, 136, 160, 33, 206, 71 },
+ { 63, 20, 8, 114, 114, 208, 12, 9, 226 },
+ { 81, 40, 11, 96, 182, 84, 29, 16, 36 } },
+ { { 134, 183, 89, 137, 98, 101, 106, 165, 148 },
+ { 72, 187, 100, 130, 157, 111, 32, 75, 80 },
+ { 66, 102, 167, 99, 74, 62, 40, 234, 128 },
+ { 41, 53, 9, 178, 241, 141, 26, 8, 107 },
+ { 104, 79, 12, 27, 217, 255, 87, 17, 7 },
+ { 74, 43, 26, 146, 73, 166, 49, 23, 157 },
+ { 65, 38, 105, 160, 51, 52, 31, 115, 128 },
+ { 87, 68, 71, 44, 114, 51, 15, 186, 23 },
+ { 47, 41, 14, 110, 182, 183, 21, 17, 194 },
+ { 66, 45, 25, 102, 197, 189, 23, 18, 22 } },
+ { { 88, 88, 147, 150, 42, 46, 45, 196, 205 },
+ { 43, 97, 183, 117, 85, 38, 35, 179, 61 },
+ { 39, 53, 200, 87, 26, 21, 43, 232, 171 },
+ { 56, 34, 51, 104, 114, 102, 29, 93, 77 },
+ { 107, 54, 32, 26, 51, 1, 81, 43, 31 },
+ { 39, 28, 85, 171, 58, 165, 90, 98, 64 },
+ { 34, 22, 116, 206, 23, 34, 43, 166, 73 },
+ { 68, 25, 106, 22, 64, 171, 36, 225, 114 },
+ { 34, 19, 21, 102, 132, 188, 16, 76, 124 },
+ { 62, 18, 78, 95, 85, 57, 50, 48, 51 } },
+ { { 193, 101, 35, 159, 215, 111, 89, 46, 111 },
+ { 60, 148, 31, 172, 219, 228, 21, 18, 111 },
+ { 112, 113, 77, 85, 179, 255, 38, 120, 114 },
+ { 40, 42, 1, 196, 245, 209, 10, 25, 109 },
+ { 100, 80, 8, 43, 154, 1, 51, 26, 71 },
+ { 88, 43, 29, 140, 166, 213, 37, 43, 154 },
+ { 61, 63, 30, 155, 67, 45, 68, 1, 209 },
+ { 142, 78, 78, 16, 255, 128, 34, 197, 171 },
+ { 41, 40, 5, 102, 211, 183, 4, 1, 221 },
+ { 51, 50, 17, 168, 209, 192, 23, 25, 82 } },
+ { { 125, 98, 42, 88, 104, 85, 117, 175, 82 },
+ { 95, 84, 53, 89, 128, 100, 113, 101, 45 },
+ { 75, 79, 123, 47, 51, 128, 81, 171, 1 },
+ { 57, 17, 5, 71, 102, 57, 53, 41, 49 },
+ { 115, 21, 2, 10, 102, 255, 166, 23, 6 },
+ { 38, 33, 13, 121, 57, 73, 26, 1, 85 },
+ { 41, 10, 67, 138, 77, 110, 90, 47, 114 },
+ { 101, 29, 16, 10, 85, 128, 101, 196, 26 },
+ { 57, 18, 10, 102, 102, 213, 34, 20, 43 },
+ { 117, 20, 15, 36, 163, 128, 68, 1, 26 } },
+ { { 138, 31, 36, 171, 27, 166, 38, 44, 229 },
+ { 67, 87, 58, 169, 82, 115, 26, 59, 179 },
+ { 63, 59, 90, 180, 59, 166, 93, 73, 154 },
+ { 40, 40, 21, 116, 143, 209, 34, 39, 175 },
+ { 57, 46, 22, 24, 128, 1, 54, 17, 37 },
+ { 47, 15, 16, 183, 34, 223, 49, 45, 183 },
+ { 46, 17, 33, 183, 6, 98, 15, 32, 183 },
+ { 65, 32, 73, 115, 28, 128, 23, 128, 205 },
+ { 40, 3, 9, 115, 51, 192, 18, 6, 223 },
+ { 87, 37, 9, 115, 59, 77, 64, 21, 47 } },
+ { { 104, 55, 44, 218, 9, 54, 53, 130, 226 },
+ { 64, 90, 70, 205, 40, 41, 23, 26, 57 },
+ { 54, 57, 112, 184, 5, 41, 38, 166, 213 },
+ { 30, 34, 26, 133, 152, 116, 10, 32, 134 },
+ { 75, 32, 12, 51, 192, 255, 160, 43, 51 },
+ { 39, 19, 53, 221, 26, 114, 32, 73, 255 },
+ { 31, 9, 65, 234, 2, 15, 1, 118, 73 },
+ { 88, 31, 35, 67, 102, 85, 55, 186, 85 },
+ { 56, 21, 23, 111, 59, 205, 45, 37, 192 },
+ { 55, 38, 70, 124, 73, 102, 1, 34, 98 } },
+ { { 102, 61, 71, 37, 34, 53, 31, 243, 192 },
+ { 69, 60, 71, 38, 73, 119, 28, 222, 37 },
+ { 68, 45, 128, 34, 1, 47, 11, 245, 171 },
+ { 62, 17, 19, 70, 146, 85, 55, 62, 70 },
+ { 75, 15, 9, 9, 64, 255, 184, 119, 16 },
+ { 37, 43, 37, 154, 100, 163, 85, 160, 1 },
+ { 63, 9, 92, 136, 28, 64, 32, 201, 85 },
+ { 86, 6, 28, 5, 64, 255, 25, 248, 1 },
+ { 56, 8, 17, 132, 137, 255, 55, 116, 128 },
+ { 58, 15, 20, 82, 135, 57, 26, 121, 40 } },
+ { { 164, 50, 31, 137, 154, 133, 25, 35, 218 },
+ { 51, 103, 44, 131, 131, 123, 31, 6, 158 },
+ { 86, 40, 64, 135, 148, 224, 45, 183, 128 },
+ { 22, 26, 17, 131, 240, 154, 14, 1, 209 },
+ { 83, 12, 13, 54, 192, 255, 68, 47, 28 },
+ { 45, 16, 21, 91, 64, 222, 7, 1, 197 },
+ { 56, 21, 39, 155, 60, 138, 23, 102, 213 },
+ { 85, 26, 85, 85, 128, 128, 32, 146, 171 },
+ { 18, 11, 7, 63, 144, 171, 4, 4, 246 },
+ { 35, 27, 10, 146, 174, 171, 12, 26, 128 } },
+ { { 190, 80, 35, 99, 180, 80, 126, 54, 45 },
+ { 85, 126, 47, 87, 176, 51, 41, 20, 32 },
+ { 101, 75, 128, 139, 118, 146, 116, 128, 85 },
+ { 56, 41, 15, 176, 236, 85, 37, 9, 62 },
+ { 146, 36, 19, 30, 171, 255, 97, 27, 20 },
+ { 71, 30, 17, 119, 118, 255, 17, 18, 138 },
+ { 101, 38, 60, 138, 55, 70, 43, 26, 142 },
+ { 138, 45, 61, 62, 219, 1, 81, 188, 64 },
+ { 32, 41, 20, 117, 151, 142, 20, 21, 163 },
+ { 112, 19, 12, 61, 195, 128, 48, 4, 24 } } };
+
+ static int vp8CoefUpdateProbs[][][][] = new int[][][][] {
+ {
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255,
+ 255 },
+ { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255,
+ 255 },
+
+ { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } } },
+ {
+ {
+ { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255,
+ 255 },
+ { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } } },
+ {
+ {
+ { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255,
+ 255 } },
+ {
+
+ { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } } },
+ {
+ {
+ { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+
+ { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } },
+ {
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 },
+ { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255 } } } };
+
+ public static int[][][][] getDefaultCoefProbs() {
+ int r[][][][] = new int[vp8DefaultCoefProbs.length][vp8DefaultCoefProbs[0].length][vp8DefaultCoefProbs[0][0].length][vp8DefaultCoefProbs[0][0][0].length];
+ for (int i = 0; i < vp8DefaultCoefProbs.length; i++)
+ for (int j = 0; j < vp8DefaultCoefProbs[0].length; j++)
+ for (int k = 0; k < vp8DefaultCoefProbs[0][0].length; k++)
+ for (int l = 0; l < vp8DefaultCoefProbs[0][0][0].length; l++)
+ r[i][j][k][l] = vp8DefaultCoefProbs[i][j][k][l];
+ return r;
+ }
+
+ private static int vp8DefaultCoefProbs[][][][] = new int[][][][] {
+ {
+ {
+ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128,
+ 128 },
+ { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128,
+ 128 },
+ { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128,
+ 128 } },
+ {
+ { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128,
+ 128 },
+ { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128,
+ 128 },
+ { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128,
+ 128 } },
+ {
+ { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128,
+ 128 },
+ { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128,
+ 128 },
+ { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128,
+ 128 },
+ { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128,
+ 128 },
+ { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128,
+ 128 } },
+ {
+
+ { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128,
+ 128 },
+ { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128,
+ 128 },
+ { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128,
+ 128 },
+ { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128,
+ 128 },
+ { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
+ { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 } } },
+ {
+ {
+ { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155,
+ 62 },
+ { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221,
+ 1 },
+ { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223,
+ 128 } },
+ {
+ { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128,
+ 128 },
+ { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128,
+ 128 },
+ { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255,
+ 128 } },
+ {
+ { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255,
+ 128 },
+ { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128,
+ 128 },
+ { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255,
+ 128 } },
+ {
+ { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128,
+ 128 },
+ { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128,
+ 128 },
+ { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128,
+ 128 } },
+ {
+ { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128,
+ 128 },
+ { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128,
+ 128 },
+ { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128,
+ 128 } },
+ {
+ { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128,
+ 128 },
+ { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128,
+ 128 },
+ { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128,
+ 128 } },
+ {
+ { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128,
+ 128 },
+ { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128,
+ 128 },
+ { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128,
+ 128 } },
+ {
+ { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 },
+ { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128,
+ 128 },
+ { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128,
+ 128 } } },
+
+ {
+ {
+ { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128,
+ 128 },
+ { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255,
+ 128 },
+ { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234,
+ 128 } },
+ {
+ { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128,
+ 128 },
+ { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128,
+ 128 },
+ { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128,
+ 128 } },
+ {
+ { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128,
+ 128 },
+ { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128,
+ 128 },
+ { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128,
+ 128 } },
+ {
+ { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128,
+ 128 },
+ { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128,
+ 128 },
+ { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128,
+ 128 },
+ { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128,
+ 128 },
+ { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128,
+ 128 },
+ { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128,
+ 128 },
+ { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 } },
+ {
+ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 } } },
+ {
+ {
+ { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175,
+ 255 },
+ { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187,
+ 128 },
+ { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216,
+ 128 } },
+ {
+ { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255,
+ 128 },
+ { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128,
+ 128 },
+ { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255,
+ 128 } },
+ {
+ { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255,
+ 128 },
+ { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255,
+ 128 },
+ { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255,
+ 128 }
+
+ },
+ {
+ { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128,
+ 128 },
+ { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128,
+ 128 },
+ { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255,
+ 128 } },
+ {
+ { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128,
+ 128 },
+ { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128,
+ 128 },
+ { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128,
+ 128 } },
+ {
+ { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128,
+ 128 },
+ { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128,
+ 128 },
+ { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128,
+ 128 } },
+ {
+ { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128,
+ 128 },
+ { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128,
+ 128 },
+ { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128,
+ 128 } },
+ {
+ { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },
+ { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128,
+ 128 } } } };
+
+ public static final int DCT_0 = 0; /* value 0 */
+ public static final int DCT_1 = 1; /* 1 */
+ public static final int DCT_2 = 2; /* 2 */
+ public static final int DCT_3 = 3; /* 3 */
+ public static final int DCT_4 = 4; /* 4 */
+ public static final int dct_cat1 = 5; /* range 5 - 6 (size 2) */
+ public static final int dct_cat2 = 6; /* 7 - 10 (4) */
+ public static final int dct_cat3 = 7; /* 11 - 18 (8) */
+ public static final int dct_cat4 = 8; /* 19 - 34 (16) */
+ public static final int dct_cat5 = 9; /* 35 - 66 (32) */
+ public static final int dct_cat6 = 10; /* 67 - 2048 (1982) */
+ public static final int dct_eob = 11; /* end of block */
+
+ public static final int vp8CoefTree[] = { -dct_eob, 2, /* eob = "0" */
+ -DCT_0, 4, /* 0 = "10" */
+ -DCT_1, 6, /* 1 = "110" */
+ 8, 12, -DCT_2, 10, /* 2 = "11100" */
+ -DCT_3, -DCT_4, /* 3 = "111010", 4 = "111011" */
+ 14, 16, -dct_cat1, -dct_cat2, /* cat1 = "111100", cat2 = "111101" */
+ 18, 20, -dct_cat3, -dct_cat4, /* cat3 = "1111100", cat4 = "1111101" */
+ -dct_cat5, -dct_cat6 /* cat4 = "1111110", cat4 = "1111111" */
+ };
+
+ public static final int vp8CoefTreeNoEOB[] = {
+ // -dct_eob, 2, /* eob = "0" */
+ -DCT_0, 4, /* 0 = "10" */
+ -DCT_1, 6, /* 1 = "110" */
+ 8, 12, -DCT_2, 10, /* 2 = "11100" */
+ -DCT_3, -DCT_4, /* 3 = "111010", 4 = "111011" */
+ 14, 16, -dct_cat1, -dct_cat2, /* cat1 = "111100", cat2 = "111101" */
+ 18, 20, -dct_cat3, -dct_cat4, /* cat3 = "1111100", cat4 = "1111101" */
+ -dct_cat5, -dct_cat6 /* cat4 = "1111110", cat4 = "1111111" */
+ };
+
+ public final static int Pcat1[] = { 159, 0 };
+ public final static int Pcat2[] = { 165, 145, 0 };
+ public final static int Pcat3[] = { 173, 148, 140, 0 };
+ public final static int Pcat4[] = { 176, 155, 140, 135, 0 };
+ public final static int Pcat5[] = { 180, 157, 141, 134, 130, 0 };
+ public final static int Pcat6[] = { 254, 254, 243, 230, 196, 177, 153, 140,
+ 133, 130, 129, 0 };
+ public static final int vp8CoefBands[] = { 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6,
+ 6, 6, 6, 6, 7 };
+ public static final int vp8defaultZigZag1d[] = { 0, 1, 4, 8, 5, 2, 3, 6, 9,
+ 12, 13, 10, 7, 11, 14, 15, };
+
+ public static final int vp8dxBitreaderNorm[] = { 0, 7, 6, 6, 5, 5, 5, 5, 4,
+ 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 };
+
+ public static final int vp8DcQLookup[] = { 4, 5, 6, 7, 8, 9, 10, 10, 11,
+ 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23,
+ 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112,
+ 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140,
+ 143, 145, 148, 151, 154, 157, };
+
+ public static final int vp8AcQLookup[] = { 4, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68,
+ 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100,
+ 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131,
+ 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170,
+ 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221,
+ 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284, };
+
+ public static String toHex(int c) {
+ String r = new String();
+ r = String.format("%1$#x ", c);
+ return r;
+ }
+
+ // clamp between 0 and value
+ public static int clamp(int input, int value) {
+ int r = input;
+ if (r > value)
+ r = value;
+ if (r < 0)
+ r = 0;
+ return r;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/webp/IDCT.java b/src/net/sourceforge/plantuml/webp/IDCT.java
new file mode 100644
index 0000000..3b9097f
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/IDCT.java
@@ -0,0 +1,172 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+public class IDCT {
+ /* IDCT implementation */
+ private static final int cospi8sqrt2minus1 = 20091;
+
+ private static final int sinpi8sqrt2 = 35468;
+
+ public static int[][] idct4x4llm(int input[]) {
+
+ int i;
+ int a1, b1, c1, d1;
+ int offset = 0;
+
+ int[] output = new int[16];
+ int temp1, temp2;
+
+ for (i = 0; i < 4; i++) {
+ a1 = input[offset + 0] + input[offset + 8];
+ b1 = input[offset + 0] - input[offset + 8];
+
+ temp1 = (input[offset + 4] * sinpi8sqrt2) >> 16;
+ temp2 = input[offset + 12]
+ + ((input[offset + 12] * cospi8sqrt2minus1) >> 16);
+
+ c1 = temp1 - temp2;
+
+ temp1 = input[offset + 4]
+ + ((input[offset + 4] * cospi8sqrt2minus1) >> 16);
+ temp2 = (input[offset + 12] * sinpi8sqrt2) >> 16;
+ d1 = temp1 + temp2;
+
+ output[offset + (0 * 4)] = a1 + d1;
+ output[offset + (3 * 4)] = a1 - d1;
+ output[offset + (1 * 4)] = b1 + c1;
+ output[offset + (2 * 4)] = b1 - c1;
+
+ offset++;
+ }
+
+ int diffo = 0;
+ int diff[][] = new int[4][4];
+ offset = 0;
+ for (i = 0; i < 4; i++) {
+ a1 = output[(offset * 4) + 0] + output[(offset * 4) + 2];
+ b1 = output[(offset * 4) + 0] - output[(offset * 4) + 2];
+
+ temp1 = (output[(offset * 4) + 1] * sinpi8sqrt2) >> 16;
+ temp2 = output[(offset * 4) + 3]
+ + ((output[(offset * 4) + 3] * cospi8sqrt2minus1) >> 16);
+ c1 = temp1 - temp2;
+
+ temp1 = output[(offset * 4) + 1]
+ + ((output[(offset * 4) + 1] * cospi8sqrt2minus1) >> 16);
+ temp2 = (output[(offset * 4) + 3] * sinpi8sqrt2) >> 16;
+ d1 = temp1 + temp2;
+
+ output[(offset * 4) + 0] = (a1 + d1 + 4) >> 3;
+ output[(offset * 4) + 3] = (a1 - d1 + 4) >> 3;
+ output[(offset * 4) + 1] = (b1 + c1 + 4) >> 3;
+ output[(offset * 4) + 2] = (b1 - c1 + 4) >> 3;
+
+ diff[0][diffo] = (a1 + d1 + 4) >> 3;
+ diff[3][diffo] = (a1 - d1 + 4) >> 3;
+ diff[1][diffo] = (b1 + c1 + 4) >> 3;
+ diff[2][diffo] = (b1 - c1 + 4) >> 3;
+
+ offset++;
+ diffo++;
+ }
+
+ return diff;
+
+ }
+
+ public static int[][] iwalsh4x4(int input[]) {
+ int i;
+ int a1, b1, c1, d1;
+ int a2, b2, c2, d2;
+
+ int[] output = new int[16];
+ int diff[][] = new int[4][4];
+ int offset = 0;
+ for (i = 0; i < 4; i++) {
+ a1 = input[offset + 0] + input[offset + 12];
+ b1 = input[offset + 4] + input[offset + 8];
+ c1 = input[offset + 4] - input[offset + 8];
+ d1 = input[offset + 0] - input[offset + 12];
+
+ output[offset + 0] = a1 + b1;
+ output[offset + 4] = c1 + d1;
+ output[offset + 8] = a1 - b1;
+ output[offset + 12] = d1 - c1;
+ offset++;
+ }
+
+ offset = 0;
+
+ for (i = 0; i < 4; i++) {
+ a1 = output[offset + 0] + output[offset + 3];
+ b1 = output[offset + 1] + output[offset + 2];
+ c1 = output[offset + 1] - output[offset + 2];
+ d1 = output[offset + 0] - output[offset + 3];
+
+ a2 = a1 + b1;
+ b2 = c1 + d1;
+ c2 = a1 - b1;
+ d2 = d1 - c1;
+ output[offset + 0] = (a2 + 3) >> 3;
+ output[offset + 1] = (b2 + 3) >> 3;
+ output[offset + 2] = (c2 + 3) >> 3;
+ output[offset + 3] = (d2 + 3) >> 3;
+ diff[0][i] = (a2 + 3) >> 3;
+ diff[1][i] = (b2 + 3) >> 3;
+ diff[2][i] = (c2 + 3) >> 3;
+ diff[3][i] = (d2 + 3) >> 3;
+ offset += 4;
+ }
+
+ return diff;
+
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/LoopFilter.java b/src/net/sourceforge/plantuml/webp/LoopFilter.java
new file mode 100644
index 0000000..9b070c5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/LoopFilter.java
@@ -0,0 +1,656 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+public class LoopFilter {
+ private static int abs(int v) {
+ return v < 0 ? -v : v;
+ }
+
+ private static int c(int v) {
+ // return (int) (v < -128 ? -128 : (v > 127 ? v : 127));
+ int r = v;
+ if (v < -128)
+ r = -128;
+ if (v > 127)
+ r = 127;
+ return r;
+ }
+
+ private static int common_adjust(boolean use_outer_taps, /*
+ * filter is 2 or 4
+ * taps wide
+ */
+ Segment seg) {
+ int p1 = u2s(seg.P1); /* retrieve and convert all 4 pixels */
+ int p0 = u2s(seg.P0);
+ int q0 = u2s(seg.Q0);
+ int q1 = u2s(seg.Q1);
+
+ /*
+ * Disregarding clamping, when "use_outer_taps" is false, "a" is
+ * 3*(q0-p0). Since we are about to divide "a" by 8, in this case we end
+ * up multiplying the edge difference by 5/8. When "use_outer_taps" is
+ * true (as for the simple filter), "a" is p1 - 3*p0 + 3*q0 - q1, which
+ * can be thought of as a refinement of 2*(q0 - p0) and the adjustment
+ * is something like (q0 - p0)/4.
+ */
+ int a = c((use_outer_taps ? c(p1 - q1) : 0) + 3 * (q0 - p0));
+ /*
+ * b is used to balance the rounding of a/8 in the case where the
+ * "fractional" part "f" of a/8 is exactly 1/2.
+ */
+ int b = (c(a + 3)) >> 3;
+ /*
+ * Divide a by 8, rounding up when f >= 1/2. Although not strictly part
+ * of the "C" language, the right-shift is assumed to propagate the sign
+ * bit.
+ */
+ a = c(a + 4) >> 3;
+ /* Subtract "a" from q0, "bringing it closer" to p0. */
+ seg.Q0 = s2u(q0 - a);
+ /*
+ * Add "a" (with adjustment "b") to p0, "bringing it closer" to q0. The
+ * clamp of "a+b", while present in the reference decoder, is
+ * superfluous; we have -16 <= a <= 15 at this point.
+ */
+ seg.P0 = s2u(p0 + b);
+
+ return a;
+ }
+
+ /*
+ * All functions take (among other things) a segment (of length at most 4 +
+ * 4 = 8) symmetrically straddling an edge. The pixel values (or pointers)
+ * are always given in order, from the "beforemost" to the "aftermost". So,
+ * for a horizontal edge (written "|"), an 8-pixel segment would be ordered
+ * p3 p2 p1 p0 | q0 q1 q2 q3.
+ */
+ /*
+ * Filtering is disabled if the difference between any two adjacent
+ * "interior" pixels in the 8-pixel segment exceeds the relevant threshold
+ * (I). A more complex thresholding calculation is done for the group of
+ * four pixels that straddle the edge, in line with the calculation in
+ * simple_segment() above.
+ */
+ public static boolean filter_yes(int I, /* limit on interior differences */
+ int E, /* limit at the edge */
+ int p3, int p2, int p1, int p0, /* pixels before edge */
+ int q0, int q1, int q2, int q3 /* pixels after edge */
+ ) {
+ return (abs(p0 - q0) * 2 + abs(p1 - q1) / 2) <= E && abs(p3 - p2) <= I
+ && abs(p2 - p1) <= I && abs(p1 - p0) <= I && abs(q3 - q2) <= I
+ && abs(q2 - q1) <= I && abs(q1 - q0) <= I;
+ }
+
+ private static Segment getSegH(SubBlock rsb, SubBlock lsb, int a) {
+ Segment seg = new Segment();
+ int[][] rdest = rsb.getDest();
+ int[][] ldest = lsb.getDest();
+ seg.P0 = ldest[3][a];
+ seg.P1 = ldest[2][a];
+ seg.P2 = ldest[1][a];
+ seg.P3 = ldest[0][a];
+ seg.Q0 = rdest[0][a];
+ seg.Q1 = rdest[1][a];
+ seg.Q2 = rdest[2][a];
+ seg.Q3 = rdest[3][a];
+ return seg;
+ }
+
+ private static Segment getSegV(SubBlock bsb, SubBlock tsb, int a) {
+ Segment seg = new Segment();
+ int[][] bdest = bsb.getDest();
+ int[][] tdest = tsb.getDest();
+
+ seg.P0 = tdest[a][3];
+ seg.P1 = tdest[a][2];
+ seg.P2 = tdest[a][1];
+ seg.P3 = tdest[a][0];
+ seg.Q0 = bdest[a][0];
+ seg.Q1 = bdest[a][1];
+ seg.Q2 = bdest[a][2];
+ seg.Q3 = bdest[a][3];
+ return seg;
+ }
+
+ /*
+ * Filtering is altered if (at least) one of the differences on either side
+ * of the edge exceeds a threshold (we have "high edge variance").
+ */
+ public static boolean hev(int threshold, int p1, int p0, /*
+ * pixels before
+ * edge
+ */
+ int q0, int q1 /* pixels after edge */
+ ) {
+ return abs(p1 - p0) > threshold || abs(q1 - q0) > threshold;
+ }
+
+ public static void loopFilter(VP8Frame frame) {
+ frame.fireLFProgressUpdate(0);
+ if (frame.getFilterType() == 2) {
+ loopFilterUV(frame);
+ frame.fireLFProgressUpdate(50);
+ loopFilterY(frame);
+ } else if (frame.getFilterType() == 1) {
+ loopFilterSimple(frame);
+ }
+ frame.fireLFProgressUpdate(100);
+ }
+
+ public static void loopFilterSimple(VP8Frame frame) {
+ for (int y = 0; y < frame.getMacroBlockRows(); y++) {
+ frame.fireLFProgressUpdate((100.0f * ((float) (y + 1) / (float) (frame
+ .getMacroBlockRows()))));
+ for (int x = 0; x < frame.getMacroBlockCols(); x++) {
+ // System.out.println("x: "+x+" y: "+y);
+ MacroBlock rmb = frame.getMacroBlock(x, y);
+ MacroBlock bmb = frame.getMacroBlock(x, y);
+
+ int loop_filter_level = rmb.getFilterLevel();
+ if(loop_filter_level!=0) {
+ int interior_limit = rmb.getFilterLevel();
+
+ int sharpnessLevel = frame.getSharpnessLevel();
+ if (sharpnessLevel > 0) {
+ interior_limit >>= sharpnessLevel > 4 ? 2 : 1;
+ if (interior_limit > 9 - sharpnessLevel)
+ interior_limit = 9 - sharpnessLevel;
+ }
+ if (interior_limit == 0)
+ interior_limit = 1;
+
+ /* Luma and Chroma use the same inter-subblock edge limit */
+ int sub_bedge_limit = (loop_filter_level * 2) + interior_limit;
+ if(sub_bedge_limit < 1)
+ sub_bedge_limit = 1;
+
+ /* Luma and Chroma use the same inter-macroblock edge limit */
+ int mbedge_limit = sub_bedge_limit+4;
+
+ // left
+ if (x > 0) {
+ MacroBlock lmb = frame.getMacroBlock(x - 1, y);
+ for (int b = 0; b < 4; b++) {
+ SubBlock rsb = rmb.getSubBlock(SubBlock.PLANE.Y1, 0, b);
+ SubBlock lsb = lmb.getSubBlock(SubBlock.PLANE.Y1, 3, b);
+ for (int a = 0; a < 4; a++) {
+ Segment seg = getSegH(rsb, lsb, a);
+ // MBfilter(hev_threshold, interior_limit,
+ // mbedge_limit, seg);
+ // System.out.println(mbedge_limit);
+ simple_segment(mbedge_limit, seg);
+ setSegH(rsb, lsb, seg, a);
+ }
+ }
+ }
+
+ // sb left
+ if (!rmb.isSkip_inner_lf()) {
+
+ for (int a = 1; a < 4; a++) {
+ for (int b = 0; b < 4; b++) {
+ SubBlock lsb = rmb.getSubBlock(SubBlock.PLANE.Y1,
+ a - 1, b);
+ SubBlock rsb = rmb.getSubBlock(SubBlock.PLANE.Y1,
+ a, b);
+ for (int c = 0; c < 4; c++) {
+ // System.out.println("sbleft a:"+a+" b:"+b+" c:"+c);
+ Segment seg = getSegH(rsb, lsb, c);
+ simple_segment(sub_bedge_limit, seg);
+ // System.out.println(sub_bedge_limit);
+ // subblock_filter(hev_threshold,interior_limit,sub_bedge_limit,
+ // seg);
+ setSegH(rsb, lsb, seg, c);
+ }
+ }
+ }
+ }
+
+ // top
+ if (y > 0) {
+ MacroBlock tmb = frame.getMacroBlock(x, y - 1);
+ for (int b = 0; b < 4; b++) {
+ SubBlock tsb = tmb.getSubBlock(SubBlock.PLANE.Y1, b, 3);
+ SubBlock bsb = bmb.getSubBlock(SubBlock.PLANE.Y1, b, 0);
+ for (int a = 0; a < 4; a++) {
+ Segment seg = getSegV(bsb, tsb, a);
+ simple_segment(mbedge_limit, seg);
+ // System.out.println(mbedge_limit);
+ // MBfilter(hev_threshold, interior_limit,
+ // mbedge_limit, seg);
+ setSegV(bsb, tsb, seg, a);
+ }
+ }
+ }
+
+ // sb top
+ if (!rmb.isSkip_inner_lf()) {
+ for (int a = 1; a < 4; a++) {
+ for (int b = 0; b < 4; b++) {
+ SubBlock tsb = bmb.getSubBlock(SubBlock.PLANE.Y1,
+ b, a - 1);
+ SubBlock bsb = bmb.getSubBlock(SubBlock.PLANE.Y1,
+ b, a);
+ for (int c = 0; c < 4; c++) {
+ // System.out.println("sbtop");
+ Segment seg = getSegV(bsb, tsb, c);
+ simple_segment(sub_bedge_limit, seg);
+ // System.out.println(sub_bedge_limit);
+ // subblock_filter(hev_threshold,interior_limit,sub_bedge_limit,
+ // seg);
+ setSegV(bsb, tsb, seg, c);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static void loopFilterUV(VP8Frame frame) {
+ for (int y = 0; y < frame.getMacroBlockRows(); y++) {
+ frame.fireLFProgressUpdate((100.0f * ((float) (y + 1) / (float) (frame
+ .getMacroBlockRows()))) / 2);
+ for (int x = 0; x < frame.getMacroBlockCols(); x++) {
+ MacroBlock rmb = frame.getMacroBlock(x, y);
+ MacroBlock bmb = frame.getMacroBlock(x, y);
+ int sharpnessLevel = frame.getSharpnessLevel();
+ int loop_filter_level = rmb.getFilterLevel();
+ if(loop_filter_level!=0) {
+ int interior_limit = rmb.getFilterLevel();
+ if (sharpnessLevel > 0) {
+ interior_limit >>= sharpnessLevel > 4 ? 2 : 1;
+ if (interior_limit > 9 - sharpnessLevel)
+ interior_limit = 9 - sharpnessLevel;
+ }
+ if (interior_limit == 0)
+ interior_limit = 1;
+
+ int hev_threshold = 0;
+ if (frame.getFrameType() == 0) /* current frame is a key frame */
+ {
+ if (loop_filter_level >= 40)
+ hev_threshold = 2;
+ else if (loop_filter_level >= 15)
+ hev_threshold = 1;
+ } else /* current frame is an interframe */
+ {
+ if (loop_filter_level >= 40)
+ hev_threshold = 3;
+ else if (loop_filter_level >= 20)
+ hev_threshold = 2;
+ else if (loop_filter_level >= 15)
+ hev_threshold = 1;
+ }
+
+ /* Luma and Chroma use the same inter-macroblock edge limit */
+ int mbedge_limit = ((loop_filter_level + 2) * 2)
+ + interior_limit;
+ /* Luma and Chroma use the same inter-subblock edge limit */
+ int sub_bedge_limit = (loop_filter_level * 2) + interior_limit;
+
+ if (x > 0) {
+ MacroBlock lmb = frame.getMacroBlock(x - 1, y);
+ for (int b = 0; b < 2; b++) {
+ SubBlock rsbU = rmb.getSubBlock(SubBlock.PLANE.U, 0, b);
+ SubBlock lsbU = lmb.getSubBlock(SubBlock.PLANE.U, 1, b);
+ SubBlock rsbV = rmb.getSubBlock(SubBlock.PLANE.V, 0, b);
+ SubBlock lsbV = lmb.getSubBlock(SubBlock.PLANE.V, 1, b);
+ for (int a = 0; a < 4; a++) {
+ Segment seg = getSegH(rsbU, lsbU, a);
+ MBfilter(hev_threshold, interior_limit,
+ mbedge_limit, seg);
+ setSegH(rsbU, lsbU, seg, a);
+ seg = getSegH(rsbV, lsbV, a);
+ MBfilter(hev_threshold, interior_limit,
+ mbedge_limit, seg);
+ setSegH(rsbV, lsbV, seg, a);
+
+ }
+ }
+ }
+ // sb left
+
+ if (!rmb.isSkip_inner_lf()) {
+ for (int a = 1; a < 2; a++) {
+ for (int b = 0; b < 2; b++) {
+ SubBlock lsbU = rmb.getSubBlock(SubBlock.PLANE.U,
+ a - 1, b);
+ SubBlock rsbU = rmb.getSubBlock(SubBlock.PLANE.U,
+ a, b);
+ SubBlock lsbV = rmb.getSubBlock(SubBlock.PLANE.V,
+ a - 1, b);
+ SubBlock rsbV = rmb.getSubBlock(SubBlock.PLANE.V,
+ a, b);
+ for (int c = 0; c < 4; c++) {
+ Segment seg = getSegH(rsbU, lsbU, c);
+ subblock_filter(hev_threshold, interior_limit,
+ sub_bedge_limit, seg);
+ setSegH(rsbU, lsbU, seg, c);
+ seg = getSegH(rsbV, lsbV, c);
+ subblock_filter(hev_threshold, interior_limit,
+ sub_bedge_limit, seg);
+ setSegH(rsbV, lsbV, seg, c);
+ }
+ }
+ }
+ }
+ // top
+ if (y > 0) {
+ MacroBlock tmb = frame.getMacroBlock(x, y - 1);
+ for (int b = 0; b < 2; b++) {
+ SubBlock tsbU = tmb.getSubBlock(SubBlock.PLANE.U, b, 1);
+ SubBlock bsbU = bmb.getSubBlock(SubBlock.PLANE.U, b, 0);
+ SubBlock tsbV = tmb.getSubBlock(SubBlock.PLANE.V, b, 1);
+ SubBlock bsbV = bmb.getSubBlock(SubBlock.PLANE.V, b, 0);
+ for (int a = 0; a < 4; a++) {
+ // System.out.println("l");
+ Segment seg = getSegV(bsbU, tsbU, a);
+ MBfilter(hev_threshold, interior_limit,
+ mbedge_limit, seg);
+ setSegV(bsbU, tsbU, seg, a);
+ seg = getSegV(bsbV, tsbV, a);
+ MBfilter(hev_threshold, interior_limit,
+ mbedge_limit, seg);
+ setSegV(bsbV, tsbV, seg, a);
+ }
+ }
+ }
+ // sb top
+
+ if (!rmb.isSkip_inner_lf()) {
+ for (int a = 1; a < 2; a++) {
+ for (int b = 0; b < 2; b++) {
+ SubBlock tsbU = bmb.getSubBlock(SubBlock.PLANE.U,
+ b, a - 1);
+ SubBlock bsbU = bmb.getSubBlock(SubBlock.PLANE.U,
+ b, a);
+ SubBlock tsbV = bmb.getSubBlock(SubBlock.PLANE.V,
+ b, a - 1);
+ SubBlock bsbV = bmb.getSubBlock(SubBlock.PLANE.V,
+ b, a);
+ for (int c = 0; c < 4; c++) {
+ Segment seg = getSegV(bsbU, tsbU, c);
+ subblock_filter(hev_threshold, interior_limit,
+ sub_bedge_limit, seg);
+ setSegV(bsbU, tsbU, seg, c);
+ seg = getSegV(bsbV, tsbV, c);
+ subblock_filter(hev_threshold, interior_limit,
+ sub_bedge_limit, seg);
+ setSegV(bsbV, tsbV, seg, c);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static void loopFilterY(VP8Frame frame) {
+ for (int y = 0; y < frame.getMacroBlockRows(); y++) {
+ frame.fireLFProgressUpdate(50 + (100.0f * ((float) (y + 1) / (float) (frame
+ .getMacroBlockRows()))) / 2);
+ for (int x = 0; x < frame.getMacroBlockCols(); x++) {
+ MacroBlock rmb = frame.getMacroBlock(x, y);
+ MacroBlock bmb = frame.getMacroBlock(x, y);
+ int sharpnessLevel = frame.getSharpnessLevel();
+ int loop_filter_level = rmb.getFilterLevel();
+
+ if(loop_filter_level!=0) {
+ int interior_limit = rmb.getFilterLevel();
+
+ if (sharpnessLevel > 0) {
+ interior_limit >>= sharpnessLevel > 4 ? 2 : 1;
+ if (interior_limit > 9 - sharpnessLevel)
+ interior_limit = 9 - sharpnessLevel;
+ }
+ if (interior_limit == 0)
+ interior_limit = 1;
+
+ int hev_threshold = 0;
+ if (frame.getFrameType() == 0) /* current frame is a key frame */
+ {
+ if (loop_filter_level >= 40)
+ hev_threshold = 2;
+ else if (loop_filter_level >= 15)
+ hev_threshold = 1;
+ } else /* current frame is an interframe */
+ {
+ if (loop_filter_level >= 40)
+ hev_threshold = 3;
+ else if (loop_filter_level >= 20)
+ hev_threshold = 2;
+ else if (loop_filter_level >= 15)
+ hev_threshold = 1;
+ }
+
+ /* Luma and Chroma use the same inter-macroblock edge limit */
+ int mbedge_limit = ((loop_filter_level + 2) * 2)
+ + interior_limit;
+ /* Luma and Chroma use the same inter-subblock edge limit */
+ int sub_bedge_limit = (loop_filter_level * 2) + interior_limit;
+
+ // left
+ if (x > 0) {
+ MacroBlock lmb = frame.getMacroBlock(x - 1, y);
+ for (int b = 0; b < 4; b++) {
+ SubBlock rsb = rmb.getSubBlock(SubBlock.PLANE.Y1, 0, b);
+ SubBlock lsb = lmb.getSubBlock(SubBlock.PLANE.Y1, 3, b);
+ for (int a = 0; a < 4; a++) {
+ Segment seg = getSegH(rsb, lsb, a);
+ MBfilter(hev_threshold, interior_limit,
+ mbedge_limit, seg);
+ setSegH(rsb, lsb, seg, a);
+ }
+ }
+ }
+ // sb left
+ if (!rmb.isSkip_inner_lf()) {
+ for (int a = 1; a < 4; a++) {
+ for (int b = 0; b < 4; b++) {
+ SubBlock lsb = rmb.getSubBlock(SubBlock.PLANE.Y1,
+ a - 1, b);
+ SubBlock rsb = rmb.getSubBlock(SubBlock.PLANE.Y1,
+ a, b);
+ for (int c = 0; c < 4; c++) {
+ // System.out.println("sbleft a:"+a+" b:"+b+" c:"+c);
+ Segment seg = getSegH(rsb, lsb, c);
+ subblock_filter(hev_threshold, interior_limit,
+ sub_bedge_limit, seg);
+ setSegH(rsb, lsb, seg, c);
+ }
+ }
+ }
+ }
+ // top
+ if (y > 0) {
+ MacroBlock tmb = frame.getMacroBlock(x, y - 1);
+ for (int b = 0; b < 4; b++) {
+ SubBlock tsb = tmb.getSubBlock(SubBlock.PLANE.Y1, b, 3);
+ SubBlock bsb = bmb.getSubBlock(SubBlock.PLANE.Y1, b, 0);
+ for (int a = 0; a < 4; a++) {
+ Segment seg = getSegV(bsb, tsb, a);
+ MBfilter(hev_threshold, interior_limit,
+ mbedge_limit, seg);
+ setSegV(bsb, tsb, seg, a);
+ }
+ }
+ }
+ // sb top
+ if (!rmb.isSkip_inner_lf()) {
+ for (int a = 1; a < 4; a++) {
+ for (int b = 0; b < 4; b++) {
+ SubBlock tsb = bmb.getSubBlock(SubBlock.PLANE.Y1,
+ b, a - 1);
+ SubBlock bsb = bmb.getSubBlock(SubBlock.PLANE.Y1,
+ b, a);
+ for (int c = 0; c < 4; c++) {
+ Segment seg = getSegV(bsb, tsb, c);
+ subblock_filter(hev_threshold, interior_limit,
+ sub_bedge_limit, seg);
+ setSegV(bsb, tsb, seg, c);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ static void MBfilter(int hev_threshold, /* detect high edge variance */
+ int interior_limit, /* possibly disable filter */
+ int edge_limit, Segment seg) {
+ int p3 = u2s(seg.P3), p2 = u2s(seg.P2), p1 = u2s(seg.P1), p0 = u2s(seg.P0);
+ int q0 = u2s(seg.Q0), q1 = u2s(seg.Q1), q2 = u2s(seg.Q2), q3 = u2s(seg.Q3);
+ if (filter_yes(interior_limit, edge_limit, q3, q2, q1, q0, p0, p1, p2,
+ p3)) {
+ if (!hev(hev_threshold, p1, p0, q0, q1)) {
+ // Same as the initial calculation in "common_adjust",
+ // w is something like twice the edge difference
+ int w = c(c(p1 - q1) + 3 * (q0 - p0));
+
+ // 9/64 is approximately 9/63 = 1/7 and 1<<7 = 128 = 2*64.
+ // So this a, used to adjust the pixels adjacent to the edge,
+ // is something like 3/7 the edge difference.
+ int a = (27 * w + 63) >> 7;
+
+ seg.Q0 = s2u(q0 - a);
+ seg.P0 = s2u(p0 + a);
+ // Next two are adjusted by 2/7 the edge difference
+ a = (18 * w + 63) >> 7;
+ // System.out.println("a: "+a);
+ seg.Q1 = s2u(q1 - a);
+ seg.P1 = s2u(p1 + a);
+ // Last two are adjusted by 1/7 the edge difference
+ a = (9 * w + 63) >> 7;
+ seg.Q2 = s2u(q2 - a);
+ seg.P2 = s2u(p2 + a);
+ } else
+ // if hev, do simple filter
+ common_adjust(true, seg); // using outer taps
+ }
+ }
+
+ /* Clamp, then convert signed number back to pixel value. */
+ private static int s2u(int v) {
+ return (int) (c(v) + 128);
+ }
+
+ private static void setSegH(SubBlock rsb, SubBlock lsb, Segment seg, int a) {
+ int[][] rdest = rsb.getDest();
+ int[][] ldest = lsb.getDest();
+ ldest[3][a] = seg.P0;
+ ldest[2][a] = seg.P1;
+ ldest[1][a] = seg.P2;
+ ldest[0][a] = seg.P3;
+ rdest[0][a] = seg.Q0;
+ rdest[1][a] = seg.Q1;
+ rdest[2][a] = seg.Q2;
+ rdest[3][a] = seg.Q3;
+
+ }
+
+ private static void setSegV(SubBlock bsb, SubBlock tsb, Segment seg, int a) {
+ int[][] bdest = bsb.getDest();
+ int[][] tdest = tsb.getDest();
+ tdest[a][3] = seg.P0;
+ tdest[a][2] = seg.P1;
+ tdest[a][1] = seg.P2;
+ tdest[a][0] = seg.P3;
+ bdest[a][0] = seg.Q0;
+ bdest[a][1] = seg.Q1;
+ bdest[a][2] = seg.Q2;
+ bdest[a][3] = seg.Q3;
+
+ }
+
+ private static void simple_segment(int edge_limit, /*
+ * do nothing if edge
+ * difference exceeds
+ * limit
+ */
+ Segment seg) {
+ if ((abs(seg.P0 - seg.Q0) * 2 + abs(seg.P1 - seg.Q1) / 2) <= edge_limit) {
+ common_adjust(true, seg); /* use outer taps */
+ } else {
+ }
+ }
+
+ public static void subblock_filter(int hev_threshold, /*
+ * detect high edge
+ * variance
+ */
+ int interior_limit, /* possibly disable filter */
+ int edge_limit, Segment seg) {
+ int p3 = u2s(seg.P3), p2 = u2s(seg.P2), p1 = u2s(seg.P1), p0 = u2s(seg.P0);
+ int q0 = u2s(seg.Q0), q1 = u2s(seg.Q1), q2 = u2s(seg.Q2), q3 = u2s(seg.Q3);
+ if (filter_yes(interior_limit, edge_limit, q3, q2, q1, q0, p0, p1, p2,
+ p3)) {
+ boolean hv = hev(hev_threshold, p1, p0, q0, q1);
+ int a = (common_adjust(hv, seg) + 1) >> 1;
+ if (!hv) {
+ seg.Q1 = s2u(q1 - a);
+ seg.P1 = s2u(p1 + a);
+ }
+ } else {
+ }
+
+ }
+
+ /* Convert pixel value (0 <= v <= 255) to an 8-bit signed number. */
+ private static int u2s(int v) {
+ return (int) (v - 128);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/MacroBlock.java b/src/net/sourceforge/plantuml/webp/MacroBlock.java
new file mode 100644
index 0000000..412fdeb
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/MacroBlock.java
@@ -0,0 +1,798 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.io.IOException;
+
+public class MacroBlock {
+
+ private int filterLevel;
+ private boolean keepDebugInfo = false;
+ private int segmentId;
+ private int skipCoeff;
+ private boolean skipInnerLoopFilter;
+ SubBlock[][] uSubBlocks;
+ private int uVFilterLevel;
+
+ private int uvMode;
+ SubBlock[][] vSubBlocks;
+ private int x, y;
+ SubBlock y2SubBlock;
+ private int yMode;
+ SubBlock[][] ySubBlocks;
+
+ MacroBlock(int x, int y, boolean keepDebugInfo) {
+ this.x = x - 1;
+ this.y = y - 1;
+ this.keepDebugInfo = keepDebugInfo;
+
+ ySubBlocks = new SubBlock[4][4];
+ uSubBlocks = new SubBlock[2][2];
+ vSubBlocks = new SubBlock[2][2];
+ SubBlock above = null;
+ SubBlock left = null;
+
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ left = null;
+ above = null;
+ if (j > 0)
+ left = ySubBlocks[j - 1][i];
+ if (i > 0)
+ above = ySubBlocks[j][i - 1];
+ ySubBlocks[j][i] = new SubBlock(this, above, left,
+ SubBlock.PLANE.Y1);
+ }
+ }
+
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ left = null;
+ above = null;
+ if (j > 0)
+ left = uSubBlocks[j - 1][i];
+ if (i > 0)
+ above = uSubBlocks[j][i - 1];
+ uSubBlocks[j][i] = new SubBlock(this, above, left,
+ SubBlock.PLANE.U);
+ }
+ }
+
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ left = null;
+ above = null;
+ if (j > 0)
+ left = vSubBlocks[j - 1][i];
+ if (i > 0)
+ above = vSubBlocks[j][i - 1];
+ vSubBlocks[j][i] = new SubBlock(this, above, left,
+ SubBlock.PLANE.V);
+ }
+ }
+ y2SubBlock = new SubBlock(this, null, null, SubBlock.PLANE.Y2);
+
+ }
+
+ public void decodeMacroBlock(VP8Frame frame) throws IOException {
+ MacroBlock mb = this;
+ if (mb.getSkipCoeff() > 0) {
+ if (mb.getYMode() != Globals.B_PRED)
+ mb.skipInnerLoopFilter = true;
+ } else if (mb.getYMode() != Globals.B_PRED) {
+ decodeMacroBlockTokens(frame, true);
+ } else {
+ decodeMacroBlockTokens(frame, false);
+ }
+ }
+
+ private void decodeMacroBlockTokens(VP8Frame frame, boolean withY2)
+ throws IOException {
+ skipInnerLoopFilter = false;
+ if (withY2) {
+ skipInnerLoopFilter = skipInnerLoopFilter
+ | decodePlaneTokens(frame, 1, SubBlock.PLANE.Y2, false);
+ }
+ skipInnerLoopFilter = skipInnerLoopFilter
+ | decodePlaneTokens(frame, 4, SubBlock.PLANE.Y1, withY2);
+ skipInnerLoopFilter = skipInnerLoopFilter
+ | decodePlaneTokens(frame, 2, SubBlock.PLANE.U, false);
+ skipInnerLoopFilter = skipInnerLoopFilter
+ | decodePlaneTokens(frame, 2, SubBlock.PLANE.V, false);
+ skipInnerLoopFilter = !skipInnerLoopFilter;
+ }
+
+ private boolean decodePlaneTokens(VP8Frame frame, int dimentions,
+ SubBlock.PLANE plane, boolean withY2) throws IOException {
+ MacroBlock mb = this;
+ boolean r = false;
+ for (int y = 0; y < dimentions; y++) {
+ for (int x = 0; x < dimentions; x++) {
+ int L = 0;
+ int A = 0;
+ int lc = 0;
+ SubBlock sb = mb.getSubBlock(plane, x, y);
+ SubBlock left = frame.getLeftSubBlock(sb, plane);
+ SubBlock above = frame.getAboveSubBlock(sb, plane);
+ if (left.hasNoZeroToken()) {
+
+ L = 1;
+ }
+
+ lc += L;
+
+ if (above.hasNoZeroToken()) {
+
+ A = 1;
+ }
+
+ lc += A;
+ sb.decodeSubBlock(frame.getTokenBoolDecoder(),
+ frame.getCoefProbs(), lc,
+ SubBlock.planeToType(plane, withY2), withY2);
+ r = r | sb.hasNoZeroToken();
+ }
+ }
+ return r;
+ }
+
+ public void dequantMacroBlock(VP8Frame frame) {
+ MacroBlock mb = this;
+ if (mb.getYMode() != Globals.B_PRED) {
+ SubBlock sb = mb.getY2SubBlock();
+ int acQValue = frame.getSegmentQuants().getSegQuants()[this.getSegmentId()]
+ .getY2ac_delta_q();
+ int dcQValue = frame.getSegmentQuants().getSegQuants()[this.getSegmentId()].getY2dc();
+
+ int input[] = new int[16];
+ input[0] = sb.getTokens()[0] * dcQValue;
+
+ for (int x = 1; x < 16; x++)
+ input[x] = sb.getTokens()[x] * acQValue;
+
+ sb.setDiff(IDCT.iwalsh4x4(input));
+ for (int j = 0; j < 4; j++) {
+ for (int i = 0; i < 4; i++) {
+ SubBlock ysb = mb.getYSubBlock(i, j);
+ ysb.dequantSubBlock(frame, sb.getDiff()[i][j]);
+ }
+ }
+
+ mb.predictY(frame);
+ mb.predictUV(frame);
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ SubBlock uvsb = mb.getUSubBlock(j, i);
+ uvsb.dequantSubBlock(frame, null);
+ uvsb = mb.getVSubBlock(i, j);
+ uvsb.dequantSubBlock(frame, null);
+ }
+ }
+ mb.recon_mb();
+
+ } else {
+ for (int j = 0; j < 4; j++) {
+ for (int i = 0; i < 4; i++) {
+ SubBlock sb = mb.getYSubBlock(i, j);
+ sb.dequantSubBlock(frame, null);
+ sb.predict(frame);
+ sb.reconstruct();
+ }
+ }
+ mb.predictUV(frame);
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ SubBlock sb = mb.getUSubBlock(j, i);
+ sb.dequantSubBlock(frame, null);
+ sb.reconstruct();
+ }
+ }
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ SubBlock sb = mb.getVSubBlock(j, i);
+ sb.dequantSubBlock(frame, null);
+ sb.reconstruct();
+ }
+ }
+ }
+ }
+
+ public void drawDebug() {
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++) {
+ SubBlock sb = ySubBlocks[i][0];
+ sb.drawDebugH();
+ sb = ySubBlocks[0][j];
+ sb.drawDebugV();
+ }
+ }
+
+ public SubBlock getBottomSubBlock(int x, SubBlock.PLANE plane) {
+ if (plane == SubBlock.PLANE.Y1) {
+ return ySubBlocks[x][3];
+ } else if (plane == SubBlock.PLANE.U) {
+ return uSubBlocks[x][1];
+ } else if (plane == SubBlock.PLANE.V) {
+ return vSubBlocks[x][1];
+ } else if (plane == SubBlock.PLANE.Y2) {
+ return y2SubBlock;
+ }
+ return null;
+ }
+
+ public String getDebugString() {
+ String r = new String();
+ r = r + " YMode: " + Globals.getModeAsString(yMode);
+ r = r + "\n UVMode: " + Globals.getModeAsString(uvMode);
+ r = r + "\n SegmentID: " + segmentId;
+ r = r + "\n Filter Level: " + filterLevel;
+ r = r + "\n UV Filter Level: " + uVFilterLevel;
+ r = r + "\n Skip Coeff: " + skipCoeff;
+
+ return r;
+ }
+
+ public int getFilterLevel() {
+ return this.filterLevel;
+ }
+
+ public SubBlock getLeftSubBlock(int y, SubBlock.PLANE plane) {
+ if (plane == SubBlock.PLANE.Y1) {
+ return ySubBlocks[0][y];
+ }
+
+ else if (plane == SubBlock.PLANE.V) {
+ return vSubBlocks[0][y];
+ }
+ if (plane == SubBlock.PLANE.Y2) {
+ return y2SubBlock;
+ } else if (plane == SubBlock.PLANE.U) {
+ return uSubBlocks[0][y];
+ }
+ return null;
+ }
+
+ public SubBlock getRightSubBlock(int y, SubBlock.PLANE plane) {
+ if (plane == SubBlock.PLANE.Y1) {
+ return ySubBlocks[3][y];
+ } else if (plane == SubBlock.PLANE.U) {
+ return uSubBlocks[1][y];
+ } else if (plane == SubBlock.PLANE.V) {
+ return vSubBlocks[1][y];
+ } else if (plane == SubBlock.PLANE.Y2) {
+ return y2SubBlock;
+ }
+ return null;
+ }
+
+ public int getSkipCoeff() {
+ return skipCoeff;
+ }
+
+ public SubBlock getSubBlock(SubBlock.PLANE plane, int i, int j) {
+ switch (plane) {
+ case Y1:
+ return getYSubBlock(i, j);
+ case U:
+ return getUSubBlock(i, j);
+
+ case V:
+ return getVSubBlock(i, j);
+ case Y2:
+ return getY2SubBlock();
+ }
+ return null;
+ }
+
+ public int getSubblockX(SubBlock sb) {
+ if (sb.getPlane() == SubBlock.PLANE.Y1) {
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++)
+ if (ySubBlocks[x][y] == sb)
+ return x;
+ } else if (sb.getPlane() == SubBlock.PLANE.U) {
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++)
+ if (uSubBlocks[x][y] == sb)
+ return x;
+ } else if (sb.getPlane() == SubBlock.PLANE.V) {
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++)
+ if (vSubBlocks[x][y] == sb)
+ return x;
+ } else if (sb.getPlane() == SubBlock.PLANE.Y2) {
+ return 0;
+ }
+
+ return -100;
+
+ }
+
+ public int getSubblockY(SubBlock sb) {
+ if (sb.getPlane() == SubBlock.PLANE.Y1) {
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++)
+ if (ySubBlocks[x][y] == sb)
+ return y;
+ } else if (sb.getPlane() == SubBlock.PLANE.U) {
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++)
+ if (uSubBlocks[x][y] == sb)
+ return y;
+ } else if (sb.getPlane() == SubBlock.PLANE.V) {
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++)
+ if (vSubBlocks[x][y] == sb)
+ return y;
+ } else if (sb.getPlane() == SubBlock.PLANE.Y2) {
+ return 0;
+ }
+
+ return -100;
+ }
+
+ public SubBlock getUSubBlock(int i, int j) {
+ return uSubBlocks[i][j];
+ }
+
+ public int getUVFilterLevel() {
+ return this.uVFilterLevel;
+ }
+
+ public int getUvMode() {
+ return uvMode;
+ }
+
+ public SubBlock getVSubBlock(int i, int j) {
+ return vSubBlocks[i][j];
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public SubBlock getY2SubBlock() {
+ return y2SubBlock;
+ }
+
+ public int getYMode() {
+ return yMode;
+ }
+
+ public SubBlock getYSubBlock(int i, int j) {
+ return ySubBlocks[i][j];
+ }
+
+ public boolean isKeepDebugInfo() {
+ return keepDebugInfo;
+ }
+
+ public boolean isSkip_inner_lf() {
+ return skipInnerLoopFilter;
+ }
+
+ public void predictUV(VP8Frame frame) {
+ MacroBlock aboveMb = frame.getMacroBlock(x, y - 1);
+ MacroBlock leftMb = frame.getMacroBlock(x - 1, y);
+
+ switch (this.uvMode) {
+ case Globals.DC_PRED:
+ // System.out.println("UV DC_PRED");
+
+ boolean up_available = false;
+ boolean left_available = false;
+ int Uaverage = 0;
+ int Vaverage = 0;
+ int expected_udc = 0;
+ int expected_vdc = 0;
+ if (x > 0)
+ left_available = true;
+ if (y > 0)
+ up_available = true;
+ if (up_available || left_available) {
+ if (up_available) {
+ for (int j = 0; j < 2; j++) {
+ SubBlock usb = aboveMb.getUSubBlock(j, 1);
+ SubBlock vsb = aboveMb.getVSubBlock(j, 1);
+ for (int i = 0; i < 4; i++) {
+ Uaverage += usb.getDest()[i][3];
+ Vaverage += vsb.getDest()[i][3];
+ }
+ }
+ }
+
+ if (left_available) {
+ for (int j = 0; j < 2; j++) {
+ SubBlock usb = leftMb.getUSubBlock(1, j);
+ SubBlock vsb = leftMb.getVSubBlock(1, j);
+ for (int i = 0; i < 4; i++) {
+ Uaverage += usb.getDest()[3][i];
+ Vaverage += vsb.getDest()[3][i];
+ }
+ }
+ }
+
+ int shift = 2;
+ if (up_available)
+ shift++;
+ if (left_available)
+ shift++;
+
+ expected_udc = (Uaverage + (1 << (shift - 1))) >> shift;
+ expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift;
+ } else {
+ expected_udc = 128;
+ expected_vdc = 128;
+ }
+
+ int ufill[][] = new int[4][4];
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++)
+ ufill[x][y] = expected_udc;
+
+ int vfill[][] = new int[4][4];
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++)
+ vfill[x][y] = expected_vdc;
+
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++) {
+ SubBlock usb = uSubBlocks[x][y];
+ SubBlock vsb = vSubBlocks[x][y];
+ usb.setPredict(ufill);
+ vsb.setPredict(vfill);
+ }
+
+ break;
+ case Globals.V_PRED:
+ // System.out.println("UV V_PRED");
+
+ SubBlock[] aboveUSb = new SubBlock[2];
+ SubBlock[] aboveVSb = new SubBlock[2];
+ for (int x = 0; x < 2; x++) {
+ aboveUSb[x] = aboveMb.getUSubBlock(x, 1);
+ aboveVSb[x] = aboveMb.getVSubBlock(x, 1);
+ }
+
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++) {
+ SubBlock usb = uSubBlocks[y][x];
+ SubBlock vsb = vSubBlocks[y][x];
+ int ublock[][] = new int[4][4];
+ int vblock[][] = new int[4][4];
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++) {
+ ublock[j][i] = aboveUSb[y]
+ .getMacroBlockPredict(Globals.V_PRED)[j][3];
+ vblock[j][i] = aboveVSb[y]
+ .getMacroBlockPredict(Globals.V_PRED)[j][3];
+ }
+ usb.setPredict(ublock);
+ vsb.setPredict(vblock);
+ }
+
+ break;
+
+ case Globals.H_PRED:
+ // System.out.println("UV H_PRED");
+
+ SubBlock[] leftUSb = new SubBlock[2];
+ SubBlock[] leftVSb = new SubBlock[2];
+ for (int x = 0; x < 2; x++) {
+ leftUSb[x] = leftMb.getUSubBlock(1, x);
+ leftVSb[x] = leftMb.getVSubBlock(1, x);
+ }
+
+ for (int y = 0; y < 2; y++)
+ for (int x = 0; x < 2; x++) {
+ SubBlock usb = uSubBlocks[x][y];
+ SubBlock vsb = vSubBlocks[x][y];
+ int ublock[][] = new int[4][4];
+ int vblock[][] = new int[4][4];
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++) {
+ ublock[i][j] = leftUSb[y]
+ .getMacroBlockPredict(Globals.H_PRED)[3][j];
+ vblock[i][j] = leftVSb[y]
+ .getMacroBlockPredict(Globals.H_PRED)[3][j];
+ }
+ usb.setPredict(ublock);
+ vsb.setPredict(vblock);
+ }
+
+ break;
+ case Globals.TM_PRED:
+ // TODO:
+ // System.out.println("UV TM_PRED MB");
+ MacroBlock ALMb = frame.getMacroBlock(x - 1, y - 1);
+ SubBlock ALUSb = ALMb.getUSubBlock(1, 1);
+ int alu = ALUSb.getDest()[3][3];
+ SubBlock ALVSb = ALMb.getVSubBlock(1, 1);
+ int alv = ALVSb.getDest()[3][3];
+
+ aboveUSb = new SubBlock[2];
+ leftUSb = new SubBlock[2];
+ aboveVSb = new SubBlock[2];
+ leftVSb = new SubBlock[2];
+ for (int x = 0; x < 2; x++) {
+ aboveUSb[x] = aboveMb.getUSubBlock(x, 1);
+ leftUSb[x] = leftMb.getUSubBlock(1, x);
+ aboveVSb[x] = aboveMb.getVSubBlock(x, 1);
+ leftVSb[x] = leftMb.getVSubBlock(1, x);
+ }
+
+ for (int b = 0; b < 2; b++) {
+ for (int a = 0; a < 4; a++) {
+ for (int d = 0; d < 2; d++) {
+ for (int c = 0; c < 4; c++) {
+
+ int upred = leftUSb[b].getDest()[3][a]
+ + aboveUSb[d].getDest()[c][3] - alu;
+ upred = Globals.clamp(upred, 255);
+ uSubBlocks[d][b].setPixel(c, a, upred);
+
+ int vpred = leftVSb[b].getDest()[3][a]
+ + aboveVSb[d].getDest()[c][3] - alv;
+ vpred = Globals.clamp(vpred, 255);
+ vSubBlocks[d][b].setPixel(c, a, vpred);
+
+ }
+ }
+
+ }
+ }
+
+ break;
+ default:
+ System.out.println("TODO predict_mb_uv: " + this.yMode);
+ System.exit(0);
+ }
+ }
+
+ public void predictY(VP8Frame frame) {
+ MacroBlock aboveMb = frame.getMacroBlock(x, y - 1);
+ MacroBlock leftMb = frame.getMacroBlock(x - 1, y);
+
+ switch (this.yMode) {
+ case Globals.DC_PRED:
+ // System.out.println("DC_PRED");
+ boolean up_available = false;
+ boolean left_available = false;
+
+ int average = 0;
+ int expected_dc = 0;
+ if (x > 0)
+ left_available = true;
+ if (y > 0)
+ up_available = true;
+
+ if (up_available || left_available) {
+ if (up_available) {
+ for (int j = 0; j < 4; j++) {
+ SubBlock sb = aboveMb.getYSubBlock(j, 3);
+ for (int i = 0; i < 4; i++) {
+ average += sb.getDest()[i][3];
+ }
+ }
+ }
+
+ if (left_available) {
+ for (int j = 0; j < 4; j++) {
+ SubBlock sb = leftMb.getYSubBlock(3, j);
+ for (int i = 0; i < 4; i++) {
+ average += sb.getDest()[3][i];
+ }
+ }
+ }
+
+ int shift = 3;
+ if (up_available)
+ shift++;
+ if (left_available)
+ shift++;
+
+ expected_dc = (average + (1 << (shift - 1))) >> shift;
+ } else {
+ expected_dc = 128;
+ }
+
+ int fill[][] = new int[4][4];
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++)
+ fill[x][y] = expected_dc;
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++) {
+ SubBlock sb = ySubBlocks[x][y];
+ sb.setPredict(fill);
+ }
+
+ break;
+ case Globals.V_PRED:
+ // System.out.println("V_PRED");
+
+ SubBlock[] aboveYSb = new SubBlock[4];
+ for (int x = 0; x < 4; x++)
+ aboveYSb[x] = aboveMb.getYSubBlock(x, 3);
+
+ for (int y = 0; y < 4; y++) {
+ for (int x = 0; x < 4; x++) {
+ SubBlock sb = ySubBlocks[x][y];
+ int block[][] = new int[4][4];
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++) {
+ block[i][j] = aboveYSb[x].getPredict(
+ Globals.B_VE_PRED, false)[i][3];
+ }
+ sb.setPredict(block);
+
+ }
+ }
+
+ break;
+
+ case Globals.H_PRED:
+ // System.out.println("H_PRED");
+
+ SubBlock[] leftYSb = new SubBlock[4];
+ for (int x = 0; x < 4; x++)
+ leftYSb[x] = leftMb.getYSubBlock(3, x);
+
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++) {
+ SubBlock sb = ySubBlocks[x][y];
+ int block[][] = new int[4][4];
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++) {
+ block[i][j] = leftYSb[y].getPredict(
+ Globals.B_DC_PRED, true)[3][j];
+ }
+ sb.setPredict(block);
+ }
+
+ SubBlock[] leftUSb = new SubBlock[2];
+ for (int x = 0; x < 2; x++)
+ leftUSb[x] = leftMb.getYSubBlock(1, x);
+
+ break;
+ case Globals.TM_PRED:
+ // System.out.println("TM_PRED MB");
+ MacroBlock ALMb = frame.getMacroBlock(x - 1, y - 1);
+ SubBlock ALSb = ALMb.getYSubBlock(3, 3);
+ int al = ALSb.getDest()[3][3];
+
+ aboveYSb = new SubBlock[4];
+ leftYSb = new SubBlock[4];
+ for (int x = 0; x < 4; x++)
+ aboveYSb[x] = aboveMb.getYSubBlock(x, 3);
+ for (int x = 0; x < 4; x++)
+ leftYSb[x] = leftMb.getYSubBlock(3, x);
+ fill = new int[4][4];
+
+ for (int b = 0; b < 4; b++) {
+ for (int a = 0; a < 4; a++) {
+
+ for (int d = 0; d < 4; d++) {
+ for (int c = 0; c < 4; c++) {
+
+ int pred = leftYSb[b].getDest()[3][a]
+ + aboveYSb[d].getDest()[c][3] - al;
+
+ ySubBlocks[d][b].setPixel(c, a,
+ Globals.clamp(pred, 255));
+
+ }
+ }
+
+ }
+ }
+
+ break;
+ default:
+ System.out.println("TODO predict_mb_y: " + this.yMode);
+ System.exit(0);
+ }
+ }
+
+ public void recon_mb() {
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++) {
+ SubBlock sb = ySubBlocks[i][j];
+ sb.reconstruct();
+ }
+
+ for (int j = 0; j < 2; j++)
+ for (int i = 0; i < 2; i++) {
+ SubBlock sb = uSubBlocks[i][j];
+ sb.reconstruct();
+ }
+ for (int j = 0; j < 2; j++)
+ for (int i = 0; i < 2; i++) {
+ SubBlock sb = vSubBlocks[i][j];
+ sb.reconstruct();
+ }
+
+ }
+
+ public void setFilterLevel(int value) {
+ this.filterLevel = value;
+ }
+
+ public void setSegmentId(int value) {
+ this.segmentId = value;
+ }
+
+ public void setSkipCoeff(int mbSkipCoeff) {
+ skipCoeff = mbSkipCoeff;
+ }
+
+ public void setUVFilterLevel(int value) {
+ this.uVFilterLevel = value;
+ }
+
+ public void setUvMode(int mode) {
+ this.uvMode = mode;
+ }
+
+ public void setYMode(int yMode) {
+ this.yMode = yMode;
+ }
+
+ public String toString() {
+ return "x: " + x + "y: " + y;
+ }
+
+ public int getSegmentId() {
+ return segmentId;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/Portrait.java b/src/net/sourceforge/plantuml/webp/Portrait.java
new file mode 100644
index 0000000..85ef65b
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/Portrait.java
@@ -0,0 +1,79 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.imageio.ImageIO;
+import javax.imageio.stream.ImageInputStream;
+
+public class Portrait {
+
+ private final String name;
+ private final int age;
+ private final byte webp[];
+
+ public Portrait(String name, int age, byte webp[]) throws IOException {
+ this.name = name;
+ this.age = age;
+ this.webp = webp;
+ }
+
+ public BufferedImage getBufferedImage() {
+ try {
+ final InputStream is = new ByteArrayInputStream(webp);
+ final ImageInputStream iis = ImageIO.createImageInputStream(is);
+ final VP8Decoder vp8Decoder = new VP8Decoder();
+ vp8Decoder.decodeFrame(iis, false);
+ iis.close();
+ return vp8Decoder.getFrame().getBufferedImage();
+ } catch (IOException e) {
+ return null;
+ }
+
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/webp/Portraits.java b/src/net/sourceforge/plantuml/webp/Portraits.java
new file mode 100644
index 0000000..fcedb90
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/Portraits.java
@@ -0,0 +1,104 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.version.PSystemVersion;
+
+public class Portraits {
+
+ private final List<Portrait> all = new ArrayList<Portrait>();
+
+ public void all(Portrait p) {
+ all.add(p);
+ }
+
+ private static InputStream getInputStream() {
+ return PSystemVersion.class.getResourceAsStream("out.png");
+ }
+
+ public Portraits() {
+ final InputStream is = getInputStream();
+ if (is != null) {
+ try {
+ read(is);
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
+ private void read(InputStream is) throws IOException {
+ final DataInputStream dis = new DataInputStream(is);
+ final int nb = dis.readShort();
+ final List<String> names = new ArrayList<String>();
+ final List<Integer> ages = new ArrayList<Integer>();
+ for (int i = 0; i < nb; i++) {
+ names.add(dis.readUTF());
+ ages.add((int) dis.readByte());
+ }
+ for (int i = 0; i < nb; i++) {
+ final int len = dis.readShort();
+ final byte data[] = new byte[len];
+ dis.readFully(data);
+ all.add(new Portrait(names.get(i), ages.get(i), data));
+ }
+ }
+
+ public static void main(String[] args) {
+ final Portraits p = new Portraits();
+ System.err.println(p.all);
+ }
+
+ public Portrait getOne() {
+ if (all.size() == 0) {
+ return null;
+ }
+ return all.get(0);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/webp/Segment.java b/src/net/sourceforge/plantuml/webp/Segment.java
new file mode 100644
index 0000000..414c3cb
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/Segment.java
@@ -0,0 +1,62 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+public class Segment {
+ int P0, P1, P2, P3;
+ int Q0, Q1, Q2, Q3;
+
+ public String toString() {
+ return "" + Globals.toHex(P3) + " " + Globals.toHex(P2) + " "
+ + Globals.toHex(P1) + " " + Globals.toHex(P0) + " "
+ + Globals.toHex(Q0) + " " + Globals.toHex(Q1) + " "
+ + Globals.toHex(Q2) + " " + Globals.toHex(Q3);
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/SegmentQuant.java b/src/net/sourceforge/plantuml/webp/SegmentQuant.java
new file mode 100644
index 0000000..1cf6347
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/SegmentQuant.java
@@ -0,0 +1,137 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+public class SegmentQuant {
+ private int filterStrength;
+ private int Qindex;
+ private int uvac;
+ private int uvdc;
+ private int y1ac;
+ private int y1dc;
+ private int y2ac;
+ private int y2dc;
+
+ private int clip(int val, int max) {
+ int r = val;
+ if (val > max)
+ r = max;
+ if (r < 0)
+ r = 0;
+ return r;
+ }
+
+ public int getQindex() {
+ return Qindex;
+ }
+
+ public int getUvac_delta_q() {
+ return uvac;
+ }
+
+ public int getUvdc_delta_q() {
+ return uvdc;
+ }
+
+ public int getY1ac() {
+ return y1ac;
+ }
+
+ public int getY1dc() {
+ return y1dc;
+ }
+
+ public int getY2ac_delta_q() {
+ return y2ac;
+ }
+
+ public int getY2dc() {
+ return y2dc;
+ }
+
+ public void setFilterStrength(int value) {
+ this.filterStrength = value;
+ }
+
+ public void setQindex(int qindex) {
+ Qindex = qindex;
+ }
+
+ public void setUvac_delta_q(int uvac_delta_q) {
+ this.uvac = Globals.vp8AcQLookup[clip(Qindex + uvac_delta_q, 127)];
+ }
+
+ public void setUvdc_delta_q(int uvdc_delta_q) {
+ this.uvdc = Globals.vp8DcQLookup[clip(Qindex + uvdc_delta_q, 127)];
+ }
+
+ public void setY1ac() {
+ this.y1ac = Globals.vp8AcQLookup[clip(Qindex, 127)];
+ }
+
+ public void setY1dc(int y1dc) {
+ this.y1dc = Globals.vp8DcQLookup[clip(Qindex + y1dc, 127)];
+ this.setY1ac();
+ }
+
+ public void setY2ac_delta_q(int y2ac_delta_q) {
+ this.y2ac = Globals.vp8AcQLookup[clip(Qindex + y2ac_delta_q, 127)] * 155 / 100;
+ if (this.y2ac < 8)
+ this.y2ac = 8;
+ }
+
+ public void setY2dc(int y2dc_delta_q) {
+ this.y2dc = Globals.vp8DcQLookup[clip(Qindex + y2dc_delta_q, 127)] * 2;
+ }
+
+ public int getFilterStrength() {
+ return filterStrength;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/SegmentQuants.java b/src/net/sourceforge/plantuml/webp/SegmentQuants.java
new file mode 100644
index 0000000..585aa00
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/SegmentQuants.java
@@ -0,0 +1,132 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.io.IOException;
+
+public class SegmentQuants {
+
+ private static DeltaQ get_delta_q(BoolDecoder bc, int prev)
+ throws IOException {
+ DeltaQ ret = new DeltaQ();
+ ret.v = 0;
+ ret.update = false;
+
+ if (bc.readBit() > 0) {
+ ret.v = bc.readLiteral(4);
+
+ if (bc.readBit() > 0)
+ ret.v = -ret.v;
+ }
+
+ /* Trigger a quantizer update if the delta-q value has changed */
+ if (ret.v != prev)
+ ret.update = true;
+
+ return ret;
+ }
+
+ private int qIndex;
+
+ private SegmentQuant[] segQuants = new SegmentQuant[Globals.MAX_MB_SEGMENTS];
+
+ public SegmentQuants() {
+ for (int x = 0; x < Globals.MAX_MB_SEGMENTS; x++)
+ segQuants[x] = new SegmentQuant();
+ }
+
+ public int getqIndex() {
+ return qIndex;
+ }
+
+ public SegmentQuant[] getSegQuants() {
+ return segQuants;
+ }
+
+ public void parse(BoolDecoder bc, boolean segmentation_enabled,
+ boolean mb_segement_abs_delta) throws IOException {
+ qIndex = bc.readLiteral(7);
+ boolean q_update = false;
+ DeltaQ v = get_delta_q(bc, 0);
+ int y1dc_delta_q = v.v;
+ q_update = q_update || v.update;
+ v = get_delta_q(bc, 0);
+ int y2dc_delta_q = v.v;
+ q_update = q_update || v.update;
+ v = get_delta_q(bc, 0);
+ int y2ac_delta_q = v.v;
+ q_update = q_update || v.update;
+ v = get_delta_q(bc, 0);
+ int uvdc_delta_q = v.v;
+ q_update = q_update || v.update;
+ v = get_delta_q(bc, 0);
+ int uvac_delta_q = v.v;
+ q_update = q_update || v.update;
+
+ for (SegmentQuant s : segQuants) {
+ if (!segmentation_enabled) {
+ s.setQindex(qIndex);
+ } else if (!mb_segement_abs_delta) {
+ s.setQindex(s.getQindex() + qIndex);
+ }
+
+ s.setY1dc(y1dc_delta_q);
+ s.setY2dc(y2dc_delta_q);
+ s.setY2ac_delta_q(y2ac_delta_q);
+ s.setUvdc_delta_q(uvdc_delta_q);
+ s.setUvac_delta_q(uvac_delta_q);
+
+ }
+ }
+
+ public void setSegQuants(SegmentQuant[] segQuants) {
+ this.segQuants = segQuants;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/SubBlock.java b/src/net/sourceforge/plantuml/webp/SubBlock.java
new file mode 100644
index 0000000..aaf0ab9
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/SubBlock.java
@@ -0,0 +1,651 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.io.IOException;
+
+public class SubBlock {
+ public static enum PLANE {
+ U, V, Y1, Y2
+ };
+
+ public static final int UV = 2;
+ public static final int Y = 3;
+ public static final int Y_AFTER_Y2 = 0;
+ public static final int Y2 = 1;
+
+ public static int planeToType(PLANE plane, Boolean withY2) {
+ switch (plane) {
+ case Y2:
+ return 1;
+ case Y1:
+ if (withY2)
+ return 0;
+ else
+ return 3;
+ case U:
+ return 2;
+ case V:
+ return 2;
+ }
+ return -1;
+
+ }
+
+ private SubBlock above;
+
+ private int[][] dest;
+ private int[][] diff;
+ private boolean hasNoZeroToken;
+ private SubBlock left;
+ private MacroBlock macroBlock;
+ private int mode;
+ private PLANE plane;
+ private int predict[][];
+ private int tokens[];
+
+ public SubBlock(MacroBlock macroBlock, SubBlock above, SubBlock left,
+ SubBlock.PLANE plane) {
+ this.macroBlock = macroBlock;
+ this.plane = plane;
+ this.above = above;
+ this.left = left;
+ mode = 0;
+ tokens = new int[16];
+ for (int z = 0; z < 16; z++)
+ tokens[z] = 0;
+ }
+
+ private int DCTextra(BoolDecoder bc2, int p[]) throws IOException {
+ int v = 0;
+ int offset = 0;
+ do {
+ v += v + bc2.readBool(p[offset]);
+ offset++;
+ } while (p[offset] > 0);
+ return v;
+ }
+
+ public void decodeSubBlock(BoolDecoder bc2, int[][][][] coef_probs,
+ int ilc, int type, boolean withY2) throws IOException {
+ SubBlock sb = this;
+ int startAt = 0;
+ if (withY2)
+ startAt = 1;
+ int lc = ilc;
+ int c = 0;
+ int v = 1;
+
+ boolean skip = false;
+
+ while (!(v == Globals.dct_eob) && c + startAt < 16) {
+
+ if (!skip)
+ v = bc2.readTree(Globals.vp8CoefTree,
+ coef_probs[type][Globals.vp8CoefBands[c + startAt]][lc]);
+ else
+ v = bc2.readTreeSkip(
+ Globals.vp8CoefTree,
+ coef_probs[type][Globals.vp8CoefBands[c + startAt]][lc],
+ 1);
+
+ int dv = decodeToken(bc2, v);
+ lc = 0;
+ skip = false;
+ if (dv == 1 || dv == -1)
+ lc = 1;
+ else if (dv > 1 || dv < -1)
+ lc = 2;
+ else if (dv == Globals.DCT_0)
+ skip = true;
+
+ int tokens[] = sb.getTokens();
+
+ if (v != Globals.dct_eob)
+ tokens[Globals.vp8defaultZigZag1d[c + startAt]] = dv;
+ c++;
+ }
+ hasNoZeroToken = false;
+ for (int x = 0; x < 16; x++)
+ if (tokens[x] != 0)
+ hasNoZeroToken = true;
+ }
+
+ private int decodeToken(BoolDecoder bc2, int v) throws IOException {
+ int r = v;
+
+ if (v == Globals.dct_cat1) {
+ r = 5 + DCTextra(bc2, Globals.Pcat1);
+ }
+ if (v == Globals.dct_cat2) {
+ r = 7 + DCTextra(bc2, Globals.Pcat2);
+ }
+ if (v == Globals.dct_cat3) {
+ r = 11 + DCTextra(bc2, Globals.Pcat3);
+ }
+ if (v == Globals.dct_cat4) {
+ r = 19 + DCTextra(bc2, Globals.Pcat4);
+ }
+ if (v == Globals.dct_cat5) {
+ r = 35 + DCTextra(bc2, Globals.Pcat5);
+ }
+ if (v == Globals.dct_cat6) {
+ r = 67 + DCTextra(bc2, Globals.Pcat6);
+ }
+ if (v != Globals.DCT_0 && v != Globals.dct_eob) {
+ if (bc2.readBit() > 0)
+ r = -r;
+ }
+
+ return r;
+ }
+
+ public void dequantSubBlock(VP8Frame frame, Integer Dc) {
+ SubBlock sb = this;
+
+ int[] adjustedValues = new int[16];
+ for (int i = 0; i < 16; i++) {
+ int QValue;
+ if (plane == PLANE.U || plane == PLANE.V) {
+ QValue = frame.getSegmentQuants().getSegQuants()[this.getMacroBlock().getSegmentId()]
+ .getUvac_delta_q();
+ if (i == 0)
+ QValue = frame.getSegmentQuants().getSegQuants()[this.getMacroBlock().getSegmentId()]
+ .getUvdc_delta_q();
+ } else {
+ QValue = frame.getSegmentQuants().getSegQuants()[this.getMacroBlock().getSegmentId()].getY1ac();
+ if (i == 0)
+ QValue = frame.getSegmentQuants().getSegQuants()[this.getMacroBlock().getSegmentId()]
+ .getY1dc();
+ }
+
+ int inputValue = sb.getTokens()[i];
+ adjustedValues[i] = inputValue * QValue;
+
+ }
+
+ if (Dc != null)
+ adjustedValues[0] = Dc;
+
+ int[][] diff = IDCT.idct4x4llm(adjustedValues);
+ sb.setDiff(diff);
+
+ }
+
+ public void drawDebug() {
+ if (dest != null) {
+ dest[0][0] = 128;
+ dest[1][0] = 128;
+ dest[2][0] = 128;
+ dest[3][0] = 128;
+ dest[0][0] = 128;
+ dest[0][1] = 128;
+ dest[0][2] = 128;
+ dest[0][3] = 128;
+ }
+
+ }
+
+ public void drawDebugH() {
+ if (dest != null) {
+ dest[0][0] = 0;
+ dest[1][0] = 0;
+ dest[2][0] = 0;
+ dest[3][0] = 0;
+ }
+
+ }
+
+ public void drawDebugV() {
+ if (dest != null) {
+ dest[0][0] = 0;
+ dest[0][1] = 0;
+ dest[0][2] = 0;
+ dest[0][3] = 0;
+ }
+ }
+
+ public SubBlock getAbove() {
+
+ return above;
+ }
+
+ public String getDebugString() {
+ String r = new String();
+ r = r + " " + plane;
+ if (getMacroBlock().getYMode() == Globals.B_PRED
+ && plane == SubBlock.PLANE.Y1)
+ r = r + "\n " + Globals.getSubBlockModeAsString(mode);
+ return r;
+ }
+
+ public int[][] getDest() {
+ if (dest != null)
+ return dest;
+ else
+ return new int[4][4];
+ }
+
+ public int[][] getDiff() {
+
+ return diff;
+ }
+
+ public SubBlock getLeft() {
+
+ return left;
+ }
+
+ public MacroBlock getMacroBlock() {
+ return macroBlock;
+ }
+
+ public int[][] getMacroBlockPredict(int intra_mode) {
+ if (dest != null)
+ return dest;
+
+ else {
+ int rv = 127;
+ if (intra_mode == Globals.H_PRED)
+ rv = 129;
+ int r[][] = new int[4][4];
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++)
+ r[i][j] = rv;
+ return r;
+ }
+ }
+
+ public int getMode() {
+ return mode;
+ }
+
+ public PLANE getPlane() {
+ return plane;
+ }
+
+ public int[][] getPredict() {
+ if (predict != null)
+ return predict;
+ return getPredict(Globals.B_DC_PRED, false);
+ }
+
+ public int[][] getPredict(int intra_bmode, boolean left) {
+ if (dest != null)
+ return dest;
+ if (predict != null)
+ return predict;
+ else {
+ int rv = 127;
+
+ if ((intra_bmode == Globals.B_TM_PRED
+ || intra_bmode == Globals.B_DC_PRED
+ || intra_bmode == Globals.B_VE_PRED
+ || intra_bmode == Globals.B_HE_PRED
+ || intra_bmode == Globals.B_VR_PRED
+ || intra_bmode == Globals.B_RD_PRED || intra_bmode == Globals.B_HD_PRED)
+ && left)
+
+ rv = 129;
+ int r[][] = new int[4][4];
+ for (int j = 0; j < 4; j++)
+ for (int i = 0; i < 4; i++)
+ r[i][j] = rv;
+ return r;
+ }
+ }
+
+ int[] getTokens() {
+ return tokens;
+ }
+
+ public boolean hasNoZeroToken() {
+ return hasNoZeroToken;
+ }
+
+ public boolean isDest() {
+ if (dest == null)
+ return false;
+ return true;
+ }
+
+ public void predict(VP8Frame frame) {
+ SubBlock sb = this;
+ SubBlock aboveSb = frame.getAboveSubBlock(sb, sb.getPlane());
+ SubBlock leftSb = frame.getLeftSubBlock(sb, sb.getPlane());
+
+ int[] above = new int[4];
+ int[] left = new int[4];
+
+ above[0] = aboveSb.getPredict(sb.getMode(), false)[0][3];
+ above[1] = aboveSb.getPredict(sb.getMode(), false)[1][3];
+ above[2] = aboveSb.getPredict(sb.getMode(), false)[2][3];
+ above[3] = aboveSb.getPredict(sb.getMode(), false)[3][3];
+ left[0] = leftSb.getPredict(sb.getMode(), true)[3][0];
+ left[1] = leftSb.getPredict(sb.getMode(), true)[3][1];
+ left[2] = leftSb.getPredict(sb.getMode(), true)[3][2];
+ left[3] = leftSb.getPredict(sb.getMode(), true)[3][3];
+ SubBlock AL = frame.getLeftSubBlock(aboveSb, sb.getPlane());
+
+ // for above left if left and above is null use left (129?) else use
+ // above (127?)
+ int al;
+ if (!leftSb.isDest() && !aboveSb.isDest()) {
+
+ al = AL.getPredict(sb.getMode(), false)[3][3];
+ } else if (!aboveSb.isDest()) {
+
+ al = AL.getPredict(sb.getMode(), false)[3][3];
+ } else
+ al = AL.getPredict(sb.getMode(), true)[3][3];
+ SubBlock AR = frame.getAboveRightSubBlock(sb, sb.plane);
+ int ar[] = new int[4];
+ ar[0] = AR.getPredict(sb.getMode(), false)[0][3];
+ ar[1] = AR.getPredict(sb.getMode(), false)[1][3];
+ ar[2] = AR.getPredict(sb.getMode(), false)[2][3];
+ ar[3] = AR.getPredict(sb.getMode(), false)[3][3];
+ int[][] p = new int[4][4];
+ int pp[];
+ switch (sb.getMode()) {
+ case Globals.B_DC_PRED:
+ // System.out.println("B_DC_PRED");
+ int expected_dc = 0;
+
+ for (int i = 0; i < 4; i++) {
+ expected_dc += above[i];
+ expected_dc += left[i];
+ }
+ expected_dc = (expected_dc + 4) >> 3;
+
+ for (int y = 0; y < 4; y++)
+ for (int x = 0; x < 4; x++)
+ p[x][y] = expected_dc;
+
+ break;
+ case Globals.B_TM_PRED:
+
+ // System.out.println("B_TM_PRED");
+
+ // prediction similar to true_motion prediction
+
+ for (int r = 0; r < 4; r++) {
+ for (int c = 0; c < 4; c++) {
+
+ int pred = above[c] - al + left[r];
+ if (pred < 0)
+ pred = 0;
+
+ if (pred > 255)
+ pred = 255;
+
+ p[c][r] = pred;
+ }
+ }
+ break;
+ case Globals.B_VE_PRED:
+ // System.out.println("B_VE_PRED");
+
+ int ap[] = new int[4];
+ ap[0] = (al + 2 * above[0] + above[1] + 2) >> 2;
+ ap[1] = (above[0] + 2 * above[1] + above[2] + 2) >> 2;
+ ap[2] = (above[1] + 2 * above[2] + above[3] + 2) >> 2;
+ ap[3] = (above[2] + 2 * above[3] + ar[0] + 2) >> 2;
+
+ for (int r = 0; r < 4; r++) {
+ for (int c = 0; c < 4; c++) {
+
+ p[c][r] = ap[c];
+
+ }
+ }
+ break;
+ case Globals.B_HE_PRED:
+ // System.out.println("B_HE_PRED");
+
+ int lp[] = new int[4];
+ lp[0] = (al + 2 * left[0] + left[1] + 2) >> 2;
+ lp[1] = (left[0] + 2 * left[1] + left[2] + 2) >> 2;
+ lp[2] = (left[1] + 2 * left[2] + left[3] + 2) >> 2;
+ lp[3] = (left[2] + 2 * left[3] + left[3] + 2) >> 2;
+
+ for (int r = 0; r < 4; r++) {
+ for (int c = 0; c < 4; c++) {
+ p[c][r] = lp[r];
+ }
+ }
+ break;
+ case Globals.B_LD_PRED:
+ // System.out.println("B_LD_PRED");
+ p[0][0] = (above[0] + above[1] * 2 + above[2] + 2) >> 2;
+ p[1][0] = p[0][1] = (above[1] + above[2] * 2 + above[3] + 2) >> 2;
+ p[2][0] = p[1][1] = p[0][2] = (above[2] + above[3] * 2 + ar[0] + 2) >> 2;
+ p[3][0] = p[2][1] = p[1][2] = p[0][3] = (above[3] + ar[0] * 2
+ + ar[1] + 2) >> 2;
+ p[3][1] = p[2][2] = p[1][3] = (ar[0] + ar[1] * 2 + ar[2] + 2) >> 2;
+ p[3][2] = p[2][3] = (ar[1] + ar[2] * 2 + ar[3] + 2) >> 2;
+ p[3][3] = (ar[2] + ar[3] * 2 + ar[3] + 2) >> 2;
+
+ break;
+ case Globals.B_RD_PRED:
+ // System.out.println("B_RD_PRED");
+ pp = new int[9];
+
+ pp[0] = left[3];
+ pp[1] = left[2];
+ pp[2] = left[1];
+ pp[3] = left[0];
+ pp[4] = al;
+ pp[5] = above[0];
+ pp[6] = above[1];
+ pp[7] = above[2];
+ pp[8] = above[3];
+
+ p[0][3] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
+ p[1][3] = p[0][2] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
+ p[2][3] = p[1][2] = p[0][1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
+ p[3][3] = p[2][2] = p[1][1] = p[0][0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
+ p[3][2] = p[2][1] = p[1][0] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
+ p[3][1] = p[2][0] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
+ p[3][0] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2;
+ break;
+
+ case Globals.B_VR_PRED:
+ // System.out.println("B_VR_PRED");
+ pp = new int[9];
+
+ pp[0] = left[3];
+ pp[1] = left[2];
+ pp[2] = left[1];
+ pp[3] = left[0];
+ pp[4] = al;
+ pp[5] = above[0];
+ pp[6] = above[1];
+ pp[7] = above[2];
+ pp[8] = above[3];
+
+ p[0][3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
+ p[0][2] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
+ p[1][3] = p[0][1] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
+ p[1][2] = p[0][0] = (pp[4] + pp[5] + 1) >> 1;
+ p[2][3] = p[1][1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
+ p[2][2] = p[1][0] = (pp[5] + pp[6] + 1) >> 1;
+ p[3][3] = p[2][1] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
+ p[3][2] = p[2][0] = (pp[6] + pp[7] + 1) >> 1;
+ p[3][1] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2;
+ p[3][0] = (pp[7] + pp[8] + 1) >> 1;
+
+ break;
+ case Globals.B_VL_PRED:
+ // System.out.println("B_VL_PRED");
+
+ p[0][0] = (above[0] + above[1] + 1) >> 1;
+ p[0][1] = (above[0] + above[1] * 2 + above[2] + 2) >> 2;
+ p[0][2] = p[1][0] = (above[1] + above[2] + 1) >> 1;
+ p[1][1] = p[0][3] = (above[1] + above[2] * 2 + above[3] + 2) >> 2;
+ p[1][2] = p[2][0] = (above[2] + above[3] + 1) >> 1;
+ p[1][3] = p[2][1] = (above[2] + above[3] * 2 + ar[0] + 2) >> 2;
+ p[3][0] = p[2][2] = (above[3] + ar[0] + 1) >> 1;
+ p[3][1] = p[2][3] = (above[3] + ar[0] * 2 + ar[1] + 2) >> 2;
+ p[3][2] = (ar[0] + ar[1] * 2 + ar[2] + 2) >> 2;
+ p[3][3] = (ar[1] + ar[2] * 2 + ar[3] + 2) >> 2;
+
+ break;
+ case Globals.B_HD_PRED:
+ // System.out.println("B_HD_PRED");
+ pp = new int[9];
+ pp[0] = left[3];
+ pp[1] = left[2];
+ pp[2] = left[1];
+ pp[3] = left[0];
+ pp[4] = al;
+ pp[5] = above[0];
+ pp[6] = above[1];
+ pp[7] = above[2];
+ pp[8] = above[3];
+
+ p[0][3] = (pp[0] + pp[1] + 1) >> 1;
+ p[1][3] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
+ p[0][2] = p[2][3] = (pp[1] + pp[2] + 1) >> 1;
+ p[1][2] = p[3][3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
+ p[2][2] = p[0][1] = (pp[2] + pp[3] + 1) >> 1;
+ p[3][2] = p[1][1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
+ p[2][1] = p[0][0] = (pp[3] + pp[4] + 1) >> 1;
+ p[3][1] = p[1][0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
+ p[2][0] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
+ p[3][0] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
+ break;
+ case Globals.B_HU_PRED:
+ // System.out.println("B_HU_PRED");
+
+ p[0][0] = (left[0] + left[1] + 1) >> 1;
+ p[1][0] = (left[0] + left[1] * 2 + left[2] + 2) >> 2;
+ p[2][0] = p[0][1] = (left[1] + left[2] + 1) >> 1;
+ p[3][0] = p[1][1] = (left[1] + left[2] * 2 + left[3] + 2) >> 2;
+ p[2][1] = p[0][2] = (left[2] + left[3] + 1) >> 1;
+ p[3][1] = p[1][2] = (left[2] + left[3] * 2 + left[3] + 2) >> 2;
+ p[2][2] = p[3][2] = p[0][3] = p[1][3] = p[2][3] = p[3][3] = left[3];
+ break;
+
+ default:
+ System.out.println("TODO: " + sb.getMode());
+ System.exit(0);
+ break;
+ }
+
+ sb.setPredict(p);
+ }
+
+ public void reconstruct() {
+ SubBlock sb = this;
+
+ int r, c;
+ int p[][] = sb.getPredict(1, false);
+
+ int dest[][] = new int[4][4];
+ int diff[][] = sb.getDiff();
+
+ for (r = 0; r < 4; r++) {
+ for (c = 0; c < 4; c++) {
+ int a = diff[r][c] + p[r][c];
+
+ if (a < 0)
+ a = 0;
+
+ if (a > 255)
+ a = 255;
+
+ dest[r][c] = a;
+
+ }
+
+ }
+
+ sb.setDest(dest);
+ if (!this.getMacroBlock().isKeepDebugInfo()) {
+ sb.diff = null;
+ sb.predict = null;
+ sb.tokens = null;
+ }
+ }
+
+ public void setDest(int[][] dest) {
+ this.dest = dest;
+ }
+
+ public void setDiff(int[][] diff) {
+ this.diff = diff;
+ }
+
+ public void setMode(int mode) {
+ this.mode = mode;
+ }
+
+ public void setPixel(int x, int y, int p) {
+ if (dest == null) {
+ dest = new int[4][4];
+ }
+ dest[x][y] = p;
+ }
+
+ public void setPredict(int[][] predict) {
+ this.predict = predict;
+
+ }
+
+ public String toString() {
+ String r = "[";
+ for (int x = 0; x < 16; x++)
+ r = r + tokens[x] + " ";
+ r = r + "]";
+
+ return r;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/webp/VP8Decoder.java b/src/net/sourceforge/plantuml/webp/VP8Decoder.java
new file mode 100644
index 0000000..fc48ff5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/VP8Decoder.java
@@ -0,0 +1,191 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sourceforge.plantuml.webp;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.imageio.stream.ImageInputStream;
+
+public class VP8Decoder {
+ private int[][][][] coefProbs;
+ VP8Frame f;
+ private int frameCount = 0;
+
+ public VP8Decoder() {
+ coefProbs = Globals.getDefaultCoefProbs();
+ }
+
+ public void decodeFrame(ImageInputStream stream, boolean debug)
+ throws IOException {
+ coefProbs = Globals.getDefaultCoefProbs();
+ f = new VP8Frame(stream, coefProbs);
+ if (f.decodeFrame(debug)) {
+
+ }
+ frameCount++;
+ }
+
+ public VP8Frame getFrame() {
+ return f;
+ }
+
+ public int getHeight() {
+ return f.getHeight();
+ }
+
+ public int getWidth() {
+ return f.getWidth();
+ }
+
+ @SuppressWarnings("unused")
+ private void writeFile(int[][] data) {
+ FileOutputStream out;
+ try {
+ out = new FileOutputStream("outagain.raw");
+ for (int y = 0; y < data[0].length; y++)
+ for (int x = 0; x < data.length; x++) {
+ out.write(data[x][y]);
+ out.write(data[x][y]);
+ out.write(data[x][y]);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void writePGMFile(String fileName, VP8Frame frame) {
+
+
+ FileOutputStream out;
+ try {
+ int[][] yData = frame.getYBuffer();
+ int[][] uData = frame.getUBuffer();
+ int[][] vData = frame.getVBuffer();
+ int outStride = (f.getWidth()+1)& ~1;
+ int uvHeight = (f.getHeight() +1) / 2;
+ out = new FileOutputStream(fileName);
+ out.write((byte) 'P');
+ out.write((byte) '5');
+ out.write((byte) 0x0a);
+ out.write(("" + outStride).getBytes());
+ out.write((byte) ' ');
+
+ out.write(("" + (f.getHeight() + uvHeight)).getBytes());
+
+ out.write((byte) 0x0a);
+ out.write(("255").getBytes());
+ out.write((byte) 0xa);
+ for (int y = 0; y < f.getHeight(); y++) {
+ for (int x = 0; x < f.getWidth(); x++) {
+ out.write(yData[x][y]);
+ }
+ if((f.getWidth() & 1)==1)
+ out.write(0x0);
+ }
+ for (int y = 0; y < (f.getHeight() + 1) / 2; y++) {
+ for (int x = 0; x < (f.getWidth() + 1) / 2; x++) {
+ out.write(uData[x][y]);
+ }
+ for (int x = 0; x < (f.getWidth() + 1) / 2; x++) {
+ out.write(vData[x][y]);
+ }
+
+ }
+
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void writeYV12File(String fileName, VP8Frame frame) {
+
+ FileOutputStream out;
+ try {
+ int[][] yData = frame.getYBuffer();
+ int[][] uData = frame.getUBuffer();
+ int[][] vData = frame.getVBuffer();
+ out = new FileOutputStream(fileName);
+ out.write((byte) 'P');
+ out.write((byte) '5');
+ out.write((byte) 0x0a);
+ out.write(("" + f.getWidth()).getBytes());
+ out.write((byte) ' ');
+
+ out.write(("" + (f.getHeight() * 3 / 2)).getBytes());
+ out.write((byte) 0x0a);
+ out.write(("255").getBytes());
+ out.write((byte) 0xa);
+ for (int y = 0; y < f.getHeight(); y++) {
+ for (int x = 0; x < f.getWidth(); x++) {
+ out.write(yData[x][y]);
+ }
+
+ }
+ for (int y = 0; y < (f.getHeight() + 1) / 2; y++)
+ for (int x = 0; x < (f.getWidth() + 1) / 2; x++) {
+ out.write(uData[x][y]);
+ }
+ for (int y = 0; y < (f.getHeight() + 1) / 2; y++)
+ for (int x = 0; x < (f.getWidth() + 1) / 2; x++) {
+ out.write(vData[x][y]);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/webp/VP8Frame.java b/src/net/sourceforge/plantuml/webp/VP8Frame.java
new file mode 100644
index 0000000..2f35286
--- /dev/null
+++ b/src/net/sourceforge/plantuml/webp/VP8Frame.java
@@ -0,0 +1,1090 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2017, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * This file is part of PlantUML.
+ *
+ * Licensed under The MIT License (Massachusetts Institute of Technology License)
+ *
+ * See http://opensource.org/licenses/MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Author: Arnaud Roques
+ */
+/* This file is part of javavp8decoder.
+
+ javavp8decoder 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.
+
+ javavp8decoder is 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 javavp8decoder. If not, see <http://www.gnu.org/licenses/>.
+*/
+package net.sourceforge.plantuml.webp;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.WritableRaster;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Vector;
+
+import javax.imageio.event.IIOReadProgressListener;
+import javax.imageio.stream.ImageInputStream;
+
+
+public class VP8Frame {
+ private static int BLOCK_TYPES = 4;
+ private static int COEF_BANDS = 8;
+ private static int MAX_ENTROPY_TOKENS = 12;
+ private static int MAX_MODE_LF_DELTAS = 4;
+ private static int MAX_REF_LF_DELTAS = 4;
+ private static int PREV_COEF_CONTEXTS = 3;
+
+
+ private ArrayList<IIOReadProgressListener> _listeners = new ArrayList<IIOReadProgressListener>();
+
+ private int bufferCount;
+ private int buffersToCreate=1;
+ private int[][][][] coefProbs;
+ private boolean debug=false;
+ private int filterLevel;
+
+ private int filterType;
+
+ private ImageInputStream frame;
+ private int frameType;
+ private int height;
+ private int macroBlockCols;
+ private int macroBlockNoCoeffSkip;
+ private int macroBlockRows;
+
+ private MacroBlock[][] macroBlocks;
+ private int macroBlockSegementAbsoluteDelta;
+ private int[] macroBlockSegmentTreeProbs;
+ private int[] modeLoopFilterDeltas = new int[MAX_MODE_LF_DELTAS];
+ private int modeRefLoopFilterDeltaEnabled;
+ private int modeRefLoopFilterDeltaUpdate;
+ private int multiTokenPartition = 0;
+
+ private long offset;
+ private int[] refLoopFilterDeltas = new int[MAX_REF_LF_DELTAS];
+ private int refreshEntropyProbs;
+ private int refreshLastFrame;
+ private int segmentationIsEnabled;
+ private SegmentQuants segmentQuants;
+ private int sharpnessLevel;
+ private int simpleFilter;
+ private BoolDecoder tokenBoolDecoder;
+ private Vector<BoolDecoder> tokenBoolDecoders;
+ private int updateMacroBlockSegmentationMap;
+ private int updateMacroBlockSegmentatonData;
+ private int width;
+ public VP8Frame(ImageInputStream stream) throws IOException {
+ this.frame = stream;
+ offset = frame.getStreamPosition();
+ this.coefProbs=Globals.getDefaultCoefProbs();
+ tokenBoolDecoders = new Vector<BoolDecoder>();
+ }
+ public VP8Frame(ImageInputStream stream, int[][][][] coefProbs) throws IOException {
+ this.frame = stream;
+ offset = frame.getStreamPosition();
+ this.coefProbs=coefProbs;
+ tokenBoolDecoders = new Vector<BoolDecoder>();
+ }
+ public void addIIOReadProgressListener(IIOReadProgressListener listener) {
+ _listeners.add(listener);
+ }
+ private void createMacroBlocks() {
+ macroBlocks = new MacroBlock[macroBlockCols+2][macroBlockRows+2];
+ for(int x=0; x<macroBlockCols+2; x++) {
+ for(int y=0; y<macroBlockRows+2; y++) {
+ macroBlocks[x][y] = new MacroBlock(x, y, debug);
+
+ }
+ }
+
+ }
+ public boolean decodeFrame(boolean debug) throws IOException {
+
+ this.debug=debug;
+ segmentQuants = new SegmentQuants();
+ int c;
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ frameType = getBitAsInt(c, 0);
+ if(frameType!=0)
+ return false;
+ int versionNumber = getBitAsInt(c, 1) << 1;
+
+ versionNumber += getBitAsInt(c, 2) << 1;
+ versionNumber += getBitAsInt(c, 3);
+ int firstPartitionLengthInBytes;
+ firstPartitionLengthInBytes = getBitAsInt(c, 5) << 0;
+ firstPartitionLengthInBytes += getBitAsInt(c, 6) << 1;
+ firstPartitionLengthInBytes += getBitAsInt(c, 7) << 2;
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ firstPartitionLengthInBytes += c << 3;
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ firstPartitionLengthInBytes += c << 11;
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ int hBytes = c;
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ hBytes += c << 8;
+ width = (hBytes & 0x3fff);
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ int vBytes = c;
+ frame.seek(offset++); c=frame.readUnsignedByte();
+ vBytes += c << 8;
+ height = (vBytes & 0x3fff);
+ int tWidth = width;
+ int tHeight = height;
+ if ((tWidth & 0xf) != 0)
+ tWidth += 16 - (tWidth & 0xf);
+
+ if ((tHeight & 0xf) != 0)
+ tHeight += 16 - (tHeight & 0xf);
+ macroBlockRows=tHeight >> 4;
+ macroBlockCols=tWidth >> 4;
+ createMacroBlocks();
+
+ BoolDecoder bc = new BoolDecoder(frame, offset);
+
+ if (frameType == 0) {
+ int clr_type = bc.readBit();
+ int clamp_type = bc.readBit();
+
+ }
+ segmentationIsEnabled = bc.readBit();
+ if (segmentationIsEnabled > 0) {
+ updateMacroBlockSegmentationMap = bc.readBit();
+ updateMacroBlockSegmentatonData = bc.readBit();
+ if(updateMacroBlockSegmentatonData > 0 ) {
+
+ macroBlockSegementAbsoluteDelta = bc.readBit();
+ /* For each segmentation feature (Quant and loop filter level) */
+ for (int i = 0; i < Globals.MAX_MB_SEGMENTS; i++) {
+ int value =0;
+ if (bc.readBit() > 0) {
+ value = bc.readLiteral(Globals.vp8MacroBlockFeatureDataBits[0]);
+ if(bc.readBit()>0)
+ value=-value;
+ }
+ this.segmentQuants.getSegQuants()[i].setQindex(value);
+ }
+ for (int i = 0; i < Globals.MAX_MB_SEGMENTS; i++) {
+ int value = 0;
+ if (bc.readBit() > 0) {
+ value = bc.readLiteral(Globals.vp8MacroBlockFeatureDataBits[1]);
+ if(bc.readBit()>0)
+ value=-value;
+ }
+ this.segmentQuants.getSegQuants()[i].setFilterStrength(value);
+ }
+
+ if(updateMacroBlockSegmentationMap > 0) {
+ macroBlockSegmentTreeProbs = new int[Globals.MB_FEATURE_TREE_PROBS];
+ for (int i = 0; i < Globals.MB_FEATURE_TREE_PROBS; i++) {
+ int value=255;
+ if (bc.readBit()>0) {
+ value = bc.readLiteral(8);
+ }
+ else
+ value = 255;
+ macroBlockSegmentTreeProbs[i] = value;
+ }
+ }
+ }
+ }
+ simpleFilter = bc.readBit();
+ filterLevel = bc.readLiteral(6);
+
+ sharpnessLevel = bc.readLiteral(3);
+ modeRefLoopFilterDeltaEnabled = bc.readBit();
+ if (modeRefLoopFilterDeltaEnabled > 0) {
+ // Do the deltas need to be updated
+ modeRefLoopFilterDeltaUpdate = bc.readBit();
+ if (modeRefLoopFilterDeltaUpdate > 0) {
+ for (int i = 0; i < MAX_REF_LF_DELTAS; i++) {
+
+ if (bc.readBit() > 0) {
+ refLoopFilterDeltas[i] = bc.readLiteral(6);
+ if (bc.readBit() > 0) // Apply sign
+ refLoopFilterDeltas[i] = refLoopFilterDeltas[i] * -1;
+ }
+ }
+ for (int i = 0; i < MAX_MODE_LF_DELTAS; i++) {
+
+ if (bc.readBit() > 0) {
+ modeLoopFilterDeltas[i] = bc.readLiteral(6);
+ if (bc.readBit() > 0) // Apply sign
+ modeLoopFilterDeltas[i] = modeLoopFilterDeltas[i] * -1;
+ }
+ }
+ }
+ }
+
+ filterType = (filterLevel == 0) ? 0 : (simpleFilter>0) ? 1 : 2;
+ setupTokenDecoder(bc, firstPartitionLengthInBytes,
+ offset);
+ bc.seek();
+
+ segmentQuants.parse(bc, segmentationIsEnabled==1, macroBlockSegementAbsoluteDelta==1);
+
+ // Determine if the golden frame or ARF buffer should be updated and
+ // how.
+ // For all non key frames the GF and ARF refresh flags and sign bias
+ // flags must be set explicitly.
+ if (frameType != 0) {
+ throw new IllegalArgumentException("bad input: not intra");
+ }
+ refreshEntropyProbs = bc.readBit();
+ if (refreshEntropyProbs > 0) {
+
+ }
+ refreshLastFrame = 0;
+ if (frameType == 0)
+ refreshLastFrame = 1;
+ else
+ refreshLastFrame = bc.readBit();
+ for (int i = 0; i < BLOCK_TYPES; i++)
+ for (int j = 0; j < COEF_BANDS; j++)
+ for (int k = 0; k < PREV_COEF_CONTEXTS; k++)
+ for (int l = 0; l < MAX_ENTROPY_TOKENS - 1; l++) {
+
+ if (bc.readBool(Globals.vp8CoefUpdateProbs[i][j][k][l]) > 0) {
+ int newp = bc.readLiteral(8);
+ this.coefProbs[i][j][k][l] = newp;
+ }
+ }
+
+ // Read the mb_no_coeff_skip flag
+ macroBlockNoCoeffSkip = (int) bc.readBit();
+ if (frameType == 0) {
+ readModes(bc);
+ } else {
+ throw new IllegalArgumentException("bad input: not intra");
+ }
+
+ int ibc = 0;
+ int num_part = 1 << multiTokenPartition;
+
+ for (int mb_row = 0; mb_row < macroBlockRows; mb_row++) {
+
+ if (num_part > 1) {
+
+ tokenBoolDecoder = tokenBoolDecoders.elementAt(ibc);
+ tokenBoolDecoder.seek();
+
+ decodeMacroBlockRow(mb_row);
+
+ ibc++;
+ if(ibc==num_part)
+ ibc=0;
+ }
+ else
+ decodeMacroBlockRow(mb_row);
+ fireProgressUpdate(mb_row);
+
+ }
+
+ if(this.getFilterType()>0 && this.getFilterLevel()!=0)
+ this.loopFilter();
+ return true;
+ }
+ private void decodeMacroBlockRow(int mbRow) throws IOException {
+ for (int mbCol = 0; mbCol < macroBlockCols; mbCol++) {
+
+ MacroBlock mb = getMacroBlock(mbCol, mbRow);
+
+ mb.decodeMacroBlock(this);
+
+ mb.dequantMacroBlock(this);
+
+ }
+ }
+
+ public void fireLFProgressUpdate(float p) {
+ java.util.Iterator<IIOReadProgressListener> listeners = _listeners.iterator();
+ while( listeners.hasNext() ) {
+ ( (IIOReadProgressListener)listeners.next() ).imageProgress( null, (100/buffersToCreate)+(p/buffersToCreate));
+ }
+ }
+ private void fireProgressUpdate(int mb_row) {
+ java.util.Iterator<IIOReadProgressListener> listeners = _listeners.iterator();
+ while( listeners.hasNext() ) {
+ ( (IIOReadProgressListener)listeners.next() ).imageProgress( null, (100.0f*((float)(mb_row+1)/(float)getMacroBlockRows()))/buffersToCreate);
+ }
+ }
+ public void fireRGBProgressUpdate(float p) {
+ java.util.Iterator<IIOReadProgressListener> listeners = _listeners.iterator();
+ while( listeners.hasNext() ) {
+ ( (IIOReadProgressListener)listeners.next() ).imageProgress( null, ((bufferCount+4)*(100/buffersToCreate))+(p/buffersToCreate));
+ }
+ }
+
+ public SubBlock getAboveRightSubBlock(SubBlock sb, SubBlock.PLANE plane) {
+ // this might break at right edge
+ SubBlock r;
+ MacroBlock mb = sb.getMacroBlock();
+ int x = mb.getSubblockX(sb);
+ int y = mb.getSubblockY(sb);
+
+ if(plane==SubBlock.PLANE.Y1) {
+
+ // top row
+ if(y==0 && x<3) {
+
+ MacroBlock mb2=this.getMacroBlock(mb.getX(), mb.getY()-1);
+ r = mb2.getSubBlock(plane, x+1, 3);
+ return r;
+ }
+ //top right
+ else if(y==0 && x==3) {
+
+ MacroBlock mb2=this.getMacroBlock(mb.getX()+1, mb.getY()-1);
+ r = mb2.getSubBlock(plane, 0, 3);
+
+ if(mb2.getX()==this.getMacroBlockCols()) {
+
+ int dest[][] = new int [4][4];
+ for(int b=0; b<4; b++)
+ for(int a=0; a<4; a++) {
+ if(mb2.getY()<0)
+ dest[a][b]=127;
+ else
+ dest[a][b]=this.getMacroBlock(mb.getX(), mb.getY()-1).getSubBlock(SubBlock.PLANE.Y1, 3, 3).getDest()[3][3];
+ }
+ r=new SubBlock(mb2,null, null, SubBlock.PLANE.Y1);
+ r.setDest(dest);
+
+
+ }
+
+ return r;
+ }
+ //not right edge or top row
+ else if(y>0 && x<3) {
+
+ r = mb.getSubBlock(plane, x+1, y-1);
+ return r;
+ }
+ //else use top right
+ else {
+ SubBlock sb2 = mb.getSubBlock(sb.getPlane(), 3, 0);
+ return this.getAboveRightSubBlock(sb2, plane);
+ }
+ }
+ else {
+ throw new IllegalArgumentException("bad input: getAboveRightSubBlock()");
+ }
+ }
+
+ public SubBlock getAboveSubBlock(SubBlock sb, SubBlock.PLANE plane) {
+
+ SubBlock r = sb.getAbove();
+ if(r==null) {
+ MacroBlock mb = sb.getMacroBlock();
+ int x = mb.getSubblockX(sb);
+
+ MacroBlock mb2 = getMacroBlock(mb.getX(), mb.getY()-1);
+ //TODO: SPLIT
+ while(plane==SubBlock.PLANE.Y2 && mb2.getYMode()== Globals.B_PRED) {
+ mb2 = getMacroBlock(mb2.getX(), mb2.getY()-1);
+ }
+ r = mb2.getBottomSubBlock(x, sb.getPlane());
+
+ }
+
+ return r;
+ }
+
+ private boolean getBit(int data, int bit) {
+ int r = data & (1 << bit);
+ if (r > 0)
+ return true;
+ return false;
+ }
+
+ private int getBitAsInt(int data, int bit) {
+ int r = data & (1 << bit);
+ if (r > 0)
+ return 1;
+ return 0;
+ }
+
+ public BufferedImage getBufferedImage() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ useBufferedImage(bi);
+ bufferCount++;
+ return bi;
+ }
+
+
+
+ public int[][][][] getCoefProbs() {
+ return coefProbs;
+ }
+
+ public BufferedImage getDebugImageDiff() {
+
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int yy, u, v;
+ yy = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDiff()[x%4][y%4];
+ u = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4];
+ v = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4];
+ c[0] = (int)( 1.164*(yy-16)+1.596*(v-128) );
+ c[1] = (int)( 1.164*(yy-16)-0.813*(v-128)-0.391*(u-128) );
+ c[2] = (int)( 1.164*(yy-16)+2.018*(u-128) );
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImagePredict() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int yy, u, v;
+ yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getPredict()[x%4][y%4];
+ u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4];
+ v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4];
+ c[0] = (int)( 1.164*(yy-16)+1.596*(v-128) );
+ c[1] = (int)( 1.164*(yy-16)-0.813*(v-128)-0.391*(u-128) );
+ c[2] = (int)( 1.164*(yy-16)+2.018*(u-128) );
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageUBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int u;
+ u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4];
+ c[0] = u;
+ c[1] = u;
+ c[2] = u;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageUDiffBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int u;
+ u = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4];
+ c[0] = u;
+ c[1] = u;
+ c[2] = u;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageUPredBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int u;
+ u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4];
+ c[0] = u;
+ c[1] = u;
+ c[2] = u;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageVBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int v;
+ v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4];
+ c[0] = v;
+ c[1] = v;
+ c[2] = v;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageVDiffBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int v;
+ v = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDiff()[(x/2)%4][(y/2)%4];
+ c[0] = v;
+ c[1] = v;
+ c[2] = v;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+ public BufferedImage getDebugImageVPredBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int v;
+ v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getPredict()[(x/2)%4][(y/2)%4];
+ c[0] = v;
+ c[1] = v;
+ c[2] = v;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageYBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int yy;
+ yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDest()[x%4][y%4];
+ c[0] = yy;
+ c[1] = yy;
+ c[2] = yy;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageYDiffBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int yy;
+ yy = 127+this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDiff()[x%4][y%4];
+ c[0] = yy;
+ c[1] = yy;
+ c[2] = yy;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public BufferedImage getDebugImageYPredBuffer() {
+ BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
+ WritableRaster imRas = bi.getWritableTile(0, 0);
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int yy;
+ yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getPredict()[x%4][y%4];
+ c[0] = yy;
+ c[1] = yy;
+ c[2] = yy;
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ bufferCount++;
+ return bi;
+ }
+
+ public int getFilterLevel() {
+ return filterLevel;
+ }
+ public int getFilterType() {
+ return filterType;
+ }
+ public int getFrameType() {
+ return frameType;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+ public SubBlock getLeftSubBlock(SubBlock sb, SubBlock.PLANE plane) {
+ SubBlock r = sb.getLeft();
+ if(r==null) {
+ MacroBlock mb = sb.getMacroBlock();
+ int y = mb.getSubblockY(sb);
+ MacroBlock mb2 = getMacroBlock(mb.getX()-1, mb.getY());
+ //TODO: SPLIT
+
+ while(plane==SubBlock.PLANE.Y2 && mb2.getYMode()== Globals.B_PRED)
+ mb2 = getMacroBlock(mb2.getX()-1, mb2.getY());
+
+ r = mb2.getRightSubBlock(y, sb.getPlane());
+
+ }
+
+ return r;
+ }
+ public MacroBlock getMacroBlock(int mbCol, int mbRow) {
+ return macroBlocks[mbCol+1][mbRow+1];
+ }
+ public int getMacroBlockCols() {
+ return macroBlockCols;
+ }
+ public String getMacroBlockDebugString(int mbx, int mby, int sbx, int sby) {
+ String r = new String();
+ if(mbx<this.macroBlockCols && mby<this.getMacroBlockRows()) {
+ MacroBlock mb = getMacroBlock(mbx, mby);
+ r=r+mb.getDebugString();
+ if(sbx<4 && sby<4) {
+ SubBlock sb = mb.getSubBlock(SubBlock.PLANE.Y1, sbx, sby);
+ r=r+"\n SubBlock "+sbx+", "+sby+"\n "+sb.getDebugString();
+ sb = mb.getSubBlock(SubBlock.PLANE.Y2, sbx, sby);
+ r=r+"\n SubBlock "+sbx+", "+sby+"\n "+sb.getDebugString();
+ sb = mb.getSubBlock(SubBlock.PLANE.U, sbx/2, sby/2);
+ r=r+"\n SubBlock "+sbx/2+", "+sby/2+"\n "+sb.getDebugString();
+ sb = mb.getSubBlock(SubBlock.PLANE.V, sbx/2, sby/2);
+ r=r+"\n SubBlock "+sbx/2+", "+sby/2+"\n "+sb.getDebugString();
+ }
+ }
+ return r;
+ }
+ public int getMacroBlockRows() {
+ return macroBlockRows;
+ }
+
+ public int getQIndex() {
+ return segmentQuants.getqIndex();
+ }
+ public SegmentQuants getSegmentQuants() {
+ return segmentQuants;
+ }
+ public int getSharpnessLevel() {
+ return sharpnessLevel;
+ }
+ public BoolDecoder getTokenBoolDecoder() throws IOException {
+ tokenBoolDecoder.seek();
+ return tokenBoolDecoder;
+ }
+
+ public int[][] getUBuffer() {
+ int r[][]= new int [macroBlockCols*8][macroBlockRows*8];
+ for(int y=0; y<macroBlockRows; y++) {
+ for(int x=0; x<macroBlockCols; x++) {
+ MacroBlock mb = macroBlocks[x+1][y+1];
+ for(int b=0; b<2; b++) {
+ for(int a=0; a<2; a++) {
+ SubBlock sb = mb.getUSubBlock(a, b);
+ for(int d=0; d<4; d++) {
+ for(int c=0; c<4; c++) {
+ r[(x*8)+(a*4)+c][(y*8)+(b*4)+d] = sb.getDest()[c][d];
+
+ }
+ }
+ }
+ }
+ }
+ }
+ return r;
+ }
+
+ public int[][] getVBuffer() {
+ int r[][]= new int [macroBlockCols*8][macroBlockRows*8];
+ for(int y=0; y<macroBlockRows; y++) {
+ for(int x=0; x<macroBlockCols; x++) {
+ MacroBlock mb = macroBlocks[x+1][y+1];
+ for(int b=0; b<2; b++) {
+ for(int a=0; a<2; a++) {
+ SubBlock sb = mb.getVSubBlock(a, b);
+ for(int d=0; d<4; d++) {
+ for(int c=0; c<4; c++) {
+ r[(x*8)+(a*4)+c][(y*8)+(b*4)+d] = sb.getDest()[c][d];
+
+ }
+ }
+ }
+ }
+ }
+ }
+ return r;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+ public int[][] getYBuffer() {
+ int r[][]= new int [macroBlockCols*16][macroBlockRows*16];
+ for(int y=0; y<macroBlockRows; y++) {
+ for(int x=0; x<macroBlockCols; x++) {
+ MacroBlock mb = macroBlocks[x+1][y+1];
+ for(int b=0; b<4; b++) {
+ for(int a=0; a<4; a++) {
+ SubBlock sb = mb.getYSubBlock(a, b);
+ for(int d=0; d<4; d++) {
+ for(int c=0; c<4; c++) {
+ r[(x*16)+(a*4)+c][(y*16)+(b*4)+d] = sb.getDest()[c][d];
+
+ }
+ }
+ }
+ }
+ }
+ }
+ return r;
+ }
+
+ public void loopFilter() {
+ LoopFilter.loopFilter(this);
+ }
+
+ private void readModes(BoolDecoder bc) throws IOException {
+ int mb_row = -1;
+ int prob_skip_false = 0;
+
+ if (macroBlockNoCoeffSkip > 0) {
+ prob_skip_false = bc.readLiteral(8);
+ }
+
+ while (++mb_row < macroBlockRows) {
+ int mb_col = -1;
+ while (++mb_col < macroBlockCols) {
+
+ //if (this.segmentation_enabled > 0) {
+ // logger.log(Level.SEVERE, "TODO:");
+ // throw new IllegalArgumentException("bad input: segmentation_enabled()");
+ //}
+ // Read the macroblock coeff skip flag if this feature is in
+ // use, else default to 0
+ MacroBlock mb = getMacroBlock(mb_col, mb_row);
+
+ if ((segmentationIsEnabled >0) &&( updateMacroBlockSegmentationMap > 0)) {
+ int value = bc.readTree(Globals.macroBlockSegmentTree, this.macroBlockSegmentTreeProbs);
+ mb.setSegmentId(value);
+ }
+
+ if(modeRefLoopFilterDeltaEnabled > 0) {
+ int level = filterLevel;
+ level = level + refLoopFilterDeltas[0];
+ level = (level < 0) ? 0 : (level > 63) ? 63 : level;
+ mb.setFilterLevel(level);
+ }
+ else {
+ mb.setFilterLevel(segmentQuants.getSegQuants()[mb.getSegmentId()].getFilterStrength());
+// logger.error("TODO:");
+ }
+
+ int mb_skip_coeff = 0;
+ if (macroBlockNoCoeffSkip > 0)
+ mb_skip_coeff = bc.readBool(prob_skip_false);
+ else
+ mb_skip_coeff = 0;
+ mb.setSkipCoeff(mb_skip_coeff);
+
+ int y_mode = readYMode(bc);
+
+ mb.setYMode(y_mode);
+
+ if (y_mode == Globals.B_PRED) {
+
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+
+ SubBlock sb = mb.getYSubBlock(j, i);
+
+ SubBlock A = getAboveSubBlock(sb, SubBlock.PLANE.Y1);
+
+ SubBlock L = getLeftSubBlock(sb, SubBlock.PLANE.Y1);
+
+ int mode = readSubBlockMode(bc, A.getMode(), L.getMode());
+
+ sb.setMode(mode);
+
+ }
+ }
+ if(modeRefLoopFilterDeltaEnabled > 0) {
+ int level = mb.getFilterLevel();
+ level = level + this.modeLoopFilterDeltas[0];
+ level = (level < 0) ? 0 : (level > 63) ? 63 : level;
+ mb.setFilterLevel(level);
+ }
+ } else {
+ int BMode;
+
+
+ switch (y_mode) {
+ case Globals.DC_PRED:
+ BMode = Globals.B_DC_PRED;
+ break;
+ case Globals.V_PRED:
+ BMode = Globals.B_VE_PRED;
+ break;
+ case Globals.H_PRED:
+ BMode = Globals.B_HE_PRED;
+ break;
+ case Globals.TM_PRED:
+ BMode = Globals.B_TM_PRED;
+ break;
+ default:
+ BMode = Globals.B_DC_PRED;
+ break;
+ }
+ for (int x = 0; x < 4; x++) {
+ for (int y = 0; y < 4; y++) {
+ SubBlock sb = mb.getYSubBlock(x, y);
+ sb.setMode(BMode);
+ }
+ }
+ }
+ int mode = readUvMode(bc);
+ mb.setUvMode(mode);
+ }
+ }
+ }
+
+
+
+ private int readPartitionSize(long l) throws IOException {
+ frame.seek(l);
+ int size =frame.readUnsignedByte() + (frame.readUnsignedByte() << 8) + (frame.readUnsignedByte() << 16);
+ return size;
+
+ }
+ private int readSubBlockMode(BoolDecoder bc, int A, int L) throws IOException {
+ int i = bc.readTree(Globals.vp8SubBlockModeTree, Globals.vp8KeyFrameSubBlockModeProb[A][L]);
+ return i;
+ }
+ private int readUvMode(BoolDecoder bc) throws IOException {
+ int i = bc.readTree(Globals.vp8UVModeTree, Globals.vp8KeyFrameUVModeProb);
+ return i;
+ }
+
+ private int readYMode(BoolDecoder bc) throws IOException {
+ int i = bc.readTree(Globals.vp8KeyFrameYModeTree, Globals.vp8KeyFrameYModeProb);
+ return i;
+ }
+
+ public void removeIIOReadProgressListener(IIOReadProgressListener listener) {
+ _listeners.remove(listener);
+ }
+
+ public void setBuffersToCreate (int count) {
+ this.buffersToCreate = 3+count;
+ this.bufferCount=0;
+ }
+
+ private void setupTokenDecoder(BoolDecoder bc, int first_partition_length_in_bytes, long offset) throws IOException {
+
+ long partitionSize = 0;
+ long partitionsStart = offset+first_partition_length_in_bytes;
+ long partition = partitionsStart;
+ multiTokenPartition = bc.readLiteral(2);
+ int num_part = 1 << multiTokenPartition;
+ if (num_part > 1) {
+ partition += 3 * (num_part - 1);
+ }
+ for (int i = 0; i < num_part; i++) {
+ /*
+ * Calculate the length of this partition. The last partition size
+ * is implicit.
+ */
+ if (i < num_part - 1) {
+
+ partitionSize = readPartitionSize(partitionsStart+(i*3));
+ bc.seek();
+ } else {
+ partitionSize = frame.length() - partition;
+ }
+
+ tokenBoolDecoders.add(new BoolDecoder(frame, partition));
+ partition+=partitionSize;
+ }
+ tokenBoolDecoder = tokenBoolDecoders.elementAt(0);
+ }
+
+ public void useBufferedImage(BufferedImage dst) {
+ WritableRaster imRas = dst.getWritableTile(0, 0);
+
+ for(int x = 0; x< getWidth(); x++) {
+ for(int y = 0; y< getHeight(); y++) {
+ int c[] = new int[3];
+ int yy, u, v;
+ yy = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.Y1, (x%16)/4, (y%16)/4).getDest()[x%4][y%4];
+ u = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.U, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4];
+ v = this.getMacroBlock(x/16, y/16).getSubBlock(SubBlock.PLANE.V, ((x/2)%8)/4, ((y/2)%8)/4).getDest()[(x/2)%4][(y/2)%4];
+ c[0] = (int)( 1.164*(yy-16)+1.596*(v-128) );
+ c[1] = (int)( 1.164*(yy-16)-0.813*(v-128)-0.391*(u-128) );
+ c[2] = (int)( 1.164*(yy-16)+2.018*(u-128) );
+
+ for(int z=0; z<3; z++) {
+ if(c[z]<0)
+ c[z]=0;
+ if(c[z]>255)
+ c[z]=255;
+ }
+ imRas.setPixel(x, y, c);
+ }
+ fireRGBProgressUpdate(100.0F*x/getWidth());
+ }
+ }
+ public void setFrame(ImageInputStream frame) {
+ try {
+ this.frame.flush();
+ this.frame.close();
+ this.frame = frame;
+ offset = frame.getStreamPosition();
+ this.coefProbs=Globals.getDefaultCoefProbs();
+ tokenBoolDecoders = new Vector<BoolDecoder>();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java b/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java
index 7b13ae3..6fec7d8 100644
--- a/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java
+++ b/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/xmi/IXmiClassDiagram.java b/src/net/sourceforge/plantuml/xmi/IXmiClassDiagram.java
index d0eb0f5..8546938 100644
--- a/src/net/sourceforge/plantuml/xmi/IXmiClassDiagram.java
+++ b/src/net/sourceforge/plantuml/xmi/IXmiClassDiagram.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
diff --git a/src/net/sourceforge/plantuml/xmi/XmiClassDiagramArgo.java b/src/net/sourceforge/plantuml/xmi/XmiClassDiagramArgo.java
index c03bce2..1aa726f 100644
--- a/src/net/sourceforge/plantuml/xmi/XmiClassDiagramArgo.java
+++ b/src/net/sourceforge/plantuml/xmi/XmiClassDiagramArgo.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -241,7 +241,7 @@ public class XmiClassDiagramArgo implements IXmiClassDiagram {
final Element feature = document.createElement("UML:Classifier.feature");
cla.appendChild(feature);
- for (Member m : entity.getFieldsToDisplay()) {
+ for (Member m : entity.getBodier().getFieldsToDisplay()) {
// <UML:Attribute xmi.id="UMLAttribute.6" name="Attribute1"
// visibility="public" isSpecification="false"
// ownerScope="instance" changeability="changeable"
@@ -252,7 +252,7 @@ public class XmiClassDiagramArgo implements IXmiClassDiagram {
feature.appendChild(attribute);
}
- for (Member m : entity.getMethodsToDisplay()) {
+ for (Member m : entity.getBodier().getMethodsToDisplay()) {
// <UML:Operation xmi.id="UMLOperation.7" name="Operation1"
// visibility="public" isSpecification="false"
// ownerScope="instance" isQuery="false" concurrency="sequential"
diff --git a/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStandard.java b/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStandard.java
index a01e142..868c2ab 100644
--- a/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStandard.java
+++ b/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStandard.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -249,7 +249,7 @@ public class XmiClassDiagramStandard implements IXmiClassDiagram {
final Element feature = document.createElement("UML:Classifier.feature");
cla.appendChild(feature);
- for (Member m : entity.getFieldsToDisplay()) {
+ for (Member m : entity.getBodier().getFieldsToDisplay()) {
// <UML:Attribute xmi.id="UMLAttribute.6" name="Attribute1"
// visibility="public" isSpecification="false"
// ownerScope="instance" changeability="changeable"
@@ -260,7 +260,7 @@ public class XmiClassDiagramStandard implements IXmiClassDiagram {
feature.appendChild(attribute);
}
- for (Member m : entity.getMethodsToDisplay()) {
+ for (Member m : entity.getBodier().getMethodsToDisplay()) {
// <UML:Operation xmi.id="UMLOperation.7" name="Operation1"
// visibility="public" isSpecification="false"
// ownerScope="instance" isQuery="false" concurrency="sequential"
diff --git a/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStar.java b/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStar.java
index d9c32a0..260b59e 100644
--- a/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStar.java
+++ b/src/net/sourceforge/plantuml/xmi/XmiClassDiagramStar.java
@@ -2,9 +2,9 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2014, Arnaud Roques
+ * (C) Copyright 2009-2017, Arnaud Roques
*
- * Project Info: http://plantuml.sourceforge.net
+ * Project Info: http://plantuml.com
*
* This file is part of PlantUML.
*
@@ -246,7 +246,7 @@ public class XmiClassDiagramStar implements IXmiClassDiagram {
final Element feature = document.createElement("UML:Classifier.feature");
cla.appendChild(feature);
- for (Member m : entity.getFieldsToDisplay()) {
+ for (Member m : entity.getBodier().getFieldsToDisplay()) {
// <UML:Attribute xmi.id="UMLAttribute.6" name="Attribute1"
// visibility="public" isSpecification="false"
// ownerScope="instance" changeability="changeable"
@@ -257,7 +257,7 @@ public class XmiClassDiagramStar implements IXmiClassDiagram {
feature.appendChild(attribute);
}
- for (Member m : entity.getMethodsToDisplay()) {
+ for (Member m : entity.getBodier().getMethodsToDisplay()) {
// <UML:Operation xmi.id="UMLOperation.7" name="Operation1"
// visibility="public" isSpecification="false"
// ownerScope="instance" isQuery="false" concurrency="sequential"
diff --git a/src/sprites/archimate/access.png b/src/sprites/archimate/access.png
new file mode 100644
index 0000000..8e3ed7c
--- /dev/null
+++ b/src/sprites/archimate/access.png
Binary files differ
diff --git a/src/sprites/archimate/activity.png b/src/sprites/archimate/activity.png
new file mode 100644
index 0000000..cd291c1
--- /dev/null
+++ b/src/sprites/archimate/activity.png
Binary files differ
diff --git a/src/sprites/archimate/actor.png b/src/sprites/archimate/actor.png
new file mode 100644
index 0000000..e0a66a6
--- /dev/null
+++ b/src/sprites/archimate/actor.png
Binary files differ
diff --git a/src/sprites/archimate/aggregation.png b/src/sprites/archimate/aggregation.png
new file mode 100644
index 0000000..9ca0b9a
--- /dev/null
+++ b/src/sprites/archimate/aggregation.png
Binary files differ
diff --git a/src/sprites/archimate/application-collaboration.png b/src/sprites/archimate/application-collaboration.png
new file mode 100644
index 0000000..83cfd9a
--- /dev/null
+++ b/src/sprites/archimate/application-collaboration.png
Binary files differ
diff --git a/src/sprites/archimate/application-component.png b/src/sprites/archimate/application-component.png
new file mode 100644
index 0000000..bfd10c3
--- /dev/null
+++ b/src/sprites/archimate/application-component.png
Binary files differ
diff --git a/src/sprites/archimate/application-data-object.png b/src/sprites/archimate/application-data-object.png
new file mode 100644
index 0000000..3371fbb
--- /dev/null
+++ b/src/sprites/archimate/application-data-object.png
Binary files differ
diff --git a/src/sprites/archimate/application-function.png b/src/sprites/archimate/application-function.png
new file mode 100644
index 0000000..3247f34
--- /dev/null
+++ b/src/sprites/archimate/application-function.png
Binary files differ
diff --git a/src/sprites/archimate/application-interaction.png b/src/sprites/archimate/application-interaction.png
new file mode 100644
index 0000000..0084c6d
--- /dev/null
+++ b/src/sprites/archimate/application-interaction.png
Binary files differ
diff --git a/src/sprites/archimate/application-interface.png b/src/sprites/archimate/application-interface.png
new file mode 100644
index 0000000..7663ba5
--- /dev/null
+++ b/src/sprites/archimate/application-interface.png
Binary files differ
diff --git a/src/sprites/archimate/application-service.png b/src/sprites/archimate/application-service.png
new file mode 100644
index 0000000..411291f
--- /dev/null
+++ b/src/sprites/archimate/application-service.png
Binary files differ
diff --git a/src/sprites/archimate/assessment-filled.png b/src/sprites/archimate/assessment-filled.png
new file mode 100644
index 0000000..94eee5d
--- /dev/null
+++ b/src/sprites/archimate/assessment-filled.png
Binary files differ
diff --git a/src/sprites/archimate/assessment.png b/src/sprites/archimate/assessment.png
new file mode 100644
index 0000000..a713754
--- /dev/null
+++ b/src/sprites/archimate/assessment.png
Binary files differ
diff --git a/src/sprites/archimate/assignment.png b/src/sprites/archimate/assignment.png
new file mode 100644
index 0000000..4dc80e6
--- /dev/null
+++ b/src/sprites/archimate/assignment.png
Binary files differ
diff --git a/src/sprites/archimate/association.png b/src/sprites/archimate/association.png
new file mode 100644
index 0000000..17625f4
--- /dev/null
+++ b/src/sprites/archimate/association.png
Binary files differ
diff --git a/src/sprites/archimate/business-activity.png b/src/sprites/archimate/business-activity.png
new file mode 100644
index 0000000..e7738a0
--- /dev/null
+++ b/src/sprites/archimate/business-activity.png
Binary files differ
diff --git a/src/sprites/archimate/business-actor.png b/src/sprites/archimate/business-actor.png
new file mode 100644
index 0000000..57b9683
--- /dev/null
+++ b/src/sprites/archimate/business-actor.png
Binary files differ
diff --git a/src/sprites/archimate/business-collaboration.png b/src/sprites/archimate/business-collaboration.png
new file mode 100644
index 0000000..d716f62
--- /dev/null
+++ b/src/sprites/archimate/business-collaboration.png
Binary files differ
diff --git a/src/sprites/archimate/business-contract.png b/src/sprites/archimate/business-contract.png
new file mode 100644
index 0000000..351e0ef
--- /dev/null
+++ b/src/sprites/archimate/business-contract.png
Binary files differ
diff --git a/src/sprites/archimate/business-event.png b/src/sprites/archimate/business-event.png
new file mode 100644
index 0000000..8ad664e
--- /dev/null
+++ b/src/sprites/archimate/business-event.png
Binary files differ
diff --git a/src/sprites/archimate/business-function.png b/src/sprites/archimate/business-function.png
new file mode 100644
index 0000000..ef5d9a5
--- /dev/null
+++ b/src/sprites/archimate/business-function.png
Binary files differ
diff --git a/src/sprites/archimate/business-interaction.png b/src/sprites/archimate/business-interaction.png
new file mode 100644
index 0000000..2ee9336
--- /dev/null
+++ b/src/sprites/archimate/business-interaction.png
Binary files differ
diff --git a/src/sprites/archimate/business-interface.png b/src/sprites/archimate/business-interface.png
new file mode 100644
index 0000000..39deb66
--- /dev/null
+++ b/src/sprites/archimate/business-interface.png
Binary files differ
diff --git a/src/sprites/archimate/business-location.png b/src/sprites/archimate/business-location.png
new file mode 100644
index 0000000..42629df
--- /dev/null
+++ b/src/sprites/archimate/business-location.png
Binary files differ
diff --git a/src/sprites/archimate/business-meaning.png b/src/sprites/archimate/business-meaning.png
new file mode 100644
index 0000000..31bb920
--- /dev/null
+++ b/src/sprites/archimate/business-meaning.png
Binary files differ
diff --git a/src/sprites/archimate/business-object.png b/src/sprites/archimate/business-object.png
new file mode 100644
index 0000000..5882de5
--- /dev/null
+++ b/src/sprites/archimate/business-object.png
Binary files differ
diff --git a/src/sprites/archimate/business-process.png b/src/sprites/archimate/business-process.png
new file mode 100644
index 0000000..ab44048
--- /dev/null
+++ b/src/sprites/archimate/business-process.png
Binary files differ
diff --git a/src/sprites/archimate/business-product.png b/src/sprites/archimate/business-product.png
new file mode 100644
index 0000000..f5f74af
--- /dev/null
+++ b/src/sprites/archimate/business-product.png
Binary files differ
diff --git a/src/sprites/archimate/business-representation.png b/src/sprites/archimate/business-representation.png
new file mode 100644
index 0000000..7f12fe7
--- /dev/null
+++ b/src/sprites/archimate/business-representation.png
Binary files differ
diff --git a/src/sprites/archimate/business-role.png b/src/sprites/archimate/business-role.png
new file mode 100644
index 0000000..9ae92fb
--- /dev/null
+++ b/src/sprites/archimate/business-role.png
Binary files differ
diff --git a/src/sprites/archimate/business-service.png b/src/sprites/archimate/business-service.png
new file mode 100644
index 0000000..2474be4
--- /dev/null
+++ b/src/sprites/archimate/business-service.png
Binary files differ
diff --git a/src/sprites/archimate/business-value.png b/src/sprites/archimate/business-value.png
new file mode 100644
index 0000000..78e45e7
--- /dev/null
+++ b/src/sprites/archimate/business-value.png
Binary files differ
diff --git a/src/sprites/archimate/collaboration.png b/src/sprites/archimate/collaboration.png
new file mode 100644
index 0000000..bbce8cb
--- /dev/null
+++ b/src/sprites/archimate/collaboration.png
Binary files differ
diff --git a/src/sprites/archimate/communication-path.png b/src/sprites/archimate/communication-path.png
new file mode 100644
index 0000000..ccd8a73
--- /dev/null
+++ b/src/sprites/archimate/communication-path.png
Binary files differ
diff --git a/src/sprites/archimate/component.png b/src/sprites/archimate/component.png
new file mode 100644
index 0000000..9e69665
--- /dev/null
+++ b/src/sprites/archimate/component.png
Binary files differ
diff --git a/src/sprites/archimate/composition.png b/src/sprites/archimate/composition.png
new file mode 100644
index 0000000..65e8360
--- /dev/null
+++ b/src/sprites/archimate/composition.png
Binary files differ
diff --git a/src/sprites/archimate/constraint-filled.png b/src/sprites/archimate/constraint-filled.png
new file mode 100644
index 0000000..13290ed
--- /dev/null
+++ b/src/sprites/archimate/constraint-filled.png
Binary files differ
diff --git a/src/sprites/archimate/constraint.png b/src/sprites/archimate/constraint.png
new file mode 100644
index 0000000..c6e781c
--- /dev/null
+++ b/src/sprites/archimate/constraint.png
Binary files differ
diff --git a/src/sprites/archimate/contract.png b/src/sprites/archimate/contract.png
new file mode 100644
index 0000000..fe9c9bf
--- /dev/null
+++ b/src/sprites/archimate/contract.png
Binary files differ
diff --git a/src/sprites/archimate/deliverable-filled.png b/src/sprites/archimate/deliverable-filled.png
new file mode 100644
index 0000000..9905438
--- /dev/null
+++ b/src/sprites/archimate/deliverable-filled.png
Binary files differ
diff --git a/src/sprites/archimate/device.png b/src/sprites/archimate/device.png
new file mode 100644
index 0000000..3b7fbee
--- /dev/null
+++ b/src/sprites/archimate/device.png
Binary files differ
diff --git a/src/sprites/archimate/driver-filled.png b/src/sprites/archimate/driver-filled.png
new file mode 100644
index 0000000..62cbb1e
--- /dev/null
+++ b/src/sprites/archimate/driver-filled.png
Binary files differ
diff --git a/src/sprites/archimate/driver.png b/src/sprites/archimate/driver.png
new file mode 100644
index 0000000..ae62eb3
--- /dev/null
+++ b/src/sprites/archimate/driver.png
Binary files differ
diff --git a/src/sprites/archimate/event.png b/src/sprites/archimate/event.png
new file mode 100644
index 0000000..5cb4990
--- /dev/null
+++ b/src/sprites/archimate/event.png
Binary files differ
diff --git a/src/sprites/archimate/flow.png b/src/sprites/archimate/flow.png
new file mode 100644
index 0000000..f31c585
--- /dev/null
+++ b/src/sprites/archimate/flow.png
Binary files differ
diff --git a/src/sprites/archimate/function.png b/src/sprites/archimate/function.png
new file mode 100644
index 0000000..2c88eb0
--- /dev/null
+++ b/src/sprites/archimate/function.png
Binary files differ
diff --git a/src/sprites/archimate/gap-filled.png b/src/sprites/archimate/gap-filled.png
new file mode 100644
index 0000000..21c84b6
--- /dev/null
+++ b/src/sprites/archimate/gap-filled.png
Binary files differ
diff --git a/src/sprites/archimate/gap.png b/src/sprites/archimate/gap.png
new file mode 100644
index 0000000..a75307d
--- /dev/null
+++ b/src/sprites/archimate/gap.png
Binary files differ
diff --git a/src/sprites/archimate/goal-filled.png b/src/sprites/archimate/goal-filled.png
new file mode 100644
index 0000000..f0d1beb
--- /dev/null
+++ b/src/sprites/archimate/goal-filled.png
Binary files differ
diff --git a/src/sprites/archimate/goal.png b/src/sprites/archimate/goal.png
new file mode 100644
index 0000000..e80c0e8
--- /dev/null
+++ b/src/sprites/archimate/goal.png
Binary files differ
diff --git a/src/sprites/archimate/influence.png b/src/sprites/archimate/influence.png
new file mode 100644
index 0000000..9fd03df
--- /dev/null
+++ b/src/sprites/archimate/influence.png
Binary files differ
diff --git a/src/sprites/archimate/interaction.png b/src/sprites/archimate/interaction.png
new file mode 100644
index 0000000..699b226
--- /dev/null
+++ b/src/sprites/archimate/interaction.png
Binary files differ
diff --git a/src/sprites/archimate/interface-required.png b/src/sprites/archimate/interface-required.png
new file mode 100644
index 0000000..1f203bd
--- /dev/null
+++ b/src/sprites/archimate/interface-required.png
Binary files differ
diff --git a/src/sprites/archimate/interface-symmetric.png b/src/sprites/archimate/interface-symmetric.png
new file mode 100644
index 0000000..421ca5d
--- /dev/null
+++ b/src/sprites/archimate/interface-symmetric.png
Binary files differ
diff --git a/src/sprites/archimate/interface.png b/src/sprites/archimate/interface.png
new file mode 100644
index 0000000..c557335
--- /dev/null
+++ b/src/sprites/archimate/interface.png
Binary files differ
diff --git a/src/sprites/archimate/junction-and.png b/src/sprites/archimate/junction-and.png
new file mode 100644
index 0000000..39fd653
--- /dev/null
+++ b/src/sprites/archimate/junction-and.png
Binary files differ
diff --git a/src/sprites/archimate/junction-or.png b/src/sprites/archimate/junction-or.png
new file mode 100644
index 0000000..a997be0
--- /dev/null
+++ b/src/sprites/archimate/junction-or.png
Binary files differ
diff --git a/src/sprites/archimate/junction.png b/src/sprites/archimate/junction.png
new file mode 100644
index 0000000..9ee76c2
--- /dev/null
+++ b/src/sprites/archimate/junction.png
Binary files differ
diff --git a/src/sprites/archimate/location.png b/src/sprites/archimate/location.png
new file mode 100644
index 0000000..acb627e
--- /dev/null
+++ b/src/sprites/archimate/location.png
Binary files differ
diff --git a/src/sprites/archimate/meaning.png b/src/sprites/archimate/meaning.png
new file mode 100644
index 0000000..4994c33
--- /dev/null
+++ b/src/sprites/archimate/meaning.png
Binary files differ
diff --git a/src/sprites/archimate/network.png b/src/sprites/archimate/network.png
new file mode 100644
index 0000000..98be4c7
--- /dev/null
+++ b/src/sprites/archimate/network.png
Binary files differ
diff --git a/src/sprites/archimate/node.png b/src/sprites/archimate/node.png
new file mode 100644
index 0000000..348dc3a
--- /dev/null
+++ b/src/sprites/archimate/node.png
Binary files differ
diff --git a/src/sprites/archimate/object.png b/src/sprites/archimate/object.png
new file mode 100644
index 0000000..2409ec2
--- /dev/null
+++ b/src/sprites/archimate/object.png
Binary files differ
diff --git a/src/sprites/archimate/plateau.png b/src/sprites/archimate/plateau.png
new file mode 100644
index 0000000..a7d63f0
--- /dev/null
+++ b/src/sprites/archimate/plateau.png
Binary files differ
diff --git a/src/sprites/archimate/principle-filled.png b/src/sprites/archimate/principle-filled.png
new file mode 100644
index 0000000..551c046
--- /dev/null
+++ b/src/sprites/archimate/principle-filled.png
Binary files differ
diff --git a/src/sprites/archimate/principle.png b/src/sprites/archimate/principle.png
new file mode 100644
index 0000000..d6174d5
--- /dev/null
+++ b/src/sprites/archimate/principle.png
Binary files differ
diff --git a/src/sprites/archimate/process.png b/src/sprites/archimate/process.png
new file mode 100644
index 0000000..e6a8f41
--- /dev/null
+++ b/src/sprites/archimate/process.png
Binary files differ
diff --git a/src/sprites/archimate/product.png b/src/sprites/archimate/product.png
new file mode 100644
index 0000000..a60eb15
--- /dev/null
+++ b/src/sprites/archimate/product.png
Binary files differ
diff --git a/src/sprites/archimate/realisation.png b/src/sprites/archimate/realisation.png
new file mode 100644
index 0000000..fbeb005
--- /dev/null
+++ b/src/sprites/archimate/realisation.png
Binary files differ
diff --git a/src/sprites/archimate/representation.png b/src/sprites/archimate/representation.png
new file mode 100644
index 0000000..0d8ac19
--- /dev/null
+++ b/src/sprites/archimate/representation.png
Binary files differ
diff --git a/src/sprites/archimate/requirement-filled.png b/src/sprites/archimate/requirement-filled.png
new file mode 100644
index 0000000..5767b4a
--- /dev/null
+++ b/src/sprites/archimate/requirement-filled.png
Binary files differ
diff --git a/src/sprites/archimate/requirement.png b/src/sprites/archimate/requirement.png
new file mode 100644
index 0000000..d5a7ee5
--- /dev/null
+++ b/src/sprites/archimate/requirement.png
Binary files differ
diff --git a/src/sprites/archimate/role.png b/src/sprites/archimate/role.png
new file mode 100644
index 0000000..d77dbad
--- /dev/null
+++ b/src/sprites/archimate/role.png
Binary files differ
diff --git a/src/sprites/archimate/service.png b/src/sprites/archimate/service.png
new file mode 100644
index 0000000..0d5c36a
--- /dev/null
+++ b/src/sprites/archimate/service.png
Binary files differ
diff --git a/src/sprites/archimate/specialisation.png b/src/sprites/archimate/specialisation.png
new file mode 100644
index 0000000..d3449a3
--- /dev/null
+++ b/src/sprites/archimate/specialisation.png
Binary files differ
diff --git a/src/sprites/archimate/stakeholder-filled.png b/src/sprites/archimate/stakeholder-filled.png
new file mode 100644
index 0000000..3925c04
--- /dev/null
+++ b/src/sprites/archimate/stakeholder-filled.png
Binary files differ
diff --git a/src/sprites/archimate/system-software.png b/src/sprites/archimate/system-software.png
new file mode 100644
index 0000000..596cb48
--- /dev/null
+++ b/src/sprites/archimate/system-software.png
Binary files differ
diff --git a/src/sprites/archimate/technology-artifact.png b/src/sprites/archimate/technology-artifact.png
new file mode 100644
index 0000000..5d87613
--- /dev/null
+++ b/src/sprites/archimate/technology-artifact.png
Binary files differ
diff --git a/src/sprites/archimate/technology-communication-path.png b/src/sprites/archimate/technology-communication-path.png
new file mode 100644
index 0000000..3d45c93
--- /dev/null
+++ b/src/sprites/archimate/technology-communication-path.png
Binary files differ
diff --git a/src/sprites/archimate/technology-device.png b/src/sprites/archimate/technology-device.png
new file mode 100644
index 0000000..ed0550a
--- /dev/null
+++ b/src/sprites/archimate/technology-device.png
Binary files differ
diff --git a/src/sprites/archimate/technology-function.png b/src/sprites/archimate/technology-function.png
new file mode 100644
index 0000000..cac91ea
--- /dev/null
+++ b/src/sprites/archimate/technology-function.png
Binary files differ
diff --git a/src/sprites/archimate/technology-infra-interface.png b/src/sprites/archimate/technology-infra-interface.png
new file mode 100644
index 0000000..ac1e4d0
--- /dev/null
+++ b/src/sprites/archimate/technology-infra-interface.png
Binary files differ
diff --git a/src/sprites/archimate/technology-infra-service.png b/src/sprites/archimate/technology-infra-service.png
new file mode 100644
index 0000000..bc398ea
--- /dev/null
+++ b/src/sprites/archimate/technology-infra-service.png
Binary files differ
diff --git a/src/sprites/archimate/technology-network.png b/src/sprites/archimate/technology-network.png
new file mode 100644
index 0000000..95ec28b
--- /dev/null
+++ b/src/sprites/archimate/technology-network.png
Binary files differ
diff --git a/src/sprites/archimate/technology-node.png b/src/sprites/archimate/technology-node.png
new file mode 100644
index 0000000..a83440b
--- /dev/null
+++ b/src/sprites/archimate/technology-node.png
Binary files differ
diff --git a/src/sprites/archimate/technology-system-software.png b/src/sprites/archimate/technology-system-software.png
new file mode 100644
index 0000000..aa729b4
--- /dev/null
+++ b/src/sprites/archimate/technology-system-software.png
Binary files differ
diff --git a/src/sprites/archimate/triggering.png b/src/sprites/archimate/triggering.png
new file mode 100644
index 0000000..f1e6f53
--- /dev/null
+++ b/src/sprites/archimate/triggering.png
Binary files differ
diff --git a/src/sprites/archimate/used-by.png b/src/sprites/archimate/used-by.png
new file mode 100644
index 0000000..ddf5905
--- /dev/null
+++ b/src/sprites/archimate/used-by.png
Binary files differ
diff --git a/src/sprites/archimate/value.png b/src/sprites/archimate/value.png
new file mode 100644
index 0000000..ab64ce4
--- /dev/null
+++ b/src/sprites/archimate/value.png
Binary files differ
diff --git a/src/sprites/archimate/workpackage-filled.png b/src/sprites/archimate/workpackage-filled.png
new file mode 100644
index 0000000..8ece99c
--- /dev/null
+++ b/src/sprites/archimate/workpackage-filled.png
Binary files differ