From 028e1e7780292168c59d0010e6362d27cf68b46e Mon Sep 17 00:00:00 2001 From: thetric Date: Thu, 4 Jan 2018 19:15:01 +0100 Subject: feat: remove lots of old code BREAKING CHANGES * XEarth diagrams are no longer supported * easter egg diagrams are no longer supported * plantuml doesn't provide a ftp server anymore * hidden "oregon" game removed * no more sudoku support * removed telnet server build: update maven compiler plugin + java level to 1.7 Refactor: * Override deprecated DirWatcher with DirWatcher2 * Remove unused package sequencediagram.puma * Remove unused package plantuml.hector * Remove unused package plantuml.geom * Remove unused package plantuml.graph * Remove plantuml.hector2 * Remove unused classes from plantuml.graph2 * Remove unused package plantuml.api.mda, plantuml.mda * Remove unused package plantuml.posimo * Remove unused package plantuml.project * Remove unused package plantuml.project2 * Remove unused package plantuml.skin.bluemodern * Remove unused class version.Professional * Remove unused classes from plantuml.api * Remove unused class bpm.FootPrint * Remove empty, unused classes * Remove math.AsciiMathOld * Remove unused flashcode.FlashCodeUtilsNone class * Remove unused classes --- pom.xml | 6 +- src/ext/plantuml/com/ctreber/acearth/ACearth.java | 373 -- .../com/ctreber/acearth/Configuration.java | 108 - .../com/ctreber/acearth/ConfigurationACearth.java | 152 - src/ext/plantuml/com/ctreber/acearth/MapData.java | 6835 -------------------- .../com/ctreber/acearth/MapDataReader.java | 110 - .../com/ctreber/acearth/gui/CanvasACearth.java | 21 - .../com/ctreber/acearth/gui/PixelCanvas.java | 72 - .../com/ctreber/acearth/plugins/Plugin.java | 46 - .../ctreber/acearth/plugins/markers/Marker.java | 187 - .../acearth/plugins/markers/PluginMarkers.java | 72 - .../com/ctreber/acearth/projection/Projection.java | 274 - .../ctreber/acearth/projection/ProjectionCyl.java | 72 - .../ctreber/acearth/projection/ProjectionMerc.java | 75 - .../acearth/projection/ProjectionOrtho.java | 71 - .../com/ctreber/acearth/renderer/RenderTarget.java | 24 - .../com/ctreber/acearth/renderer/Renderer.java | 92 - .../ctreber/acearth/renderer/RowTypeRenderer.java | 26 - .../acearth/renderer/RowTypeRendererScanBit.java | 82 - .../acearth/renderer/RowTypeRendererScanDot.java | 60 - .../ctreber/acearth/scanbit/BitGeneratorMap.java | 125 - .../acearth/scanbit/BitGeneratorMapDefault.java | 265 - .../acearth/scanbit/BitGeneratorMapOrtho.java | 170 - .../com/ctreber/acearth/scanbit/ScanBit.java | 62 - .../ctreber/acearth/scanbit/ScanBitGenerator.java | 32 - .../com/ctreber/acearth/scanbit/ScanBuf.java | 193 - .../ctreber/acearth/scandot/DotGeneratorLines.java | 72 - .../ctreber/acearth/scandot/DotGeneratorStars.java | 51 - .../com/ctreber/acearth/scandot/ScanDot.java | 67 - .../ctreber/acearth/scandot/ScanDotGenerator.java | 27 - .../com/ctreber/acearth/shader/Shader.java | 131 - .../com/ctreber/acearth/shader/ShaderDefault.java | 59 - .../com/ctreber/acearth/shader/ShaderFlat.java | 24 - .../com/ctreber/acearth/shader/ShaderOrtho.java | 55 - .../com/ctreber/acearth/util/Coordinate.java | 153 - .../com/ctreber/acearth/util/EdgeCrossing.java | 59 - .../plantuml/com/ctreber/acearth/util/Point2D.java | 35 - .../plantuml/com/ctreber/acearth/util/Point3D.java | 48 - .../plantuml/com/ctreber/acearth/util/Polygon.java | 49 - .../com/ctreber/acearth/util/StringParser.java | 99 - .../acearth/util/SunPositionCalculator.java | 260 - .../plantuml/com/ctreber/acearth/util/Toolkit.java | 135 - .../plantuml/com/ctreber/aclib/gui/MOBoolean.java | 38 - .../com/ctreber/aclib/gui/MOChangeListener.java | 13 - .../plantuml/com/ctreber/aclib/gui/MODouble.java | 74 - src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java | 86 - .../plantuml/com/ctreber/aclib/gui/MOInteger.java | 74 - .../plantuml/com/ctreber/aclib/gui/MOString.java | 36 - .../com/ctreber/aclib/gui/MonitoredObject.java | 44 - .../plantuml/com/ctreber/aclib/sort/CTSort.java | 20 - .../com/ctreber/aclib/sort/DefaultComparator.java | 19 - .../plantuml/com/ctreber/aclib/sort/QuickSort.java | 96 - src/net/sourceforge/plantuml/DirWatcher.java | 116 +- src/net/sourceforge/plantuml/DirWatcher2.java | 130 - src/net/sourceforge/plantuml/Option.java | 12 - src/net/sourceforge/plantuml/PSystemBuilder.java | 30 +- src/net/sourceforge/plantuml/QString.java | 90 - src/net/sourceforge/plantuml/Run.java | 13 - src/net/sourceforge/plantuml/SingleLine.java | 43 - .../plantuml/acearth/PSystemXearth.java | 133 - .../plantuml/acearth/PSystemXearthFactory.java | 107 - src/net/sourceforge/plantuml/api/CountRate.java | 82 - src/net/sourceforge/plantuml/api/MagicArray.java | 98 - src/net/sourceforge/plantuml/api/NiceNumber.java | 71 - .../sourceforge/plantuml/api/NumberAnalyzed2.java | 184 - .../sourceforge/plantuml/api/PlantumlUtils.java | 60 - .../plantuml/api/mda/option2/MDADiagram.java | 42 - .../plantuml/api/mda/option2/MDAEntity.java | 41 - .../plantuml/api/mda/option2/MDAPackage.java | 46 - .../plantuml/api/mda/option2/MDAUtils.java | 45 - .../plantuml/api/mda/option3/MDAVisitor.java | 39 - src/net/sourceforge/plantuml/bpm/FootPrint.java | 45 - src/net/sourceforge/plantuml/code/Spiral.java | 67 - .../plantuml/code/SpiralOnRectangle.java | 65 - src/net/sourceforge/plantuml/creole/UCreole.java | 42 - src/net/sourceforge/plantuml/eggs/EggUtils.java | 102 - .../sourceforge/plantuml/eggs/GraphicsPath.java | 84 - .../sourceforge/plantuml/eggs/PSystemAppleTwo.java | 90 - .../plantuml/eggs/PSystemAppleTwoFactory.java | 61 - .../sourceforge/plantuml/eggs/PSystemCharlie.java | 80 - .../plantuml/eggs/PSystemCharlieFactory.java | 51 - .../sourceforge/plantuml/eggs/PSystemColors.java | 282 - .../plantuml/eggs/PSystemColorsFactory.java | 56 - src/net/sourceforge/plantuml/eggs/PSystemEgg.java | 82 - .../plantuml/eggs/PSystemEggFactory.java | 68 - src/net/sourceforge/plantuml/eggs/PSystemLost.java | 78 - .../plantuml/eggs/PSystemLostFactory.java | 51 - src/net/sourceforge/plantuml/eggs/PSystemPath.java | 65 - .../plantuml/eggs/PSystemPathFactory.java | 57 - src/net/sourceforge/plantuml/eggs/PSystemRIP.java | 464 -- .../plantuml/eggs/PSystemRIPFactory.java | 59 - .../sourceforge/plantuml/eggs/SentenceDecoder.java | 69 - .../plantuml/eggs/SentenceProducer.java | 55 - .../plantuml/flashcode/FlashCodeFactory.java | 12 +- .../plantuml/flashcode/FlashCodeUtilsNone.java | 47 - src/net/sourceforge/plantuml/ftp/FtpConnexion.java | 206 - src/net/sourceforge/plantuml/ftp/FtpLoop.java | 333 - src/net/sourceforge/plantuml/ftp/FtpServer.java | 128 - .../sourceforge/plantuml/geom/AbstractFigure.java | 315 - .../plantuml/geom/AbstractPolyline.java | 200 - src/net/sourceforge/plantuml/geom/Box.java | 240 - src/net/sourceforge/plantuml/geom/ClosedArea.java | 297 - .../sourceforge/plantuml/geom/CollectionUtils.java | 86 - src/net/sourceforge/plantuml/geom/Dijkstra.java | 130 - src/net/sourceforge/plantuml/geom/InflateData.java | 67 - .../plantuml/geom/InflationTransform.java | 211 - src/net/sourceforge/plantuml/geom/Kingdom.java | 123 - .../sourceforge/plantuml/geom/LineSegmentInt.java | 268 - .../sourceforge/plantuml/geom/Neighborhood.java | 119 - src/net/sourceforge/plantuml/geom/Orientation.java | 42 - src/net/sourceforge/plantuml/geom/Point2DInt.java | 122 - src/net/sourceforge/plantuml/geom/Pointable.java | 40 - src/net/sourceforge/plantuml/geom/Polyline.java | 50 - .../plantuml/geom/PolylineBreakeable.java | 154 - .../sourceforge/plantuml/geom/PolylineImpl.java | 100 - src/net/sourceforge/plantuml/geom/Singularity.java | 154 - src/net/sourceforge/plantuml/geom/SpiderWeb.java | 183 - src/net/sourceforge/plantuml/geom/XMoveable.java | 42 - .../plantuml/geom/kinetic/Quadrant.java | 82 - .../plantuml/geom/kinetic/QuadrantMapper.java | 106 - .../sourceforge/plantuml/geom/kinetic/World.java | 173 - src/net/sourceforge/plantuml/golem/Magnet.java | 39 - src/net/sourceforge/plantuml/golem/Square.java | 39 - src/net/sourceforge/plantuml/graph/ALink.java | 48 - src/net/sourceforge/plantuml/graph/ALinkImpl.java | 73 - src/net/sourceforge/plantuml/graph/ANode.java | 48 - src/net/sourceforge/plantuml/graph/ANodeImpl.java | 78 - .../plantuml/graph/AbstractEntityImage.java | 115 - src/net/sourceforge/plantuml/graph/Board.java | 267 - .../plantuml/graph/BoardCollection.java | 128 - .../sourceforge/plantuml/graph/BoardExplorer.java | 86 - .../sourceforge/plantuml/graph/CostComputer.java | 42 - .../sourceforge/plantuml/graph/ElectricCharge.java | 70 - .../sourceforge/plantuml/graph/ElectricWord.java | 68 - .../plantuml/graph/EntityImageActivityBar.java | 66 - .../plantuml/graph/EntityImageActivityBranch.java | 73 - .../plantuml/graph/EntityImageActivityCircle.java | 70 - .../plantuml/graph/EntityImageCircleInterface.java | 92 - src/net/sourceforge/plantuml/graph/Galaxy4.java | 94 - .../plantuml/graph/GeneralPathFactory.java | 158 - src/net/sourceforge/plantuml/graph/Graph1.java | 81 - src/net/sourceforge/plantuml/graph/Heap.java | 242 - .../plantuml/graph/KenavoCostComputer.java | 78 - .../plantuml/graph/LenghtLinkComparator.java | 61 - src/net/sourceforge/plantuml/graph/LinkString.java | 66 - .../plantuml/graph/MethodsOrFieldsArea.java | 96 - src/net/sourceforge/plantuml/graph/Move.java | 78 - src/net/sourceforge/plantuml/graph/Oven.java | 95 - .../plantuml/graph/SimpleCostComputer.java | 60 - .../plantuml/graph/SortedCollection.java | 46 - .../plantuml/graph/SortedCollectionArrayList.java | 89 - .../plantuml/graph/SortedCollectionLinked.java | 89 - src/net/sourceforge/plantuml/graph/Zoda1.java | 168 - src/net/sourceforge/plantuml/graph/Zoda2.java | 126 - .../plantuml/graph2/CubicCurveFactory.java | 97 - src/net/sourceforge/plantuml/graph2/Dijkstra.java | 156 - .../plantuml/graph2/IInflationTransform.java | 57 - .../graph2/IdentityInflationTransform.java | 70 - .../sourceforge/plantuml/graph2/InflateData2.java | 126 - .../plantuml/graph2/InflationTransform2.java | 240 - .../plantuml/graph2/MagicPointsFactory.java | 75 - .../plantuml/graph2/MagicPointsFactory2.java | 73 - src/net/sourceforge/plantuml/graph2/Measurer.java | 40 - src/net/sourceforge/plantuml/graph2/MyCurve.java | 173 - .../sourceforge/plantuml/graph2/Neighborhood2.java | 190 - src/net/sourceforge/plantuml/graph2/Plan.java | 255 - src/net/sourceforge/plantuml/graph2/Polyline2.java | 111 - .../plantuml/graph2/RectanglesCollection.java | 200 - .../sourceforge/plantuml/graph2/Singularity2.java | 164 - .../sourceforge/plantuml/graph2/SortedList.java | 46 - .../plantuml/graph2/SortedListImpl.java | 129 - src/net/sourceforge/plantuml/hector/Box2D.java | 81 - .../hector/CucaDiagramFileMakerHectorB1.java | 169 - .../sourceforge/plantuml/hector/GrowingTree.java | 175 - .../sourceforge/plantuml/hector/HectorPath.java | 72 - src/net/sourceforge/plantuml/hector/Pin.java | 78 - .../sourceforge/plantuml/hector/PinFactory.java | 68 - src/net/sourceforge/plantuml/hector/PinLink.java | 78 - .../plantuml/hector/PinLinksContinuousSet.java | 104 - src/net/sourceforge/plantuml/hector/Skeleton.java | 85 - .../plantuml/hector/SkeletonBuilder.java | 85 - .../plantuml/hector/SkeletonConfiguration.java | 256 - .../hector/SkeletonConfigurationComparator.java | 60 - .../hector/SkeletonConfigurationEvaluator.java | 42 - .../SkeletonConfigurationEvaluatorLineLenght.java | 48 - .../plantuml/hector/SkeletonConfigurationSet.java | 90 - .../hector/SkeletonConfigurationUtils.java | 57 - .../plantuml/hector/SkeletonConfigurations.java | 40 - .../plantuml/hector/SkeletonMutation.java | 42 - .../plantuml/hector/SmartConnection.java | 111 - .../plantuml/hector/UnlinarCompressedPlan.java | 144 - .../plantuml/hector/UnlinearCompression.java | 112 - src/net/sourceforge/plantuml/hector2/MinMax.java | 99 - .../plantuml/hector2/continuity/Skeleton.java | 189 - .../hector2/continuity/SkeletonBuilder.java | 87 - .../sourceforge/plantuml/hector2/graphic/Foo1.java | 67 - .../sourceforge/plantuml/hector2/graphic/Foo2.java | 108 - .../plantuml/hector2/layering/Layer.java | 117 - .../plantuml/hector2/layering/LayerFactory.java | 67 - .../plantuml/hector2/mpos/Distribution.java | 114 - .../plantuml/hector2/mpos/MutationLayer.java | 46 - .../plantuml/hector2/mpos/MutationLayerMove.java | 67 - .../sourceforge/plantuml/jungle/GNodeUtils.java | 56 - .../sourceforge/plantuml/math/AsciiMathOld.java | 151 - .../sourceforge/plantuml/math/AsciiMathParser.js | 846 --- .../sourceforge/plantuml/mda/MDADiagramImpl.java | 85 - .../sourceforge/plantuml/mda/MDAEntityImpl.java | 53 - .../sourceforge/plantuml/mda/MDAPackageImpl.java | 71 - src/net/sourceforge/plantuml/oregon/BasicGame.java | 43 - src/net/sourceforge/plantuml/oregon/Keyboard.java | 42 - .../sourceforge/plantuml/oregon/KeyboardList.java | 66 - .../sourceforge/plantuml/oregon/MagicTable.java | 233 - .../plantuml/oregon/NoInputException.java | 39 - .../plantuml/oregon/OregonBasicGame.java | 940 --- .../sourceforge/plantuml/oregon/PSystemOregon.java | 115 - .../plantuml/oregon/PSystemOregonFactory.java | 65 - src/net/sourceforge/plantuml/oregon/Screen.java | 65 - .../sourceforge/plantuml/oregon/SecureCoder.java | 72 - .../sourceforge/plantuml/oregon/SmartKeyboard.java | 75 - .../plantuml/posimo/AbstractEntityImage2.java | 85 - src/net/sourceforge/plantuml/posimo/Decor.java | 45 - .../plantuml/posimo/DecorInterfaceProvider.java | 80 - .../plantuml/posimo/EntityImageNote2.java | 81 - src/net/sourceforge/plantuml/posimo/Frame.java | 133 - .../plantuml/posimo/IEntityImageBlock.java | 49 - .../sourceforge/plantuml/posimo/LabelImage.java | 84 - .../plantuml/posimo/LineRectIntersection.java | 83 - .../plantuml/posimo/LineSegmentIntersection.java | 81 - .../sourceforge/plantuml/posimo/MargedBlock.java | 90 - src/net/sourceforge/plantuml/posimo/Mirror.java | 54 - .../sourceforge/plantuml/posimo/PathDrawer.java | 46 - .../plantuml/posimo/PathDrawerInterface.java | 329 - src/net/sourceforge/plantuml/posimo/Racorder.java | 44 - .../plantuml/posimo/RacorderAbstract.java | 58 - .../plantuml/posimo/RacorderFollowTangeante.java | 73 - .../posimo/RacorderFollowTangeanteOld.java | 58 - .../plantuml/posimo/RacorderInToCenter.java | 57 - .../plantuml/posimo/RacorderOrthogonal.java | 83 - .../sourceforge/plantuml/posimo/SimpleDrawer.java | 99 - .../plantuml/posimo/TwoLinesIntersection.java | 73 - src/net/sourceforge/plantuml/posimo/data.txt | 38 - .../plantuml/project/BasicInstantArithmetic.java | 84 - src/net/sourceforge/plantuml/project/Constant.java | 58 - src/net/sourceforge/plantuml/project/Day.java | 177 - src/net/sourceforge/plantuml/project/DayClose.java | 42 - .../sourceforge/plantuml/project/DayCloseNone.java | 44 - .../sourceforge/plantuml/project/DayCloseOr.java | 58 - .../plantuml/project/DayCloseWeekDay.java | 53 - src/net/sourceforge/plantuml/project/Duration.java | 82 - .../sourceforge/plantuml/project/Expression.java | 46 - src/net/sourceforge/plantuml/project/Formal.java | 40 - .../plantuml/project/FormalAddition.java | 60 - .../project/FormalAdditionInstantDuration.java | 67 - .../sourceforge/plantuml/project/FreeVariable.java | 71 - .../plantuml/project/IncompleteItem.java | 192 - src/net/sourceforge/plantuml/project/Instant.java | 87 - .../plantuml/project/InstantArithmetic.java | 45 - src/net/sourceforge/plantuml/project/Item.java | 62 - .../sourceforge/plantuml/project/ItemCaract.java | 73 - .../plantuml/project/ItemComparator.java | 60 - src/net/sourceforge/plantuml/project/Jalon.java | 95 - src/net/sourceforge/plantuml/project/Load.java | 80 - src/net/sourceforge/plantuml/project/Month.java | 90 - src/net/sourceforge/plantuml/project/Numeric.java | 43 - .../plantuml/project/NumericNumber.java | 77 - .../sourceforge/plantuml/project/NumericType.java | 80 - .../plantuml/project/PSystemProject.java | 129 - .../sourceforge/plantuml/project/ParentItem.java | 133 - src/net/sourceforge/plantuml/project/Project.java | 283 - .../sourceforge/plantuml/project/Ressource.java | 60 - src/net/sourceforge/plantuml/project/WeekDay.java | 62 - .../project/command/CommandAffectation.java | 61 - .../project/command/CommandCloseWeekDay.java | 58 - .../project/graphic/GanttDiagramUnused.java | 140 - .../plantuml/project/graphic/ItemHeader.java | 116 - .../plantuml/project/graphic/TimeScale.java | 159 - .../sequencediagram/graphic/FreeYStrategy.java | 45 - .../graphic/FreeYStrategyBasic.java | 49 - .../plantuml/sequencediagram/puma/FixedLink.java | 60 - .../plantuml/sequencediagram/puma/PSegment.java | 73 - .../plantuml/sequencediagram/puma/PUnivers.java | 71 - .../sequencediagram/puma/PushDirection.java | 41 - .../plantuml/sequencediagram/puma/PushSide.java | 41 - .../sequencediagram/puma/PushStrategy.java | 41 - .../sequencediagram/puma/SegmentPosition.java | 57 - .../AbstractComponentBlueModernArrow.java | 94 - .../plantuml/skin/bluemodern/BlueModern.java | 188 - .../bluemodern/ComponentBlueModernActiveLine.java | 82 - .../skin/bluemodern/ComponentBlueModernActor.java | 99 - .../skin/bluemodern/ComponentBlueModernArrow.java | 197 - .../bluemodern/ComponentBlueModernDelayLine.java | 79 - .../bluemodern/ComponentBlueModernDelayText.java | 84 - .../bluemodern/ComponentBlueModernDivider.java | 114 - .../bluemodern/ComponentBlueModernEnglober.java | 97 - .../ComponentBlueModernGroupingHeader.java | 161 - .../skin/bluemodern/ComponentBlueModernLine.java | 76 - .../bluemodern/ComponentBlueModernNewpage.java | 74 - .../skin/bluemodern/ComponentBlueModernNote.java | 119 - .../bluemodern/ComponentBlueModernParticipant.java | 92 - .../bluemodern/ComponentBlueModernSelfArrow.java | 157 - .../plantuml/skin/bluemodern/FillRoundShape.java | 80 - .../plantuml/skin/bluemodern/ShadowShape.java | 47 - .../plantuml/stats/StatsUtilsIncrement.java | 14 +- src/net/sourceforge/plantuml/sudoku/DLXEngine.java | 1175 ---- .../plantuml/sudoku/GraphicsSudoku.java | 170 - src/net/sourceforge/plantuml/sudoku/ISudoku.java | 46 - .../sourceforge/plantuml/sudoku/PSystemSudoku.java | 76 - .../plantuml/sudoku/PSystemSudokuFactory.java | 62 - src/net/sourceforge/plantuml/sudoku/SudokuDLX.java | 92 - .../plantuml/svek/ArithmeticStrategyMax.java | 52 - src/net/sourceforge/plantuml/svek/Line.java | 20 - src/net/sourceforge/plantuml/svek/Oscillator.java | 89 - .../sourceforge/plantuml/swing/MainWindow2.java | 8 +- .../plantuml/telnet/AcceptTelnetClient.java | 92 - .../sourceforge/plantuml/telnet/TelnetServer.java | 50 - .../sourceforge/plantuml/ugraphic/InflaterSet.java | 69 - .../plantuml/ugraphic/sprite/SpriteGrayLevel.java | 18 - .../plantuml/ugraphic/svg/DriverNoneSvg.java | 48 - 318 files changed, 75 insertions(+), 39334 deletions(-) delete mode 100644 src/ext/plantuml/com/ctreber/acearth/ACearth.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/Configuration.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/MapData.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/MapDataReader.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/projection/Projection.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/shader/Shader.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/Point2D.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/Point3D.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/Polygon.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/StringParser.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java delete mode 100644 src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MOString.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java delete mode 100644 src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java delete mode 100644 src/net/sourceforge/plantuml/DirWatcher2.java delete mode 100644 src/net/sourceforge/plantuml/QString.java delete mode 100644 src/net/sourceforge/plantuml/SingleLine.java delete mode 100644 src/net/sourceforge/plantuml/acearth/PSystemXearth.java delete mode 100644 src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java delete mode 100644 src/net/sourceforge/plantuml/api/CountRate.java delete mode 100644 src/net/sourceforge/plantuml/api/MagicArray.java delete mode 100644 src/net/sourceforge/plantuml/api/NiceNumber.java delete mode 100644 src/net/sourceforge/plantuml/api/NumberAnalyzed2.java delete mode 100644 src/net/sourceforge/plantuml/api/PlantumlUtils.java delete mode 100644 src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java delete mode 100644 src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java delete mode 100644 src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java delete mode 100644 src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java delete mode 100644 src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java delete mode 100644 src/net/sourceforge/plantuml/bpm/FootPrint.java delete mode 100644 src/net/sourceforge/plantuml/code/Spiral.java delete mode 100644 src/net/sourceforge/plantuml/code/SpiralOnRectangle.java delete mode 100644 src/net/sourceforge/plantuml/creole/UCreole.java delete mode 100644 src/net/sourceforge/plantuml/eggs/EggUtils.java delete mode 100644 src/net/sourceforge/plantuml/eggs/GraphicsPath.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemCharlie.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemColors.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemColorsFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemEgg.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemLost.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemPath.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemRIP.java delete mode 100644 src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java delete mode 100644 src/net/sourceforge/plantuml/eggs/SentenceDecoder.java delete mode 100644 src/net/sourceforge/plantuml/eggs/SentenceProducer.java delete mode 100644 src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java delete mode 100644 src/net/sourceforge/plantuml/ftp/FtpConnexion.java delete mode 100644 src/net/sourceforge/plantuml/ftp/FtpLoop.java delete mode 100644 src/net/sourceforge/plantuml/ftp/FtpServer.java delete mode 100644 src/net/sourceforge/plantuml/geom/AbstractFigure.java delete mode 100644 src/net/sourceforge/plantuml/geom/AbstractPolyline.java delete mode 100644 src/net/sourceforge/plantuml/geom/Box.java delete mode 100644 src/net/sourceforge/plantuml/geom/ClosedArea.java delete mode 100644 src/net/sourceforge/plantuml/geom/CollectionUtils.java delete mode 100644 src/net/sourceforge/plantuml/geom/Dijkstra.java delete mode 100644 src/net/sourceforge/plantuml/geom/InflateData.java delete mode 100644 src/net/sourceforge/plantuml/geom/InflationTransform.java delete mode 100644 src/net/sourceforge/plantuml/geom/Kingdom.java delete mode 100644 src/net/sourceforge/plantuml/geom/LineSegmentInt.java delete mode 100644 src/net/sourceforge/plantuml/geom/Neighborhood.java delete mode 100644 src/net/sourceforge/plantuml/geom/Orientation.java delete mode 100644 src/net/sourceforge/plantuml/geom/Point2DInt.java delete mode 100644 src/net/sourceforge/plantuml/geom/Pointable.java delete mode 100644 src/net/sourceforge/plantuml/geom/Polyline.java delete mode 100644 src/net/sourceforge/plantuml/geom/PolylineBreakeable.java delete mode 100644 src/net/sourceforge/plantuml/geom/PolylineImpl.java delete mode 100644 src/net/sourceforge/plantuml/geom/Singularity.java delete mode 100644 src/net/sourceforge/plantuml/geom/SpiderWeb.java delete mode 100644 src/net/sourceforge/plantuml/geom/XMoveable.java delete mode 100644 src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java delete mode 100644 src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java delete mode 100644 src/net/sourceforge/plantuml/geom/kinetic/World.java delete mode 100644 src/net/sourceforge/plantuml/golem/Magnet.java delete mode 100644 src/net/sourceforge/plantuml/golem/Square.java delete mode 100644 src/net/sourceforge/plantuml/graph/ALink.java delete mode 100644 src/net/sourceforge/plantuml/graph/ALinkImpl.java delete mode 100644 src/net/sourceforge/plantuml/graph/ANode.java delete mode 100644 src/net/sourceforge/plantuml/graph/ANodeImpl.java delete mode 100644 src/net/sourceforge/plantuml/graph/AbstractEntityImage.java delete mode 100644 src/net/sourceforge/plantuml/graph/Board.java delete mode 100644 src/net/sourceforge/plantuml/graph/BoardCollection.java delete mode 100644 src/net/sourceforge/plantuml/graph/BoardExplorer.java delete mode 100644 src/net/sourceforge/plantuml/graph/CostComputer.java delete mode 100644 src/net/sourceforge/plantuml/graph/ElectricCharge.java delete mode 100644 src/net/sourceforge/plantuml/graph/ElectricWord.java delete mode 100644 src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java delete mode 100644 src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java delete mode 100644 src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java delete mode 100644 src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java delete mode 100644 src/net/sourceforge/plantuml/graph/Galaxy4.java delete mode 100644 src/net/sourceforge/plantuml/graph/GeneralPathFactory.java delete mode 100644 src/net/sourceforge/plantuml/graph/Graph1.java delete mode 100644 src/net/sourceforge/plantuml/graph/Heap.java delete mode 100644 src/net/sourceforge/plantuml/graph/KenavoCostComputer.java delete mode 100644 src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java delete mode 100644 src/net/sourceforge/plantuml/graph/LinkString.java delete mode 100644 src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java delete mode 100644 src/net/sourceforge/plantuml/graph/Move.java delete mode 100644 src/net/sourceforge/plantuml/graph/Oven.java delete mode 100644 src/net/sourceforge/plantuml/graph/SimpleCostComputer.java delete mode 100644 src/net/sourceforge/plantuml/graph/SortedCollection.java delete mode 100644 src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java delete mode 100644 src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java delete mode 100644 src/net/sourceforge/plantuml/graph/Zoda1.java delete mode 100644 src/net/sourceforge/plantuml/graph/Zoda2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java delete mode 100644 src/net/sourceforge/plantuml/graph2/Dijkstra.java delete mode 100644 src/net/sourceforge/plantuml/graph2/IInflationTransform.java delete mode 100644 src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java delete mode 100644 src/net/sourceforge/plantuml/graph2/InflateData2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/InflationTransform2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java delete mode 100644 src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/Measurer.java delete mode 100644 src/net/sourceforge/plantuml/graph2/MyCurve.java delete mode 100644 src/net/sourceforge/plantuml/graph2/Neighborhood2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/Plan.java delete mode 100644 src/net/sourceforge/plantuml/graph2/Polyline2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/RectanglesCollection.java delete mode 100644 src/net/sourceforge/plantuml/graph2/Singularity2.java delete mode 100644 src/net/sourceforge/plantuml/graph2/SortedList.java delete mode 100644 src/net/sourceforge/plantuml/graph2/SortedListImpl.java delete mode 100644 src/net/sourceforge/plantuml/hector/Box2D.java delete mode 100644 src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java delete mode 100644 src/net/sourceforge/plantuml/hector/GrowingTree.java delete mode 100644 src/net/sourceforge/plantuml/hector/HectorPath.java delete mode 100644 src/net/sourceforge/plantuml/hector/Pin.java delete mode 100644 src/net/sourceforge/plantuml/hector/PinFactory.java delete mode 100644 src/net/sourceforge/plantuml/hector/PinLink.java delete mode 100644 src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java delete mode 100644 src/net/sourceforge/plantuml/hector/Skeleton.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonBuilder.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java delete mode 100644 src/net/sourceforge/plantuml/hector/SkeletonMutation.java delete mode 100644 src/net/sourceforge/plantuml/hector/SmartConnection.java delete mode 100644 src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java delete mode 100644 src/net/sourceforge/plantuml/hector/UnlinearCompression.java delete mode 100644 src/net/sourceforge/plantuml/hector2/MinMax.java delete mode 100644 src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java delete mode 100644 src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java delete mode 100644 src/net/sourceforge/plantuml/hector2/graphic/Foo1.java delete mode 100644 src/net/sourceforge/plantuml/hector2/graphic/Foo2.java delete mode 100644 src/net/sourceforge/plantuml/hector2/layering/Layer.java delete mode 100644 src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java delete mode 100644 src/net/sourceforge/plantuml/hector2/mpos/Distribution.java delete mode 100644 src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java delete mode 100644 src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java delete mode 100644 src/net/sourceforge/plantuml/jungle/GNodeUtils.java delete mode 100644 src/net/sourceforge/plantuml/math/AsciiMathOld.java delete mode 100644 src/net/sourceforge/plantuml/math/AsciiMathParser.js delete mode 100644 src/net/sourceforge/plantuml/mda/MDADiagramImpl.java delete mode 100644 src/net/sourceforge/plantuml/mda/MDAEntityImpl.java delete mode 100644 src/net/sourceforge/plantuml/mda/MDAPackageImpl.java delete mode 100644 src/net/sourceforge/plantuml/oregon/BasicGame.java delete mode 100644 src/net/sourceforge/plantuml/oregon/Keyboard.java delete mode 100644 src/net/sourceforge/plantuml/oregon/KeyboardList.java delete mode 100644 src/net/sourceforge/plantuml/oregon/MagicTable.java delete mode 100644 src/net/sourceforge/plantuml/oregon/NoInputException.java delete mode 100644 src/net/sourceforge/plantuml/oregon/OregonBasicGame.java delete mode 100644 src/net/sourceforge/plantuml/oregon/PSystemOregon.java delete mode 100644 src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java delete mode 100644 src/net/sourceforge/plantuml/oregon/Screen.java delete mode 100644 src/net/sourceforge/plantuml/oregon/SecureCoder.java delete mode 100644 src/net/sourceforge/plantuml/oregon/SmartKeyboard.java delete mode 100644 src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java delete mode 100644 src/net/sourceforge/plantuml/posimo/Decor.java delete mode 100644 src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java delete mode 100644 src/net/sourceforge/plantuml/posimo/EntityImageNote2.java delete mode 100644 src/net/sourceforge/plantuml/posimo/Frame.java delete mode 100644 src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java delete mode 100644 src/net/sourceforge/plantuml/posimo/LabelImage.java delete mode 100644 src/net/sourceforge/plantuml/posimo/LineRectIntersection.java delete mode 100644 src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java delete mode 100644 src/net/sourceforge/plantuml/posimo/MargedBlock.java delete mode 100644 src/net/sourceforge/plantuml/posimo/Mirror.java delete mode 100644 src/net/sourceforge/plantuml/posimo/PathDrawer.java delete mode 100644 src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java delete mode 100644 src/net/sourceforge/plantuml/posimo/Racorder.java delete mode 100644 src/net/sourceforge/plantuml/posimo/RacorderAbstract.java delete mode 100644 src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java delete mode 100644 src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java delete mode 100644 src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java delete mode 100644 src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java delete mode 100644 src/net/sourceforge/plantuml/posimo/SimpleDrawer.java delete mode 100644 src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java delete mode 100644 src/net/sourceforge/plantuml/posimo/data.txt delete mode 100644 src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java delete mode 100644 src/net/sourceforge/plantuml/project/Constant.java delete mode 100644 src/net/sourceforge/plantuml/project/Day.java delete mode 100644 src/net/sourceforge/plantuml/project/DayClose.java delete mode 100644 src/net/sourceforge/plantuml/project/DayCloseNone.java delete mode 100644 src/net/sourceforge/plantuml/project/DayCloseOr.java delete mode 100644 src/net/sourceforge/plantuml/project/DayCloseWeekDay.java delete mode 100644 src/net/sourceforge/plantuml/project/Duration.java delete mode 100644 src/net/sourceforge/plantuml/project/Expression.java delete mode 100644 src/net/sourceforge/plantuml/project/Formal.java delete mode 100644 src/net/sourceforge/plantuml/project/FormalAddition.java delete mode 100644 src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java delete mode 100644 src/net/sourceforge/plantuml/project/FreeVariable.java delete mode 100644 src/net/sourceforge/plantuml/project/IncompleteItem.java delete mode 100644 src/net/sourceforge/plantuml/project/Instant.java delete mode 100644 src/net/sourceforge/plantuml/project/InstantArithmetic.java delete mode 100644 src/net/sourceforge/plantuml/project/Item.java delete mode 100644 src/net/sourceforge/plantuml/project/ItemCaract.java delete mode 100644 src/net/sourceforge/plantuml/project/ItemComparator.java delete mode 100644 src/net/sourceforge/plantuml/project/Jalon.java delete mode 100644 src/net/sourceforge/plantuml/project/Load.java delete mode 100644 src/net/sourceforge/plantuml/project/Month.java delete mode 100644 src/net/sourceforge/plantuml/project/Numeric.java delete mode 100644 src/net/sourceforge/plantuml/project/NumericNumber.java delete mode 100644 src/net/sourceforge/plantuml/project/NumericType.java delete mode 100644 src/net/sourceforge/plantuml/project/PSystemProject.java delete mode 100644 src/net/sourceforge/plantuml/project/ParentItem.java delete mode 100644 src/net/sourceforge/plantuml/project/Project.java delete mode 100644 src/net/sourceforge/plantuml/project/Ressource.java delete mode 100644 src/net/sourceforge/plantuml/project/WeekDay.java delete mode 100644 src/net/sourceforge/plantuml/project/command/CommandAffectation.java delete mode 100644 src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java delete mode 100644 src/net/sourceforge/plantuml/project/graphic/GanttDiagramUnused.java delete mode 100644 src/net/sourceforge/plantuml/project/graphic/ItemHeader.java delete mode 100644 src/net/sourceforge/plantuml/project/graphic/TimeScale.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java delete mode 100644 src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java delete mode 100644 src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java delete mode 100644 src/net/sourceforge/plantuml/sudoku/DLXEngine.java delete mode 100644 src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java delete mode 100644 src/net/sourceforge/plantuml/sudoku/ISudoku.java delete mode 100644 src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java delete mode 100644 src/net/sourceforge/plantuml/sudoku/PSystemSudokuFactory.java delete mode 100644 src/net/sourceforge/plantuml/sudoku/SudokuDLX.java delete mode 100644 src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java delete mode 100644 src/net/sourceforge/plantuml/svek/Oscillator.java delete mode 100644 src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java delete mode 100644 src/net/sourceforge/plantuml/telnet/TelnetServer.java delete mode 100644 src/net/sourceforge/plantuml/ugraphic/InflaterSet.java delete mode 100644 src/net/sourceforge/plantuml/ugraphic/svg/DriverNoneSvg.java diff --git a/pom.xml b/pom.xml index 49a345b..1969339 100644 --- a/pom.xml +++ b/pom.xml @@ -131,10 +131,10 @@ maven-compiler-plugin - 2.3.2 + 3.7.0 - 1.5 - 1.5 + 1.7 + 1.7 false diff --git a/src/ext/plantuml/com/ctreber/acearth/ACearth.java b/src/ext/plantuml/com/ctreber/acearth/ACearth.java deleted file mode 100644 index 54adad5..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/ACearth.java +++ /dev/null @@ -1,373 +0,0 @@ -package ext.plantuml.com.ctreber.acearth; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import ext.plantuml.com.ctreber.acearth.gui.CanvasACearth; -import ext.plantuml.com.ctreber.acearth.plugins.Plugin; -import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker; -import ext.plantuml.com.ctreber.acearth.plugins.markers.PluginMarkers; -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.projection.ProjectionCyl; -import ext.plantuml.com.ctreber.acearth.projection.ProjectionMerc; -import ext.plantuml.com.ctreber.acearth.projection.ProjectionOrtho; -import ext.plantuml.com.ctreber.acearth.renderer.Renderer; -import ext.plantuml.com.ctreber.acearth.renderer.RowTypeRendererScanBit; -import ext.plantuml.com.ctreber.acearth.renderer.RowTypeRendererScanDot; -import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMap; -import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMapDefault; -import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMapOrtho; -import ext.plantuml.com.ctreber.acearth.scandot.DotGeneratorLines; -import ext.plantuml.com.ctreber.acearth.scandot.DotGeneratorStars; -import ext.plantuml.com.ctreber.acearth.scandot.ScanDot; -import ext.plantuml.com.ctreber.acearth.scandot.ScanDotGenerator; -import ext.plantuml.com.ctreber.acearth.shader.Shader; -import ext.plantuml.com.ctreber.acearth.shader.ShaderDefault; -import ext.plantuml.com.ctreber.acearth.shader.ShaderFlat; -import ext.plantuml.com.ctreber.acearth.shader.ShaderOrtho; -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.SunPositionCalculator; -import ext.plantuml.com.ctreber.acearth.util.Toolkit; -import ext.plantuml.com.ctreber.aclib.sort.CTSort; -import ext.plantuml.com.ctreber.aclib.sort.QuickSort; - -/** - *

AC.earth - XEarth for Java - *

- * - *

- * The original XEarth was written by Kirk Johnson in July 1993 - thank you for - * writing this great little program and making it available for free! - * - *

- * I wanted to extend the program, but not in C. So I created this Java version, - * and found the process quite painfull interesting. The - * biggest effort went into resolving references between C files and - * eliminatiing pointers. - * - *

License

- * - *

- * AC.earth Copyright (c) 2002 Christian Treber, ct@ctreber.com - * - *

- * AC.earth is based on XEarth by Kirk Johnson - * - *

- * To comply with the XEarth license I include the following text: - * - *

- * XEarth Copyright (C) 1989, 1990, 1993-1995, 1999 Kirk Lauritz Johnson
- * Parts of the source code are:
- *   Copyright (C) 1989, 1990, 1991 by Jim Frost
- *   Copyright (C) 1992 by Jamie Zawinski <jwz@lucid.com>
- * Permission to use, copy, modify and freely distribute xearth for
- * non-commercial and not-for-profit purposes is hereby granted
- * without fee, provided that both the above copyright notice and this
- * permission notice appear in all copies and in supporting
- * documentation.
- * [Section refering to GIF omitted because it doesn't apply to this version]
- * The author makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT
- * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * - *

- * The license for this program (AC.earth) is the same as the quoted license - * above, with one change: The "copyright notice and permission notice" shall - * include the entire text of this section. - * - * todo Phase 2: Make grid value stuff more meaningful ("every n degrees") todo - * Phase 2: Enter fixed time as data and time, not seconds since epoch todo - * Phase 2: Compact map data into binary file - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - */ -public class ACearth { - public static final String VERSION = "1.1"; - public static final String BUILD = "22.11.2002 004"; - - // private static long fsStartTime = 0; - - private ConfigurationACearth fConf = new ConfigurationACearth(); - private long fCurrentTime; - - private CanvasACearth fCanvas; - - private Coordinate fViewPos; - private double fViewRotation; - - private List fPlugins; - - /** - *

- * Well, the main class. - * @param markers - */ - public ACearth(List markers) { - // fsStartTime = System.currentTimeMillis(); - - fPlugins = new ArrayList(); - fPlugins.add(new PluginMarkers(markers)); - - } - - public void exportPng(OutputStream os) throws IOException { - fCanvas = new CanvasACearth(this, fConf.getInt("imageWidth"), fConf.getInt("imageHeight")); - update(); - fCanvas.saveToImage(os); - } - - public void update() throws IOException { - Projection lProjection = null; - Shader lShader = null; - BitGeneratorMap lScanner = null; - if (fConf.is("projection", "Cylindrical")) { - lProjection = new ProjectionCyl(); - lScanner = new BitGeneratorMapDefault(lProjection); - lShader = new ShaderDefault(); - } - - if (fConf.is("projection", "Mercator")) { - lProjection = new ProjectionMerc(); - lScanner = new BitGeneratorMapDefault(lProjection); - lShader = new ShaderDefault(); - } - - if (fConf.is("projection", "Orthographic")) { - lProjection = new ProjectionOrtho(); - lScanner = new BitGeneratorMapOrtho(lProjection); - lShader = new ShaderOrtho(); - } - - computePositions(); - lProjection.setImageWidth(fConf.getInt("imageWidth")); - lProjection.setImageHeight(fConf.getInt("imageHeight")); - lProjection.setShiftX(fConf.getInt("shiftX")); - lProjection.setShiftY(fConf.getInt("shiftY")); - lProjection.setViewMagnification(fConf.getDouble("viewMagnification")); - lProjection.setViewPos(fViewPos); - lProjection.setViewRotation(fViewRotation); - - lScanner.setImageWidth(fConf.getInt("imageWidth")); - lScanner.setImageHeight(fConf.getInt("imageHeight")); - lScanner.setMapData(MapDataReader.readMapData()); - // Process the map (produces ScanBit-s). - lScanner.generateScanBits(); - - // Process stars and lines (produces ScanDots-s). - List lScanDots = new ArrayList(); - if (fConf.getBoolean("starsP")) { - ScanDotGenerator lGenerator = new DotGeneratorStars(fConf.getInt("imageWidth"), - fConf.getInt("imageHeight"), fConf.getDouble("starFrequency"), fConf.getInt("bigStars"), new Random(fCurrentTime)); - lGenerator.generateScanDots(); - lScanDots.addAll(lGenerator.getScanDots()); - } - - if (fConf.getBoolean("gridP")) { - ScanDotGenerator lGenerator = new DotGeneratorLines(lProjection, fConf.getInt("gridDivision"), fConf - .getInt("gridPixelDivision")); - lGenerator.generateScanDots(); - lScanDots.addAll(lGenerator.getScanDots()); - } - - final CTSort lSort = new QuickSort(); - ScanDot[] lScanDotsArray = (ScanDot[]) lScanDots.toArray(new ScanDot[0]); - lSort.sort(lScanDotsArray); - - if (!fConf.getBoolean("shadeP")) { - lShader = new ShaderFlat(); - } - lShader.setProjection(lProjection); - lShader.setSunPos(fConf.getSunPos()); - lShader.setDaySideBrightness(fConf.getInt("daySideBrightness")); - lShader.setTerminatorDiscontinuity(fConf.getInt("terminatorDiscontinuity")); - lShader.setNightSideBrightness(fConf.getInt("nightSideBrightness")); - lShader.init(); - - Renderer lRenderer = new Renderer(fCanvas); - - RowTypeRendererScanBit lRowRendererScanBit = new RowTypeRendererScanBit(); - lRowRendererScanBit.setScanBits(lScanner.getScanBits()); - lRenderer.addRowTypeRenderer(lRowRendererScanBit); - - RowTypeRendererScanDot lRowRendererScanDot = new RowTypeRendererScanDot(); - lRowRendererScanDot.setScanDots(lScanDotsArray); - lRenderer.addRowTypeRenderer(lRowRendererScanDot); - - lRenderer.setShader(lShader); - lRenderer.render(); - - // Apply plugins - Iterator lIt = fPlugins.iterator(); - while (lIt.hasNext()) { - Plugin lPlugin = (Plugin) lIt.next(); - lPlugin.setProjection(lProjection); - lPlugin.setRenderTarget(fCanvas); - lPlugin.setParent(this); - lPlugin.render(); - } - - } - - /** - *

- * This is repeated when time changes since this influences the position of - * Earth. - */ - private void computePositions() { - // Determine time for rendering - if (fConf.getInt("fixedTime") == 0) { - // No fixed time. - // final long lTimePassed = System.currentTimeMillis() - fsStartTime; - // fCurrentTime = fsStartTime + (long) (fConf.getDouble("timeWarpFactor") * lTimePassed); - fCurrentTime = System.currentTimeMillis(); - } else { - // Fixed time. - fCurrentTime = fConf.getInt("fixedTime") * 1000L; - } - - if (fConf.getBoolean("sunMovesP")) { - fConf.setSunPos(SunPositionCalculator.getSunPositionOnEarth(fCurrentTime)); - } - - // Determine viewing position - if (fConf.is("viewPositionType", "Fixed")) { - fViewPos = fConf.getViewPos(); - } else if (fConf.is("viewPositionType", "Sun-relative")) { - fViewPos = getSunRelativePosition(); - } else if (fConf.is("viewPositionType", "Orbit")) { - fViewPos = getOrbitPosition(fCurrentTime); - } else if (fConf.is("viewPositionType", "Random")) { - fViewPos = getRandomPosition(); - } else if (fConf.is("viewPositionType", "Moon")) { - fViewPos = SunPositionCalculator.getMoonPositionOnEarth(fCurrentTime); - } - - // for ViewRotGalactic, compute appropriate viewing rotation - if (fConf.is("viewRotationType", "Galactic")) { - fViewRotation = (Toolkit.degsToRads(fConf.getSunPos().getLat() - * Math.sin((fViewPos.getLong() - fConf.getSunPos().getLong())))); - } else { - fViewRotation = fConf.getDouble("viewRotation"); - } - } - - /** - *

- * Add sun position and position relative to sun, straighten out the result. - * - * @return Position relativ to sun position as defined by fSunPosRel. - */ - private Coordinate getSunRelativePosition() { - final Coordinate lPos = fConf.getSunPos(); - lPos.add(fConf.getSunPosRel()); - - return lPos; - } - - private Coordinate getOrbitPosition(long pTimeMillis) { - double x, y, z; - double a, c, s; - double t1, t2; - - /* start at 0 N 0 E */ - x = 0; - y = 0; - z = 1; - - /* - * rotate in about y axis (from z towards x) according to the number of - * orbits we've completed - */ - a = (double) pTimeMillis / (fConf.getDouble("orbitPeriod") * 3600 * 1000) * 2 * Math.PI; - c = Math.cos(a); - s = Math.sin(a); - t1 = c * z - s * x; - t2 = s * z + c * x; - z = t1; - x = t2; - - /* - * rotate about z axis (from x towards y) according to the inclination - * of the orbit - */ - a = Toolkit.degsToRads(fConf.getDouble("orbitInclination")); - c = Math.cos(a); - s = Math.sin(a); - t1 = c * x - s * y; - t2 = s * x + c * y; - x = t1; - y = t2; - - /* - * rotate about y axis (from x towards z) according to the number of - * rotations the earth has made - */ - a = ((double) pTimeMillis / 86400000) * (2 * Math.PI); - c = Math.cos(a); - s = Math.sin(a); - t1 = c * x - s * z; - t2 = s * x + c * z; - x = t1; - z = t2; - - return new Coordinate(Toolkit.radsToDegs(Math.asin(y)), Toolkit.radsToDegs(Math.atan2(x, z))); - } - - /** - *

- * Pick a position (lat, lon) at random - * - * @return A random position. - */ - private static Coordinate getRandomPosition() { - - /* select a vector at random */ - final double[] pos = new double[3]; - double mag = 0; - do { - for (int i = 0; i < 3; i++) { - pos[i] = ((Math.random() * 20000) * 1e-4) - 1; - mag += pos[i] * pos[i]; - } - } while ((mag > 1.0) || (mag < 0.01)); - - /* normalize the vector */ - mag = Math.sqrt(mag); - for (int i = 0; i < 3; i++) { - pos[i] /= mag; - } - - /* convert to (lat, lon) */ - final double s_lat = pos[1]; - final double c_lat = Math.sqrt(1 - s_lat * s_lat); - final double s_lon = pos[0] / c_lat; - final double c_lon = pos[2] / c_lat; - - return new Coordinate(Math.atan2(s_lat, c_lat) * (180 / Math.PI), Math.atan2(s_lon, c_lon) * (180 / Math.PI)); - } - -// public static long getStartTime() { -// return fsStartTime; -// } - - public ConfigurationACearth getConf() { - return fConf; - } - -} \ No newline at end of file diff --git a/src/ext/plantuml/com/ctreber/acearth/Configuration.java b/src/ext/plantuml/com/ctreber/acearth/Configuration.java deleted file mode 100644 index 4da1604..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/Configuration.java +++ /dev/null @@ -1,108 +0,0 @@ -package ext.plantuml.com.ctreber.acearth; - -import java.util.HashMap; -import java.util.Map; - -import ext.plantuml.com.ctreber.aclib.gui.MOBoolean; -import ext.plantuml.com.ctreber.aclib.gui.MODouble; -import ext.plantuml.com.ctreber.aclib.gui.MOEnum; -import ext.plantuml.com.ctreber.aclib.gui.MOInteger; -import ext.plantuml.com.ctreber.aclib.gui.MOString; -import ext.plantuml.com.ctreber.aclib.gui.MonitoredObject; - -/** - *

- *

- * - *

- * © 2002 Christian Treber, ct@ctreber.com (06.10.2002) - *

- * - * @author Christian Treber, ct@ctreber.com - * - */ -public class Configuration { - private Map fValues = new HashMap(); - - /** - *

- * Item must be added before it can be set or get. - * - * @param pID - * Item name. - * @param pObject - * Item value container. - */ - public void add(String pID, MonitoredObject pObject) { - fValues.put(pID, pObject); - } - - public void setString(String pID, String pValue) { - ((MOString) fValues.get(pID)).set(pValue); - } - - public void setBoolean(String pID, boolean pValue) { - ((MOBoolean) fValues.get(pID)).set(pValue); - } - - public void setInt(String pID, int pValue) { - ((MOInteger) fValues.get(pID)).set(pValue); - } - - public void setDouble(String pID, double pValue) { - ((MODouble) fValues.get(pID)).set(pValue); - } - - public void setEnum(String pID, Object pValue) { - ((MOEnum) fValues.get(pID)).set(pValue); - } - - public String getString(String pID) { - return ((MOString) fValues.get(pID)).get(); - } - - public boolean getBoolean(String pID) { - return ((MOBoolean) fValues.get(pID)).get(); - } - - public int getInt(String pID) { - return ((MOInteger) fValues.get(pID)).get(); - } - - public double getDouble(String pID) { - return ((MODouble) fValues.get(pID)).get(); - } - - public boolean is(String pID, Object pValue) { - return ((MOEnum) fValues.get(pID)).is(pValue); - } - - public MOBoolean getMOBoolean(String pID) { - return (MOBoolean) getMO(pID); - } - - public MOString getMOString(String pID) { - return (MOString) getMO(pID); - } - - public MOEnum getMOEnum(String pID) { - return (MOEnum) getMO(pID); - } - - public MOInteger getMOInteger(String pID) { - return (MOInteger) getMO(pID); - } - - public MODouble getMODouble(String pID) { - return (MODouble) getMO(pID); - } - - public MonitoredObject getMO(String pID) { - final MonitoredObject lMO = (MonitoredObject) fValues.get(pID); - if (lMO == null) { - throw new IllegalArgumentException("Unknown conf item '" + pID + "'"); - } - - return lMO; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java b/src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java deleted file mode 100644 index ae6529c..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/ConfigurationACearth.java +++ /dev/null @@ -1,152 +0,0 @@ -package ext.plantuml.com.ctreber.acearth; - -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.aclib.gui.MOBoolean; -import ext.plantuml.com.ctreber.aclib.gui.MODouble; -import ext.plantuml.com.ctreber.aclib.gui.MOEnum; -import ext.plantuml.com.ctreber.aclib.gui.MOInteger; -import ext.plantuml.com.ctreber.aclib.gui.MOString; -import ext.plantuml.com.ctreber.aclib.gui.MonitoredObject; - -/** - *

- * How to avoid writing all the accessors? Code generator that creates derived - * class from template class? Configuration items in data structure? - *

- * - *

- * © 2002 Christian Treber, ct@ctreber.com (06.10.2002) - *

- * - * @author Christian Treber, ct@ctreber.com - * - */ -public class ConfigurationACearth extends Configuration { - private static final int DEFAULT_DIMENSION = 512; - - public ConfigurationACearth() { - final MOEnum lProjection = new MOEnum(); - lProjection.addValidValue("Mercator"); - lProjection.addValidValue("Orthographic"); - lProjection.addValidValue("Cylindrical"); - lProjection.set("Orthographic"); - add("projection", (MonitoredObject) lProjection); - - final MOEnum lPositionType = new MOEnum(); - lPositionType.addValidValue("Fixed"); - lPositionType.addValidValue("Sun-relative"); - lPositionType.addValidValue("Orbit"); - lPositionType.addValidValue("Random"); - lPositionType.addValidValue("Moon"); - lPositionType.set("Sun-relative"); - add("viewPositionType", lPositionType); - - final MOEnum lViewRotationType = new MOEnum(); - lViewRotationType.addValidValue("North"); - lViewRotationType.addValidValue("Galactic"); - lViewRotationType.set("North"); - add("viewRotationType", lViewRotationType); - - final MOString lOutputMode = new MOString("gui"); - add("outputMode", lOutputMode); - - // Only relevant if view type is "Fixed"./ - final MODouble lViewPosLat = new MODouble(0, -90, +90); - add("viewPosLat", lViewPosLat); - final MODouble lViewPosLong = new MODouble(0, -180, +180); - add("viewPosLong", lViewPosLong); - // Only relevant if view type is "Sun-relative". - final MODouble lSunPosRelLat = new MODouble(0, -90, +90); - add("sunPosRelLat", lSunPosRelLat); - final MODouble lSunPosRelLong = new MODouble(0, -180, +180); - add("sunPosRelLong", lSunPosRelLong); - - final MOBoolean lSunMovesP = new MOBoolean(true); - add("sunMovesP", lSunMovesP); - // Only relevant if sun does not move. - final MODouble lSunPosLat = new MODouble(0, -90, +90); - add("sunPosLat", lSunPosLat); - final MODouble lSunPosLong = new MODouble(0, -180, +180); - add("sunPosLong", lSunPosLong); - - final MODouble lTimeWarpFactor = new MODouble(1.0, 0, Double.MAX_VALUE); - add("timeWarpFactor", lTimeWarpFactor); - final MOInteger lFixedTime = new MOInteger(0, 0, Integer.MAX_VALUE); - add("fixedTime", lFixedTime); - final MOInteger lWaitTime = new MOInteger(300, 0, Integer.MAX_VALUE); - add("waitTime", lWaitTime); - - final MODouble lOrbitPeriod = new MODouble(1, 0.0001, Double.MAX_VALUE); - add("orbitPeriod", lOrbitPeriod); - final MODouble lOrbitInclination = new MODouble(45.0, 0, 90); - add("orbitInclination", lOrbitInclination); - - final MOBoolean lLabelP = new MOBoolean(false); - add("labelP", lLabelP); - - final MOInteger lImageWidth = new MOInteger(DEFAULT_DIMENSION, 0, Integer.MAX_VALUE); - add("imageWidth", lImageWidth); - final MOInteger lImageHeight = new MOInteger(DEFAULT_DIMENSION, 0, Integer.MAX_VALUE); - add("imageHeight", lImageHeight); - - final MOBoolean lStarsP = new MOBoolean(true); - add("starsP", lStarsP); - final MODouble lStarFrequency = new MODouble(0.002, 0, Double.MAX_VALUE); - add("starFrequency", lStarFrequency); - final MOInteger lBigStars = new MOInteger(0, 0, 100); - add("bigStars", lBigStars); - - final MOBoolean lGridP = new MOBoolean(true); - add("gridP", lGridP); - final MOInteger lGridDivision = new MOInteger(6, 0, Integer.MAX_VALUE); - add("gridDivision", lGridDivision); - final MOInteger lGridPixelDevision = new MOInteger(15, 0, Integer.MAX_VALUE); - add("gridPixelDivision", lGridPixelDevision); - - final MOInteger lShiftX = new MOInteger(0, 0, Integer.MAX_VALUE); - add("shiftX", lShiftX); - final MOInteger lShiftY = new MOInteger(0, 0, Integer.MAX_VALUE); - add("shiftY", lShiftY); - final MODouble lViewMagnification = new MODouble(1.0, 0, Double.MAX_VALUE); - add("viewMagnification", lViewMagnification); - - final MOBoolean lShadeP = new MOBoolean(true); - add("shadeP", lShadeP); - final MOInteger lDaySideBrightness = new MOInteger(100, 0, 100); - add("daySideBrightness", lDaySideBrightness); - final MOInteger lNightSideBrightness = new MOInteger(5, 0, 100); - add("nightSideBrightness", lNightSideBrightness); - final MOInteger lTerminatorDiscontinuity = new MOInteger(1, 0, 100); - add("terminatorDiscontinuity", lTerminatorDiscontinuity); - - final MODouble lViewRotation = new MODouble(0, 0, Double.MAX_VALUE); - add("viewRotation", lViewRotation); - } - - public Coordinate getViewPos() { - return new Coordinate(getDouble("viewPosLat"), getDouble("viewPosLong")); - } - - public void setViewPos(Coordinate pViewPos) { - setDouble("viewPosLat", pViewPos.getLat()); - setDouble("viewPosLong", pViewPos.getLong()); - } - - public Coordinate getSunPos() { - return new Coordinate(getDouble("sunPosLat"), getDouble("sunPosLong")); - } - - public void setSunPos(Coordinate pSunPos) { - setDouble("sunPosLat", pSunPos.getLat()); - setDouble("sunPosLong", pSunPos.getLong()); - } - - public Coordinate getSunPosRel() { - return new Coordinate(getDouble("sunPosRelLat"), getDouble("sunPosRelLong")); - } - - public void setSunPosRel(Coordinate pSunPosRel) { - setDouble("sunPosRelLat", pSunPosRel.getLat()); - setDouble("sunPosRelLong", pSunPosRel.getLong()); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/MapData.java b/src/ext/plantuml/com/ctreber/acearth/MapData.java deleted file mode 100644 index b1f66a7..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/MapData.java +++ /dev/null @@ -1,6835 +0,0 @@ -package ext.plantuml.com.ctreber.acearth; - -import java.util.ArrayList; -import java.util.List; - -/** - *

AC.earth - XEarth for Java - *

- * - *

- * The original XEarth was written by Kirk Johnson in July 1993 - thank you for - * writing this great little program and making it available for free! - * - *

- * I wanted to extend the program, but not in C. So I created this Java version, - * and found the process quite painfull interesting. The - * biggest effort went into resolving references between C files and - * eliminatiing pointers. - * - *

License

- * - *

- * AC.earth Copyright (c) 2002 Christian Treber, ct@ctreber.com - * - *

- * AC.earth is based on XEarth by Kirk Johnson - * - *

- * To comply with the XEarth license I include the following text: - * - *

- * XEarth Copyright (C) 1989, 1990, 1993-1995, 1999 Kirk Lauritz Johnson
- * Parts of the source code are:
- *   Copyright (C) 1989, 1990, 1991 by Jim Frost
- *   Copyright (C) 1992 by Jamie Zawinski <jwz@lucid.com>
- * Permission to use, copy, modify and freely distribute xearth for
- * non-commercial and not-for-profit purposes is hereby granted
- * without fee, provided that both the above copyright notice and this
- * permission notice appear in all copies and in supporting
- * documentation.
- * [Section refering to GIF omitted because it doesn't apply to this version]
- * The author makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT
- * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, d OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * - *

- * The license for this program (AC.earth) is the same as the quoted license - * above, with one change: The "copyright notice and permission notice" shall - * include the entire text of this section. - * - * todo Phase 2: Make grid value stuff more meaningful ("every n degrees") todo - * Phase 2: Enter fixed time as d and time, not seconds since epoch todo - * Phase 2: Compact map d into binary file - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - */ -public class MapData { - - private final List d = new ArrayList(); - - public MapData() { - //add("/*0*/"); - add("3903,1,13663,15523,21733,"); - add("-138,74,34,69,29,-64,-38,19,10,-93,24,41,"); - add("-123,2,74,-139,23,68,-93,-54,94,-46,17,16,"); - add("33,33,-44,-145,-37,113,-59,-82,92,-117,-44,99,"); - add("-83,-79,101,-98,-59,97,-129,1,70,-132,62,30,"); - add("-136,30,54,-146,22,63,-120,37,38,-137,40,44,"); - add("-132,50,34,-137,27,51,-140,23,54,-141,32,48,"); - add("-133,4,62,-123,-34,82,-124,44,28,-95,124,-40,"); - add("-134,50,28,-136,-5,65,-143,24,48,-135,51,25,"); - add("-151,13,57,-116,80,-5,-70,114,-49,-151,52,28,"); - add("-141,44,27,-137,28,36,-151,0,61,-115,-55,84,"); - add("-137,-19,66,-113,-59,83,-106,-67,85,-83,-88,91,"); - add("-56,-106,92,4,-127,82,57,-127,62,81,-117,47,"); - add("4,-126,79,-56,-109,89,-81,-94,88,-111,-65,80,"); - add("-137,-19,60,-140,50,16,-129,77,-4,-125,84,-11,"); - add("-140,59,9,-141,51,13,-141,46,16,-146,36,22,"); - add("-145,24,28,-147,4,41,-146,30,23,-136,66,-3,"); - add("-101,105,-39,-69,120,-58,-46,125,-69,-119,79,-19,"); - add("-150,23,25,-143,45,7,-135,65,-9,-147,32,16,"); - add("-145,29,16,-142,15,24,-138,-36,55,-149,6,29,"); - add("-142,46,1,-154,71,-14,-125,38,0,-122,43,-4,"); - add("-131,126,-59,-138,25,9,-148,44,-2,-111,93,-43,"); - add("-32,122,-79,97,86,-77,111,74,-72,87,91,-80,"); - add("55,110,-89,20,109,-83,-52,128,-82,-122,81,-36,"); - add("-105,100,-54,-10,122,-89,103,79,-78,66,104,-92,"); - add("-18,101,-74,-145,-63,76,-125,-11,32,-59,130,-89,"); - add("-132,44,-11,-122,31,-2,-140,-37,51,-116,-63,67,"); - add("-123,-52,59,-148,-9,28,-165,-12,33,-130,47,-18,"); - add("-137,6,13,-141,-43,50,-141,43,-15,-120,-13,23,"); - add("-120,-62,60,-141,-30,36,-134,-48,49,-126,58,-32,"); - add("-147,39,-17,-152,5,8,-152,-1,12,-138,-34,35,"); - add("-152,-18,23,-141,-6,11,-140,-63,54,-146,-2,7,"); - add("-148,-18,19,-152,-10,12,-146,-17,16,-134,-51,40,"); - add("-137,-51,39,-122,-67,50,-94,-101,74,-153,-3,1,"); - add("-142,-45,31,-141,-36,24,-96,-91,63,-113,-76,51,"); - add("-131,-64,42,-148,-12,3,-148,11,-14,-140,28,-26,"); - add("-91,63,-49,-167,-51,26,-149,14,-19,-148,-15,0,"); - add("-147,-15,0,-141,43,-42,-112,79,-66,-79,97,-77,"); - add("-61,80,-64,-177,-45,16,-75,-108,69,-60,-116,77,"); - add("-58,-117,76,-67,-115,73,-74,-111,69,-82,-109,65,"); - add("-94,-100,58,-130,-71,31,-136,-61,24,-140,-54,17,"); - add("-142,-49,13,-136,-61,21,-108,-86,40,-109,-96,47,"); - add("-114,-89,40,-67,-108,58,-32,-126,76,-92,-106,52,"); - add("-95,-106,50,-65,-120,64,-22,-130,76,-16,-131,77,"); - add("18,-106,67,52,-115,78,-47,-130,68,-87,-111,50,"); - add("-97,-107,45,-92,-108,45,-107,-102,39,-124,-81,22,"); - add("-137,-67,11,-117,-90,27,-110,-101,34,-137,-63,6,"); - add("-142,-53,-1,-148,-33,-13,-149,-22,-22,-131,-55,1,"); - add("-102,-108,34,-70,-128,52,-73,-122,47,-62,-129,53,"); - add("-110,-97,23,-136,-69,2,-130,-68,2,-97,-100,27,"); - add("-63,-128,47,-72,-127,45,-68,-126,43,-24,-137,61,"); - add("-48,-134,51,-105,-101,20,-115,-97,14,-113,-102,17,"); - add("-124,-85,4,-45,-85,27,-86,-166,50,-81,-132,36,"); - add("-63,-120,34,-64,-131,39,-91,-126,28,-120,-81,-2,"); - add("-82,-125,28,-39,-135,45,-41,-142,46,-36,-139,45,"); - add("11,-63,29,88,49,7,55,-128,68,94,-66,54,"); - add("72,-129,71,25,-129,57,-35,-131,40,-72,-140,30,"); - add("-12,-75,25,57,-175,80,29,-137,57,23,-139,56,"); - add("5,-143,51,-9,-144,46,-25,-144,40,-51,-140,32,"); - add("-67,-134,24,-71,-130,20,-54,-138,27,-39,-142,32,"); - add("-15,-146,40,-39,-140,30,-86,-127,11,-87,-123,9,"); - add("-101,-113,1,-125,-80,-16,-35,-55,4,131,-79,62,"); - add("79,-115,55,55,-132,52,48,-37,24,80,37,14,"); - add("-24,-130,27,5,-132,35,86,-97,49,143,40,32,"); - add("151,15,39,139,11,37,23,-12,9,-165,-14,-43,"); - add("-150,-15,-39,-124,-71,-18,-137,66,-57,-95,-40,-19,"); - add("4,-145,37,-10,-150,33,68,-38,29,109,-29,39,"); - add("169,19,45,140,-28,46,108,53,18,32,16,5,"); - add("-131,-86,-16,-144,20,-46,-145,-14,-39,-139,0,-41,"); - add("-63,-98,4,132,-84,59,105,-1,30,30,-154,43,"); - add("141,35,33,23,-19,11,-4,-74,15,145,44,31,"); - add("138,22,33,85,-33,31,-198,-69,-40,68,-43,28,"); - add("74,-18,24,-111,-109,-7,57,-133,43,67,-24,23,"); - add("37,-29,16,51,-69,28,93,5,23,42,-89,29,"); - add("50,7,12,-20,-138,21,87,-128,47,146,-64,49,"); - add("100,-103,43,114,-63,40,40,-145,35,105,-106,43,"); - add("55,-111,32,51,-127,32,3,-125,20,49,-47,19,"); - add("-112,-70,-15,99,-97,37,66,-128,34,69,-98,30,"); - add("130,-47,35,64,-103,28,124,-117,43,137,-54,36,"); - add("123,-81,35,103,-103,34,110,-85,32,132,-68,34,"); - add("80,-100,27,164,-73,38,115,-81,30,105,-101,29,"); - add("109,-105,30,109,-98,28,107,-112,28,118,-87,27,"); - add("130,-70,27,131,-69,26,132,-73,26,140,-50,24,"); - add("136,-62,24,144,-33,22,137,60,13,138,61,12,"); - add("135,58,12,141,51,12,143,53,11,140,57,10,"); - add("154,36,13,144,15,12,80,34,4,221,-11,21,"); - add("150,21,10,153,12,10,31,26,0,-186,-21,-12,"); - add("-70,16,-7,216,24,15,145,2,10,70,-27,7,"); - add("241,-37,18,88,41,1,74,-80,12,215,-66,16,"); - add("148,-42,10,139,-66,11,145,61,0,127,75,-3,"); - add("152,42,0,142,47,-2,142,46,-2,131,71,-5,"); - add("138,62,-5,135,65,-7,139,51,-5,127,55,-7,"); - add("-86,84,-8,179,-137,12,126,67,-9,101,104,-12,"); - add("145,45,-9,147,33,-7,150,23,-8,151,18,-8,"); - add("151,15,-8,152,14,-9,152,2,-8,118,66,-15,"); - add("96,-12,-4,194,-39,-9,150,-20,-8,138,-57,-5,"); - add("119,-93,1,116,-123,3,104,-60,-4,93,-111,3,"); - add("72,-52,-2,-60,-116,16,22,-115,9,66,-152,6,"); - add("111,-118,-1,127,-59,-9,123,10,-14,172,14,-20,"); - add("81,57,-14,16,106,-11,97,-87,-4,83,20,-12,"); - add("13,34,-5,114,-41,-11,107,4,-14,144,-25,-18,"); - add("172,14,-25,57,94,-16,10,60,-7,117,-110,-8,"); - add("125,-37,-16,93,-200,1,128,-95,-14,128,-3,-20,"); - add("103,-40,-15,18,-169,8,77,-131,-5,50,-132,-1,"); - add("-31,-147,13,-24,-149,11,-20,-146,10,0,-155,5,"); - add("-58,-164,16,-80,-104,16,-38,-144,10,131,-77,-21,"); - add("-34,-206,9,-55,-13,9,-78,-47,14,106,-119,-17,"); - add("145,-47,-25,-5,-38,1,-148,11,26,-107,24,17,"); - add("-17,-219,3,-58,-133,9,-72,-120,10,-86,-22,13,"); - add("-68,14,11,81,-166,-15,78,-129,-15,131,-79,-23,"); - add("25,-86,-7,-143,111,26,-24,16,5,89,-154,-19,"); - add("76,-104,-16,30,-67,-7,110,-201,-26,122,-55,-23,"); - add("48,-37,-10,-95,-2,16,116,-113,-26,116,-93,-25,"); - add("108,-103,-25,91,-120,-24,103,-106,-26,89,-118,-25,"); - add("104,-105,-28,95,-110,-27,110,-104,-30,78,-131,-27,"); - add("57,-122,-23,82,-96,-26,50,-176,-27,-13,-142,-11,"); - add("102,-132,-36,104,-28,-26,127,73,-21,93,-26,-24,"); - add("-201,-68,38,-145,-55,26,65,-176,-34,77,-125,-32,"); - add("81,-121,-33,28,-149,-25,49,-142,-31,54,-139,-31,"); - add("63,-136,-34,66,-131,-35,13,-141,-25,-66,-116,-2,"); - add("-103,-102,7,18,-151,-29,41,-143,-34,36,-135,-32,"); - add("49,-132,-35,63,-140,-41,80,-124,-43,39,-130,-35,"); - add("20,-148,-34,-29,-145,-23,-11,-149,-29,-32,-147,-24,"); - add("-72,-145,-14,-85,-112,-5,-122,-66,14,-122,-104,4,"); - add("-63,-130,-16,-105,-105,-2,-74,-124,-13,-34,-157,-32,"); - add("-69,-133,-19,-16,-143,-33,-36,-147,-32,-55,-134,-24,"); - add("-50,-135,-26,-44,-152,-34,-93,-118,-14,-41,-114,-24,"); - add("0,-144,-43,2,-144,-43,-19,-144,-41,-27,-148,-40,"); - add("-22,-140,-40,-12,-144,-44,14,-143,-49,61,-126,-55,"); - add("56,-127,-56,98,-104,-56,78,-117,-58,64,-122,-58,"); - add("51,-130,-58,58,-125,-59,57,-126,-59,67,-119,-60,"); - add("36,-136,-61,39,-134,-61,51,-126,-61,67,-120,-64,"); - add("69,-117,-64,50,-128,-65,77,-111,-65,74,-113,-66,"); - add("50,-126,-66,16,-135,-62,-51,-115,-38,-7,-166,-71,"); - add("-8,-132,-57,-15,-140,-60,-13,-136,-59,33,-133,-71,"); - add("44,-122,-69,31,-129,-70,-17,-137,-62,0,-135,-66,"); - add("-2,-133,-66,18,-132,-71,21,-122,-68,21,-125,-70,"); - add("12,-128,-71,19,-130,-74,41,-121,-76,52,-119,-79,"); - add("58,-116,-80,84,-100,-79,88,-94,-78,98,-93,-81,"); - add("61,-104,-78,59,-112,-82,37,-121,-82,30,-125,-83,"); - add("16,-127,-81,24,-125,-83,31,-121,-83,45,-116,-86,"); - add("41,-117,-86,51,-113,-88,57,-108,-87,61,-107,-90,"); - add("21,-123,-87,-4,-129,-84,-31,-128,-75,-113,-90,-23,"); - add("-98,-49,-2,35,-95,-76,20,-75,-58,78,-152,-131,"); - add("6,-123,-89,-60,-113,-60,47,-37,-42,134,23,-29,"); - add("68,-84,-84,108,-67,-86,80,-84,-90,125,-33,-69,"); - add("120,35,-18,134,79,9,151,38,-29,129,19,-35,"); - add("138,-2,-56,150,15,-49,131,79,6,134,50,-18,"); - add("145,18,-47,117,-26,-69,139,5,-55,142,26,-43,"); - add("131,-22,-74,122,-33,-80,139,-17,-76,122,77,1,"); - add("139,-10,-74,110,29,-30,112,94,16,135,-5,-70,"); - add("135,4,-64,138,53,-30,135,59,-24,131,75,-13,"); - add("131,75,-12,129,77,-12,124,90,-1,128,79,-11,"); - add("122,91,-1,118,93,2,113,99,8,113,99,7,"); - add("126,83,-13,126,80,-15,115,101,4,108,105,10,"); - add("101,112,18,98,113,19,95,118,24,103,110,12,"); - add("87,122,29,106,111,9,112,98,-4,119,92,-13,"); - add("122,70,-31,127,93,-20,85,115,20,83,127,29,"); - add("55,132,47,65,130,40,76,128,29,70,131,35,"); - add("48,133,49,45,135,51,-9,92,60,-74,102,107,"); - add("104,114,-1,117,120,-7,131,81,-40,122,53,-51,"); - add("130,55,-55,130,46,-62,131,49,-61,130,49,-63,"); - add("128,60,-55,110,95,-25,103,114,-9,70,138,25,"); - add("-30,65,57,76,199,53,59,134,28,32,109,34,"); - add("26,155,61,42,142,42,-38,14,34,-44,-59,2,"); - add("31,186,71,10,140,62,-18,132,76,3,115,53,"); - add("15,152,60,-54,105,86,-37,109,76,49,147,32,"); - add("20,140,48,3,59,24,117,-35,-97,114,87,-42,"); - add("108,102,-32,96,108,-23,120,104,-41,123,58,-66,"); - add("95,68,-40,108,117,-32,117,122,-36,72,132,-1,"); - add("115,90,-50,109,78,-51,120,74,-63,119,65,-67,"); - add("99,59,-54,147,55,-94,106,38,-70,135,57,-87,"); - add("102,89,-48,115,73,-66,102,97,-48,86,104,-32,"); - add("85,115,-28,98,117,-40,99,115,-41,60,144,0,"); - add("42,99,0,42,96,-3,30,174,35,-10,83,36,"); - add("-10,101,43,18,182,45,13,138,32,22,135,24,"); - add("6,161,44,47,139,1,-9,159,54,25,141,20,"); - add("4,141,35,10,153,33,10,126,25,63,149,-15,"); - add("25,140,13,-29,151,62,-84,79,90,-85,64,86,"); - add("-73,102,85,-2,156,37,-21,134,47,-19,149,47,"); - add("-19,119,39,-35,164,61,14,142,16,54,146,-17,"); - add("-35,114,49,11,161,18,59,120,-28,44,119,-17,"); - add("-78,96,80,-61,118,67,-77,87,75,-36,161,52,"); - add("23,148,1,52,143,-24,50,144,-23,41,151,-15,"); - add("49,140,-25,92,92,-66,62,139,-37,37,138,-18,"); - add("72,152,-47,26,97,-13,71,122,-50,52,152,-33,"); - add("18,145,-6,101,86,-81,107,41,-89,71,113,-55,"); - add("34,134,-23,127,38,-109,89,107,-74,72,119,-59,"); - add("65,140,-53,52,131,-44,71,99,-62,80,121,-71,"); - add("70,106,-63,82,114,-75,76,109,-70,75,111,-70,"); - add("75,110,-71,75,109,-74,81,101,-79,85,91,-84,"); - add("78,102,-78,80,99,-82,85,91,-87,87,85,-89,"); - add("91,74,-94,92,69,-97,90,77,-95,89,76,-96,"); - add("78,96,-87,69,108,-80,73,103,-84,71,105,-82,"); - add("66,112,-80,64,112,-79,66,109,-81,64,110,-82,"); - add("61,115,-78,62,112,-81,49,125,-69,40,132,-62,"); - add("51,123,-73,53,119,-77,47,126,-71,43,128,-69,"); - add("38,132,-64,12,144,-39,20,142,-48,32,134,-61,"); - add("42,124,-73,44,123,-75,31,137,-65,11,140,-43,"); - add("58,113,-94,38,127,-74,30,129,-66,24,138,-63,"); - add("42,119,-80,33,131,-74,-10,152,-29,-2,147,-38,"); - add("-10,152,-31,69,73,-106,24,26,-38,-53,40,54,"); - add("-13,145,-27,-24,153,-18,-28,142,-10,15,138,-62,"); - add("-35,100,10,-105,49,113,-83,-34,112,-46,-113,93,"); - add("-75,-66,111,-89,-32,116,-91,-28,117,-82,-53,112,"); - add("-93,-32,117,-101,25,108,-98,-13,116,-83,-61,110,"); - add("-98,-19,115,-101,15,106,-96,-14,108,-74,-80,104,"); - add("-79,-74,105,-87,-57,108,-101,22,101,-113,29,108,"); - add("-91,-1,94,-84,-72,105,-85,-65,103,-86,-55,101,"); - add("-112,-5,112,-109,12,104,-102,86,77,-96,96,67,"); - add("-86,113,52,-74,136,34,-89,95,57,-99,63,75,"); - add("-117,-24,116,-43,19,34,87,98,-107,88,66,-102,"); - add("77,82,-96,-35,155,-13,-75,117,35,-92,112,52,"); - add("-100,62,73,-97,117,53,-86,83,52,-79,138,26,"); - add("-97,97,57,-109,73,73,-94,111,46,-86,117,37,"); - add("-94,110,44,-121,46,89,-92,89,49,-102,50,70,"); - add("-112,33,83,-66,134,8,-86,29,62,-21,-93,50,"); - add("-96,161,23,-64,103,15,-85,138,19,-56,143,-7,"); - add("-44,144,-19,-46,136,-16,-62,143,-5,-64,135,-2,"); - add("-76,133,7,-83,129,14,-79,109,17,-110,64,60,"); - add("-100,91,41,-122,107,49,-110,57,61,-78,129,4,"); - add("-59,140,-16,-63,146,-17,-32,132,-35,-52,137,-23,"); - add("-33,149,-44,-47,136,-28,-56,143,-27,10,76,-44,"); - add("-128,195,1,-63,134,-19,-57,131,-24,-120,83,47,"); - add("-108,96,31,-111,87,37,-134,73,59,-73,102,0,"); - add("-93,125,0,-48,134,-37,-20,153,-68,43,57,-62,"); - add("-128,103,35,-123,123,19,-84,121,-9,-82,124,-13,"); - add("-91,123,-7,-86,122,-10,-91,122,-9,-96,117,-3,"); - add("-91,122,-10,-92,124,-13,-67,126,-30,-68,124,-31,"); - add("-88,115,-12,-105,134,-13,-42,105,-39,-113,113,2,"); - add("-110,104,6,-106,108,-1,-95,114,-12,-85,119,-24,"); - add("-61,127,-45,-109,113,-7,-5,135,-88,49,1,-32,"); - add("86,-151,47,88,-107,16,114,-104,-5,80,-117,25,"); - add("65,-125,39,116,-100,-12,110,-101,-7,115,-93,-18,"); - add("134,-51,-58,42,108,-98,-38,135,-61,8,122,-86,"); - add("-7,130,-82,-17,126,-74,10,119,-87,50,-2,-33,"); - add("14,-138,84,20,-130,74,25,-132,70,-1,-137,90,"); - add("43,-69,16,141,-10,-92,115,-95,-20,98,-116,6,"); - add("97,-116,4,94,-115,6,104,-108,-7,100,-114,-2,"); - add("94,-115,2,99,-119,1,85,-103,-1,86,-96,-7,"); - add("104,-120,-6,97,-117,-3,58,-142,39,51,-108,23,"); - add("104,-121,-9,102,-81,-32,121,-53,-64,122,-83,-49,"); - add("111,-96,-33,94,-121,-7,87,-129,1,76,-122,6,"); - add("68,-99,0,98,-169,11,16,-130,55,19,-142,59,"); - add("68,-123,8,49,-139,31,60,-134,18,101,-119,-23,"); - add("83,-108,-17,97,-113,-24,110,-56,-65,124,-71,-71,"); - add("111,-91,-51,98,-97,-38,86,-115,-20,88,-136,-13,"); - add("80,-130,-9,64,-143,8,90,-117,-27,73,-128,-7,"); - add("90,-126,-26,106,-94,-54,103,-93,-53,82,-118,-25,"); - add("58,-121,-2,102,-128,-40,72,-124,-16,53,-141,8,"); - add("41,-148,20,-12,-138,64,40,-140,17,12,-117,33,"); - add("97,-176,-26,53,-134,-1,28,-110,13,65,-183,2,"); - add("74,-127,-25,29,-144,20,24,-145,25,74,-136,-27,"); - add("75,-114,-35,127,-42,-108,105,-7,-100,93,42,-104,"); - add("94,34,-103,92,9,-95,64,101,-96,81,71,-105,"); - add("62,98,-97,96,35,-111,104,10,-111,104,4,-111,"); - add("93,36,-111,90,45,-112,89,46,-113,65,93,-104,"); - add("76,71,-111,96,5,-108,94,6,-109,90,45,-118,"); - add("46,110,-96,44,108,-93,76,66,-115,80,52,-115,"); - add("89,32,-118,84,36,-116,73,67,-115,87,32,-120,"); - add("85,34,-121,80,47,-119,70,61,-116,65,68,-113,"); - add("63,83,-118,-38,151,-21,3,138,-69,50,93,-110,"); - add("72,53,-121,73,52,-121,76,43,-124,78,34,-123,"); - add("68,63,-125,69,47,-119,86,6,-123,92,-28,-116,"); - add("73,43,-127,10,133,-87,-30,138,-32,27,112,-102,"); - add("75,35,-129,79,18,-128,73,30,-126,22,110,-100,"); - add("-19,144,-57,15,115,-93,54,64,-124,69,33,-128,"); - add("80,10,-133,2,92,-61,-55,140,-5,-51,141,-14,"); - add("-17,137,-65,-21,139,-62,8,116,-95,56,-22,-73,"); - add("66,-9,-102,-3,146,-99,-3,110,-77,9,114,-100,"); - add("31,90,-120,15,102,-103,-7,124,-86,-6,121,-87,"); - add("-19,131,-74,-69,85,49,-92,72,98,-86,113,51,"); - add("-88,108,57,-85,116,46,-84,92,60,-86,26,120,"); - add("-94,38,120,-88,27,117,-94,42,114,-95,53,104,"); - add("-96,94,71,-91,110,48,-89,112,42,-81,127,16,"); - add("-63,134,-18,-55,135,-33,-63,129,-17,-35,140,-71,"); - add("-52,93,-3,-22,-178,188,-23,-89,111,-31,-81,115,"); - add("-14,-111,114,-22,-100,113,-38,-91,128,-14,-93,94,"); - add("-5,-92,80,-19,-114,115,-59,-61,127,-80,-22,127,"); - add("-96,21,114,-89,18,106,-100,6,127,-65,-24,103,"); - add("-64,-60,127,-97,15,113,-96,115,39,-70,26,69,"); - add("-65,57,41,-26,95,-37,3,161,-123,-50,136,-40,"); - add("-70,137,-16,-27,111,-52,-102,122,33,-82,23,85,"); - add("-7,-115,97,20,-126,72,18,-129,75,64,-135,22,"); - add("9,-77,45,-113,146,31,-93,140,8,-98,105,39,"); - add("-90,132,9,-23,84,-37,-31,122,-57,-81,129,-4,"); - add("-84,90,30,-110,86,63,-92,67,55,-105,120,27,"); - add("-124,79,80,-67,94,2,-102,129,12,-94,130,1,"); - add("-90,122,1,-88,113,7,-90,119,1,-95,94,26,"); - add("-62,54,23,42,90,-122,-74,158,-54,147,-35,-134,"); - add("67,37,-108,6,90,-87,-19,107,-73,55,-45,-23,"); - add("112,-93,-47,102,-43,-82,82,50,-141,100,-108,-22,"); - add("108,-111,-30,108,-99,-43,85,-130,11,92,-103,-22,"); - add("97,-111,-22,82,-131,12,93,-121,-12,100,-103,-37,"); - add("101,-51,-85,102,-25,-107,108,-63,-87,106,-94,-58,"); - add("89,-88,-41,105,-72,-78,110,-54,-100,100,-94,-55,"); - add("94,-33,-101,91,-5,-120,100,-57,-91,92,-32,-103,"); - add("48,68,-126,57,50,-127,39,69,-119,56,56,-132,"); - add("49,61,-129,83,0,-125,98,-44,-108,79,-89,-38,"); - add("83,-141,4,68,-132,15,71,-127,4,94,-116,-41,"); - add("101,-37,-127,84,-36,-101,86,-23,-117,79,-2,-127,"); - add("89,-42,-109,82,-30,-108,72,8,-130,86,-24,-124,"); - add("84,-14,-132,73,-2,-126,91,-52,-112,86,-30,-126,"); - add("85,-25,-130,53,13,-111,73,-23,-115,51,29,-124,"); - add("37,18,-89,69,19,-152,70,-4,-133,68,5,-141,"); - add("32,59,-126,66,6,-143,86,-53,-119,67,-15,-125,"); - add("51,34,-146,51,22,-136,61,1,-135,50,25,-140,"); - add("53,20,-141,20,17,-67,132,-165,-108,64,-132,8,"); - add("78,-36,-142,59,-87,-36,69,-126,-17,82,-136,-38,"); - add("70,-92,-62,67,-7,-154,61,-60,-82,52,-32,-93,"); - add("17,75,-133,9,-7,-15,4,-112,125,62,-112,-24,"); - add("74,-107,-64,77,-73,-112,72,-61,-117,65,-33,-136,"); - add("30,42,-131,32,47,-146,39,-4,-103,24,-180,155,"); - add("-30,-54,148,-31,-37,130,-49,-18,149,-33,-6,93,"); - add("89,-158,-53,73,-92,-89,77,-102,-89,74,-102,-84,"); - add("74,-110,-77,72,-96,-92,71,-77,-110,65,-51,-127,"); - add("38,23,-139,27,56,-143,17,60,-125,22,64,-145,"); - add("-8,94,-95,-34,140,-75,-74,137,55,-40,161,-91,"); - add("18,29,-95,54,-38,-120,36,-139,72,52,-115,-11,"); - add("41,-10,-118,11,-135,145,66,-140,-30,66,-125,-54,"); - add("51,-142,20,31,-133,66,38,-139,50,47,-133,11,"); - add("54,-123,-26,54,-119,-33,48,-125,-8,43,-134,15,"); - add("53,-149,-4,47,-129,-8,60,-158,-19,53,-138,-25,"); - add("50,-137,-17,51,-145,-13,54,-159,-12,35,-108,-4,"); - add("59,-160,-35,51,-123,-49,60,-131,-71,47,-113,-50,"); - add("54,-157,-34,58,-129,-77,53,-122,-70,39,-100,-44,"); - add("44,-137,-28,54,-154,-52,41,-124,-33,36,-139,-4,"); - add("48,-169,-26,36,-109,-40,52,-167,-50,45,-130,-56,"); - add("48,-119,-81,46,-117,-82,44,-128,-66,41,-123,-60,"); - add("41,-147,-44,37,-137,-39,41,-140,-55,36,-126,-51,"); - add("28,-99,-42,30,-135,-22,34,-195,-1,29,-109,-48,"); - add("35,-111,-67,47,-161,-94,39,-116,-90,40,-98,-112,"); - add("39,-50,-139,23,51,-139,15,82,-129,-5,131,-67,"); - add("-13,127,-37,4,120,-113,21,47,-142,22,41,-143,"); - add("30,-9,-149,5,5,-30,-40,53,161,-26,128,22,"); - add("-6,125,-84,-9,129,-72,-2,108,-91,25,-3,-132,"); - add("5,62,-91,-29,150,1,-28,148,-7,-38,164,28,"); - add("-23,115,1,-29,160,-28,-21,155,-68,-10,107,-78,"); - add("-19,133,-65,-27,145,-36,-29,146,-33,-32,122,17,"); - add("-28,89,40,-35,149,-13,-45,151,39,-32,147,-39,"); - add("-38,128,24,-43,146,21,-34,145,-30,-27,134,-66,"); - add("-14,110,-99,16,30,-147,14,-6,-75,1,34,-72,"); - add("-26,154,-116,-3,70,-117,24,-12,-144,7,49,-146,"); - add("-8,83,-127,-38,140,-30,-32,120,-35,-12,88,-121,"); - add("-3,64,-137,-7,76,-139,-18,89,-88,-25,114,-107,"); - add("-13,87,-134,-9,70,-133,-26,108,-106,-25,104,-102,"); - add("-30,113,-95,-28,101,-68,-28,113,-137,-21,87,-122,"); - add("-9,29,-19,-4,-10,94,-34,124,-122,27,-56,-83,"); - add("-1,45,-207,-23,87,-134,-13,53,-105,-35,116,-129,"); - add("-37,110,-67,-31,89,-47,-61,153,48,-49,129,-38,"); - add("-29,92,-116,-9,39,-146,-12,44,-145,-34,95,-113,"); - add("-49,127,-48,-29,67,32,62,-145,-77,57,-142,-11,"); - add("8,-13,-68,-14,40,-98,-52,133,-70,75,-182,-57,"); - add("-12,35,-112,-44,109,-9,33,-76,-139,-48,120,-77,"); - add("-21,54,-26,65,-162,-49,-42,106,-96,-59,144,-14,"); - add("-1,4,-21,61,-150,-42,33,-82,-72,-48,117,-129,"); - add("-48,115,-84,-57,138,37,-53,128,7,-57,134,0,"); - add("-44,104,54,-21,49,122,-39,88,132,-26,59,139,"); - add("-22,48,48,3,-3,-138,47,-107,-105,34,-78,-126,"); - add("4,-12,-148,72,-167,-24,44,-106,-87,15,-43,-144,"); - add("-5,4,-156,46,-116,-110,54,-137,-75,48,-121,-40,"); - add("56,-142,-41,52,-133,-24,53,-139,-34,45,-123,-74,"); - add("9,-27,-38,-22,59,8,54,-149,-71,38,-114,-94,"); - add("9,-30,-61,-24,61,-13,48,-135,-53,3,-16,-54,"); - add("-16,36,-44,62,-169,-7,0,-8,-58,-17,26,-129,"); - add("27,-95,-117,32,-103,-77,45,-136,-47,24,-40,146,"); - add("33,-125,-154,-37,96,-55,58,-178,-50,28,-93,-52,"); - add("48,-161,-73,39,-130,-51,43,-142,-32,38,-126,-30,"); - add("48,-147,26,49,-146,40,47,-148,37,40,-122,44,"); - add("44,-147,15,2,-29,-76,-42,117,-105,-17,42,-53,"); - add("50,-175,-19,-23,51,-92,33,-122,-32,-32,84,-84,"); - add("15,-70,-58,-15,39,-41,26,-110,-54,-39,103,-107,"); - add("-43,117,-85,-33,69,-124,-36,88,-93,-24,83,4,"); - add("-3,-54,-168,-48,120,-98,-41,123,-30,-44,128,-30,"); - add("31,-151,-129,40,-155,-57,14,-85,-92,-2,-35,-92,"); - add("56,-180,20,30,-130,-54,37,-146,-32,38,-142,-12,"); - add("37,-146,-21,27,-134,-67,33,-147,-32,30,-143,-55,"); - add("37,-155,-14,11,-70,-40,-28,99,-27,29,-160,-70,"); - add("21,-130,-68,26,-144,-58,29,-148,-37,31,-141,-4,"); - add("31,-141,3,33,-158,-10,6,-71,-55,13,-72,-15,"); - add("33,-145,19,33,-156,14,36,-130,69,29,-134,26,"); - add("26,-148,-14,2,-59,-53,-15,50,-44,39,-168,63,"); - add("27,-129,31,34,-153,54,26,-142,18,30,-145,45,"); - add("22,-137,11,7,-139,-93,-24,27,-135,5,-134,-93,"); - add("-1,-104,-102,-2,-95,-95,3,-152,-107,-7,-70,-96,"); - add("7,-124,-52,1,-114,-73,-5,-112,-101,1,-126,-77,"); - add("1,-132,-75,11,-156,-28,14,-142,-6,10,-151,-22,"); - add("7,-139,-30,-4,-115,-74,12,-146,0,3,-140,-38,"); - add("-2,-122,-58,-9,-132,-95,-10,-122,-90,-10,-121,-86,"); - add("5,-156,-18,-14,-115,-96,-23,-76,-131,-18,-93,-106,"); - add("-24,-88,-128,-27,-66,-136,-22,-98,-112,-27,-72,-129,"); - add("-28,-72,-129,-22,-96,-106,-20,-35,-86,-40,49,-157,"); - add("-22,21,-88,-26,2,-102,8,154,50,10,136,59,"); - add("11,135,65,13,138,78,24,89,116,8,136,63,"); - add("-8,153,2,-6,142,11,-5,153,23,-15,144,-22,"); - add("-16,146,-19,-9,152,15,1,137,55,5,133,70,"); - add("9,123,90,20,85,124,15,100,112,6,121,87,"); - add("16,85,115,19,71,126,11,103,109,3,127,88,"); - add("19,58,133,31,-16,146,18,68,134,12,80,121,"); - add("8,86,105,-2,133,85,-15,41,-55,3,-124,-72,"); - add("0,-49,-38,-16,196,57,-14,146,35,-16,147,32,"); - add("-2,103,72,-2,124,97,-20,150,21,-12,142,64,"); - add("29,-19,151,12,45,117,-18,149,43,-22,146,25,"); - add("-28,150,-11,-27,123,-22,-36,141,-59,-35,128,-61,"); - add("-34,150,-27,-37,143,-45,-40,134,-67,-38,133,-56,"); - add("-36,134,-38,-30,149,21,-36,144,-20,-34,137,-9,"); - add("-28,122,7,-37,54,-137,-33,23,-144,-16,-59,-160,"); - add("39,-162,-1,37,-146,12,9,-83,-52,-31,-7,-164,"); - add("-30,8,-140,-27,-21,-151,-7,-56,-96,-5,-88,-112,"); - add("-10,-97,-145,-5,-87,-105,13,-135,-73,-4,-53,-63,"); - add("29,-193,-50,21,-154,-43,-36,34,-123,-30,51,-83,"); - add("19,-149,-42,27,-125,12,-38,23,-137,-34,-36,-164,"); - add("-18,-78,-129,-9,-95,-104,-27,-58,-142,7,-100,-41,"); - add("46,-128,86,27,-147,6,26,-152,2,17,-163,-35,"); - add("12,-82,-2,-52,57,-162,-42,111,-88,-42,110,-85,"); - add("-46,58,-132,-51,62,-140,-25,121,-13,4,123,89,"); - add("-1,39,21,-18,-128,-141,-39,-14,-140,-9,147,56,"); - add("3,81,64,-30,-77,-152,4,97,73,-40,11,-127,"); - add("-6,92,40,-42,114,-68,-40,10,-127,-32,-63,-142,"); - add("-59,75,-141,-54,62,-131,-50,90,-97,-53,60,-123,"); - add("-58,91,-120,-54,71,-114,-46,100,-72,-41,93,-60,"); - add("-37,148,-13,-31,158,14,-30,109,-13,-50,117,-63,"); - add("-30,153,20,-15,138,55,-25,124,17,-34,152,15,"); - add("-28,158,39,-20,136,50,-22,134,43,-15,136,65,"); - add("-26,140,40,0,105,90,3,119,114,-8,120,83,"); - add("-7,106,75,14,94,131,14,90,130,7,80,101,"); - add("10,118,149,-10,109,83,7,95,122,-2,105,108,"); - add("-3,106,110,-15,45,-3,-38,137,29,4,83,113,"); - add("1,91,112,-17,130,97,-20,110,68,-57,138,-24,"); - add("-54,137,-16,-55,130,-24,-66,120,-76,-58,70,-105,"); - add("-72,109,-102,-57,131,-21,-57,108,-48,-36,71,-26,"); - add("-45,12,-132,-61,63,-114,-59,95,-65,-72,78,-126,"); - add("-46,24,-111,-62,43,-134,-41,48,-62,-34,60,-27,"); - add("-14,-62,-118,-10,-97,-149,-36,-22,-129,-64,65,-103,"); - add("2,-104,-116,77,-141,52,45,-140,-33,24,-120,-67,"); - add("17,-115,-77,-58,-12,-173,-57,124,-22,-18,111,74,"); - add("-26,121,63,-73,123,-61,-16,13,-28,-46,17,-105,"); - add("-78,58,-139,-50,16,-113,-62,28,-127,-75,77,-107,"); - add("-63,51,-103,-62,6,-144,-29,49,-18,-32,-36,-116,"); - add("-70,53,-111,-73,78,-93,-56,79,-47,-13,65,38,"); - add("-30,-67,-139,-58,161,33,-19,119,82,-75,112,-55,"); - add("-2,-33,-39,34,-104,-32,5,-131,-123,-1,-80,-85,"); - add("-55,26,-96,-54,54,-65,-40,45,-43,-53,30,-85,"); - add("-32,-3,-73,-87,63,-122,-50,-9,-116,-65,19,-116,"); - add("-71,17,-130,-80,46,-117,-98,116,-87,-28,51,-6,"); - add("-14,31,1,-91,99,-85,-74,32,-114,-103,87,-115,"); - add("-79,73,-82,-82,82,-76,-50,91,-8,-13,71,46,"); - add("-78,49,-99,-77,5,-139,-82,111,-44,-83,71,-82,"); - add("-64,95,-23,-62,48,-66,-44,102,22,-40,-15,-85,"); - add("-28,-6,-56,-58,141,35,-39,101,30,46,34,115,"); - add("-127,87,-137,-54,85,-10,-56,143,46,-47,-20,-103,"); - add("15,-44,-16,-73,105,-22,-90,112,-42,-64,95,-13,"); - add("-115,119,-74,-79,122,-6,-41,102,36,-5,21,13,"); - add("-83,22,-116,-94,84,-69,-101,50,-113,-20,139,110,"); - add("1,35,40,-102,57,-106,-29,101,59,-77,74,-46,"); - add("-58,12,-81,-32,114,70,67,-11,98,-159,133,-114,"); - add("-20,42,13,50,52,138,8,96,119,63,18,124,"); - add("116,-69,116,31,53,113,29,28,82,-126,35,-174,"); - add("-93,81,-63,-105,73,-90,-99,59,-93,-86,56,-77,"); - add("-34,133,99,25,76,128,10,90,123,40,56,135,"); - add("4,74,95,73,9,136,76,5,137,5,99,132,"); - add("-36,38,-15,11,-124,-136,-72,8,-113,-84,29,-107,"); - add("-24,-78,-135,-62,-21,-130,-51,-42,-133,-70,17,-93,"); - add("-12,121,124,7,78,105,-13,101,103,33,74,145,"); - add("-62,121,49,-41,121,84,-33,114,91,-36,114,88,"); - add("-44,117,81,-44,121,87,19,71,130,38,52,136,"); - add("15,79,139,1,59,85,-94,108,-13,-104,105,-34,"); - add("-115,101,-56,-91,70,-58,-105,97,-40,-64,75,-3,"); - add("-66,-10,-127,-103,105,-21,-82,81,-20,-136,62,-137,"); - add("-76,32,-78,-125,58,-119,-47,-24,-109,-91,71,-42,"); - add("-94,124,27,58,52,166,74,-12,100,64,25,141,"); - add("39,56,147,23,65,135,97,-31,118,88,-61,57,"); - add("129,-98,73,102,-82,52,80,-6,131,25,59,137,"); - add("-74,118,55,-84,108,19,-38,109,106,59,10,125,"); - add("65,14,144,24,51,131,-22,92,115,-74,112,52,"); - add("-105,109,-13,-101,67,-74,-37,-43,-143,-102,33,-130,"); - add("-65,19,-86,-133,124,-31,-106,97,-22,-106,68,-72,"); - add("-105,53,-95,-110,54,-98,-106,87,-34,-134,101,-57,"); - add("-102,77,-41,-78,4,-122,-71,-5,-122,0,-91,-149,"); - add("60,-97,-60,113,-96,28,108,-82,42,123,-93,52,"); - add("88,-91,0,-19,-77,-152,136,-111,47,93,-79,32,"); - add("-144,58,-147,-113,62,-85,-115,90,-44,-111,61,-81,"); - add("-113,56,-91,-106,46,-91,-97,31,-101,-93,3,-134,"); - add("-105,44,-89,-1,-105,-155,-62,-37,-142,-27,-60,-125,"); - add("94,-121,-38,106,-109,-4,-1,-61,-85,-7,-28,-51,"); - add("120,-40,116,118,-122,0,52,-66,-17,-29,-65,-130,"); - add("-35,-59,-128,-109,51,-83,-59,-48,-147,-101,-1,-137,"); - add("24,-67,-55,65,-148,-103,37,-87,-62,39,-74,-39,"); - add("87,11,130,88,-84,13,26,-142,-142,57,-118,-69,"); - add("16,-93,-91,119,-132,1,112,-116,12,74,-115,-36,"); - add("25,-109,-94,66,-86,-11,-7,-85,-108,-97,52,-70,"); - add("-111,45,-94,-37,-21,-73,-70,78,-3,-81,57,-40,"); - add("-112,37,-103,-90,-7,-121,-106,68,-57,-97,-5,-126,"); - add("-126,95,-48,-86,98,4,-101,132,28,-28,89,67,"); - add("-63,130,74,-78,121,47,-64,123,66,-43,115,85,"); - add("-18,107,106,-15,103,109,-2,97,117,-18,104,107,"); - add("-29,108,102,-13,98,110,27,76,134,18,79,126,"); - add("-3,85,110,-93,116,36,-98,88,-8,-119,65,-63,"); - add("-108,31,-97,-125,72,-58,-123,70,-58,-122,86,-33,"); - add("-120,63,-62,-97,76,-14,-88,121,59,-57,107,81,"); - add("-116,101,0,-118,89,-16,-123,77,-37,-113,40,-77,"); - add("-117,100,6,-124,41,-85,-107,85,-3,-127,95,-8,"); - add("-61,9,-56,-24,-24,-61,-64,8,-58,50,-110,-99,"); - add("-88,-27,-132,-63,-35,-115,-145,38,-102,-118,38,-73,"); - add("-132,67,-45,-131,59,-55,-129,67,-41,-130,83,-18,"); - add("-121,80,-12,-106,90,18,-121,90,6,-129,72,-29,"); - add("-123,89,5,-125,84,-4,-126,85,-1,-132,74,-20,"); - add("-129,82,-5,-128,80,-6,-125,85,6,-114,92,27,"); - add("-114,91,26,-109,100,45,-119,88,21,-131,79,0,"); - add("-116,93,34,-120,89,25,-134,76,-3,-132,74,-3,"); - add("-118,84,25,-97,100,66,-71,79,59,-102,100,66,"); - add("-105,106,75,-63,93,90,-75,74,54,-61,108,117,"); - add("-79,93,83,-110,89,51,-105,100,74,-107,80,43,"); - add("-132,75,15,-109,82,47,-36,61,73,-24,76,107,"); - add("-79,91,89,19,67,129,-18,21,21,-106,11,-66,"); - add("-41,73,92,32,53,118,48,67,155,-14,78,128,"); - add("23,66,140,68,17,87,116,-7,88,92,-13,56,"); - add("94,-97,-96,121,-86,-49,36,8,46,-84,73,57,"); - add("198,-81,31,88,15,107,-139,99,55,-15,57,95,"); - add("-48,44,39,132,-65,-1,101,-71,-41,56,19,90,"); - add("-109,95,76,-84,83,80,0,44,86,127,-10,101,"); - add("86,14,110,30,54,137,-139,80,23,-137,46,-42,"); - add("-135,61,-7,-136,58,-12,-136,51,-26,-136,54,-17,"); - add("-142,64,0,-143,71,15,-119,71,38,-139,69,17,"); - add("-130,52,-6,-149,58,-10,-141,57,-1,-142,57,-2,"); - add("-125,55,9,-115,77,66,-138,60,13,-145,46,-19,"); - add("-135,63,25,-131,63,30,-145,46,-15,-144,29,-48,"); - add("-126,9,-75,-131,2,-89,-103,-2,-78,-145,8,-85,"); - add("-73,-25,-101,-59,-25,-91,-125,51,20,-111,-21,-115,"); - add("-110,-10,-90,-144,20,-50,-93,-27,-111,-87,54,54,"); - add("-145,67,47,-122,0,-72,-96,-31,-117,-70,-24,-85,"); - add("-163,1,-89,-50,-59,-140,-12,-32,-67,158,-11,64,"); - add("80,-49,-49,-105,-24,-102,-154,32,-21,-130,-6,-79,"); - add("-155,53,20,-111,-1,-57,-135,-2,-70,-150,10,-52,"); - add("-53,63,93,122,17,89,33,27,67,-87,73,97,"); - add("-111,65,72,-127,62,59,-142,49,30,-136,52,41,"); - add("-111,67,81,-142,54,45,-96,68,93,-145,51,42,"); - add("-138,21,-15,-134,3,-48,-143,18,-19,-112,-14,-72,"); - add("-69,-19,-64,-127,17,-11,106,-88,-136,73,-56,-82,"); - add("-17,-66,-133,-14,-67,-133,-156,43,26,-129,56,62,"); - add("-127,53,61,-121,47,50,-165,41,27,-100,5,-21,"); - add("-39,83,150,-67,73,125,-70,56,90,-158,25,6,"); - add("-138,1,-37,-115,-32,-97,-19,-22,-49,170,0,48,"); - add("129,-52,-68,49,-72,-127,69,-67,-110,37,-63,-111,"); - add("81,-63,-95,66,-61,-96,131,-36,-28,169,-43,-28,"); - add("150,-47,-39,90,-65,-90,128,-53,-54,120,-61,-71,"); - add("138,-48,-39,123,-61,-65,132,-58,-56,91,-73,-96,"); - add("134,-71,-75,115,-51,-44,139,-53,-37,119,-52,-43,"); - add("159,-20,30,145,-37,-3,85,-30,-17,36,-84,-128,"); - add("117,-79,-83,122,-58,-44,106,-49,-36,109,-94,-106,"); - add("82,-82,-98,75,-82,-101,65,-85,-107,62,-85,-108,"); - add("41,-87,-117,33,-86,-120,30,-89,-123,20,-86,-123,"); - add("25,-88,-120,33,-89,-119,32,-90,-118,34,-90,-117,"); - add("22,-90,-119,-12,-73,-110,29,-103,-133,32,-93,-116,"); - add("50,-95,-109,14,-91,-119,-30,-84,-125,-195,88,36,"); - add("-121,70,44,-137,65,33,-119,79,60,-98,87,82,"); - add("-56,82,91,-57,83,96,-59,73,80,-205,54,-2,"); - add("-151,27,-18,-78,5,-23,-22,101,138,-37,90,117,"); - add("-88,84,91,-127,63,47,-135,56,35,-139,6,-38,"); - add("-140,1,-47,-134,70,61,5,81,122,17,78,125,"); - add("-41,86,117,-89,79,93,-98,75,85,-119,64,62,"); - add("-100,19,-1,17,-95,-143,-132,50,38,-20,87,131,"); - add("47,56,102,18,68,116,-29,86,130,-106,66,74,"); - add("-66,73,102,130,32,94,103,-30,-19,47,77,145,"); - add("-70,79,111,-99,71,90,-128,63,68,-114,62,73,"); - add("-87,70,95,-55,78,123,-97,68,93,-121,24,7,"); - add("-147,9,-24,-105,-31,-85,-80,65,96,-168,46,39,"); - add("-100,19,9,53,-101,-168,-37,-29,-61,-127,65,85,"); - add("-121,58,77,-134,29,22,-156,25,12,-144,-2,-33,"); - add("-137,-3,-32,-103,-67,-138,-35,-62,-117,-94,-9,-32,"); - add("-79,89,144,-103,42,58,-147,52,71,-131,39,52,"); - add("-94,50,77,-110,45,69,-88,41,63,-145,58,91,"); - add("-135,28,39,-149,33,45,-154,42,67,-110,29,47,"); - add("-142,33,52,-122,43,75,-88,36,65,-48,26,48,"); - add("-79,-44,-90,-151,-18,-40,-139,-29,-58,-91,10,17,"); - add("-85,59,112,37,70,137,32,61,121,79,42,84,"); - add("57,43,89,16,96,195,36,62,129,70,9,19,"); - add("137,40,90,51,50,108,169,-17,-27,36,11,26,"); - add("61,36,80,155,-21,-32,83,-6,-5,-231,34,53,"); - add("-136,-5,-19,-97,17,29,72,29,68,-155,-33,-80,"); - add("-91,-42,-93,-163,-15,-36,-124,23,46,-123,34,71,"); - add("-112,47,100,-74,53,114,-24,59,131,77,57,126,"); - add("-49,54,121,-99,29,69,-108,-6,-12,54,-64,-146,"); - add("-67,-63,-139,-79,-39,-84,-150,6,20,-139,16,41,"); - add("-148,-25,-46,-76,-52,-109,-43,-62,-131,-129,-32,-58,"); - add("-159,-30,-48,-105,-46,-87,-124,-6,0,-30,8,22,"); - add("-73,-24,-43,-57,44,101,39,66,136,-102,62,146,"); - add("30,32,67,11,49,105,29,27,57,-151,-27,-39,"); - add("-117,24,70,16,27,60,-138,-5,10,-65,55,136,"); - add("-33,35,84,122,35,61,121,49,94,115,44,86,"); - add("113,41,79,158,6,-6,124,3,-8,183,20,27,"); - add("23,-15,-38,-80,-60,-133,-18,-46,-105,10,-32,-75,"); - add("86,19,35,82,53,115,21,61,141,16,64,151,"); - add("76,33,75,102,59,134,129,33,73,138,35,80,"); - add("111,28,63,105,29,69,121,41,101,115,40,102,"); - add("82,18,44,870,23,91,110,40,114,77,23,70,"); - add("168,28,91,133,20,70,114,30,98,147,9,46,"); - add("-90,27,62,141,13,57,73,-15,-30,53,-51,-132,"); - add("-19,-34,-96,-41,-51,-145,15,-49,-127,95,-34,-73,"); - add("169,5,42,52,49,140,124,28,99,17,53,147,"); - add("69,28,93,171,-33,-53,144,4,48,140,8,58,"); - add("131,12,67,113,11,64,150,-6,27,138,-14,5,"); - add("138,-42,-71,49,-51,-127,60,-54,-127,76,-29,-53,"); - add("-71,79,190,-14,52,140,1,50,144,110,25,109,"); - add("-28,52,141,-81,43,99,-8,49,144,48,39,136,"); - add("93,26,116,113,17,100,135,5,72,150,-3,56,"); - add("113,-7,29,162,-13,33,146,-15,25,140,-3,62,"); - add("52,28,120,-7,49,156,114,7,87,44,10,60,"); - add("14,38,140,41,25,111,-150,31,21,30,35,144,"); - add("94,17,120,126,4,94,139,-28,-16,135,-41,-62,"); - add("151,-29,-4,25,19,88,-141,35,31,-58,13,9,"); - add("14,-26,-86,-127,49,98,155,0,104,71,5,70,"); - add("-208,7,-117,-46,10,7,91,20,141,98,13,115,"); - add("101,9,110,114,4,102,96,10,117,95,1,79,"); - add("109,-40,-76,133,-7,81,117,-41,-68,-35,-14,-89,"); - add("120,-42,-66,96,-58,-148,89,0,74,65,10,99,"); - add("130,-44,-61,71,-13,15,25,41,188,42,22,129,"); - add("122,-11,72,140,-30,16,82,17,155,-11,36,147,"); - add("11,19,96,183,-61,-70,112,-43,-66,155,-51,-47,"); - add("84,-4,77,16,27,138,-14,31,125,-75,53,155,"); - add("-80,36,74,-32,23,74,-15,35,154,-25,35,141,"); - add("72,0,99,109,-54,-133,105,-45,-94,50,-21,-34,"); - add("-128,64,153,-73,48,147,30,17,135,-15,32,149,"); - add("18,21,148,53,10,136,28,19,158,37,11,129,"); - add("65,4,136,47,-2,67,-5,36,232,-126,44,76,"); - add("38,14,176,36,11,147,59,2,141,104,-14,111,"); - add("123,-27,48,138,-42,-32,187,-62,-75,-42,18,54,"); - add("-141,44,29,-118,42,81,-131,41,52,-47,24,99,"); - add("100,-12,127,-67,31,125,69,-3,154,111,-34,-29,"); - add("-3,-9,-99,147,-28,121,100,-20,81,90,-18,85,"); - add("77,-8,160,91,-20,75,130,-34,57,-12,7,30,"); - add("-147,40,-39,-126,31,-55,-140,35,-59,-92,16,-109,"); - add("-133,32,-52,-138,31,-73,-128,32,-25,-139,29,-69,"); - add("-131,24,-93,-135,29,-56,-140,29,-51,-155,38,9,"); - add("-68,29,120,-52,14,26,-2,-10,-105,-127,37,72,"); - add("-73,28,119,-80,32,142,-82,30,140,29,5,136,"); - add("51,1,149,91,-14,95,46,-1,124,-187,43,23,"); - add("2,10,158,-32,14,112,-177,35,-56,-60,23,186,"); - add("83,-11,131,135,-25,77,148,-30,61,135,-30,13,"); - add("142,-36,-57,44,-12,-44,21,3,184,63,-11,92,"); - add("147,-40,-107,144,-35,15,202,-54,-65,-73,21,54,"); - add("-123,32,26,-149,37,6,-32,13,130,106,-21,127,"); - add("51,-9,130,-27,8,64,-59,17,91,33,-5,135,"); - add("77,-18,95,108,-26,130,55,-13,135,48,-11,147,"); - add("66,-18,128,103,-27,104,85,-24,134,147,-41,64,"); - add("19,-6,68,15,-5,55,129,-34,-105,26,-8,31,"); - add("25,-8,70,136,-36,-112,129,-37,-45,103,-32,103,"); - add("80,-25,120,132,-38,-81,21,-7,3,-143,41,91,"); - add("-118,37,-84,-104,31,-37,37,-15,193,1,-4,148,"); - add("12,-8,152,-17,-1,153,3,-8,154,55,-21,114,"); - add("136,-42,33,138,-40,-30,143,-45,34,130,-38,-51,"); - add("84,-20,-134,141,-43,-46,99,-28,-115,139,-44,-30,"); - add("133,-47,62,126,-43,4,155,-52,-32,141,-50,9,"); - add("67,-29,129,-217,78,-48,-91,30,49,147,-56,97,"); - add("75,-27,24,-208,74,-46,-143,50,-14,-108,40,-86,"); - add("-122,44,-87,-69,19,95,-20,-1,153,-144,42,95,"); - add("-91,26,69,-105,27,110,-56,9,142,31,-19,141,"); - add("84,-28,24,106,-34,10,-98,21,131,30,-19,134,"); - add("148,-48,3,117,-31,-89,78,-17,-117,122,-36,-74,"); - add("69,-22,-14,-138,31,215,-60,10,119,-78,16,122,"); - add("-115,38,-4,-151,50,-18,-124,44,-71,-124,43,-54,"); - add("-144,45,-14,-64,14,67,179,-57,30,125,-44,67,"); - add("52,-28,137,63,-31,126,126,-49,95,144,-44,-27,"); - add("145,-47,-12,144,-46,-26,122,-48,68,107,-46,95,"); - add("131,-53,64,136,-49,11,136,-52,28,89,-28,-48,"); - add("36,2,-152,-16,20,-148,86,-19,-130,104,-30,-102,"); - add("111,-37,-68,140,-53,-1,120,-48,13,104,-50,107,"); - add("129,-49,-15,73,-19,-133,41,-13,-37,-39,1,179,"); - add("-129,44,82,-136,57,-40,-129,53,-27,-126,47,10,"); - add("-142,50,53,-63,13,112,8,-18,149,45,-31,143,"); - add("136,-57,59,142,-53,-20,138,-57,23,102,-50,93,"); - add("82,-46,121,126,-59,66,78,-45,115,43,-35,140,"); - add("57,-39,119,74,-46,108,-89,19,130,-46,-2,147,"); - add("-88,19,119,-113,31,99,-93,46,-59,72,-8,-137,"); - add("102,-28,-92,11,18,-161,-96,49,-74,-84,51,-134,"); - add("-94,51,-104,-79,46,-124,-107,51,-78,-132,56,-46,"); - add("-104,51,-100,-143,47,58,-132,44,48,-138,54,-39,"); - add("-127,51,-45,-138,54,-54,-142,53,-26,-121,47,-58,"); - add("-126,49,-59,-139,50,-36,-135,41,25,-146,45,24,"); - add("-107,44,-100,-115,44,-86,-124,45,-74,-148,49,-40,"); - add("-125,31,66,-83,14,108,-48,-1,147,-42,-1,123,"); - add("116,-48,130,127,-47,76,124,-46,79,112,-45,93,"); - add("74,-39,124,41,-31,146,95,-43,99,120,-41,17,"); - add("125,-39,-7,123,-50,70,110,-45,58,111,-53,108,"); - add("78,-23,-21,122,-24,-128,143,-52,19,146,-46,-48,"); - add("73,-19,-46,128,-61,101,66,-43,127,-160,48,75,"); - add("-148,45,55,-120,29,88,-120,29,81,-122,25,107,"); - add("-140,42,39,-122,26,88,-106,18,107,-87,7,124,"); - add("-101,13,115,-20,-16,122,55,-38,110,148,-51,18,"); - add("124,-43,8,82,-56,149,10,-26,114,62,-41,104,"); - add("-119,33,37,-113,55,-90,-93,27,22,4,-32,149,"); - add("-4,-32,163,-60,-8,131,-85,3,112,-35,-21,147,"); - add("41,-47,149,-77,-2,113,-87,20,38,-90,56,-120,"); - add("-88,48,-90,-8,17,-64,-53,-20,162,-10,-31,147,"); - add("55,-34,69,-14,-15,81,-74,-7,122,-44,-22,144,"); - add("-2,-43,171,-14,-29,128,-19,-34,149,-41,-25,138,"); - add("26,-38,109,85,-58,111,53,-51,120,-70,-19,143,"); - add("-68,2,64,-159,44,17,-135,42,-6,-111,47,-48,"); - add("-14,46,-145,77,18,-141,3,26,-96,-128,49,-44,"); - add("-150,49,-21,-141,24,57,-100,-4,114,-90,-3,96,"); - add("222,-83,76,62,-44,91,74,-55,118,90,-69,142,"); - add("142,-41,0,117,-61,82,66,-54,112,64,-59,127,"); - add("39,-38,80,-114,24,35,-160,55,-21,-116,7,85,"); - add("-21,-50,172,-30,-38,141,-44,-33,136,-18,-44,143,"); - add("15,-50,132,125,-58,61,134,-55,39,87,-65,108,"); - add("-108,-7,111,-171,30,57,-122,8,76,-161,52,-16,"); - add("-157,32,34,-14,-54,156,100,-54,67,150,-56,35,"); - add("136,-17,-59,121,-76,104,-62,-35,139,-143,18,62,"); - add("-138,38,4,-140,47,-18,-139,20,48,-134,64,-69,"); - add("-83,61,-101,-108,57,-75,-77,52,-85,-35,66,-152,"); - add("-97,53,-78,-153,45,-17,-139,35,-4,-122,43,-38,"); - add("-145,48,-39,-131,50,-55,-35,17,-25,137,-22,-26,"); - add("172,-52,33,120,-16,-36,126,-23,-20,163,-31,-28,"); - add("144,-22,-41,137,-12,-66,138,-19,-52,141,-23,-41,"); - add("122,-3,-88,89,17,-123,62,29,-135,27,39,-143,"); - add("-8,50,-143,-36,54,-137,-97,54,-86,-118,58,-80,"); - add("-129,45,-36,-124,35,-5,-133,33,4,-164,34,26,"); - add("-107,20,20,-188,54,-27,-146,34,0,-150,34,3,"); - add("-145,30,10,-127,8,63,-145,14,55,-85,-11,92,"); - add("-32,-14,67,-106,45,-73,-137,20,24,-42,26,-57,"); - add("73,11,-81,-168,22,37,-53,-27,118,-158,15,48,"); - add("-68,-6,58,-88,16,1,-103,34,-50,-68,18,-19,"); - add("189,-4,-93,63,34,-146,-88,35,-63,-131,25,-8,"); - add("-159,26,8,-61,-27,121,26,-41,118,15,-28,81,"); - add("-100,59,-136,-39,43,-117,-48,35,-90,-92,-13,92,"); - add("24,-50,148,-47,-22,93,-103,51,-111,-30,-54,187,"); - add("-4,-45,141,-43,-10,52,-44,57,-156,-3,55,-172,"); - add("-113,9,23,-46,-29,115,-20,-42,140,-51,-43,155,"); - add("-8,-37,114,-142,27,-21,-138,10,25,3,-21,63,"); - add("99,-27,38,1,-24,71,-133,8,28,-51,-34,119,"); - add("20,-39,105,-49,-14,57,-19,63,-172,-63,18,-30,"); - add("3,-52,148,-27,-6,29,-81,38,-80,-1,-47,132,"); - add("41,-28,66,-100,12,0,-57,-14,60,-78,-50,161,"); - add("19,-50,132,-110,-31,118,37,-32,72,121,-13,-3,"); - add("-55,-17,61,-119,-5,51,22,-32,75,-8,-30,81,"); - add("-128,34,-51,-13,-34,92,-68,-38,115,104,-25,35,"); - add("-22,-38,101,-97,-8,46,10,-31,75,96,-15,11,"); - add("-150,-26,102,-89,-41,122,-29,-49,124,-5,-59,142,"); - add("102,-25,34,-142,-35,113,-11,-42,101,-17,-61,141,"); - add("32,-65,140,-65,-49,121,-116,-25,80,-12,-22,49,"); - add("74,4,-24,-32,-65,149,-87,-22,64,-107,-19,61,"); - add("-74,-53,125,-30,-54,117,-20,-47,102,103,-40,63,"); - add("121,38,-100,11,45,-95,83,15,-48,-5,-52,109,"); - add("-74,-49,115,-125,-37,99,-78,21,-28,-105,24,-32,"); - add("-65,-36,84,-117,-54,126,-12,-43,88,3,-20,39,"); - add("-93,17,-21,40,-36,67,-187,32,-38,-68,-35,77,"); - add("142,-19,19,44,-6,7,-107,-31,73,-170,5,11,"); - add("-38,-29,61,138,-35,51,19,-30,56,-139,30,-41,"); - add("-26,-22,45,-79,-18,43,-10,-20,39,-119,5,2,"); - add("-73,-15,35,51,-34,60,135,-9,4,88,-13,15,"); - add("-204,6,8,-58,-54,107,41,-62,111,-12,-60,111,"); - add("165,3,-22,141,9,-30,81,9,-26,121,5,-25,"); - add("46,10,-23,-65,-71,137,-113,15,-13,-165,6,8,"); - add("-137,-10,31,-71,-39,77,44,-55,96,56,-52,87,"); - add("-60,-51,95,76,-8,8,32,-7,9,58,-30,46,"); - add("91,74,-140,133,14,-40,-101,-58,115,-116,-74,141,"); - add("22,-36,61,36,-9,12,-128,-39,79,-45,-62,111,"); - add("96,-4,-3,89,24,-50,69,16,-36,-27,-68,119,"); - add("-8,-73,125,52,-14,17,-163,-5,26,-11,-80,133,"); - add("113,-56,81,164,-41,48,93,-44,62,120,-27,28,"); - add("139,12,-38,114,32,-68,113,56,-108,91,75,-138,"); - add("71,50,-95,85,48,-96,129,23,-62,16,79,-137,"); - add("-21,60,-100,45,39,-76,43,-102,168,100,-60,85,"); - add("86,-42,54,22,-91,149,77,-82,121,102,-39,44,"); - add("30,-102,160,52,-68,100,79,-76,105,81,-75,101,"); - add("100,-72,92,107,-82,103,-20,-80,129,43,-77,108,"); - add("97,-78,95,31,-91,130,152,-23,-2,139,15,-55,"); - add("85,37,-78,-46,84,-116,82,66,-121,93,34,-76,"); - add("140,2,-42,120,7,-44,27,94,-155,33,71,-122,"); - add("-10,85,-133,-17,82,-129,-22,77,-118,-36,75,-113,"); - add("0,71,-119,-42,78,-120,-84,51,-62,-18,8,-8,"); - add("158,11,-67,92,44,-104,59,43,-94,109,50,-124,"); - add("-4,43,-75,-166,-24,98,-135,18,11,-144,30,-10,"); - add("-87,17,-4,167,12,-72,119,0,-37,2,31,-55,"); - add("149,-74,84,81,29,-78,74,63,-140,-30,63,-103,"); - add("-137,64,-72,-118,56,-65,-130,36,-23,-116,42,-42,"); - add("-64,75,-122,-41,74,-128,-29,75,-135,10,49,-99,"); - add("-15,80,-154,-40,69,-124,76,46,-118,-7,57,-113,"); - add("69,41,-108,71,47,-122,85,54,-144,93,36,-111,"); - add("75,31,-94,48,61,-151,27,60,-142,7,54,-123,"); - add("-98,55,-87,11,62,-146,-33,63,-135,49,45,-126,"); - add("-1,19,-44,43,11,-45,45,31,-92,136,-8,-38,"); - add("142,2,-68,121,-7,-38,168,-56,59,69,-63,119,"); - add("54,-65,129,-102,-29,116,-19,-59,146,-32,-54,138,"); - add("-35,-54,138,-50,-50,131,-57,-41,114,-34,-55,135,"); - add("-52,-49,125,-61,-30,89,-21,-65,145,24,-66,128,"); - add("78,-59,90,58,-76,131,98,-70,104,39,-58,98,"); - add("35,-86,155,29,-67,119,95,-70,98,126,-32,10,"); - add("161,-43,16,118,-28,2,88,-64,85,11,-26,43,"); - add("80,38,-106,156,9,-87,89,28,-93,101,21,-88,"); - add("125,31,-120,87,26,-94,91,14,-71,143,6,-86,"); - add("115,7,-74,136,12,-97,132,-76,79,140,-29,-19,"); - add("134,-20,-36,62,-45,55,-190,9,90,-75,-38,116,"); - add("-100,-25,103,-13,-67,136,-131,-8,83,-145,16,45,"); - add("-146,21,32,-137,6,55,-107,-24,97,-117,-9,71,"); - add("-105,-33,110,-98,-41,117,21,-66,111,73,-68,92,"); - add("97,-88,114,158,-25,-26,66,-81,113,35,-79,122,"); - add("68,-81,109,16,-74,121,-89,-48,120,-143,29,13,"); - add("-109,73,-77,-134,61,-47,-107,36,-17,-124,-37,114,"); - add("-48,-64,126,16,-80,128,-34,-71,129,31,-93,141,"); - add("30,-73,105,61,-83,110,66,-83,105,74,-87,106,"); - add("34,-78,107,-27,-60,104,-107,38,-18,47,87,-152,"); - add("-16,52,-75,-34,-119,198,-91,-45,103,-86,-36,85,"); - add("-11,-86,133,-87,-52,109,-140,-7,59,-122,57,-43,"); - add("-29,57,-75,-218,21,39,-130,-21,74,-112,-40,93,"); - add("-111,-38,89,-63,-56,100,-148,-32,88,-129,-25,72,"); - add("-126,-32,78,-132,-15,55,-87,9,10,190,-58,34,"); - add("-36,-31,53,-140,41,-22,-103,81,-90,-133,38,-21,"); - add("-139,51,-42,-94,-4,27,-136,-64,122,-128,-38,80,"); - add("-91,-22,48,-108,37,-30,-13,81,-112,-199,13,18,"); - add("-104,55,-58,-90,68,-83,-50,40,-48,-25,89,-125,"); - add("1,91,-135,42,64,-102,84,60,-105,60,68,-113,"); - add("96,51,-97,-95,45,-50,-102,33,-33,-46,108,-159,"); - add("68,72,-125,-33,84,-128,-29,28,-39,-132,-44,93,"); - add("-66,-71,124,-120,-33,72,-139,-21,54,-71,-78,132,"); - add("72,-25,27,91,85,-145,98,9,-30,90,-10,1,"); - add("-70,-93,155,-18,-17,29,-92,29,-29,-109,-42,80,"); - add("-76,-38,70,13,-54,79,32,-90,131,5,-98,145,"); - add("84,-39,46,72,-99,134,40,-83,114,75,-76,97,"); - add("-8,-64,92,19,-48,65,63,-79,100,137,-58,59,"); - add("59,-44,51,-210,58,-47,-104,-26,52,-25,-83,118,"); - add("-102,23,-17,-129,39,-35,-146,-27,55,4,-80,109,"); - add("-47,-11,21,-127,39,-37,-147,-12,32,-140,-28,53,"); - add("-93,-63,94,-127,-54,83,-74,-49,71,-18,-91,121,"); - add("-46,-85,114,-90,-78,108,-68,-65,87,16,-45,57,"); - add("47,-36,41,-117,-21,35,128,-38,39,-230,4,9,"); - add("-135,-41,59,-128,-49,67,-143,-27,39,-139,-41,56,"); - add("-32,-93,115,6,-98,119,-35,-60,72,-123,-64,80,"); - add("-144,-29,37,-135,-47,56,-12,-90,106,-152,-52,60,"); - add("-149,15,-18,-155,15,-20,-86,84,-100,-162,-7,4,"); - add("52,-114,135,32,-91,106,9,-114,130,-161,-25,24,"); - add("-133,4,-10,-139,-10,5,-111,74,-90,-151,-18,12,"); - add("-136,-26,20,-161,-16,8,-72,-73,77,57,-63,75,"); - add("-53,-87,93,137,-50,67,137,-19,29,162,-32,46,"); - add("100,-45,55,119,-19,27,91,-75,85,133,-37,45,"); - add("-30,-117,125,67,-94,103,85,-65,71,146,-61,67,"); - add("44,-104,109,-9,-94,97,103,-89,93,52,-99,101,"); - add("23,-57,57,-115,142,-145,-71,-3,2,-22,-109,110,"); - add("-19,-107,106,14,-78,78,-40,-136,133,-28,-107,103,"); - add("-32,-106,101,-74,-99,92,-138,-42,35,-146,0,-5,"); - add("-143,33,-37,-142,-16,8,-151,34,-42,-139,-3,-6,"); - add("-172,-22,9,-145,9,-21,-145,24,-35,-138,23,-34,"); - add("-148,23,-37,-159,-13,-4,-147,-4,-14,-148,-5,-12,"); - add("-141,50,-67,-128,15,-31,-139,-42,21,-62,-79,67,"); - add("-211,-45,10,-123,-56,35,-32,-88,78,77,-89,95,"); - add("53,-76,79,-2,-93,86,-45,-126,108,-2,-102,92,"); - add("2,-115,103,22,-108,99,-27,-115,98,-8,-54,45,"); - add("-83,-186,148,-46,-98,76,-66,-108,81,-83,-102,72,"); - add("-64,-84,59,-44,-119,91,19,-93,79,126,53,-22,"); - add("61,39,-23,-122,-131,87,47,-63,58,109,-10,26,"); - add("-38,-152,115,-1,-121,95,-19,-114,86,-49,-117,83,"); - add("18,-67,55,169,15,14,153,-25,40,133,6,14,"); - add("142,54,-22,157,13,10,84,-19,25,121,-86,80,"); - add("70,-67,58,30,-135,104,79,-114,93,127,-64,60,"); - add("128,33,-12,92,101,-65,140,50,-25,138,39,-17,"); - add("123,56,-33,151,11,3,151,-8,16,148,11,0,"); - add("152,-13,18,134,36,-21,159,-4,9,106,95,-67,"); - add("69,112,-83,114,78,-56,141,35,-24,133,37,-26,"); - add("39,115,-89,58,119,-92,90,88,-69,131,65,-52,"); - add("61,86,-69,-122,102,-82,-43,111,-91,13,111,-91,"); - add("73,102,-84,87,93,-79,93,91,-77,81,100,-86,"); - add("77,60,-52,88,121,-106,134,42,-40,147,33,-32,"); - add("144,32,-34,110,76,-70,132,56,-56,124,59,-59,"); - add("73,90,-85,0,111,-100,-56,113,-101,-23,112,-102,"); - add("34,91,-87,120,73,-76,120,69,-72,103,22,-29,"); - add("168,-48,33,114,8,-17,115,-6,-4,128,-73,57,"); - add("153,-46,29,141,-6,-10,144,54,-67,82,80,-86,"); - add("112,69,-80,121,50,-63,145,31,-49,99,69,-81,"); - add("80,84,-95,121,57,-75,149,-25,2,134,-51,28,"); - add("136,-50,26,130,-60,35,52,-105,93,70,-99,83,"); - add("55,-106,91,69,-75,59,122,-75,47,102,-99,73,"); - add("141,-44,13,116,-90,59,127,-69,37,105,-88,57,"); - add("126,-83,47,135,-58,22,123,-28,-3,147,-15,-22,"); - add("126,-70,33,105,-88,52,132,-70,28,155,-24,-19,"); - add("74,-117,83,113,-80,41,135,-26,-15,107,-79,39,"); - add("69,-110,75,82,-106,67,60,-114,80,26,-104,80,"); - add("-78,-77,86,-23,-114,101,-26,-99,88,115,-56,13,"); - add("83,65,-77,68,93,-96,53,91,-91,-1,112,-93,"); - add("128,48,-79,49,65,-70,-51,122,-89,-128,78,-28,"); - add("-125,71,-24,8,117,-104,39,103,-103,86,76,-94,"); - add("104,-33,-2,164,-45,-12,114,-71,26,89,-93,54,"); - add("97,12,-43,-10,118,-102,-113,94,-46,-123,78,-31,"); - add("-144,57,-5,-133,65,-17,-139,59,-10,-143,42,4,"); - add("-142,49,-3,-141,79,-31,14,125,-120,-172,27,24,"); - add("-145,1,39,-142,41,0,-124,69,-32,-127,77,-40,"); - add("-115,84,-50,-80,101,-77,-62,107,-87,-76,104,-82,"); - add("-102,74,-48,-137,65,-31,-133,63,-32,-126,69,-40,"); - add("-81,97,-79,-38,109,-101,34,91,-101,-89,117,-101,"); - add("60,86,-102,128,30,-60,109,51,-79,144,-3,-31,"); - add("37,-68,62,12,-104,106,70,-91,77,105,-36,12,"); - add("54,87,-104,82,59,-82,137,-74,40,56,-99,89,"); - add("72,-97,79,123,-77,46,1,-51,51,118,-122,90,"); - add("134,-72,34,107,-73,41,151,-4,-39,153,-49,1,"); - add("130,-72,32,136,-74,30,31,-32,22,-122,21,18,"); - add("213,-65,-5,139,-55,9,144,-73,23,103,-35,-1,"); - add("148,-91,37,112,-86,43,138,-77,24,-10,-96,95,"); - add("35,-112,91,22,-110,94,18,-133,116,33,-91,71,"); - add("140,-97,36,114,-81,32,83,-104,62,88,-88,45,"); - add("129,-94,34,135,-66,6,69,-40,8,-23,-79,78,"); - add("115,-110,50,89,-38,-3,126,-18,-34,159,17,-78,"); - add("142,-3,-56,130,-29,-28,119,-85,22,-228,24,75,"); - add("-138,50,14,-119,-8,55,-120,-49,88,-42,-110,108,"); - add("111,-102,42,122,-103,37,19,-127,96,120,-89,24,"); - add("113,33,-72,102,-109,47,63,-49,12,89,76,-98,"); - add("119,-92,24,37,13,-26,-57,117,-70,-80,121,-65,"); - add("-91,110,-52,25,58,-59,134,-63,-5,47,72,-80,"); - add("-121,89,-23,-21,73,-53,144,21,-80,128,-70,4,"); - add("87,-9,-31,-51,146,-103,-119,77,-13,-136,65,3,"); - add("-121,63,-2,-151,55,16,-61,42,-11,63,83,-100,"); - add("-9,85,-71,85,-38,-2,-133,153,-80,-101,103,-51,"); - add("-106,100,-46,-27,125,-104,68,49,-73,134,-93,29,"); - add("112,-92,36,75,-17,-16,-36,90,-68,134,-79,14,"); - add("41,11,-28,-67,96,-59,113,-7,-44,-169,116,-33,"); - add("11,66,-66,125,23,-78,96,39,-80,125,5,-63,"); - add("105,13,-62,149,-35,-38,149,-29,-43,116,-76,15,"); - add("140,11,-79,28,-41,24,-103,-68,116,35,-72,52,"); - add("96,112,-154,98,57,-105,75,70,-106,56,82,-109,"); - add("128,13,-81,127,12,-79,112,-18,-44,95,62,-113,"); - add("-145,71,8,-141,52,25,-122,78,-13,-72,105,-68,"); - add("-105,106,-53,-118,86,-27,-5,75,-75,43,77,-102,"); - add("-37,120,-108,39,89,-115,102,41,-100,-33,122,-114,"); - add("-32,111,-104,-30,100,-95,3,95,-108,22,84,-107,"); - add("160,5,-96,-13,108,-117,-43,104,-96,-38,95,-89,"); - add("72,25,-71,82,100,-168,27,90,-125,11,88,-114,"); - add("111,33,-107,76,31,-85,88,25,-87,-59,90,-76,"); - add("-21,26,-20,98,-112,81,108,-71,21,69,-16,-24,"); - add("-180,-4,118,-23,-14,31,114,-65,10,158,-67,-16,"); - add("132,-5,-78,125,10,-94,134,-33,-47,47,-66,51,"); - add("-99,-45,120,-80,-55,119,-12,-79,103,182,-57,-48,"); - add("134,-44,-36,78,-102,70,37,-104,100,148,-59,-29,"); - add("89,44,-113,40,79,-121,101,33,-110,79,41,-105,"); - add("65,56,-115,144,-23,-75,92,32,-108,-42,108,-105,"); - add("-159,7,107,-90,-33,108,-132,55,25,-118,90,-29,"); - add("-103,98,-51,-28,90,-95,70,20,-75,80,89,-172,"); - add("92,41,-119,84,19,-87,107,13,-98,85,61,-144,"); - add("62,52,-118,125,7,-107,86,30,-108,72,14,-78,"); - add("154,-9,-111,-4,-62,89,-80,-44,124,-41,-57,111,"); - add("-114,-27,126,-13,-39,63,115,-63,-7,145,-69,-22,"); - add("8,-33,38,-49,-42,94,-32,-19,49,-4,-135,179,"); - add("30,-76,74,-119,-11,106,-110,8,72,26,-75,74,"); - add("162,-54,-53,120,-86,15,134,-31,-63,127,-64,-19,"); - add("133,-52,-41,132,-45,-49,131,-71,-18,131,-76,-11,"); - add("128,-82,-5,130,-75,-16,137,-72,-27,125,-50,-44,"); - add("131,-43,-60,125,-75,-16,123,-73,-18,94,-109,49,"); - add("99,-108,43,72,-113,72,-6,-94,117,-37,-74,120,"); - add("-73,-52,124,-70,-54,122,-89,-43,125,-122,14,87,"); - add("-132,33,71,-112,-8,101,-98,-33,116,-106,-14,99,"); - add("-136,29,75,-115,31,55,-132,22,76,-126,63,27,"); - add("-119,4,84,-114,25,57,-133,114,-27,-108,-4,81,"); - add("-131,31,60,-111,101,-33,-88,5,57,-112,-20,99,"); - add("-128,7,80,-130,7,80,-127,2,81,-101,-39,109,"); - add("-106,-35,104,-82,-52,107,-80,-62,115,-85,-56,112,"); - add("-46,-79,108,-112,-35,103,-136,22,59,-130,13,63,"); - add("-131,-5,82,-136,18,59,-107,-21,81,65,-99,62,"); - add("120,-47,-21,86,-22,-27,-177,-28,128,-37,-77,95,"); - add("-126,-30,99,-132,3,68,-125,14,53,-140,-26,99,"); - add("-120,26,36,-121,-25,86,-74,-77,110,-52,-90,110,"); - add("18,-115,97,63,-74,37,134,27,-91,87,-35,-12,"); - add("-6,-95,91,120,-127,55,1,-112,100,34,-86,60,"); - add("-158,38,45,42,-116,82,178,-55,-41,144,-64,-17,"); - add("24,-119,91,90,-110,49,95,-87,25,-4,-78,69,"); - add("140,2,-75,128,11,-77,27,-34,14,-66,-60,87,"); - add("-90,-34,75,184,-9,-90,135,38,-104,151,-52,-39,"); - add("91,-55,-3,109,-105,27,139,-47,-38,111,10,-72,"); - add("124,27,-95,56,55,-80,-20,119,-91,42,74,-89,"); - add("136,-10,-73,133,-37,-48,139,-57,-36,133,-59,-31,"); - add("117,-98,11,130,-69,-22,125,1,-82,110,25,-93,"); - add("116,15,-90,91,52,-107,48,96,-119,61,81,-114,"); - add("103,26,-94,133,-55,-43,129,-24,-70,42,57,-82,"); - add("118,50,-132,58,-114,63,-48,-95,121,81,-123,53,"); - add("13,-114,92,40,-113,72,91,-122,41,36,-120,78,"); - add("75,-122,50,-4,-99,87,-24,-99,101,12,-122,93,"); - add("-4,-114,97,-9,-114,98,1,-113,91,2,-125,97,"); - add("1,-114,89,20,-125,83,9,-123,88,-6,-117,93,"); - add("-27,-109,100,-52,-94,105,-86,-64,105,-114,-26,95,"); - add("-130,-8,92,-97,-4,66,-89,-7,62,-155,22,83,"); - add("50,-167,88,34,-111,55,"); - add(""); - //add("/*1*/"); - add("2737,1,-14284,23878,-11217,"); - add("-82,-105,-117,-15,25,72,-60,-31,10,-79,-19,62,"); - add("9,110,225,-46,-61,-72,-154,-85,22,40,7,-38,"); - add("54,-36,-148,1,-47,-99,-122,-119,-90,-97,31,190,"); - add("25,-21,-77,-3,-73,-146,-91,-31,55,11,-36,-89,"); - add("-159,-97,12,-70,-4,82,-94,2,131,-118,-56,45,"); - add("-43,51,167,-40,-46,-43,34,-54,-159,-75,-37,27,"); - add("-59,19,122,-93,-16,98,60,99,126,-21,-11,5,"); - add("-93,-116,-113,-75,5,120,-18,-24,-28,-75,-101,-104,"); - add("-108,-75,1,-89,-3,123,55,85,101,-32,-19,6,"); - add("-123,-105,-42,-7,-27,-46,-43,-47,-35,-81,17,159,"); - add("-116,-60,49,-40,-57,-60,-105,-66,22,-127,-79,29,"); - add("-105,-95,-35,-124,-106,-28,-98,-74,1,-88,-112,-92,"); - add("-92,-106,-71,18,-79,-186,29,58,71,40,78,93,"); - add("80,93,65,18,-7,-42,-45,-114,-161,40,41,20,"); - add("30,80,115,96,95,47,95,26,-94,91,7,-122,"); - add("101,19,-114,137,43,-116,-52,-83,-87,-118,-92,-9,"); - add("-117,-93,-10,-108,-96,-29,-143,-117,-12,-135,-130,-48,"); - add("-50,-79,-75,-157,-56,130,47,-16,-100,-29,-66,-80,"); - add("-93,-105,-58,-83,-98,-54,-84,-112,-77,-75,-105,-78,"); - add("-91,-115,-68,-70,-99,-70,-81,-109,-68,-79,-107,-67,"); - add("-72,-119,-97,-41,-94,-95,-65,-112,-90,-101,-106,-26,"); - add("-87,-112,-55,-110,-104,-6,-98,-108,-29,-104,-110,-19,"); - add("-75,-117,-75,-84,-126,-70,-25,-76,-80,-75,-126,-82,"); - add("-115,-95,27,-115,-90,35,-103,-111,-12,-80,-119,-56,"); - add("-97,-117,-25,-103,-98,10,-115,-91,43,-161,-129,59,"); - add("-58,-77,-21,-114,-71,74,-7,56,92,-67,27,148,"); - add("-90,-7,134,1,-10,-18,84,0,-134,22,-52,-112,"); - add("-131,-135,12,72,27,-74,-56,-101,-58,-97,-115,-11,"); - add("-110,-72,74,-100,-74,55,-42,-104,-80,-100,-122,-9,"); - add("-113,-93,54,-106,-102,31,-103,-87,50,-115,-98,55,"); - add("-100,-98,32,-86,-121,-19,-91,-125,-18,-92,-40,104,"); - add("-84,-16,124,-85,-18,123,-114,-81,90,-91,-59,81,"); - add("-80,-14,125,-100,-90,58,-75,-40,83,-109,-75,98,"); - add("-100,-79,80,-101,-100,50,-88,-122,-1,-77,-103,4,"); - add("-104,-135,15,-99,-113,37,-104,-118,43,-74,-117,-13,"); - add("-98,-106,51,-92,-124,16,-93,-102,52,-101,-150,3,"); - add("-74,-80,45,-85,-138,-7,-88,-117,27,-92,-81,86,"); - add("-90,-67,101,-91,-76,95,-94,-102,67,-88,-91,72,"); - add("-88,-94,70,-71,-130,-14,-61,-137,-44,-62,-124,-21,"); - add("22,-4,-54,54,10,-108,83,17,-158,-35,-68,-8,"); - add("-90,-85,87,-88,-108,61,-83,-64,101,-84,-69,103,"); - add("-95,-84,110,-62,13,159,-81,-98,64,-88,-89,95,"); - add("-79,-62,109,-79,-94,70,-115,-182,49,-40,-70,8,"); - add("-56,-132,-30,-56,-147,-45,-58,-85,38,-92,-109,97,"); - add("-89,-97,105,-69,-68,91,-77,-78,102,-78,-94,87,"); - add("-77,-89,95,-74,-86,91,-73,-123,44,-75,-139,31,"); - add("-41,7,123,-3,91,124,38,129,60,75,109,-70,"); - add("75,120,-54,66,92,-61,83,66,-140,48,13,-114,"); - add("74,106,-59,56,136,28,68,124,-18,78,115,-53,"); - add("78,123,-40,83,113,-65,70,128,-8,74,133,-10,"); - add("74,120,-22,75,71,-94,55,56,-62,78,120,-30,"); - add("84,100,-69,88,119,-51,85,86,-87,76,126,-10,"); - add("83,133,-13,79,83,-72,96,128,-46,82,80,-79,"); - add("92,121,-43,91,103,-61,91,88,-82,90,83,-87,"); - add("94,102,-64,81,122,-5,74,130,21,83,131,7,"); - add("86,113,-25,72,131,35,103,170,26,-42,-12,72,"); - add("-90,-65,101,-91,-42,139,-45,4,109,-93,-93,68,"); - add("-88,-49,130,-71,-79,43,-66,-126,-37,-88,-117,29,"); - add("-87,-114,34,-86,-133,7,-87,-114,37,-89,-115,45,"); - add("-78,-97,45,-90,-131,29,-89,-101,72,-91,-113,60,"); - add("-85,-83,93,-88,-111,61,-89,-78,117,-60,-23,123,"); - add("-62,-104,9,-85,-141,17,-80,-87,88,-82,-66,126,"); - add("-85,-125,47,-58,-24,127,-98,-125,90,-43,-84,-3,"); - add("-31,-134,-109,-78,-137,23,-52,0,150,-18,-42,-12,"); - add("-34,-42,39,-63,-65,90,-117,-117,174,-58,-89,46,"); - add("-45,-70,33,-105,-136,122,-37,-55,33,-72,-83,102,"); - add("-71,-86,103,-73,-100,85,-72,-113,67,-73,-107,82,"); - add("-68,-107,68,-78,-110,101,-63,-90,83,-67,-112,64,"); - add("-64,-137,21,-59,-136,6,-69,-126,60,-67,-105,87,"); - add("-57,-153,-18,-21,-129,-108,-53,-103,46,-5,-91,-114,"); - add("-25,-98,-42,-62,-133,40,-65,-120,71,-63,-107,87,"); - add("-66,-113,89,-52,-66,109,-55,-54,138,-55,-69,119,"); - add("-56,-76,116,-58,-103,90,-59,-114,86,-51,-59,131,"); - add("-48,-48,134,-45,-43,137,-43,-37,139,-32,-3,142,"); - add("-47,-65,124,-54,-103,99,-49,-79,115,-50,-83,118,"); - add("-44,-63,129,-41,-47,137,-41,-53,136,-44,-59,143,"); - add("-42,-72,116,-33,-27,146,-32,-30,145,-35,-40,142,"); - add("-45,-93,116,-43,-58,172,-33,-60,113,-35,-67,116,"); - add("-25,-17,150,-27,-27,146,-35,-66,134,-29,-40,149,"); - add("-14,9,148,0,52,139,1,54,142,0,51,145,"); - add("11,80,128,5,56,134,-7,7,104,-26,-55,123,"); - add("-30,-59,172,25,62,-90,-7,-4,85,-32,-82,117,"); - add("-35,-95,120,-33,-91,116,-33,-94,112,-43,-128,158,"); - add("-22,-72,54,-33,-106,101,-32,-104,104,-30,-96,111,"); - add("-27,-92,117,-24,-81,124,-20,-65,134,-12,-33,146,"); - add("-1,3,152,-6,-14,149,-13,-53,140,-16,-63,136,"); - add("-17,-71,124,-4,-20,157,-8,-44,143,-16,-86,237,"); - add("2,3,72,-4,-32,105,5,-2,175,27,99,105,"); - add("3,-12,139,-35,-165,74,-8,-14,-108,-21,-95,14,"); - add("-16,-90,97,-16,-92,106,-13,-92,128,-18,-108,97,"); - add("-21,-122,85,-15,-103,109,-11,-92,117,-12,-98,114,"); - add("-25,-149,52,-21,-128,50,-23,-111,-36,-27,-130,-35,"); - add("-19,-140,74,-1,-63,128,-5,-97,143,22,71,115,"); - add("17,158,-124,7,2,79,-3,-81,127,-16,-132,72,"); - add("-7,-90,90,6,-49,148,2,-72,134,-2,-92,118,"); - add("-17,-140,51,-24,-136,-28,4,-85,148,17,108,-1,"); - add("10,-4,92,-12,-118,54,-7,-129,92,8,23,39,"); - add("24,62,114,18,5,136,11,-45,124,18,-43,173,"); - add("-3,-104,84,-4,-117,78,30,28,174,-1,-120,95,"); - add("-10,-143,56,23,-13,155,31,74,126,32,74,128,"); - add("6,141,-78,-2,111,-104,18,127,0,33,54,142,"); - add("39,100,135,29,124,58,32,80,105,47,60,198,"); - add("4,-59,69,13,-90,141,5,-141,131,23,-19,127,"); - add("16,-116,158,-24,23,-131,-39,-129,-98,-13,-148,42,"); - add("0,-121,77,6,-115,99,11,-107,115,-4,-121,54,"); - add("10,-111,107,-14,-160,19,-15,-129,-3,2,-130,72,"); - add("-31,-136,-76,-5,-116,28,-12,-155,12,-7,-162,32,"); - add("-14,-141,-11,-15,-186,-2,11,-98,78,-2,-105,25,"); - add("-26,-135,-79,-24,-112,-78,-30,-150,-95,-16,-111,-47,"); - add("-23,-93,-86,-30,-35,-138,-33,-39,-151,-22,-114,-85,"); - add("-4,-170,15,-36,-101,-166,6,-160,53,-17,-111,-74,"); - add("-27,-53,-138,-33,-65,-171,-21,-26,-112,-24,-93,-125,"); - add("1,-170,15,-4,-145,-17,-14,-124,-84,-18,-110,-108,"); - add("4,-151,15,-15,-138,-98,-21,-80,-137,8,-155,32,"); - add("2,-150,-16,10,-154,35,-6,-140,-71,7,-91,21,"); - add("24,-76,129,28,-94,141,22,97,153,13,20,77,"); - add("-5,164,11,3,-13,11,10,-156,22,6,-135,2,"); - add("-1,-144,-50,-6,-131,-75,-20,-69,-134,-14,-89,-119,"); - add("-15,-91,-122,-8,-112,-98,-8,-113,-101,-4,-122,-85,"); - add("10,-152,-16,26,-152,82,12,-139,-4,26,-119,99,"); - add("20,-144,37,-9,-86,-115,19,-129,32,29,-83,126,"); - add("30,-70,132,30,-70,131,31,-83,122,30,-119,87,"); - add("30,-120,86,29,-138,56,30,-135,62,32,-123,80,"); - add("35,-102,104,32,-130,70,34,-129,73,31,-145,41,"); - add("33,-133,55,35,-126,67,35,-143,52,34,-138,43,"); - add("34,-136,49,39,-127,69,40,-127,74,39,-131,62,"); - add("35,-144,26,46,-102,113,43,-120,78,39,-154,26,"); - add("42,-114,73,47,-116,90,44,-128,64,45,-127,64,"); - add("46,-124,66,47,-125,70,32,-162,-34,15,-96,-38,"); - add("48,-136,50,50,-120,77,51,-121,72,52,-85,116,"); - add("53,-104,93,55,-111,91,50,-94,90,54,-68,124,"); - add("54,-71,122,54,-71,118,54,-75,114,59,-82,116,"); - add("53,-47,133,55,-66,118,60,-66,129,57,-55,126,"); - add("58,-60,126,62,-96,97,62,-79,113,62,-62,126,"); - add("61,-93,91,56,-133,35,68,-87,114,65,-89,101,"); - add("68,-87,104,68,-103,91,47,-147,-14,53,-143,3,"); - add("53,-141,2,58,-139,15,55,-139,6,49,-143,-17,"); - add("42,-138,-35,50,-147,-23,58,-138,5,61,-139,10,"); - add("44,-134,-32,44,-140,-45,43,-137,-41,49,-141,-37,"); - add("47,-137,-36,36,-137,-72,4,-78,-87,62,-138,-4,"); - add("62,-111,29,43,-131,-51,56,-141,-31,53,-137,-36,"); - add("62,-135,-10,70,-132,13,55,-134,-36,24,-110,-90,"); - add("60,-137,-28,66,-138,-14,54,-127,-37,51,-134,-57,"); - add("52,-134,-60,44,-117,-56,66,-137,-28,34,-115,-84,"); - add("57,-129,-48,59,-132,-46,44,-120,-73,40,-123,-92,"); - add("76,-129,1,84,-125,28,71,-130,-20,57,-123,-54,"); - add("26,-100,-104,50,-118,-71,75,-131,-20,78,-129,-10,"); - add("82,-129,-3,84,-130,0,76,-123,-14,81,-130,-13,"); - add("78,-119,-7,63,-121,-55,51,-118,-89,76,-125,-31,"); - add("81,-125,-19,43,-108,-100,57,-117,-78,74,-121,-44,"); - add("72,-124,-53,64,-118,-69,46,-103,-94,51,-109,-97,"); - add("72,-117,-50,55,-110,-92,78,-122,-50,65,-122,-96,"); - add("42,-82,-70,87,-130,-52,-11,-41,-145,71,-110,-56,"); - add("88,-116,-17,100,-112,30,85,-119,-42,110,-137,-12,"); - add("83,-92,18,105,-118,19,87,-110,-27,73,-111,-74,"); - add("42,-78,-86,70,-110,-90,89,-116,-50,78,-111,-71,"); - add("81,-108,-55,107,-116,5,98,-91,49,47,-47,10,"); - add("69,-38,112,-33,70,110,20,15,109,40,7,146,"); - add("39,-52,-29,21,-74,-152,88,-69,71,102,-105,9,"); - add("-32,12,-66,53,-66,-33,28,-44,-43,94,-112,-47,"); - add("75,-89,-41,70,-106,-108,126,-123,13,50,-68,-58,"); - add("89,-110,-76,128,-91,118,48,-36,35,74,-96,-84,"); - add("22,-62,-139,38,-66,-102,120,-94,70,-19,-6,-83,"); - add("92,-105,-67,61,-77,-71,103,-112,-62,-4,21,62,"); - add("25,-27,-11,74,-103,-134,-90,77,-19,-51,13,-130,"); - add("-21,37,64,-80,80,25,-44,10,-122,44,-71,-113,"); - add("41,-65,-111,30,-57,-118,108,-124,-107,-26,30,28,"); - add("-11,46,149,33,-26,18,109,-71,111,32,2,123,"); - add("146,-121,40,31,-60,-127,123,-103,21,-19,-7,-94,"); - add("48,-45,-14,52,-14,131,-16,48,132,35,-25,24,"); - add("100,-72,57,2,-6,-18,65,-58,-7,-43,11,-101,"); - add("-43,2,-143,-44,18,-81,26,-28,-22,126,-84,98,"); - add("86,-86,-53,59,-67,-71,102,-98,-55,133,-113,-8,"); - add("-71,88,125,73,-62,-12,133,-103,28,-27,12,-39,"); - add("13,-32,-97,94,-71,26,76,-69,-33,-28,-4,-118,"); - add("59,-52,-18,106,-64,89,107,-88,-18,-26,53,148,"); - add("61,-54,-29,50,-69,-132,110,-78,34,122,-91,11,"); - add("92,-73,-12,130,-91,31,-52,53,65,66,-47,7,"); - add("-52,53,66,23,7,102,-112,74,-45,38,-13,69,"); - add("134,-90,44,89,-78,-45,112,-96,-59,-31,26,10,"); - add("-113,88,22,12,-22,-60,2,-18,-69,-59,11,-148,"); - add("42,-39,-34,135,-106,-30,21,12,126,27,-17,10,"); - add("85,-83,-96,93,-63,20,-42,51,94,-94,85,72,"); - add("7,23,125,76,-8,204,2,-26,-102,5,-42,-169,"); - add("9,-32,-114,115,-92,-38,123,-74,55,-78,77,97,"); - add("-23,34,76,-7,36,136,-20,50,149,82,-53,22,"); - add("44,-63,-128,86,-89,-121,-26,22,12,-49,18,-70,"); - add("6,-27,-100,132,-79,61,88,-39,99,69,-15,139,"); - add("-71,73,99,-116,90,37,-104,92,74,-99,90,83,"); - add("5,32,137,1,38,148,-20,47,123,-14,45,125,"); - add("95,-22,171,-112,84,9,-125,85,-23,-110,50,-111,"); - add("-1,15,51,-48,55,71,-148,108,-12,-55,45,13,"); - add("-91,92,75,-78,87,93,-27,69,159,-102,65,-46,"); - add("-35,39,38,6,7,38,119,-74,59,7,39,145,"); - add("-78,89,88,-121,116,62,-72,75,55,-57,83,110,"); - add("-42,75,123,-14,59,137,-12,60,141,-26,71,141,"); - add("-86,88,46,-35,49,54,-61,88,101,-106,102,32,"); - add("-94,46,-87,-71,11,-132,-100,51,-95,-112,74,-64,"); - add("-114,76,-62,-113,99,-4,-86,99,63,-59,91,102,"); - add("-56,92,108,-33,77,122,13,41,135,13,50,154,"); - add("64,-2,138,-71,86,50,-44,95,131,-71,99,77,"); - add("-89,105,50,-103,109,26,-50,96,109,-34,84,116,"); - add("19,58,165,-54,43,-20,-122,78,-88,-13,80,145,"); - add("91,-47,90,102,-80,41,33,37,145,-76,109,74,"); - add("-106,110,11,-67,-7,-152,51,-78,-57,-81,27,-112,"); - add("-102,62,-85,-106,89,-36,-85,112,55,-97,108,19,"); - add("-104,112,10,-72,119,88,32,6,83,99,-47,112,"); - add("96,-45,110,98,-50,100,70,-3,136,57,13,137,"); - add("25,48,139,-10,97,164,-71,84,20,-106,119,17,"); - add("-69,116,77,-22,75,93,-107,151,65,-80,71,-28,"); - add("-100,134,43,73,-19,108,89,-23,125,71,2,135,"); - add("67,8,133,61,18,139,59,21,137,60,21,139,"); - add("54,30,138,56,27,137,46,40,139,49,38,138,"); - add("37,51,136,27,61,134,-22,95,103,-38,107,95,"); - add("-5,91,122,-23,103,109,-22,103,110,-48,112,79,"); - add("-99,139,38,-86,39,-79,-116,84,-65,-94,116,7,"); - add("-35,112,95,-55,108,58,-109,97,-44,-109,73,-75,"); - add("-105,60,-90,-107,62,-89,-101,101,-33,-41,95,58,"); - add("-75,122,35,-89,122,11,-55,126,71,-28,108,90,"); - add("-10,89,92,-87,138,28,20,-14,15,86,-125,-14,"); - add("12,-97,-99,32,-109,-85,58,-122,-60,84,-122,-19,"); - add("107,-98,46,108,-95,52,83,-34,87,77,5,127,"); - add("98,-51,88,106,-66,79,105,-49,97,89,-24,103,"); - add("62,42,144,98,-20,117,104,-36,107,68,23,123,"); - add("43,86,165,42,31,94,18,89,130,-10,106,107,"); - add("-20,110,97,4,95,113,20,86,122,19,88,121,"); - add("-6,105,106,-26,118,91,-35,122,83,-14,135,121,"); - add("-51,89,26,-45,147,90,-17,105,83,32,78,118,"); - add("16,95,113,-14,129,106,-26,123,83,-61,122,38,"); - add("42,-16,37,134,-47,122,53,-93,-21,27,-119,-79,"); - add("-15,-103,-116,-2,-92,-91,6,-109,-100,-23,-73,-99,"); - add("-55,-129,-200,39,25,75,46,69,127,31,84,122,"); - add("22,92,117,14,99,113,2,108,105,-1,111,102,"); - add("-7,115,97,-24,123,84,-19,123,88,-8,117,95,"); - add("5,111,102,13,106,107,27,95,113,43,82,118,"); - add("21,114,119,4,99,85,-34,135,71,-55,131,42,"); - add("-48,132,50,-33,119,55,-80,153,26,-57,132,36,"); - add("-77,147,23,-26,152,83,18,104,96,-83,84,-33,"); - add("22,52,63,66,23,90,55,87,123,-8,77,44,"); - add("53,100,128,67,63,116,61,84,123,32,97,99,"); - add("66,73,118,83,76,136,58,56,97,94,28,114,"); - add("101,10,109,51,99,114,61,66,101,101,33,121,"); - add("-18,61,19,12,97,70,85,9,89,142,-3,135,"); - add("92,-23,75,109,26,118,4,103,64,53,-40,26,"); - add("106,-50,70,106,13,105,135,-4,121,36,89,83,"); - add("-19,132,57,57,96,104,91,54,110,89,56,108,"); - add("8,109,65,-51,142,30,-6,136,66,15,129,79,"); - add("45,101,90,54,101,97,10,143,78,26,122,80,"); - add("19,122,75,61,99,96,11,134,71,-41,143,31,"); - add("-38,144,32,-18,141,47,7,137,65,45,118,87,"); - add("69,99,99,-24,139,36,-31,146,34,-4,140,52,"); - add("-7,144,50,2,141,56,7,139,57,-12,143,43,"); - add("-50,145,12,-40,145,19,-35,154,24,-35,137,19,"); - add("-3,147,46,-21,153,33,-42,129,7,-23,129,22,"); - add("28,139,65,8,208,68,46,83,61,97,-111,45,"); - add("87,20,76,63,112,81,48,122,72,52,121,74,"); - add("41,130,66,39,174,76,18,127,46,55,111,70,"); - add("62,93,70,67,111,76,94,80,89,88,82,83,"); - add("59,118,70,70,109,75,44,143,63,93,85,84,"); - add("68,113,72,59,123,66,38,135,53,31,139,47,"); - add("24,142,43,19,142,38,-15,166,17,8,111,24,"); - add("-25,186,11,-31,118,-3,-35,149,-4,-55,165,-16,"); - add("-29,123,-4,-40,145,-9,-46,144,-16,-72,130,-36,"); - add("-113,64,-74,-124,19,-87,-121,-17,-90,-123,1,-91,"); - add("-112,45,-78,-117,47,-84,-94,97,-60,-111,64,-79,"); - add("-94,98,-62,-98,95,-68,-86,113,-57,-90,120,-61,"); - add("-99,69,-73,-99,88,-72,-100,83,-74,-103,76,-80,"); - add("-113,73,-87,-98,73,-77,-108,42,-88,-118,12,-99,"); - add("-115,-23,-100,-115,-17,-100,-105,-27,-95,-117,27,-101,"); - add("-118,59,-101,-105,-19,-97,-110,42,-96,-97,69,-86,"); - add("-102,62,-90,-110,46,-100,-99,-47,-97,-101,-35,-98,"); - add("-144,-109,-146,30,126,37,-70,5,-68,-40,-97,-44,"); - add("-29,-148,-39,-81,-122,-89,-4,36,-2,10,141,21,"); - add("23,149,32,47,139,54,-84,-1,-82,4,58,8,"); - add("38,136,43,-76,114,-69,-80,101,-76,-117,-33,-119,"); - add("-63,103,-60,-92,70,-92,-80,35,-80,-91,62,-93,"); - add("-80,22,-83,-107,62,-112,-91,64,-95,-96,57,-102,"); - add("-92,3,-100,-109,-4,-119,-103,-28,-114,-58,-151,-69,"); - add("-40,-110,-48,-31,-140,-40,-71,-3,-80,-78,-95,-94,"); - add("-74,-89,-88,-61,-107,-77,-35,-140,-49,-49,-142,-67,"); - add("-8,45,-6,27,146,41,-11,182,-3,-108,-34,-129,"); - add("-85,58,-97,-100,-67,-124,-82,76,-95,-35,121,-38,"); - add("-39,139,-42,-18,138,-18,-35,60,-41,-75,-100,-96,"); - add("-72,-75,-92,-89,-73,-116,-81,-77,-106,-90,-15,-115,"); - add("-108,19,-141,15,41,22,86,61,114,90,27,116,"); - add("54,124,74,29,135,40,46,136,61,54,108,70,"); - add("44,138,56,79,87,98,81,81,99,66,113,79,"); - add("54,127,64,66,111,77,74,98,87,38,125,41,"); - add("-10,148,-18,-71,91,-89,-95,37,-116,-79,135,-104,"); - add("-8,130,-18,-29,131,-44,-26,148,-43,-27,146,-45,"); - add("-8,150,-25,-12,170,-31,-13,127,-30,-76,142,-112,"); - add("-17,-116,-7,-29,21,-40,-33,100,-52,-62,104,-92,"); - add("-42,110,-68,-74,78,-106,-59,106,-93,-64,99,-98,"); - add("-62,101,-98,-85,40,-118,-83,41,-120,-78,70,-117,"); - add("-92,-113,-107,13,75,6,-27,103,-55,-85,32,-124,"); - add("-84,27,-123,-92,9,-133,5,-52,17,-12,-14,-15,"); - add("-72,37,-110,-84,23,-126,-93,-75,-123,-62,2,-93,"); - add("-78,42,-123,-79,22,-125,-86,9,-132,-73,-172,-81,"); - add("5,71,-6,11,147,-11,-52,116,-104,-49,62,-89,"); - add("-48,105,-98,-54,96,-109,-76,39,-129,-88,-164,-108,"); - add("4,91,-13,40,143,32,24,150,3,-30,139,-84,"); - add("-38,97,-87,-44,104,-101,-49,91,-107,-75,77,-148,"); - add("-49,45,-97,-46,96,-108,-70,41,-135,-72,-32,-118,"); - add("-78,7,-140,-62,-56,-95,-93,37,-181,48,34,77,"); - add("55,90,71,51,161,41,60,100,74,-5,115,-47,"); - add("-58,47,-122,-61,111,-152,-68,-37,-112,-75,67,-165,"); - add("-43,-6,-79,-24,130,-97,-84,-17,-155,39,43,60,"); - add("-32,126,-112,46,78,58,69,-5,135,113,64,189,"); - add("-45,17,-93,-69,17,-138,-69,-5,-131,-72,-8,-139,"); - add("-69,-22,-127,-73,-3,-146,-96,-25,-187,55,-46,133,"); - add("-45,-34,-77,-78,-48,-142,-59,-65,-96,-58,-56,-98,"); - add("-75,-29,-148,-55,34,-134,-65,54,-168,-32,40,-88,"); - add("-19,117,-96,-47,41,-126,-62,-2,-141,-61,-9,-138,"); - add("-62,-27,-135,-61,-16,-139,-63,-22,-142,-52,18,-139,"); - add("-9,126,-86,14,107,-19,-7,131,-88,-34,82,-132,"); - add("-45,40,-138,-47,25,-139,-55,1,-146,-5,123,-88,"); - add("16,145,-43,-25,62,-110,-54,-104,-83,-14,-134,43,"); - add("52,-49,173,-47,-52,-98,-47,-65,-90,-57,-52,-131,"); - add("-57,-30,-142,-56,-64,-123,-64,-68,-148,-41,-115,-55,"); - add("-17,-148,36,2,-128,81,6,-128,89,-7,-136,51,"); - add("-30,-157,-7,-49,-116,-86,-54,-49,-133,-19,85,-101,"); - add("-1,110,-64,-7,78,-63,12,153,-47,46,132,68,"); - add("50,119,81,43,124,58,16,167,-52,6,94,-42,"); - add("-2,123,-85,31,130,12,57,46,143,54,68,114,"); - add("55,123,81,5,134,-75,-47,48,-173,-55,-74,-113,"); - add("-45,-45,-111,-50,-139,-57,-54,-73,-119,-53,-57,-131,"); - add("-53,-86,-113,-53,-88,-111,-47,-29,-139,-41,9,-146,"); - add("-38,13,-143,-42,-130,-52,-56,-133,-106,16,67,9,"); - add("3,32,-10,-31,46,-148,-42,-55,-114,-50,-104,-112,"); - add("-52,-113,-113,-41,-143,-52,-19,-114,8,-35,-159,-27,"); - add("-32,-151,-22,-37,-31,-124,-40,-96,-98,-40,-127,-78,"); - add("-43,-93,-113,-49,-103,-139,-12,-141,39,-22,-159,8,"); - add("-9,38,-65,-2,110,-77,-9,111,-113,-9,99,-111,"); - add("-10,92,-110,-5,113,-106,-13,81,-127,-20,55,-141,"); - add("-23,35,-141,-27,26,-157,-18,35,-127,-27,18,-160,"); - add("-38,-89,-123,-29,-61,-106,-36,-68,-143,-31,-46,-140,"); - add("-33,-79,-124,-30,-56,-136,-25,-11,-150,-11,129,-209,"); - add("-18,-47,-75,-10,63,-142,9,100,-57,9,124,-89,"); - add("-3,84,-129,4,98,-107,6,103,-98,9,118,-105,"); - add("13,124,-83,18,133,-63,13,113,-80,23,146,-59,"); - add("32,130,58,29,134,2,28,135,-4,30,125,26,"); - add("40,177,11,-14,-74,22,3,-8,43,37,164,-3,"); - add("32,145,-17,33,147,-10,38,143,23,39,142,37,"); - add("40,122,78,37,136,18,31,148,-65,21,67,28,"); - add("27,99,5,10,99,-155,-12,15,-146,12,76,-78,"); - add("24,96,-28,9,95,-179,-9,-1,-93,5,66,-146,"); - add("-17,-17,-142,-16,-12,-151,0,38,-139,-11,-10,-126,"); - add("-32,-73,-156,-11,-9,-146,-12,-11,-150,-3,19,-151,"); - add("-2,20,-165,0,19,-147,-25,-71,-125,2,20,-131,"); - add("3,24,-133,15,62,-139,42,140,100,43,133,129,"); - add("22,72,40,43,138,34,42,140,-20,48,151,22,"); - add("43,136,8,46,136,47,44,137,-24,14,50,-76,"); - add("55,155,85,-22,-70,55,-42,-135,73,9,23,49,"); - add("49,140,37,50,141,46,56,160,19,50,140,9,"); - add("50,140,17,30,77,27,51,137,29,47,116,83,"); - add("43,100,105,50,121,77,51,128,19,46,126,-58,"); - add("6,36,-160,-18,-34,-104,4,27,-143,6,31,-179,"); - add("-9,-13,-122,-18,-37,-144,-21,-45,-141,-12,-24,-148,"); - add("-8,-18,-150,-12,-28,-147,-22,-58,-137,-43,-113,-113,"); - add("-43,-114,-41,-53,-142,-13,-54,-145,-2,-43,-119,-51,"); - add("-43,-124,-61,-48,-137,-39,-32,-98,-113,-33,-105,-164,"); - add("-36,-102,24,-32,-103,-95,4,-2,-173,25,67,-69,"); - add("17,31,-155,-13,-58,-173,-7,-37,-107,-6,-41,-144,"); - add("10,-12,-243,-9,-41,-66,0,-27,-131,-2,-39,-146,"); - add("19,28,-134,47,118,-94,34,68,-128,30,53,-132,"); - add("19,9,-162,25,42,-104,57,139,-86,47,106,-93,"); - add("51,128,-54,55,140,-41,52,117,-82,51,108,-91,"); - add("51,106,-95,54,119,-73,57,128,-55,58,131,-52,"); - add("54,117,-60,84,188,-60,-24,-44,43,-84,-179,93,"); - add("32,84,12,55,105,-97,59,126,-61,61,138,-22,"); - add("56,132,-7,48,130,53,66,154,3,74,176,20,"); - add("41,94,3,62,147,27,59,138,27,57,135,40,"); - add("57,134,44,52,127,63,48,122,78,57,131,52,"); - add("62,122,-17,71,128,-61,61,115,-30,76,142,-28,"); - add("57,119,33,60,92,-89,-4,9,63,26,73,95,"); - add("70,131,-8,14,37,42,38,92,91,22,60,88,"); - add("38,100,131,50,107,79,-22,-10,147,-7,13,127,"); - add("16,45,85,19,57,138,46,104,119,52,110,114,"); - add("67,114,-21,31,64,62,-45,-65,87,-29,-52,-1,"); - add("-7,-11,9,23,59,139,15,46,156,47,90,50,"); - add("-19,-29,49,-19,-14,167,-15,-11,148,-36,-51,137,"); - add("-26,-34,144,18,42,151,29,58,109,-35,-56,127,"); - add("-35,-54,123,-47,-82,59,-37,-64,38,-21,-34,138,"); - add("27,52,132,-19,-33,138,59,107,66,-4,-8,122,"); - add("-36,-65,121,-50,-92,117,29,48,103,48,89,-112,"); - add("37,67,-134,50,88,26,57,98,77,19,35,-58,"); - add("15,27,-100,7,12,-104,5,9,-168,62,107,47,"); - add("-17,-29,140,-24,-42,142,36,59,133,25,39,160,"); - add("-5,-14,129,3,-1,151,55,86,135,-59,-104,74,"); - add("-22,-40,38,36,51,147,31,44,116,9,8,77,"); - add("-4,-21,146,15,8,176,-28,-60,109,-19,-57,201,"); - add("-40,-78,59,-56,-108,86,9,-11,173,31,35,121,"); - add("51,67,131,43,55,117,-12,-48,149,-39,-90,112,"); - add("-49,-103,94,-46,-103,105,-29,-79,124,-42,-96,96,"); - add("-58,-113,33,-83,-148,-12,-71,-123,-31,-71,-133,-2,"); - add("14,12,58,12,1,91,-86,-149,-59,-47,-98,37,"); - add("-59,-132,72,-14,-61,125,-49,-123,104,-39,-86,28,"); - add("-61,-140,60,-42,-107,77,-15,-74,144,-44,-116,79,"); - add("-50,-129,75,-10,-53,94,38,26,158,44,67,73,"); - add("69,133,26,64,111,58,72,142,7,72,141,8,"); - add("66,132,-4,58,125,-42,43,109,-75,66,145,-60,"); - add("56,125,-64,53,121,-71,56,124,-68,66,135,-51,"); - add("7,0,40,-46,-102,64,-66,-128,24,-26,-56,23,"); - add("98,190,-32,58,122,-57,51,118,-89,52,114,-78,"); - add("59,122,-68,62,125,-62,65,124,-47,69,129,-43,"); - add("68,125,-44,92,158,-25,60,92,29,77,119,30,"); - add("76,112,42,73,99,67,83,110,86,72,114,-11,"); - add("4,-5,45,24,21,68,50,49,105,78,83,137,"); - add("58,59,108,70,79,99,81,101,73,81,102,63,"); - add("81,95,85,70,68,124,37,11,140,63,60,99,"); - add("81,100,56,91,97,107,61,68,56,48,25,134,"); - add("95,69,193,4,59,-161,23,9,69,72,89,35,"); - add("26,85,-155,10,9,15,30,-9,154,18,-25,150,"); - add("84,79,104,87,109,25,-33,-15,-88,14,31,-36,"); - add("5,41,-103,1,40,-121,5,23,-51,63,28,174,"); - add("40,11,129,42,54,3,60,94,-46,8,-2,39,"); - add("-75,-117,58,-81,-138,88,20,29,-8,66,113,-76,"); - add("75,118,-55,74,121,-75,-19,24,-155,29,76,-125,"); - add("18,79,-187,13,-4,70,-9,-71,196,65,112,-92,"); - add("13,-9,81,59,64,36,32,76,-114,75,146,-180,"); - add("-24,-52,77,-36,-88,143,67,69,48,43,90,-123,"); - add("14,63,-154,21,64,-133,118,139,20,-74,-92,5,"); - add("-31,-74,127,-15,-71,175,81,117,-57,56,69,1,"); - add("106,135,-25,68,85,-11,73,76,39,94,73,131,"); - add("-38,-49,13,-104,-106,-57,-91,-108,-7,-47,-74,60,"); - add("-60,-68,-20,-42,-81,99,-28,-56,70,-62,-95,57,"); - add("-86,-105,-8,-131,-160,-16,64,62,63,78,79,59,"); - add("100,112,37,100,108,51,97,105,43,72,99,-36,"); - add("74,120,-100,77,113,-67,76,113,-78,90,93,38,"); - add("55,46,61,-148,-151,-74,-47,-93,123,-30,-85,157,"); - add("99,85,98,85,80,61,153,155,70,40,40,20,"); - add("97,112,-3,58,86,-66,73,91,-27,159,166,33,"); - add("-81,-96,19,19,6,50,90,69,92,83,50,125,"); - add("70,38,117,60,12,154,52,11,133,60,12,147,"); - add("131,119,60,17,-21,107,62,13,146,43,-7,138,"); - add("91,70,72,40,42,-1,-92,-53,-116,55,100,-113,"); - add("57,110,-139,115,106,35,65,82,-46,115,115,8,"); - add("121,104,49,104,88,41,110,78,84,48,34,38,"); - add("28,8,55,75,30,116,92,65,64,121,108,21,"); - add("-3,-30,74,62,26,88,54,3,128,80,39,94,"); - add("85,37,110,109,74,71,80,94,-52,28,9,44,"); - add("40,-16,131,126,64,129,30,-8,88,93,38,113,"); - add("105,56,94,107,52,103,121,107,-2,-8,-35,69,"); - add("-4,-29,60,-178,-122,-86,32,-15,103,66,1,136,"); - add("72,-9,167,-38,-22,-26,-130,-69,-107,-7,37,-101,"); - add("-67,-14,-107,-103,-53,-97,-159,-94,-120,-65,-45,-35,"); - add("-104,-60,-89,-103,-95,-3,-96,-103,31,-41,-79,93,"); - add("-20,-77,136,82,32,106,95,49,95,108,74,63,"); - add("123,90,55,82,63,30,99,72,40,23,-25,104,"); - add("83,40,80,102,39,117,93,25,125,92,42,89,"); - add("112,46,113,93,39,89,123,44,134,22,57,-80,"); - add("36,85,-115,-20,43,-130,-30,11,-80,-105,-46,-100,"); - add("-28,22,-100,-64,26,-185,-34,27,-132,22,71,-121,"); - add("5,51,-111,-17,47,-147,80,110,-104,68,88,-76,"); - add("40,80,-117,134,108,12,123,104,-5,2,40,-99,"); - add("-108,-42,-127,5,41,-96,1,50,-135,-47,24,-171,"); - add("32,19,19,79,21,123,42,-12,125,33,-26,144,"); - add("110,50,102,112,65,68,120,67,74,82,95,-79,"); - add("61,82,-89,-11,45,-144,-43,18,-144,-67,-4,-134,"); - add("-74,-13,-131,-89,-30,-116,-99,-42,-108,-94,-38,-113,"); - add("-98,-44,-106,-98,-45,-106,-106,-58,-90,-103,-55,-93,"); - add("-115,-73,-74,-112,-73,-67,-116,-83,-49,-113,-78,-60,"); - add("-114,-82,-55,-109,-72,-76,-115,-56,-147,53,45,6,"); - add("104,65,88,121,91,47,108,69,75,117,83,57,"); - add("113,98,-9,16,57,-140,-26,43,-219,24,-2,74,"); - add("16,-31,148,12,-36,152,108,62,91,118,86,38,"); - add("114,76,55,131,77,94,84,41,79,92,39,110,"); - add("86,27,124,120,92,10,113,81,18,139,79,87,"); - add("77,33,78,70,13,120,81,13,143,58,-5,138,"); - add("69,4,136,63,-2,137,60,-6,137,64,-1,130,"); - add("75,7,127,56,-9,131,52,-32,181,44,-3,90,"); - add("99,20,130,74,5,119,76,7,118,108,46,75,"); - add("134,72,56,129,65,61,115,75,12,132,71,48,"); - add("99,24,105,124,40,102,81,4,118,91,21,92,"); - add("132,64,53,120,49,69,144,82,24,74,85,-86,"); - add("-14,53,-143,67,20,52,87,76,-48,80,68,-44,"); - add("97,75,-36,35,76,-132,-21,48,-149,-156,-38,-144,"); - add("95,70,-28,64,77,-97,-12,40,-122,-80,5,-142,"); - add("-12,-31,64,-30,-11,-21,-110,-27,-105,-127,-59,-55,"); - add("-107,-47,-55,-128,-45,-96,-125,-59,-58,19,24,-33,"); - add("54,97,-171,53,-13,131,118,50,66,101,22,112,"); - add("171,62,118,-98,-11,-134,70,22,59,106,27,102,"); - add("107,39,73,154,49,114,21,60,-124,-52,22,-141,"); - add("-43,27,-143,33,72,-146,-152,-58,-96,79,48,0,"); - add("14,40,-88,-94,-11,-134,100,83,-66,71,76,-100,"); - add("-11,39,-135,24,62,-148,29,65,-150,72,74,-101,"); - add("53,75,-145,-13,-19,41,59,2,103,160,82,31,"); - add("37,63,-137,26,63,-161,85,41,23,94,82,-98,"); - add("21,40,-98,-49,12,-135,53,25,16,92,54,-15,"); - add("-52,10,-138,17,20,-37,156,74,39,59,61,-107,"); - add("-28,16,-117,60,38,-23,63,57,-88,69,57,-77,"); - add("102,83,-118,8,24,-79,20,20,-37,74,49,-46,"); - add("-111,-42,-64,-130,-69,5,-146,-88,43,-99,-48,-22,"); - add("-96,-58,25,-49,-28,7,-95,-41,-49,-150,-98,59,"); - add("34,27,-29,17,41,-129,-147,-71,-48,-110,-42,-86,"); - add("-152,-73,-58,50,47,-75,79,60,-67,-57,-21,-49,"); - add("-132,-76,3,-160,-61,-146,61,26,47,109,43,88,"); - add("143,85,-13,94,70,-73,37,50,-133,-63,-7,-132,"); - add("-117,-40,-128,87,51,-3,81,32,66,111,70,-42,"); - add("100,74,-88,118,74,-45,15,33,-126,-36,14,-172,"); - add("9,0,27,45,-2,137,84,29,79,128,82,-65,"); - add("129,69,-4,125,66,-7,-63,-16,-85,20,36,-138,"); - add("-29,12,-144,-2,26,-156,89,63,-95,66,48,-86,"); - add("60,51,-121,40,35,-94,67,52,-111,57,50,-139,"); - add("-47,-6,-120,-118,-44,-117,1,20,-137,-44,-5,-136,"); - add("38,40,-163,14,25,-149,-28,2,-138,-115,-48,-100,"); - add("-134,-70,10,-122,-72,69,-90,-59,99,-141,-75,4,"); - add("-126,-64,-36,-75,-48,63,-110,-70,73,-136,-81,52,"); - add("-81,-55,72,-147,-81,-18,-117,-61,-47,-106,-58,-32,"); - add("-127,-65,-71,-116,-66,-23,-72,-51,68,-61,-54,134,"); - add("-54,-51,138,-72,-60,117,-96,-71,91,-106,-77,75,"); - add("-114,-80,62,-121,-83,40,-123,-83,30,-125,-83,17,"); - add("-126,-79,-24,-132,-77,-69,-106,-62,-54,-111,-61,-90,"); - add("-99,-53,-99,-91,-47,-109,-81,-39,-122,-100,-48,-164,"); - add("-81,-59,24,-107,-89,97,-75,-63,74,-113,-87,43,"); - add("-105,-79,29,-130,-103,48,-103,-85,61,-109,-89,55,"); - add("-102,-90,84,-111,-81,-25,-113,-76,-66,-171,-140,51,"); - add("34,42,-103,-4,11,-101,-114,-81,-55,-149,-133,97,"); - add("41,43,-63,60,64,-122,0,21,-147,-105,-68,-124,"); - add("22,18,1,111,76,92,111,92,-45,79,75,-102,"); - add("54,56,-120,40,49,-163,60,45,13,107,92,-91,"); - add("85,75,-103,103,81,-53,114,83,17,117,88,-23,"); - add("118,88,-25,97,77,-75,128,91,-1,128,88,17,"); - add("117,86,-53,10,22,-157,2,16,-180,1,7,-79,"); - add("-1,10,-152,-23,-6,-149,-67,-37,-156,60,41,10,"); - add("92,69,-93,64,49,-125,36,31,-144,43,35,-143,"); - add("34,29,-159,75,53,-86,104,71,-92,74,51,-124,"); - add("85,58,-119,40,28,-137,36,24,-147,65,42,-134,"); - add("50,31,-135,-11,-8,-147,-44,-31,-140,-40,-31,-200,"); - add("110,72,10,124,78,-12,123,77,-49,127,78,-27,"); - add("121,74,-43,146,88,-45,51,26,-131,-32,-25,-132,"); - add("-139,-87,-39,9,5,-11,128,80,28,67,38,-60,"); - add("112,63,-78,124,75,31,127,75,-3,138,80,10,"); - add("121,72,33,140,80,26,111,66,70,123,71,80,"); - add("121,68,47,114,65,51,111,62,99,85,47,51,"); - add("101,56,71,11,7,65,95,51,27,48,27,106,"); - add("63,33,-10,60,31,34,-13,-4,161,65,34,141,"); - add("106,55,41,105,52,-52,72,35,-130,37,15,-168,"); - add("83,39,-90,46,19,-161,79,36,-75,3,3,49,"); - add("-79,-35,130,-59,-26,161,-35,-15,131,-59,-27,128,"); - add("18,9,136,118,59,92,101,49,32,-31,-15,113,"); - add("-16,-9,126,50,23,132,103,48,78,127,60,65,"); - add("110,50,64,141,65,60,77,38,-96,-2,1,-144,"); - add("15,9,-154,78,37,-114,106,48,-94,68,30,-131,"); - add("19,8,-167,23,11,24,-25,-11,189,7,3,112,"); - add("-100,-45,171,-61,-29,68,-89,-42,116,12,2,157,"); - add("103,45,94,121,53,77,128,54,77,159,73,-115,"); - add("60,22,148,-61,-30,111,-42,-24,145,-3,-7,123,"); - add("39,15,46,131,61,-85,138,64,-138,-35,-19,110,"); - add("-59,-28,68,-116,-54,85,46,14,109,93,34,114,"); - add("115,45,65,101,37,94,152,62,24,119,52,-55,"); - add("96,45,-107,135,57,-57,109,48,-81,56,19,54,"); - add("66,19,122,134,54,-47,120,45,14,79,37,-138,"); - add("77,36,-149,41,13,45,50,19,-23,-6,5,-150,"); - add("45,22,-146,-22,-2,-170,-101,-37,-34,-127,-47,19,"); - add("-127,-52,103,-127,-48,-19,-89,-31,-100,-148,-58,-11,"); - add("-144,-57,-30,-122,-47,-64,-175,-71,-30,-117,-46,-126,"); - add("87,38,-89,112,48,-94,131,54,-56,153,61,26,"); - add("91,35,63,141,56,-31,116,46,-79,111,43,-130,"); - add("-81,-30,-107,-154,-60,-23,-162,-63,-72,76,30,-75,"); - add("143,55,4,196,75,-91,86,33,78,71,26,-98,"); - add("11,3,-102,54,18,-147,88,33,26,157,58,68,"); - add("116,41,-5,120,42,-55,125,42,-76,158,55,8,"); - add("128,42,-55,132,41,-112,70,22,-75,23,5,-78,"); - add("-125,-45,-117,-114,-39,-27,-76,-30,-127,-123,-43,-32,"); - add("-160,-53,55,-110,-42,-70,-136,-49,-22,-142,-49,71,"); - add("-89,-29,108,-55,-16,124,-71,-22,150,-83,-30,38,"); - add("-1,-1,-34,33,11,-33,-107,-42,-58,-131,-52,-69,"); - add("13,8,119,-132,-49,48,-96,-40,-84,-108,-46,-91,"); - add("-57,-27,-143,-83,-37,-88,-125,-51,2,-141,-57,24,"); - add("-144,-61,-14,-41,-22,-92,-95,-41,-26,114,46,-52,"); - add("38,22,135,113,45,-60,128,49,-80,118,50,32,"); - add("181,75,49,-20,-12,-96,69,26,-27,132,44,-152,"); - add("-31,-18,-122,-48,-23,-73,-149,-58,36,-19,0,130,"); - add("-129,-50,41,33,6,-131,146,54,-83,-67,-29,-38,"); - add("-30,-20,-127,59,15,-137,23,-3,-164,-13,-16,-141,"); - add("43,5,-140,94,26,-126,115,37,-94,38,-1,-166,"); - add("125,41,-72,115,37,-70,142,54,6,102,28,-92,"); - add("-15,-22,-149,-12,-22,-150,-12,-22,-146,-138,-61,-71,"); - add("-43,0,128,6,19,144,20,29,187,-75,-34,-47,"); - add("-42,-28,-104,-9,-26,-190,-108,-52,-82,-154,-60,4,"); - add("-152,-59,7,-108,-50,-50,-174,-79,-54,68,23,-40,"); - add("184,68,-58,50,31,85,182,65,-57,38,5,-74,"); - add("139,47,-49,119,35,-77,39,0,-111,-4,-24,-154,"); - add("32,-10,-145,36,-10,-149,68,5,-132,84,9,-131,"); - add("127,25,-132,114,57,88,-14,17,135,47,32,91,"); - add("142,47,-23,132,37,-62,108,14,-139,21,-11,-110,"); - add("87,11,-105,116,20,-113,132,32,-67,113,19,-100,"); - add("112,18,-99,140,36,-44,131,29,-67,98,8,-115,"); - add("38,-12,-122,-82,-53,-131,62,-7,-132,142,57,68,"); - add("135,54,59,40,1,-51,-82,-50,-118,-89,-53,-125,"); - add("79,1,-103,147,43,-6,135,49,40,141,48,36,"); - add("170,45,-16,-69,-36,-77,-55,-47,-138,-9,-37,-150,"); - add("72,-6,-117,20,-29,-143,-66,-60,-170,86,24,-3,"); - add("53,-18,-131,2,-32,-129,-63,-49,-118,24,-19,-101,"); - add("70,46,101,12,39,137,16,42,151,-49,20,136,"); - add("-25,24,126,33,63,227,99,7,-88,13,-32,-147,"); - add("44,-32,-180,30,-15,-95,-5,-39,-151,40,-27,-142,"); - add("-4,-41,-153,-110,-55,-92,45,5,-27,85,-6,-106,"); - add("108,11,-66,125,10,-82,138,21,-55,174,38,-24,"); - add("120,27,-11,156,35,-11,117,9,-67,135,8,-83,"); - add("135,22,-30,145,30,-9,152,26,-26,105,-5,-96,"); - add("100,-12,-111,136,17,-37,146,17,-43,124,1,-78,"); - add("151,20,-27,140,19,-26,147,16,-33,124,-6,-91,"); - add("115,-6,-86,160,20,-20,122,46,82,136,16,-18,"); - add("124,-13,-100,161,35,35,87,-29,-131,55,33,77,"); - add("139,42,76,73,-25,-112,42,-38,-138,104,-20,-104,"); - add("133,-3,-61,49,-34,-123,-41,-40,-104,66,16,23,"); - add("106,-15,-82,140,-26,-125,66,-15,-64,37,-42,-134,"); - add("27,-46,-138,-11,-53,-145,41,-44,-135,89,-34,-116,"); - add("135,-12,-71,148,-3,-46,47,-29,-88,20,-60,-161,"); - add("-50,-23,-49,-136,-35,-57,-140,-33,-47,-120,-35,-57,"); - add("-138,-47,-79,-81,-56,-117,-109,-36,-56,-160,-3,41,"); - add("-158,-18,6,-68,-67,-143,-117,-6,24,-158,-13,25,"); - add("67,-29,-95,140,17,-7,205,63,88,-60,-34,-63,"); - add("-179,-70,-111,42,-48,-129,145,-3,-55,141,6,-29,"); - add("156,23,8,29,73,166,142,5,-28,107,-28,-95,"); - add("87,-40,-119,70,-21,-65,127,-24,-87,96,-37,-107,"); - add("105,-32,-96,-20,-34,-73,-192,-36,-37,-147,-15,0,"); - add("62,-27,-73,-50,-46,-90,-64,-47,-89,-113,-45,-70,"); - add("-151,-17,3,-124,0,32,-127,18,75,-194,-8,39,"); - add("-100,-17,-8,-68,13,51,-91,47,133,-117,28,102,"); - add("-108,-23,-15,39,-62,-152,-86,-54,-89,-79,-64,-112,"); - add("-34,-63,-124,72,-46,-124,159,-3,-57,77,-31,-90,"); - add("67,-50,-124,141,-12,-69,124,38,43,80,-39,-102,"); - add("26,-74,-158,-43,-63,-113,109,-12,-55,55,-60,-133,"); - add("8,-75,-147,46,-53,-112,-48,-53,-89,-123,-74,-110,"); - add("-57,27,66,-61,60,130,-4,-8,-14,37,-64,-132,"); - add("-77,-54,-81,-137,-36,-30,-162,9,65,-61,-42,-61,"); - add("114,-19,-69,160,46,41,86,-61,-135,-67,-54,-82,"); - add("-129,-49,-55,-129,-67,-84,-119,-42,-42,-138,10,60,"); - add("-116,33,95,-4,65,119,-34,91,179,6,-43,-82,"); - add("-48,-58,-91,-90,-77,-112,-97,-71,-96,-11,-72,-125,"); - add("-53,-59,-87,-43,-35,-47,-17,-85,-143,-102,-12,14,"); - add("-72,49,109,-131,44,123,-147,-31,-2,-112,-4,34,"); - add("-197,-92,-87,4,87,151,-95,49,126,19,-17,-38,"); - add("-77,-73,-99,-120,5,56,-104,35,105,-63,53,124,"); - add("-10,-6,-7,-5,-72,-129,51,-64,-135,-57,-80,-116,"); - add("13,-75,-135,-69,-96,-137,-6,-24,-38,106,-35,-103,"); - add("67,-57,-122,33,-94,-169,82,-34,-87,89,-37,-93,"); - add("96,-49,-115,63,-62,-121,-41,-96,-137,86,-23,-66,"); - add("130,44,24,125,-16,-67,99,-44,-102,83,-75,-141,"); - add("42,-58,-101,91,-40,-88,36,-71,-117,-44,19,42,"); - add("-137,27,82,-127,-2,37,-57,52,97,-37,84,141,"); - add("-93,-22,-3,-141,5,56,-90,27,74,-97,52,116,"); - add("-101,-20,6,-32,19,41,-73,40,90,-127,49,126,"); - add("-43,45,90,26,63,92,-86,40,98,-96,48,119,"); - add("-95,41,107,-79,44,109,-10,69,120,-50,62,128,"); - add("-69,42,103,-74,48,118,-71,56,132,-91,31,97,"); - add("-19,54,106,-31,67,136,-69,61,148,75,55,64,"); - add("165,34,-18,13,77,137,-48,65,147,-67,31,93,"); - add("-58,46,119,90,73,96,-41,10,41,-47,57,138,"); - add("-36,64,148,-17,59,129,-75,42,126,-82,38,126,"); - add("-160,31,156,12,-41,-93,-177,-73,-50,89,-3,-57,"); - add("138,10,-58,88,-34,-121,46,-49,-124,-61,-78,-125,"); - add("1,-67,-133,-8,-72,-138,-147,-34,14,-19,-46,-80,"); - add("77,-45,-127,-100,-39,-21,-108,17,91,-81,72,186,"); - add("-63,18,70,-43,51,126,-61,51,138,-149,-7,76,"); - add("-28,56,131,21,67,125,69,16,-9,34,13,6,"); - add("47,46,67,24,56,103,-37,49,128,-27,-27,-40,"); - add("-92,-20,15,-102,4,73,-89,33,130,-12,-27,-52,"); - add("-111,-57,-49,-142,-41,8,-133,-53,-22,-87,46,159,"); - add("-48,-46,-65,-135,-53,-18,-131,-41,5,-130,1,98,"); - add("-109,11,107,-130,-9,78,-177,-14,109,-103,-45,-18,"); - add("-140,-29,51,-106,6,100,-39,52,151,-118,-16,62,"); - add("9,-26,-65,11,-46,-113,-103,-54,-34,-114,-32,27,"); - add("-154,-41,44,-142,-49,18,-163,-73,-16,-109,-48,-5,"); - add("-176,-51,49,-66,10,85,-13,38,99,130,56,2,"); - add("129,43,-24,29,28,35,-139,-21,84,-80,-15,43,"); - add("-154,-101,-82,-135,-44,34,-15,25,71,115,79,68,"); - add("160,107,91,75,63,75,-35,-16,-4,-117,-76,-63,"); - add("-115,-66,-40,-141,-81,-45,-143,-15,110,-116,-71,-46,"); - add("-136,-59,6,-127,-79,-49,-82,-67,-64,-65,-50,-45,"); - add("-143,-56,26,-148,-70,1,-106,-61,-19,-197,-86,23,"); - add("-38,-63,-98,-99,-108,-127,-11,37,93,-37,63,181,"); - add("-104,-51,5,-113,-78,-43,-131,-99,-69,-39,-48,-61,"); - add("-90,-69,-46,-52,22,110,36,78,129,79,77,80,"); - add("94,82,74,23,21,21,-131,-106,-85,-88,-89,-96,"); - add("-22,4,35,76,92,117,-38,-8,26,-83,-108,-141,"); - add("-18,-45,-80,-56,-75,-99,-85,-68,-47,60,12,-44,"); - add("-75,-60,-42,-128,-21,106,-14,-35,-56,-7,-46,-91,"); - add("-126,-71,-1,-154,-77,21,2,45,95,18,77,144,"); - add("-56,-15,36,-91,-90,-80,-163,-46,103,49,9,-42,"); - add("118,28,-87,-8,-31,-56,-136,-78,3,-154,-87,7,"); - add(""); - //add("/*2*/"); - add("855,1,10146,-28113,2593,"); - add("-64,-14,99,-80,-18,106,-94,-21,118,-117,-32,89,"); - add("-142,-49,-9,-125,-42,5,-128,-35,72,-151,-47,23,"); - add("-146,-50,-18,-133,-46,-35,-151,-45,14,-129,-32,74,"); - add("-134,-34,54,-100,-18,108,15,23,153,86,38,101,"); - add("166,53,22,114,38,26,140,39,-36,135,37,-51,"); - add("143,47,6,145,55,58,-124,-32,67,28,23,110,"); - add("85,41,95,148,50,1,46,0,-116,126,38,-40,"); - add("98,45,85,98,27,-54,87,31,0,117,48,45,"); - add("135,50,10,123,45,-4,105,53,98,140,63,69,"); - add("-39,1,110,-64,-4,137,-33,10,148,-42,7,144,"); - add("-39,9,148,-38,12,148,-37,11,146,-28,16,148,"); - add("-87,-10,120,-70,-3,117,-42,15,156,-32,15,133,"); - add("-44,13,141,-80,-2,130,-5,24,117,-7,29,148,"); - add("-32,21,143,-35,21,147,87,40,36,96,40,22,"); - add("-19,30,156,11,38,140,31,47,141,-43,21,144,"); - add("-83,3,129,-86,1,122,-113,-13,102,-111,-11,104,"); - add("-142,-38,40,-137,-36,41,-138,-35,40,-116,-59,-74,"); - add("-56,-54,-130,-62,-27,-26,-49,23,143,-52,19,131,"); - add("-144,-27,65,-26,-48,-141,-89,-34,-22,-138,-28,50,"); - add("-92,-1,101,74,51,99,-49,22,131,-127,-50,-42,"); - add("-141,-33,32,-124,-13,80,-149,-37,17,-130,-15,74,"); - add("-132,-14,77,-147,-42,-9,-144,-26,44,-143,-29,27,"); - add("-147,-33,15,-138,-38,-14,-110,-61,-115,-105,-49,-84,"); - add("-193,-49,-13,38,41,110,-101,-31,-25,-72,23,133,"); - add("127,47,62,-51,10,74,-161,-49,-43,-33,28,117,"); - add("43,40,100,-56,30,138,-19,42,146,36,53,142,"); - add("-86,16,108,-145,-37,-16,-97,-52,-97,-128,-51,-76,"); - add("-146,-38,-26,-149,-29,-1,-148,-30,-2,-141,-7,60,"); - add("-141,-10,48,-149,-24,8,-150,-20,19,-141,-7,49,"); - add("-150,-18,18,-147,-14,28,-149,-16,19,-149,-15,22,"); - add("-142,-3,50,-112,19,105,-133,6,71,-116,18,96,"); - add("-112,20,101,-125,15,86,-121,16,87,-159,-19,-3,"); - add("-150,-19,-10,-151,-12,6,-135,9,64,-132,4,44,"); - add("-156,-14,-3,-118,-35,-73,-114,-37,-85,-153,4,42,"); - add("-88,34,115,-81,37,121,-112,32,108,-35,-26,-68,"); - add("-76,-33,-82,-115,38,126,-117,-31,-73,-110,-34,-83,"); - add("-152,-6,-1,-152,-7,-6,-147,-13,-25,-145,-16,-37,"); - add("-144,-16,-40,-132,-26,-70,-139,-21,-59,-109,-33,-97,"); - add("-99,-36,-108,-90,36,108,-127,-5,-17,-96,20,55,"); - add("-117,5,9,-147,-8,-32,-150,-1,-14,-149,-14,-56,"); - add("-83,28,76,58,42,129,-20,42,118,-126,-13,-49,"); - add("-86,-37,-120,-54,-44,-136,15,-53,-156,-135,-21,-85,"); - add("-82,49,137,-70,46,126,-119,36,88,-81,-19,-70,"); - add("-22,-46,-143,-69,-43,-144,-140,38,89,-43,-33,-110,"); - add("114,-37,-91,71,-44,-122,-30,-42,-140,-71,-35,-129,"); - add("-97,-29,-116,-138,-9,-65,23,-25,-77,-7,-32,-110,"); - add("-136,-7,-58,-104,-24,-113,-14,-51,-183,21,-28,-96,"); - add("58,-21,-58,132,9,68,127,15,86,27,-28,-92,"); - add("-97,-23,-110,-67,-30,-130,-79,-27,-125,-47,-32,-134,"); - add("-5,-37,-148,-31,-33,-141,48,-40,-150,-136,-10,-84,"); - add("-104,-10,-83,-111,-10,-85,-125,-4,-66,-120,-8,-87,"); - add("-117,-10,-97,-90,-20,-132,-69,-16,-107,-93,-15,-121,"); - add("-67,-21,-132,-38,-25,-144,-55,-21,-141,-31,-25,-148,"); - add("-77,-16,-131,-27,-24,-147,3,-27,-149,4,-26,-149,"); - add("22,-28,-148,55,-29,-137,103,-29,-106,150,-18,-6,"); - add("145,-20,-31,134,-7,46,80,13,129,78,14,128,"); - add("132,10,135,16,-14,-76,-32,-21,-147,4,-26,-155,"); - add("162,-21,-42,93,-24,-108,-32,-18,-138,-96,-10,-124,"); - add("-65,-13,-134,-90,-9,-122,-69,-11,-134,-79,-9,-128,"); - add("-44,-14,-146,-57,-11,-139,-22,-15,-147,59,-21,-143,"); - add("-61,-7,-129,-124,4,-86,-90,-3,-120,-57,-6,-139,"); - add("-36,-9,-146,-21,-10,-149,30,-15,-148,71,-17,-133,"); - add("75,-19,-163,-105,10,-3,-134,19,54,-145,14,-43,"); - add("-144,14,-52,-142,14,-50,-140,15,-54,-141,16,-55,"); - add("-136,15,-68,-124,13,-86,-100,9,-114,-115,13,-97,"); - add("-126,16,-86,-144,21,-33,-145,22,-49,-126,14,-211,"); - add("10,2,103,-62,16,132,-128,25,66,-141,24,-30,"); - add("-57,5,-132,-39,2,-151,107,-22,-83,-36,5,-47,"); - add("-142,25,-56,-109,18,-94,-147,29,-31,-156,30,-34,"); - add("-31,9,92,136,-26,79,112,-19,99,54,-6,141,"); - add("-19,9,150,-108,25,85,-133,25,-57,-88,13,-124,"); - add("-107,18,-129,-114,24,14,24,-1,120,84,-12,129,"); - add("60,-7,138,77,-9,129,83,-11,124,-50,19,144,"); - add("-119,31,98,-114,19,-79,-47,1,-148,-123,22,-77,"); - add("-136,28,-54,-143,30,-42,-142,31,-37,-139,32,-11,"); - add("-116,34,108,60,-8,127,139,-31,32,129,-26,64,"); - add("70,-8,134,61,-5,139,61,-3,139,54,-1,147,"); - add("-91,30,115,-36,19,136,-3,14,148,5,14,152,"); - add("-21,19,148,-30,23,145,-30,23,149,-106,31,50,"); - add("-96,33,86,-112,41,116,95,-17,48,-6,13,93,"); - add("-117,39,85,-90,36,105,-94,32,62,-40,17,51,"); - add("-61,31,110,-130,30,-29,-131,37,18,66,-4,97,"); - add("25,9,103,-109,39,70,-156,39,-21,-120,26,-45,"); - add("-54,31,103,-124,41,45,-115,11,-148,-38,20,61,"); - add("29,15,151,-109,31,-3,-62,25,43,-64,36,103,"); - add("-146,51,42,-111,23,-65,-72,33,67,-134,39,-15,"); - add("-96,44,80,-156,50,-3,-129,54,68,-134,41,-21,"); - add("-134,39,-38,-150,60,54,-117,42,3,-27,36,152,"); - add("-53,11,-44,-6,-26,-159,113,-44,-30,-20,-4,-58,"); - add("-82,9,-121,-125,48,21,-84,50,117,-82,22,-47,"); - add("-147,63,50,-120,52,44,-39,38,132,-100,56,97,"); - add("-23,41,177,-118,61,82,-71,52,123,202,-60,96,"); - add("-114,60,80,93,-7,139,20,19,131,-21,39,142,"); - add("-73,14,-67,-18,-25,-152,-142,44,-57,-88,65,143,"); - add("-97,45,31,-51,46,113,-18,42,157,-42,48,133,"); - add("-38,47,138,18,29,150,86,-9,108,-40,35,75,"); - add("-97,66,102,-47,52,129,-2,40,151,56,18,152,"); - add("-95,59,72,-85,8,-104,-7,-35,-144,-28,-30,-156,"); - add("25,-48,-147,-15,-25,-128,-24,-22,-132,-5,-34,-151,"); - add("73,-59,-120,23,-40,-133,3,-39,-169,21,-33,-111,"); - add("38,-44,-131,-54,-9,-152,126,-67,-76,70,-43,-69,"); - add("53,-45,-120,47,-38,-98,1,-24,-130,48,-43,-128,"); - add("75,-51,-119,85,-50,-97,50,-39,-115,16,-28,-131,"); - add("145,-69,-78,92,-14,130,81,-38,-46,92,-49,-90,"); - add("135,-55,-30,105,-50,-76,120,-56,-82,123,-40,17,"); - add("101,-51,-102,-31,-10,-145,-5,-15,-118,144,-53,-23,"); - add("127,-51,-60,141,-46,15,142,-48,-7,141,-48,-20,"); - add("139,-48,-27,129,-49,-68,142,-47,-20,144,-43,2,"); - add("134,-47,-55,118,-43,-65,95,-41,-118,48,-30,-133,"); - add("40,-27,-148,9,-19,-150,-25,-8,-148,2,-15,-146,"); - add("-5,-12,-156,31,-21,-145,-2,-12,-152,-15,-7,-143,"); - add("9,-13,-157,-86,24,-2,-77,18,-69,16,-15,-167,"); - add("-97,25,-49,-131,35,-68,-99,24,-107,55,-20,-57,"); - add("93,-30,-67,129,-40,-49,84,-29,-95,-35,5,-125,"); - add("-80,19,-128,-38,7,-140,-68,16,-139,-184,54,-42,"); - add("30,-11,-109,-23,5,-131,-40,10,-134,-186,56,-83,"); - add("112,-34,-78,70,-22,-118,55,-16,-134,-40,13,-157,"); - add("4,1,-147,49,-12,-139,-6,5,-150,40,-7,-148,"); - add("4,4,-147,-49,20,-153,-49,20,-120,42,-5,-148,"); - add("39,-4,-144,28,1,-165,-30,17,-116,-70,28,-110,"); - add("110,-29,-54,130,-44,72,26,-16,138,-25,-2,147,"); - add("-13,-5,153,70,-28,142,78,-20,-44,36,-3,-147,"); - add("-24,16,-149,53,-7,-129,110,-37,77,57,-23,124,"); - add("143,-44,74,27,-14,135,126,-36,32,75,-23,68,"); - add("98,-29,76,82,-17,-108,28,0,-145,-68,25,-127,"); - add("24,4,-161,49,-4,-144,86,-13,-128,107,-19,-105,"); - add("27,5,-144,-12,15,-154,84,-6,-166,-127,38,-63,"); - add("-148,36,15,-143,44,-72,-19,20,-144,109,-26,-31,"); - add("136,-40,54,109,-23,-50,-14,17,-123,-89,31,-83,"); - add("-123,39,-67,-87,35,-107,77,-9,-97,155,-46,54,"); - add("104,-16,-88,94,-9,-114,8,18,-157,92,-13,-73,"); - add("110,-17,-77,101,-8,-114,95,-6,-120,67,5,-135,"); - add("95,-5,-114,65,6,-140,81,3,-128,85,1,-126,"); - add("109,-7,-101,130,-14,-76,103,-3,-108,79,6,-131,"); - add("87,5,-123,129,-10,-87,18,26,-156,96,3,-108,"); - add("151,-19,-53,144,-31,23,139,-14,-57,133,-6,-84,"); - add("146,-32,31,140,-18,-24,118,0,-95,127,-12,-39,"); - add("156,-16,-38,134,-22,14,143,-10,-54,81,-45,165,"); - add("104,3,-81,78,19,-143,165,-22,5,-30,-18,107,"); - add("-130,3,66,-57,-19,133,6,-28,137,79,-26,81,"); - add("97,-32,107,88,0,-61,160,-18,-5,141,-19,14,"); - add("98,-1,-51,42,24,-149,104,4,-76,77,5,-66,"); - add("52,22,-135,113,9,-95,125,-16,19,118,4,-70,"); - add("89,-27,97,77,-31,117,41,-30,136,-72,-25,156,"); - add("-144,6,35,-121,-2,69,69,-30,124,161,-14,3,"); - add("37,-21,100,-45,-22,142,-92,-12,117,-82,-13,121,"); - add("-60,-18,139,-79,-13,131,-69,-14,132,-35,-19,147,"); - add("27,-24,148,60,-25,134,135,-21,64,138,-19,55,"); - add("133,-23,87,126,-7,-24,71,13,-132,96,8,-112,"); - add("117,6,-96,151,-12,12,-16,-15,116,-64,-16,145,"); - add("86,-21,123,23,-21,148,-22,-17,154,7,-18,148,"); - add("106,-18,108,92,-18,118,66,-18,136,75,-16,129,"); - add("56,-16,137,9,-14,151,-32,-11,148,-72,-7,133,"); - add("-86,-6,126,-84,-4,126,-14,-8,133,123,-8,18,"); - add("89,4,-130,125,1,-97,157,-11,62,114,1,-81,"); - add("157,-2,-36,120,3,-96,85,8,-121,92,8,-118,"); - add("75,8,-118,108,9,-118,128,6,-80,153,1,-24,"); - add("123,5,-53,115,10,-101,132,8,-74,135,9,-67,"); - add("113,8,-67,85,13,-99,153,6,-28,38,8,-63,"); - add("45,16,-122,89,13,-90,109,16,-106,112,15,-84,"); - add("81,16,-100,104,20,-116,151,21,-102,20,22,-149,"); - add("111,19,-87,53,22,-133,53,22,-123,132,8,1,"); - add("71,16,-73,-64,23,-163,42,23,-122,-1,27,-158,"); - add("66,27,-132,-52,19,-120,-108,12,-98,-88,18,-123,"); - add("-106,12,-92,-181,0,-44,53,12,-52,133,30,-117,"); - add("100,13,-34,82,37,-157,82,20,-73,63,33,-132,"); - add("115,28,-95,35,21,-85,31,32,-130,61,37,-142,"); - add("27,33,-132,16,32,-130,62,36,-128,76,39,-130,"); - add("-76,23,-114,-33,36,-149,-108,11,-73,-26,28,-111,"); - add("74,41,-132,-110,13,-76,9,25,-88,-85,32,-135,"); - add("-90,31,-127,-103,-6,-2,-99,8,-46,-25,40,-142,"); - add("-56,34,-126,-32,47,-159,9,45,-144,40,39,-116,"); - add("-74,30,-107,-14,40,-127,106,39,-102,153,10,-1,"); - add("126,33,-75,143,33,-68,84,42,-106,163,15,-9,"); - add("136,8,12,146,15,-9,154,12,8,123,-13,73,"); - add("140,35,-61,147,12,11,142,13,8,142,26,-26,"); - add("106,40,-77,132,38,-62,143,29,-28,135,34,-44,"); - add("194,36,-27,97,-12,78,124,-4,64,150,16,23,"); - add("159,37,-31,46,48,-115,156,45,-53,-15,-36,94,"); - add("-26,-53,138,147,11,43,118,0,64,138,-8,98,"); - add("120,71,-143,138,11,45,145,21,23,146,6,68,"); - add("113,50,-75,115,32,-22,87,-32,148,71,25,-26,"); - add("148,46,-37,171,21,52,60,55,-120,84,45,-71,"); - add("112,-11,108,134,20,40,147,29,20,107,-15,126,"); - add("147,32,16,131,8,82,130,11,73,131,16,60,"); - add("141,21,56,125,8,85,139,21,58,133,18,65,"); - add("111,2,99,144,26,57,153,29,56,87,53,-79,"); - add("72,62,-121,120,61,-70,123,47,-21,79,-2,88,"); - add("-86,-65,114,-106,-63,88,-125,-59,59,-42,-50,118,"); - add("131,12,99,76,-14,129,81,-11,124,87,-7,121,"); - add("105,3,111,32,-30,145,-31,-50,141,-74,-56,114,"); - add("-40,-47,127,112,11,101,121,18,85,137,36,41,"); - add("131,62,-66,141,35,58,25,-32,158,-43,-49,136,"); - add("95,18,63,95,12,88,17,-29,150,74,7,81,"); - add("119,18,111,27,-25,152,17,-25,144,64,-7,141,"); - add("44,-14,140,73,-1,140,52,-8,136,110,21,107,"); - add("140,49,19,136,45,44,78,7,125,25,-20,159,"); - add("129,47,22,139,49,40,139,48,50,59,4,115,"); - add("7,-23,148,32,-11,148,-6,-27,148,-101,-55,90,"); - add("-76,-48,104,-17,-28,144,16,-18,175,104,29,94,"); - add("124,40,85,58,5,144,73,15,129,78,17,127,"); - add("88,23,124,82,22,122,59,11,135,67,15,133,"); - add("30,-1,147,-6,-17,148,-18,-20,147,-90,-49,114,"); - add("-65,-38,129,-105,-54,130,66,23,86,82,28,102,"); - add("-29,-22,162,43,11,136,-8,-12,155,9,-3,157,"); - add("54,18,141,-20,-14,150,30,9,148,-2,-4,155,"); - add("38,14,144,0,-2,154,-38,-17,145,-30,-13,146,"); - add("-13,-5,165,118,51,49,159,71,70,-58,-25,54,"); - add("-147,-64,16,-117,-49,76,-86,-35,120,-43,-14,142,"); - add("-63,-23,129,-10,1,153,-12,1,149,-21,-2,150,"); - add("-87,-30,128,-7,4,134,-138,-53,64,-79,-30,35,"); - add("-98,-32,115,-59,-15,138,-81,-23,127,-102,-32,104,"); - add("-125,-43,76,-134,-48,36,-137,-54,-19,-115,-37,69,"); - add("-97,-26,116,-95,-26,95,"); - add(""); - //add("/*3*/"); - add("533,1,14413,-10720,-24028,"); - add("106,64,35,41,145,-39,45,121,-25,118,62,45,"); - add("108,59,42,130,65,53,121,63,49,125,156,13,"); - add("105,16,61,116,68,46,134,43,70,123,76,50,"); - add("78,121,2,37,136,-31,102,110,25,28,136,-35,"); - add("3,139,-52,41,137,-25,71,135,-3,71,132,-1,"); - add("106,109,33,94,119,21,23,137,-33,49,144,-17,"); - add("50,142,-13,38,151,-25,25,132,-27,44,100,-1,"); - add("117,83,55,114,84,53,77,128,14,100,11,68,"); - add("77,-59,74,102,-33,85,81,128,19,59,137,0,"); - add("45,141,-9,21,141,-27,40,147,-13,49,131,-2,"); - add("55,141,2,99,120,41,12,152,-33,97,77,53,"); - add("59,144,7,26,145,-17,59,151,8,83,100,39,"); - add("77,-10,61,69,-98,78,-3,-158,37,16,-145,50,"); - add("6,-150,44,28,-68,40,47,-117,69,-62,-183,3,"); - add("25,-97,47,27,-119,56,-34,-144,17,30,-138,66,"); - add("-8,-148,39,-63,-137,-5,-3,-148,45,-37,-145,19,"); - add("-51,-146,9,10,-137,56,16,-141,62,-6,-146,48,"); - add("-18,-141,38,10,-146,62,22,-132,68,43,-119,81,"); - add("8,-136,60,28,-124,73,85,-76,100,103,-39,102,"); - add("114,21,87,118,63,73,114,73,68,103,83,54,"); - add("74,129,12,119,59,79,116,34,89,116,41,87,"); - add("107,90,60,96,110,43,112,66,76,109,71,73,"); - add("114,56,83,102,33,84,106,93,64,98,100,55,"); - add("101,89,63,107,85,72,105,76,74,45,130,-4,"); - add("-39,126,-84,-51,115,-92,-23,126,-65,10,141,-39,"); - add("49,132,2,-28,103,-60,-91,36,-100,-74,6,-72,"); - add("-3,145,-49,-37,155,-83,-53,99,-80,74,82,45,"); - add("87,113,49,72,-11,71,12,-108,44,35,-107,66,"); - add("67,112,31,62,10,57,48,21,40,-31,120,-66,"); - add("19,34,9,75,-92,100,92,-81,115,82,-8,84,"); - add("109,97,80,90,-10,94,116,25,110,106,78,87,"); - add("85,40,76,101,-2,107,98,47,89,108,136,75,"); - add("93,-18,105,101,107,79,72,-5,80,45,4,49,"); - add("66,-13,77,-92,-105,-70,-116,-3,-126,-80,-112,-54,"); - add("-41,-175,10,55,-93,89,75,5,80,98,-28,118,"); - add("99,-9,114,116,57,113,75,-20,92,46,-138,98,"); - add("60,6,68,39,-81,73,60,-72,95,43,-109,90,"); - add("-49,-156,-2,56,-99,103,50,-71,86,-4,-133,46,"); - add("44,-94,90,23,-141,85,-100,-116,-74,-87,-100,-64,"); - add("17,-35,35,10,-127,65,48,36,43,92,-10,115,"); - add("51,51,42,103,56,103,109,16,130,28,-100,78,"); - add("18,-163,94,41,49,31,15,153,-49,18,117,-26,"); - add("99,103,83,78,114,53,90,103,74,89,65,90,"); - add("76,53,79,62,-14,88,19,-118,75,56,19,66,"); - add("49,-39,84,65,59,63,17,-34,39,-23,-173,43,"); - add("60,-55,107,55,99,32,14,-38,36,32,-76,79,"); - add("49,-70,100,-47,-125,-9,-20,-79,9,80,18,105,"); - add("-21,-130,32,56,-2,81,36,-42,73,46,-97,113,"); - add("-68,-135,-32,-26,-92,9,12,-100,68,-109,-64,-125,"); - add("17,-12,31,88,5,126,85,45,101,98,10,141,"); - add("33,-89,96,-10,-72,24,-108,-124,-95,-9,-120,52,"); - add("7,-166,103,59,52,60,73,129,39,75,139,38,"); - add("64,131,26,40,8,56,10,-123,85,35,-95,108,"); - add("38,-102,118,-6,-132,67,-46,-141,11,-57,-137,-9,"); - add("-32,-109,18,35,-92,112,37,-91,117,7,-117,86,"); - add("-8,-141,79,7,-120,92,25,-100,109,43,-74,123,"); - add("53,-57,130,57,-51,132,67,-25,134,61,-36,133,"); - add("69,-2,122,76,10,129,24,-97,116,41,-63,123,"); - add("68,-18,141,49,-44,126,26,-88,117,52,-38,132,"); - add("78,18,135,79,17,141,39,-36,107,37,-65,131,"); - add("30,-62,114,22,-89,124,18,-91,117,14,-95,118,"); - add("40,-60,139,40,-50,134,15,-97,124,-18,-110,68,"); - add("-10,-135,113,59,79,51,69,184,-27,23,-36,85,"); - add("-27,-131,71,-24,-129,79,-54,-125,5,-65,-137,-2,"); - add("-50,-138,32,-25,-122,75,-19,-121,89,-40,-134,59,"); - add("-56,-139,28,-80,-120,-45,-70,-128,-14,-80,-119,-43,"); - add("-82,-123,-40,-83,-118,-49,-75,-119,-27,-53,-167,84,"); - add("100,105,97,60,81,39,98,141,53,-23,-83,47,"); - add("-79,-124,-31,-87,-103,-72,-57,-134,37,63,50,81,"); - add("103,130,75,-27,-77,34,-85,-107,-64,-87,-106,-64,"); - add("-85,-114,-49,-85,-119,-40,-82,-127,-22,-63,-133,29,"); - add("-81,-128,-14,-89,-107,-59,-88,-115,-41,-79,-124,-8,"); - add("-93,-112,-54,-84,-127,-12,-67,-131,32,-71,-133,28,"); - add("-77,-127,10,-81,-128,3,-90,-122,-21,-92,-115,-32,"); - add("-91,-119,-25,-94,-115,-31,-85,-125,-1,-77,-137,40,"); - add("-92,-172,59,-23,-67,51,-85,-127,14,-63,-112,36,"); - add("-33,-122,120,50,-14,128,8,-34,69,-75,-127,40,"); - add("-100,-130,-6,-84,-36,-120,-97,-70,-91,-105,-98,-61,"); - add("-98,-58,-109,-69,-40,-76,-88,-26,-136,-69,0,-135,"); - add("-85,-22,-130,-62,9,-131,-36,52,-145,4,92,-127,"); - add("-10,81,-134,-54,23,-132,-42,37,-127,30,113,-104,"); - add("-19,73,-132,-69,10,-132,-67,12,-130,-64,23,-138,"); - add("-69,12,-130,-82,-5,-128,-97,-18,-133,-83,-38,-84,"); - add("-62,26,-130,-73,16,-134,-92,-30,-104,-67,39,-149,"); - add("-2,101,-125,22,108,-95,31,118,-93,-30,71,-126,"); - add("-69,31,-135,-37,68,-130,-46,59,-131,-44,61,-128,"); - add("-40,68,-130,-79,17,-126,-101,-20,-116,-90,2,-122,"); - add("-82,15,-124,-66,41,-128,-72,36,-130,-66,44,-129,"); - add("-59,54,-129,-54,61,-126,-77,32,-128,-88,16,-122,"); - add("-91,12,-122,-94,8,-120,-101,-6,-112,-94,8,-117,"); - add("-78,34,-120,-119,-51,-88,-117,-66,-71,-117,-80,-56,"); - add("-104,-26,-91,-87,18,-111,-122,-68,-68,-121,-27,-104,"); - add("-86,2,-92,-126,-117,-26,-112,-44,-74,-38,-120,71,"); - add("-98,-130,20,-129,-42,-92,-107,-99,-16,-85,-115,23,"); - add("-124,-98,-31,-87,-113,21,-80,-156,70,-62,-71,9,"); - add("-173,-72,-100,30,103,-70,-25,85,-105,-8,117,-118,"); - add("-31,90,-114,-65,81,-136,-70,41,-102,-11,108,-108,"); - add("11,117,-95,-39,91,-115,36,126,-78,-31,-5,-23,"); - add("-84,-123,30,-33,-105,63,-57,-130,65,4,-102,94,"); - add("11,-104,105,-21,-114,85,-51,-122,66,-60,-146,83,"); - add("84,-30,106,5,-114,113,-106,3,-101,-105,24,-119,"); - add("-2,109,-105,33,121,-83,13,141,-119,-96,-66,-25,"); - add("-122,-121,3,-61,-111,49,-43,-125,79,3,-137,133,"); - add("-119,-18,-87,-85,45,-119,-83,53,-122,-35,-85,51,"); - add("-7,-50,41,-116,-89,-16,-71,-54,-8,227,159,44,"); - add("-34,-26,-6,-122,-85,-24,-113,-99,-1,-100,-112,23,"); - add("-87,-116,39,-22,-117,95,-75,-117,53,-127,-103,-3,"); - add("-114,-89,-7,-114,-97,4,-128,-46,-59,-127,-32,-70,"); - add("-138,-91,-19,-80,19,-83,-136,-18,-88,-123,-15,-80,"); - add("-134,-63,-39,-134,-55,-47,-135,-49,-51,-89,37,-102,"); - add("-50,81,-118,-69,69,-117,-36,76,-99,-50,97,-129,"); - add("-109,-60,-18,27,-110,124,-68,-50,1,-74,71,-120,"); - add("-83,-61,1,-118,-90,6,-118,-72,-10,-166,-79,-35,"); - add("33,81,-56,-45,52,-80,-106,31,-99,-54,89,-120,"); - add("-53,84,-113,-65,76,-112,-91,53,-107,-114,29,-96,"); - add("-127,5,-82,-132,6,-85,-118,12,-81,-75,78,-114,"); - add("-42,85,-100,49,106,-64,45,112,-72,8,121,-99,"); - add("16,118,-92,34,114,-76,-2,118,-100,-22,114,-106,"); - add("-32,107,-105,-28,83,-82,18,123,-89,15,102,-72,"); - add("-23,126,-112,-27,98,-90,16,148,-104,-36,111,-104,"); - add("-29,92,-85,-33,108,-97,-98,84,-113,-57,79,-88,"); - add("-55,94,-96,26,127,-77,-46,113,-103,-21,121,-94,"); - add("3,124,-84,5,131,-85,52,127,-59,3,127,-83,"); - add("-8,125,-85,-2,126,-83,9,129,-78,18,131,-73,"); - add("-17,125,-87,-17,124,-85,46,131,-57,49,127,-52,"); - add("73,127,-39,73,123,-36,98,120,-20,37,121,-51,"); - add("26,144,-69,42,129,-52,37,130,-53,35,153,-67,"); - add("94,112,-12,39,138,-54,130,95,16,83,115,-18,"); - add("94,105,-6,121,87,19,92,135,-20,126,100,16,"); - add("107,31,42,122,95,19,132,110,18,78,104,-8,"); - add("52,139,-39,13,134,-58,91,140,-16,131,17,66,"); - add("131,106,25,24,-114,68,87,14,43,94,98,9,"); - add("73,136,-21,48,153,-43,78,105,-2,70,133,-19,"); - add(""); - //add("/*4*/"); - add("521,1,-7056,27453,9826,"); - add("48,26,-40,102,-3,82,129,39,-21,109,39,-34,"); - add("149,63,-76,128,57,-78,109,51,-74,115,37,-34,"); - add("155,37,-8,74,53,-109,30,53,-140,34,5,8,"); - add("16,-47,150,31,-29,102,147,9,62,99,17,11,"); - add("87,16,4,95,1,51,162,24,19,128,16,22,"); - add("150,20,22,150,21,14,147,40,-44,112,37,-54,"); - add("138,36,-40,141,35,-40,136,40,-59,124,28,-26,"); - add("101,31,-51,-186,8,-106,-101,20,-105,-103,19,-105,"); - add("-143,-14,-27,-148,-10,-40,-143,-34,32,-74,15,-85,"); - add("215,32,9,77,25,-38,-169,-3,-78,-107,8,-83,"); - add("-49,5,-41,160,34,-24,89,49,-114,72,13,-3,"); - add("104,-15,104,144,20,5,117,36,-60,-34,35,-133,"); - add("-138,6,-87,-100,9,-84,-26,2,-22,106,27,-34,"); - add("-46,31,-131,9,15,-50,67,-33,153,51,-38,155,"); - add("115,-8,83,73,-31,138,68,-22,102,-7,-50,156,"); - add("-23,-48,143,63,-35,135,127,12,17,55,24,-51,"); - add("83,-28,119,58,46,-118,28,48,-137,40,54,-155,"); - add("-28,28,-103,19,24,-71,-62,10,-58,48,38,-104,"); - add("-81,31,-138,-60,27,-121,-117,-1,-50,-49,-1,-21,"); - add("156,41,-69,-66,30,-137,-147,-11,-32,-25,17,-76,"); - add("183,8,61,84,29,-64,-116,16,-113,-119,-4,-45,"); - add("77,37,-102,147,-12,121,151,36,-63,12,32,-114,"); - add("100,-13,92,106,9,16,105,-20,118,-3,-3,10,"); - add("-130,-1,-53,79,-42,189,132,10,16,121,14,-3,"); - add("106,20,-32,35,40,-131,-138,11,-95,-50,-21,57,"); - add("10,46,-169,69,37,-110,76,18,-43,138,-12,102,"); - add("87,-21,110,101,33,-87,-53,19,-95,-114,12,-87,"); - add("12,41,-158,-85,7,-59,152,22,-32,-85,29,-153,"); - add("15,11,-41,84,-23,129,122,-16,112,95,37,-117,"); - add("21,34,-136,-87,20,-116,-75,5,-50,179,24,-36,"); - add("-114,10,-86,-64,32,-167,41,27,-107,139,16,-18,"); - add("125,9,5,132,-15,116,94,23,-70,-19,32,-157,"); - add("-106,8,-74,-49,18,-107,81,19,-60,78,3,13,"); - add("-125,21,-150,-109,-17,43,95,44,-183,83,32,-133,"); - add("61,27,-122,133,24,-80,108,28,-115,38,30,-154,"); - add("110,20,-81,127,17,-55,-21,16,-102,-151,-11,11,"); - add("-62,-7,23,131,29,-132,152,-1,58,123,15,-53,"); - add("-21,16,-106,-143,-1,-43,-83,3,-50,228,12,1,"); - add("155,6,10,102,20,-101,124,18,-90,107,21,-118,"); - add("-44,18,-138,-120,9,-92,-151,-8,10,-119,-20,108,"); - add("-142,0,-54,-144,-19,79,-121,-20,92,-119,-20,86,"); - add("-67,-9,34,143,31,-154,100,21,-98,96,22,-124,"); - add("58,22,-139,-64,9,-94,-117,-19,93,-141,-15,49,"); - add("-96,-5,-11,191,29,-131,-90,8,-108,-158,-5,-43,"); - add("-133,-6,-26,-88,-3,-36,207,24,-69,163,2,76,"); - add("131,-2,79,148,8,6,140,11,-31,71,17,-112,"); - add("-85,10,-124,-73,5,-72,0,13,-123,-135,-1,-55,"); - add("-129,-1,-65,-138,-7,-14,-103,-3,-43,161,11,-4,"); - add("140,4,45,135,0,78,110,11,-52,-95,9,-131,"); - add("-94,6,-119,-143,-1,-77,-135,-4,-55,-94,-4,-21,"); - add("-93,-10,28,-41,-13,106,-121,-11,22,-31,17,-204,"); - add("-68,2,-87,-140,-11,-12,-69,-8,23,94,-3,118,"); - add("85,-4,125,-5,-13,134,-42,-6,17,-30,11,-134,"); - add("-79,8,-159,-81,-8,3,-33,-17,156,-47,-12,77,"); - add("-162,-23,72,-64,-5,-20,28,18,-155,0,14,-147,"); - add("4,14,-151,-96,-8,-23,-86,-20,128,-92,-17,74,"); - add("-60,-11,44,-16,16,-196,-135,-16,6,192,35,-159,"); - add("-33,5,-106,-101,-6,-76,-153,-13,-66,-100,-22,129,"); - add("-62,-18,139,-13,-2,1,47,17,-149,52,17,-141,"); - add("-120,-10,-67,-128,-23,88,-156,-23,29,-96,-6,-97,"); - add("-75,-11,9,-161,-17,-91,-135,-17,-46,-158,-24,-9,"); - add("-66,-19,118,82,4,124,20,1,35,-159,-26,8,"); - add("-131,-27,69,-149,-26,5,-115,-15,-68,-79,-5,-112,"); - add("-136,-20,-71,-132,-18,-97,-92,-11,-104,-134,-22,-57,"); - add("-126,-27,35,-85,-27,146,3,-8,117,-31,-12,78,"); - add("-78,-22,78,72,6,114,84,7,125,27,-2,88,"); - add("-125,-28,30,-53,2,-158,-83,-15,-23,37,-8,187,"); - add("-6,-3,18,-45,4,-159,-37,4,-148,-69,-4,-134,"); - add("-122,-27,3,-14,-11,103,23,2,47,-56,-24,133,"); - add("-16,-10,74,-160,-31,-52,-68,-28,146,2,-15,161,"); - add("38,5,36,82,20,-10,39,-2,103,14,-6,92,"); - add("100,14,75,91,6,131,28,-10,139,4,-17,155,"); - add("-15,-22,150,-14,-21,139,-64,-30,120,-86,-26,53,"); - add("-80,-37,132,-46,-34,162,-75,-38,138,-88,-29,54,"); - add("-74,-22,30,-46,-35,152,-96,-36,80,-86,-47,153,"); - add("-106,-40,80,-72,-45,154,-114,-39,58,-87,-20,-17,"); - add("-31,-22,74,-100,-39,73,-184,-50,-1,-85,-46,120,"); - add("47,-12,127,129,32,18,96,30,-20,135,52,-87,"); - add("58,25,-52,-84,-59,192,-29,-33,130,30,-7,72,"); - add("-124,-33,1,72,1,88,-94,-29,17,21,-3,40,"); - add("-42,-19,38,4,-18,88,-59,-44,134,-73,-40,89,"); - add("-68,-28,39,-40,22,-146,2,33,-152,-53,15,-141,"); - add("-78,5,-131,-105,-33,17,-23,-37,147,48,-17,142,"); - add("-9,-35,153,54,-16,137,72,1,89,28,-16,102,"); - add("-118,-44,46,-91,-40,58,-86,-48,95,-70,-32,47,"); - add("-128,-40,7,-97,-41,45,-118,-10,-108,-108,-16,-70,"); - add("-100,-36,16,94,-8,155,118,26,45,30,-3,48,"); - add("-88,-50,90,-5,-29,108,-83,20,-181,-61,13,-130,"); - add("-50,4,-82,-53,-5,-51,-41,-34,87,-148,-38,-42,"); - add("-56,-34,64,161,41,50,129,23,72,36,-12,94,"); - add("100,1,123,7,-9,41,-86,-24,-11,37,-16,107,"); - add("-82,-3,-89,-56,15,-129,-59,16,-141,-96,-15,-64,"); - add("-170,-44,-50,-53,-35,69,117,12,110,106,9,101,"); - add("71,-8,121,15,-30,131,6,-3,21,-63,14,-130,"); - add("-40,21,-135,-110,-11,-99,-118,-16,-95,-78,-29,14,"); - add("-1,-26,101,63,-15,139,-126,-37,-22,-51,-34,62,"); - add("-122,-20,-87,-65,-49,103,145,31,74,142,41,32,"); - add("143,44,17,143,37,37,121,19,78,-6,-8,22,"); - add("-106,-25,-34,-154,-31,-77,-146,-44,-22,-143,-39,-39,"); - add("-139,-40,-33,-62,-35,48,85,-1,116,53,0,68,"); - add("-184,-35,-112,-17,-28,83,-15,-32,96,130,28,64,"); - add("136,29,71,24,-11,68,-165,-25,-119,-135,-42,-24,"); - add("-69,-39,52,-100,-73,125,28,-5,54,51,8,36,"); - add("-181,-67,0,-74,-63,122,195,74,-5,104,26,40,"); - add("119,64,-69,-31,-71,201,-58,-63,136,-23,-15,23,"); - add("1,55,-181,-66,-27,10,-35,-28,52,-152,-42,-51,"); - add("-76,-18,-34,133,15,117,47,-3,66,-180,-32,-116,"); - add("-70,-33,20,3,-16,55,-107,-47,18,47,-7,82,"); - add("12,-6,35,-83,-41,28,22,-12,65,-73,-36,24,"); - add("25,-30,122,-38,-42,84,60,16,22,-98,-49,33,"); - add("-130,-83,94,19,-34,122,-13,-35,90,-21,-28,56,"); - add("54,7,40,-92,-51,43,58,10,37,-98,-67,77,"); - add("57,-17,114,-21,-11,7,-77,-40,22,13,-34,109,"); - add("37,-10,67,-72,-48,51,-35,-37,59,92,13,67,"); - add("126,5,125,142,35,58,116,22,61,41,-17,87,"); - add("-146,-56,-6,60,-3,69,-97,-55,42,59,0,61,"); - add("-3,-18,43,63,-2,65,-120,-76,71,103,34,18,"); - add("-126,-76,63,185,44,72,79,-31,151,88,23,29,"); - add("4,50,-116,-5,45,-116,126,-9,141,57,37,-37,"); - add("21,43,-83,112,43,-3,-39,21,-88,74,12,38,"); - add("12,9,-12,33,17,-10,8,15,-29,95,37,-6,"); - add("19,27,-49,73,31,-12,4,15,-35,104,47,-23,"); - add("84,70,-102,40,56,-109,58,66,-120,125,26,48,"); - add("101,24,26,42,40,-68,85,33,-10,57,40,-58,"); - add("43,2,32,57,10,24,76,29,-11,-12,32,-96,"); - add("127,17,64,44,59,-121,-19,47,-146,170,32,60,"); - add("62,78,-163,57,57,-112,113,7,77,114,33,3,"); - add("98,67,-107,127,23,38,118,1,92,107,28,6,"); - add("82,50,-75,128,61,-78,76,16,15,-11,-28,72,"); - add("-127,-57,64,89,-12,100,147,19,57,106,16,32,"); - add(""); - //add("/*5*/"); - add("321,1,-10216,27876,4312,"); - add("-33,-1,-76,72,20,45,-2,15,-106,-14,19,-164,"); - add("39,12,16,27,27,-123,65,8,111,85,31,-9,"); - add("8,22,-136,71,20,39,8,15,-85,28,3,48,"); - add("4,-19,148,36,-10,148,91,34,-10,5,22,-145,"); - add("-23,12,-142,-74,2,-199,39,5,60,101,19,116,"); - add("97,15,136,111,41,-23,83,46,-134,-80,-19,-64,"); - add("-122,-34,-49,-149,-37,-113,40,14,2,175,50,71,"); - add("-13,9,-102,-138,-39,-64,31,12,-10,122,36,43,"); - add("129,29,115,102,31,16,46,35,-157,-87,-11,-138,"); - add("-56,-6,-113,-222,-73,-11,83,30,-16,-1,8,-72,"); - add("42,15,-13,111,28,86,158,51,1,-51,-7,-85,"); - add("-141,-30,-150,119,40,-9,109,25,97,130,48,-48,"); - add("40,27,-149,-81,-18,-74,-180,-53,-52,108,42,-72,"); - add("-67,-16,-56,21,9,-21,157,48,17,-26,-2,-67,"); - add("-175,-51,-57,83,31,-45,72,26,-34,127,32,93,"); - add("78,33,-99,-164,-42,-116,93,29,7,-46,-7,-95,"); - add("29,9,1,98,22,110,124,39,-10,36,22,-141,"); - add("38,22,-136,-15,5,-146,-116,-29,-96,-131,-52,162,"); - add("-2,9,-138,-168,-59,92,30,17,-111,82,29,-61,"); - add("58,25,-106,-53,-14,-52,-97,-26,-78,108,38,-70,"); - add("84,26,-3,138,41,41,138,44,-54,109,37,-90,"); - add("137,43,-56,61,23,-112,-40,-7,-144,-129,-34,-103,"); - add("-72,-18,-120,-116,-36,59,-11,0,-126,-95,-32,94,"); - add("12,7,-103,-111,-33,-55,-128,-42,81,-118,-41,121,"); - add("9,6,-99,-97,-29,-88,-120,-41,52,-76,-28,121,"); - add("-132,-45,25,-156,-52,-3,31,11,-43,-48,-11,-205,"); - add("55,18,52,82,24,128,114,40,-67,113,40,-102,"); - add("130,44,-64,145,46,-1,132,43,-41,135,42,-15,"); - add("136,40,48,138,41,56,119,33,92,89,26,-38,"); - add("6,5,-152,-47,-11,-143,-92,-26,-117,-137,-39,-88,"); - add("-116,-35,-60,-150,-46,-31,-133,-41,-51,-142,-45,-12,"); - add("-118,-39,-20,-147,-48,5,-147,-49,3,-69,-23,127,"); - add("-17,-7,159,-97,-35,131,-30,-9,-143,16,7,-160,"); - add("-128,-44,2,-123,-44,84,-87,-32,123,5,0,128,"); - add("48,15,108,-26,-10,41,-121,-45,61,-16,-9,122,"); - add("4,-3,150,-18,-12,161,16,-1,147,-33,-20,163,"); - add("142,56,-94,-32,-16,89,-94,-43,172,87,35,-57,"); - add("33,8,63,-16,-15,156,-31,-20,134,77,20,120,"); - add("224,86,-107,-50,-25,106,-45,-24,121,-143,-57,81,"); - add("-4,-6,52,-12,-10,76,-63,-30,87,-88,-41,97,"); - add("-89,-44,123,-97,-26,-101,-126,-48,6,104,26,133,"); - add("61,11,121,-78,-35,67,-48,-33,136,-7,-9,59,"); - add("-98,-47,90,-40,-27,104,-124,-58,86,-110,-55,90,"); - add("-119,-57,82,-121,-47,-10,-139,-52,-35,-26,-26,124,"); - add("28,-11,166,165,60,53,-23,-27,123,-19,-27,133,"); - add("-49,-40,137,-121,-51,7,-58,0,-158,-127,-38,-102,"); - add("72,37,-48,110,57,-83,22,29,-151,-29,8,-149,"); - add("-73,-16,-111,-128,-46,-65,-134,-47,-73,-106,-57,89,"); - add("-119,-68,133,-79,-22,-93,-88,-24,-123,-86,-20,-158,"); - add("-74,-40,60,-104,-51,36,15,11,-34,105,55,-70,"); - add("40,33,-139,8,24,-185,-97,-38,-54,-122,-47,-84,"); - add("-136,-60,-25,-121,-62,56,-57,-38,119,-8,-19,140,"); - add("53,12,112,102,35,117,51,13,85,22,-10,161,"); - add("136,69,-54,9,0,39,-73,-51,134,57,9,131,"); - add("-80,-45,58,-83,-53,109,-76,-54,126,-40,-37,125,"); - add("-10,-27,141,-118,-50,-33,-83,-49,60,-26,-39,160,"); - add("-43,-39,111,5,-29,182,-3,-24,125,-70,-55,117,"); - add("-21,-37,139,21,-21,160,19,-20,146,3,-29,150,"); - add("9,-29,158,108,53,-2,74,56,-98,77,62,-118,"); - add("33,42,-131,48,52,-147,29,36,-118,66,56,-133,"); - add("81,63,-139,58,14,68,-45,-49,153,69,32,-2,"); - add("5,-4,34,-65,-58,148,-52,-49,128,35,12,22,"); - add("6,0,13,-36,-43,131,3,-27,132,-51,-50,126,"); - add("48,17,25,94,46,-11,111,64,-64,148,89,-103,"); - add("-51,-52,135,106,52,-17,93,65,-109,46,40,-98,"); - add("104,66,-102,60,44,-88,59,48,-118,7,33,-157,"); - add("61,47,-111,96,62,-119,45,40,-122,45,33,-83,"); - add("124,73,-132,-1,-12,72,-14,-25,114,85,32,18,"); - add("104,68,-154,13,-7,76,64,28,-15,60,14,63,"); - add("-60,-47,133,21,-19,153,-70,-34,34,1,-17,94,"); - add("169,50,93,-76,-32,11,-140,-45,-62,-77,-48,87,"); - add("-46,-28,50,-52,-44,112,-24,-34,123,-24,-34,117,"); - add("48,9,49,121,63,-59,141,74,-81,41,-4,97,"); - add("74,22,40,108,55,-61,56,6,82,71,52,-120,"); - add("92,12,116,74,35,-30,82,28,15,84,54,-109,"); - add("-55,-3,-90,-92,-25,-50,27,17,-35,-66,-7,-93,"); - add("27,15,-25,168,65,-10,-77,-16,-67,-89,-7,-146,"); - add("62,29,-26,97,33,19,105,56,-96,-22,11,-108,"); - add("61,32,-54,-91,-27,-41,30,18,-40,-51,-10,-57,"); - add("79,38,-48,-64,-18,-37,23,20,-72,30,34,-145,"); - add(""); - //add("/*6*/"); - add("232,1,18592,-4797,-23051,"); - add("-106,15,-88,-120,-24,-91,-119,8,-94,-118,7,-93,"); - add("-120,-52,-82,-108,20,-87,-97,76,-88,-109,63,-95,"); - add("10,142,-19,95,107,50,118,58,78,117,25,84,"); - add("129,55,90,-36,0,-28,-107,-30,-77,-120,-9,-89,"); - add("-118,13,-91,-134,35,-107,36,120,6,-13,12,-11,"); - add("-146,-1,-108,61,204,10,-49,-33,-30,-119,-65,-75,"); - add("-99,38,-78,-75,44,-61,-122,-40,-80,-111,-70,-66,"); - add("-120,-44,-76,-131,-23,-86,-92,-37,-57,-116,-80,-64,"); - add("-78,-127,-30,-86,-126,-34,-63,-120,-20,-133,-100,-68,"); - add("-47,-112,-9,-98,-97,-45,-110,-83,-54,-81,-130,-25,"); - add("-117,-86,-56,-123,-29,-71,-124,-22,-72,-145,-4,-88,"); - add("-117,-41,-63,-131,-11,-75,-123,-34,-66,-185,-57,-96,"); - add("-47,-75,-11,-128,-41,-65,-123,32,-77,40,107,0,"); - add("-100,58,-68,45,25,20,127,31,66,127,50,61,"); - add("118,67,55,-31,116,-41,72,59,30,131,18,74,"); - add("117,87,52,6,176,-30,138,9,81,129,-9,80,"); - add("77,116,25,78,118,27,64,119,19,56,148,9,"); - add("114,75,59,107,85,53,93,102,44,110,89,56,"); - add("63,156,17,62,136,21,-86,71,-66,-129,-7,-82,"); - add("-135,30,-90,-20,131,-30,76,119,32,95,108,47,"); - add("124,25,76,123,42,74,116,64,69,117,74,68,"); - add("122,39,77,132,36,85,29,140,4,8,153,-11,"); - add("81,116,43,89,110,51,116,51,75,100,96,62,"); - add("100,82,63,95,92,60,126,13,89,114,54,78,"); - add("104,83,70,107,77,73,122,28,89,119,30,88,"); - add("117,44,86,115,52,84,111,58,82,111,59,84,"); - add("110,66,82,109,62,83,115,26,92,106,29,84,"); - add("116,62,92,108,32,88,115,2,96,110,49,91,"); - add("106,67,87,105,65,88,107,57,90,101,75,86,"); - add("109,46,94,104,60,91,102,33,91,102,-62,96,"); - add("99,-71,94,20,-114,24,54,-82,54,102,-52,98,"); - add("111,0,105,59,-109,62,65,-115,69,63,-110,69,"); - add("63,-114,69,76,-102,82,93,-48,96,111,34,107,"); - add("62,101,55,41,106,33,51,178,40,49,-74,54,"); - add("47,53,45,60,125,53,28,146,21,13,151,6,"); - add("-26,132,-32,-7,147,-13,49,159,46,26,101,24,"); - add("100,19,104,106,7,112,93,80,97,94,61,99,"); - add("99,46,107,103,0,112,92,-59,102,79,-95,89,"); - add("102,-47,116,95,-44,108,27,-144,35,66,-107,79,"); - add("-26,-80,-28,-89,10,-101,-113,-40,-126,-79,-43,-87,"); - add("-25,-126,-21,-48,-117,-49,-96,-86,-100,-104,-7,-113,"); - add("-103,-7,-111,-104,22,-113,-109,-1,-114,-95,41,-103,"); - add("-39,-73,-36,47,-135,57,106,-18,112,49,35,51,"); - add("92,22,96,70,-108,81,83,-45,93,94,29,101,"); - add("111,-45,126,-51,-80,-51,-99,-57,-104,-78,-112,-76,"); - add("-68,-98,-65,17,-122,30,-25,-150,-12,-85,-55,-86,"); - add("-90,52,-101,-34,127,-48,-36,147,-52,-73,194,-92,"); - add("21,-74,27,-15,-191,2,-79,-92,-74,-104,-65,-102,"); - add("-102,-37,-100,-121,16,-124,34,-53,39,-61,-124,-48,"); - add("-100,-76,-92,-105,-15,-103,-110,-21,-105,-106,-32,-100,"); - add("-102,-61,-90,-104,-53,-94,-108,-63,-94,-102,-25,-93,"); - add("-101,-45,-88,-111,-79,-92,-100,-81,-81,-87,-94,-67,"); - add("-89,-135,-61,-38,-138,-15,-47,-141,-22,-114,-156,-77,"); - add("-40,-83,-22,-121,-73,-93,17,-1,14,130,-9,115,"); - add("-146,-136,-105,90,-8,80,-9,-55,1,-90,-119,-58,"); - add("-3,-143,23,17,-176,48,-104,50,-100,-46,-39,-32,"); - add("-109,-13,-91,-167,68,-154,-25,-111,0,-104,-104,-67,"); - add("-94,-101,-59,-84,-116,-46,-96,-102,-57,"); - add(""); - //add("/*7*/"); - add("154,1,26493,2257,-13893,"); - add("-76,-31,-149,-74,37,-134,-66,79,-108,57,125,126,"); - add("-2,122,18,-70,10,-127,-71,7,-130,-74,49,-125,"); - add("-55,104,-77,43,75,91,54,35,105,57,73,117,"); - add("53,89,117,73,-38,129,-4,82,10,35,49,76,"); - add("65,-40,116,5,32,15,-31,140,-26,-9,133,15,"); - add("53,62,116,26,133,85,38,28,81,59,-90,93,"); - add("25,88,73,47,-149,54,56,-117,82,48,-93,74,"); - add("42,-130,54,50,-135,71,65,-82,116,50,-45,94,"); - add("7,-114,-9,4,-113,-15,66,-64,125,45,19,101,"); - add("66,-38,135,57,-93,104,62,-52,127,54,-50,112,"); - add("33,-153,44,46,-120,83,52,-101,102,42,-120,79,"); - add("45,-118,87,46,-102,92,58,-44,133,58,-36,134,"); - add("57,-37,135,57,-22,139,54,-54,127,26,-133,49,"); - add("25,-75,56,18,-121,35,29,-156,57,6,-124,5,"); - add("-9,-102,-29,81,61,215,46,78,129,40,25,111,"); - add("57,3,156,39,94,117,26,50,77,42,-95,109,"); - add("33,-121,83,9,-151,16,29,-118,75,13,-155,32,"); - add("-4,-158,-18,-19,-112,-56,-28,-126,-82,14,-146,40,"); - add("-12,-145,-30,-32,-83,-88,-10,-97,-26,-50,-35,-138,"); - add("-38,-109,-101,-29,-130,-70,7,-157,32,-8,-110,-14,"); - add("-22,-139,-46,-22,-167,-40,-8,-126,-4,-26,-111,-54,"); - add("-57,-16,-152,-43,-3,-113,-56,-11,-142,-51,28,-136,"); - add("-43,22,-113,-17,22,-44,-20,-161,-27,-26,-159,-42,"); - add("-61,77,-162,-61,-39,-142,-50,59,-128,-32,100,-89,"); - add("-26,34,-66,-52,-93,-110,-56,-29,-123,-35,-99,-66,"); - add("-53,64,-130,-44,15,-99,-56,-73,-114,-34,-133,-54,"); - add("-13,-154,-5,-33,-74,-59,-56,70,-131,-55,59,-128,"); - add("-58,55,-130,-56,67,-126,-38,95,-92,-27,130,-73,"); - add("4,111,-6,-20,68,-47,-22,171,-65,-39,115,-88,"); - add("28,83,49,20,62,35,10,163,7,-47,142,-102,"); - add("-36,123,-79,-12,41,-25,-60,19,-119,-48,126,-100,"); - add("-59,63,-115,-4,145,-12,19,146,35,-8,159,-15,"); - add("-17,144,-31,-32,136,-60,-51,96,-94,-20,76,-35,"); - add("-5,39,-8,-65,-89,-125,-68,-15,-126,-73,10,-133,"); - add("-26,105,-43,53,108,101,61,93,116,55,87,108,"); - add("53,95,104,32,132,70,-50,137,-83,32,133,71,"); - add("38,140,87,23,98,55,49,127,109,6,116,26,"); - add("20,83,51,-86,28,-162,-47,53,-82,38,99,86,"); - add("20,88,52,"); - add(""); - //add("/*8*/"); - add("165,1,-3761,29749,925,"); - add("105,16,-88,20,5,-115,-80,-9,-37,-29,-3,-31,"); - add("-47,-4,-80,-110,-14,-41,-136,-19,81,-100,-17,132,"); - add("1,1,-30,72,13,-169,33,6,-71,95,14,-116,"); - add("-71,-8,-70,-163,-23,48,0,1,-106,9,2,-129,"); - add("-147,-21,-153,-110,-16,31,-7,-1,135,-53,-8,-61,"); - add("-122,-19,-35,-63,-10,95,83,11,213,-84,-12,-44,"); - add("-61,-9,-181,-128,-21,73,71,11,96,120,18,87,"); - add("71,9,180,-31,-5,-34,-70,-9,-133,-142,-22,-76,"); - add("-76,-13,72,82,11,161,14,1,95,-8,-5,121,"); - add("111,15,104,152,24,26,154,20,94,-47,-7,-9,"); - add("-156,-22,-41,-25,-8,124,-41,-6,-17,-91,-11,-125,"); - add("-40,-8,50,-29,-4,-16,-67,-7,-129,-78,-9,-150,"); - add("-110,-19,4,-113,-22,102,-96,-21,116,-46,-7,-35,"); - add("58,13,-93,118,23,-94,104,20,-112,24,7,-151,"); - add("-68,-11,-87,-130,-23,56,-120,-22,56,-114,-23,91,"); - add("-158,-31,75,-82,-16,16,15,-2,197,-113,-21,-44,"); - add("25,8,-118,19,7,-151,-71,-13,-140,-128,-25,-53,"); - add("-165,-34,-4,8,0,136,119,23,111,-68,-14,33,"); - add("-86,-18,2,-119,-25,-28,-119,-27,44,-30,-9,120,"); - add("205,42,85,-71,-15,8,-158,-33,-60,-80,-16,-72,"); - add("15,6,-141,110,26,-69,106,24,-103,-43,-8,-138,"); - add("-141,-31,34,-114,-26,87,-72,-16,-23,-46,-10,-142,"); - add("-126,-28,-99,-150,-36,4,32,7,90,-57,-14,93,"); - add("15,2,148,-64,-18,122,50,10,115,89,18,123,"); - add("30,3,144,-27,-10,120,-120,-32,101,30,2,119,"); - add("126,25,109,91,18,84,144,33,-15,-11,3,-107,"); - add("91,23,-68,12,8,-124,0,6,-162,115,26,-25,"); - add("-3,-2,51,-49,-16,139,46,4,146,133,26,68,"); - add("161,36,-43,69,8,150,100,19,16,75,13,51,"); - add("97,23,-71,60,8,68,132,27,-12,35,13,-141,"); - add("-62,-5,-151,42,10,-41,84,13,67,50,5,82,"); - add("-5,-8,156,61,14,-56,-16,6,-192,78,13,33,"); - add("36,0,138,75,7,128,133,27,-61,21,0,70,"); - add("44,-1,150,152,29,-54,167,24,52,92,10,74,"); - add("145,21,23,139,18,43,150,19,39,151,18,47,"); - add("11,7,-78,-117,-10,-95,-148,-15,-126,48,7,13,"); - add("141,14,96,37,12,-110,20,0,43,101,6,127,"); - add("105,9,88,154,15,60,145,17,13,77,17,-129,"); - add("66,14,-106,21,9,-121,-130,-8,-126,76,8,5,"); - add("41,9,-86,-23,5,-159,-33,-1,-85,-109,-11,-52,"); - add("25,6,-75,8,5,-139,-90,-10,-11,-124,-18,83,"); - add(""); - //add("/*9*/"); - add("141,-1,-21883,20471,1436,"); - add("65,72,-30,87,96,-65,100,105,-11,107,111,-3,"); - add("102,102,54,109,109,17,92,90,60,101,90,127,"); - add("-65,-68,57,36,31,57,109,106,20,79,70,98,"); - add("111,104,51,-8,-21,150,-38,-50,135,-36,-49,136,"); - add("-43,-57,130,-92,-95,31,-111,-115,37,-111,-111,-3,"); - add("-90,-84,-66,-92,-84,-97,-97,-100,-2,16,3,123,"); - add("93,86,76,54,39,143,-62,-78,107,-99,-108,41,"); - add("-99,-110,38,-57,-72,90,77,63,126,93,86,74,"); - add("105,111,-16,107,112,-13,106,102,39,99,89,73,"); - add("106,107,-9,100,116,-107,24,10,84,-82,-96,103,"); - add("-64,-76,75,-8,-30,135,-15,-42,160,116,101,83,"); - add("60,64,-21,94,106,-86,61,78,-109,63,76,-93,"); - add("73,86,-101,3,26,-151,0,22,-151,9,29,-154,"); - add("2,22,-155,-15,3,-139,-8,9,-146,7,24,-151,"); - add("28,40,-138,43,54,-139,91,89,-30,73,74,-77,"); - add("119,111,-7,88,89,-104,118,108,-11,24,31,-124,"); - add("-13,-1,-150,60,61,-116,100,93,-69,110,101,-66,"); - add("28,31,-127,-2,5,-150,26,30,-153,34,34,-165,"); - add("-125,-107,-95,-72,-60,-133,-3,0,-117,-97,-86,-61,"); - add("-81,-72,-89,-64,-57,-131,-43,-39,-140,-43,-40,-140,"); - add("-67,-63,-120,-81,-77,-105,-74,-71,-112,-82,-81,-130,"); - add("-45,-39,74,36,37,155,35,36,139,-75,-70,33,"); - add("-34,-31,69,-4,-3,150,54,51,132,31,29,142,"); - add("51,45,135,68,61,144,-91,-86,86,-2,-5,78,"); - add("4,-1,145,-62,-61,110,-67,-69,114,-13,-20,160,"); - add("38,29,127,56,45,132,16,4,152,38,22,175,"); - add("-80,-81,76,-9,-21,153,-37,-46,111,-91,-95,80,"); - add("-42,-32,-78,-24,-11,-141,0,11,-124,24,35,-148,"); - add("-54,-41,-140,-27,-15,-151,-85,-77,-108,9,12,-37,"); - add("14,18,-89,-17,-13,-76,-97,-91,-71,-97,-92,-70,"); - add("-97,-94,-70,-126,-123,-92,37,32,153,-110,-113,18,"); - add("-105,-107,-20,-102,-103,-53,-103,-107,-10,-100,-104,-41,"); - add("-103,-108,0,-99,-109,34,-103,-112,0,-102,-112,13,"); - add("-90,-102,61,-85,-99,76,-3,-10,140,58,57,128,"); - add("87,91,82,94,99,65,100,107,35,102,110,3,"); - add(""); - //add("/*10*/"); - add("132,1,25827,-2922,-14981,"); - add("-63,23,-112,19,140,5,21,141,11,-16,138,-50,"); - add("13,153,-1,15,150,2,6,149,-11,-3,144,-22,"); - add("16,158,7,42,141,56,-44,112,-86,-60,83,-109,"); - add("-75,-8,-126,-28,-102,-36,-4,-168,10,29,-144,65,"); - add("-51,-124,-70,-63,-96,-91,-77,-86,-116,-10,-125,1,"); - add("4,-160,31,-56,-106,-75,-92,-2,-147,-29,144,-68,"); - add("-75,45,-127,-81,15,-127,-33,114,-68,61,79,85,"); - add("42,105,52,77,107,108,-6,149,-27,-10,119,-28,"); - add("50,128,66,63,116,89,43,135,59,58,105,86,"); - add("82,146,124,-61,9,-101,-61,102,-105,-75,53,-123,"); - add("-69,72,-112,-53,112,-89,-48,117,-79,-64,75,-102,"); - add("-81,-47,-121,-42,124,-68,69,87,103,89,-54,137,"); - add("55,-52,87,80,8,126,72,-53,115,74,-45,120,"); - add("77,43,124,66,-102,111,43,-122,76,61,-53,103,"); - add("75,38,125,38,141,57,63,82,104,52,115,88,"); - add("20,146,31,1,150,0,-27,141,-45,-44,124,-75,"); - add("-68,67,-115,-74,-34,-125,-76,-10,-127,-81,22,-133,"); - add("-73,11,-119,-75,-29,-121,-79,18,-125,-87,6,-138,"); - add("-72,-3,-112,-84,-17,-131,-72,-76,-110,-85,-8,-128,"); - add("-84,18,-126,-83,27,-122,-79,62,-115,-46,119,-65,"); - add("-62,111,-87,-57,114,-77,-48,140,-63,17,126,30,"); - add("71,-46,100,74,-113,101,46,-90,63,68,-92,97,"); - add("80,-71,115,82,-11,122,81,24,124,77,22,118,"); - add("83,-36,125,78,45,123,79,29,125,80,20,129,"); - add("77,10,124,72,58,119,63,41,105,81,33,135,"); - add("38,-108,60,49,-123,78,73,5,124,53,-60,89,"); - add("42,-121,70,42,-135,71,20,-165,34,-5,-129,-7,"); - add("-5,-218,-5,50,-60,89,37,-137,69,31,-131,61,"); - add("-2,-151,4,-6,-157,-1,35,-133,73,10,-147,30,"); - add("52,-105,103,11,-115,32,-4,-145,7,-35,-179,-41,"); - add("-67,-3,-120,-71,-23,-124,-23,-150,-21,-35,-129,-43,"); - add("-10,-165,6,8,-149,38,1,-148,26,17,-139,57,"); - add("-25,-158,-14,-61,-75,-93,-72,30,-132,"); - add(""); - //add("/*11*/"); - add("133,1,29737,2888,-2716,"); - add("9,-113,-12,8,-138,-52,6,-140,-72,-2,-106,-100,"); - add("-2,-111,-113,-5,-99,-114,-5,-101,-110,-4,-106,-109,"); - add("-16,-34,-151,-6,-108,-107,-4,-123,-92,-4,-124,-82,"); - add("-10,-97,-118,1,-147,-41,-1,-134,-54,-18,-43,-138,"); - add("-15,-85,-133,-17,-73,-129,-13,-126,-116,-1,-136,-24,"); - add("-5,-142,-55,-5,-144,-46,-5,-143,-50,-6,-154,-42,"); - add("-20,-65,-126,-23,-73,-133,-11,-130,-64,-16,-117,-89,"); - add("-18,-115,-96,-18,-122,-91,-10,-146,-42,-19,-126,-84,"); - add("-15,-136,-61,-19,-130,-78,-8,-149,-12,-19,-137,-69,"); - add("-25,-105,-103,-24,-111,-94,-22,-131,-73,-26,-107,-100,"); - add("-31,-88,-120,-31,-93,-119,-21,-139,-52,-30,-107,-102,"); - add("-33,-90,-116,-33,-98,-110,-35,-84,-122,-34,-94,-108,"); - add("-38,-70,-134,-36,-100,-107,-31,-118,-80,-38,-108,-108,"); - add("-50,-131,-143,11,129,-8,-21,16,-85,-51,-87,-158,"); - add("-12,85,-78,-28,-11,-98,-44,-106,-121,-14,86,-78,"); - add("11,150,-16,9,150,-19,11,150,-8,11,150,-5,"); - add("19,146,27,-2,156,-48,19,137,34,-6,148,-55,"); - add("-10,124,-58,31,104,87,28,122,77,29,133,80,"); - add("43,39,151,41,13,150,34,-129,151,1,99,-15,"); - add("-14,144,-74,34,85,116,16,106,50,12,151,27,"); - add("9,148,24,24,72,85,40,15,160,31,36,124,"); - add("31,99,122,-1,135,-10,6,103,22,-5,70,-21,"); - add("-27,80,-116,-8,134,-29,24,93,101,33,40,138,"); - add("30,-79,128,48,-65,208,-16,34,-70,-32,86,-138,"); - add("11,125,52,32,29,145,28,59,129,17,117,89,"); - add("8,142,49,21,102,112,25,64,128,25,57,130,"); - add("7,141,61,19,104,114,22,-104,94,17,33,97,"); - add("19,84,121,14,168,114,17,44,107,0,140,42,"); - add("12,110,102,17,81,126,13,95,116,16,79,127,"); - add("17,69,139,9,106,103,17,75,150,-6,95,13,"); - add("3,124,86,0,119,72,3,113,91,7,106,117,"); - add("19,1,150,14,39,141,19,-8,148,18,-11,149,"); - add("13,33,146,5,87,123,5,77,128,14,7,148,"); - add(""); - //add("/*12*/"); - add("129,-1,17606,18970,15171,"); - add("-13,-69,100,24,-118,119,79,-124,60,75,-119,57,"); - add("88,-117,38,105,-103,1,120,-58,-71,115,-15,-117,"); - add("107,-39,-82,114,-100,-19,119,-75,-55,119,-64,-69,"); - add("111,-41,-90,109,-28,-102,103,-17,-111,72,31,-131,"); - add("75,26,-129,69,33,-132,71,28,-131,83,13,-127,"); - add("26,2,-40,-103,181,-91,-89,118,-32,-85,121,-42,"); - add("-65,119,-69,-79,119,-52,-55,115,-80,-90,101,-15,"); - add("-97,78,26,-117,33,112,-71,83,-19,27,21,-65,"); - add("43,18,-83,-112,123,-21,-104,-5,146,-111,83,31,"); - add("-87,114,-44,-49,113,-96,-21,93,-105,128,-44,-107,"); - add("73,-19,-72,88,-33,-72,52,40,-132,35,56,-132,"); - add("-61,93,-54,-129,77,65,-119,82,41,-103,112,-27,"); - add("-111,101,-2,-98,4,127,-60,-33,129,37,-112,118,"); - add("76,-104,52,43,-80,60,-175,159,-1,-94,108,-37,"); - add("-68,104,-66,-36,102,-106,-71,91,-44,-136,52,97,"); - add("-108,31,93,-127,86,30,-99,45,57,-105,116,-45,"); - add("-116,93,3,-111,99,-15,-114,71,31,-118,47,69,"); - add("-37,83,-81,105,-3,-124,117,-34,-92,23,30,-75,"); - add("-173,114,35,-11,82,-119,-5,84,-127,73,16,-120,"); - add("99,0,-126,103,-17,-107,50,18,-95,-136,110,-8,"); - add("-28,92,-120,-61,101,-93,-100,104,-49,-77,98,-69,"); - add("-117,55,57,-84,-14,134,-69,-10,106,-112,43,68,"); - add("-117,32,91,-63,-37,142,-40,-45,124,-33,-54,130,"); - add("-51,-57,155,-69,-21,116,16,-82,112,-33,-62,136,"); - add("6,-73,108,-68,-55,161,-91,-26,142,-28,-31,78,"); - add("65,-125,116,26,-99,118,-5,-63,97,3,-96,136,"); - add("113,-74,-14,126,-73,-31,128,-109,16,69,-71,25,"); - add("101,-143,90,74,-109,72,117,-96,4,112,-93,3,"); - add("122,-91,-11,116,-97,3,118,-79,-27,124,-87,-23,"); - add("119,-92,-12,104,-107,22,117,-94,-11,115,-91,-14,"); - add("122,-32,-100,119,-63,-59,6,-38,42,-102,-1,123,"); - add("-37,-76,143,51,-113,87,48,-116,92,70,-87,27,"); - add(""); - //add("/*13*/"); - add("124,1,19067,-11237,20253,"); - add("-33,-122,-37,-29,-151,-59,-10,-135,-68,31,-113,-96,"); - add("-3,-132,-75,-21,-117,-50,-58,-142,-31,-39,-139,-48,"); - add("-8,-125,-70,25,-112,-96,-3,-132,-82,61,-101,-125,"); - add("57,-50,-88,90,-39,-116,62,-82,-117,98,-12,-107,"); - add("113,52,-80,114,71,-69,115,51,-85,112,14,-108,"); - add("112,48,-86,99,84,-50,84,137,2,78,132,5,"); - add("79,128,-2,81,128,-4,66,137,16,73,133,6,"); - add("68,135,11,59,138,20,67,136,10,71,133,3,"); - add("77,128,-9,71,135,1,69,135,2,65,138,8,"); - add("63,138,7,66,137,4,74,132,-11,62,123,-2,"); - add("67,148,4,69,134,-8,66,137,-2,71,133,-13,"); - add("70,134,-12,64,138,-4,50,138,11,55,142,6,"); - add("15,140,50,55,141,4,81,114,-42,53,86,-22,"); - add("56,154,5,10,135,49,5,138,55,14,146,47,"); - add("79,50,-71,13,-135,-75,51,-82,-97,83,123,-46,"); - add("60,141,-11,13,136,44,-18,131,76,3,142,54,"); - add("22,147,34,18,146,35,14,147,40,-2,145,57,"); - add("-2,136,52,-8,136,58,-47,91,89,-15,145,67,"); - add("-63,151,124,-75,-67,64,-95,-104,75,-2,-149,-48,"); - add("-41,-140,-2,-54,-146,9,-100,-65,91,-94,-118,63,"); - add("-71,56,100,-64,-50,53,-14,-217,-65,-54,-64,35,"); - add("-33,-189,-35,-79,-71,59,-81,-136,36,-8,95,45,"); - add("-59,-48,45,-115,-224,35,-47,52,72,-109,-77,85,"); - add("-93,-85,64,-42,-128,-9,-26,-34,14,-77,54,103,"); - add("-96,-1,98,-95,-83,64,-107,-29,96,-115,-54,94,"); - add("-101,-38,85,-108,-40,91,-38,-156,-28,-71,-134,14,"); - add("-84,-126,28,-80,-121,25,-45,-139,-18,-10,-135,-50,"); - add("-26,-143,-40,-12,-139,-52,16,-129,-77,-24,-134,-40,"); - add("6,-139,-73,2,-130,-66,-41,-141,-31,-45,-126,-20,"); - add("-86,-125,20,-83,-112,23,-94,-127,23,-69,-137,-6,"); - add("-101,-89,49,-79,-92,25,-68,-146,-15,"); - add(""); - //add("/*14*/"); - add("122,1,14146,19873,-17463,"); - add("104,-90,-18,-83,-22,-92,35,-96,-78,124,-19,79,"); - add("34,103,143,90,-59,8,110,-101,-22,114,-79,6,"); - add("38,-117,-98,122,-132,-43,-14,-100,-120,73,-117,-66,"); - add("97,-107,-32,92,-115,-44,111,-100,-11,100,-112,-31,"); - add("95,-109,-32,129,-66,43,117,-85,15,108,-105,-13,"); - add("122,-84,22,126,-56,55,128,-50,65,124,-60,52,"); - add("109,-21,80,-26,124,104,-148,120,-13,56,19,71,"); - add("123,-63,49,59,-112,-61,78,-122,-52,112,-100,3,"); - add("123,-89,27,116,-101,10,61,-129,-71,121,-80,37,"); - add("112,-15,95,39,56,95,115,1,116,111,-11,102,"); - add("120,-40,81,112,-13,103,119,3,127,79,17,103,"); - add("127,-51,83,113,-91,28,118,-84,42,118,-83,43,"); - add("122,-71,62,115,-81,46,105,-30,89,100,-76,36,"); - add("25,-102,-77,-105,-3,-123,-105,13,-106,-64,-64,-135,"); - add("-67,52,-22,-93,123,22,-79,-2,-89,-140,23,-128,"); - add("-81,13,-73,-106,51,-61,-130,25,-112,-119,61,-63,"); - add("-113,41,-75,-90,-25,-115,-91,-16,-107,-52,-37,-88,"); - add("133,-120,16,74,-125,-45,2,-108,-101,-17,-89,-99,"); - add("-88,-30,-115,-106,89,-20,-124,123,-4,-101,92,-11,"); - add("-128,42,-82,-65,56,-8,45,91,128,-73,118,44,"); - add("-75,-7,-77,-47,-80,-121,-48,-27,-69,-113,7,-97,"); - add("-123,-9,-120,-108,79,-23,-159,95,-51,5,-137,-123,"); - add("-122,86,-27,-72,118,46,-148,21,-106,-146,127,-5,"); - add("41,-97,-56,72,-134,-63,-73,11,-52,-131,69,-45,"); - add("-89,124,40,-123,82,-26,-54,64,16,6,109,107,"); - add("-49,118,71,-87,119,44,-104,108,19,-96,105,23,"); - add("-69,120,62,-46,118,80,-34,117,89,-106,120,36,"); - add("-113,25,-66,-58,35,-10,-57,106,63,-108,106,23,"); - add("-116,100,11,-90,116,51,-50,111,78,-30,116,99,"); - add("-18,105,98,26,93,122,-20,107,102,-61,115,79,"); - add("-36,99,82,"); - add(""); - //add("/*15*/"); - add("125,1,-1369,25599,15582,"); - add("-20,-57,92,-68,-54,82,2,-61,99,-37,-16,22,"); - add("-100,-31,38,-10,-85,134,26,-58,95,-46,-77,115,"); - add("-69,-80,116,34,-51,81,137,48,-60,11,-18,29,"); - add("-57,-58,82,-68,-102,148,-8,-72,106,-43,-121,173,"); - add("63,41,-53,40,81,-116,76,85,-120,50,-47,75,"); - add("20,-62,93,45,-78,120,-71,-85,116,-66,-81,111,"); - add("56,-59,90,165,12,-4,137,10,-5,179,39,-45,"); - add("-9,-27,39,-83,-86,117,38,-81,116,105,-49,74,"); - add("34,-64,90,-22,-82,111,-3,-101,137,-99,-17,17,"); - add("-155,-4,-5,-140,-41,46,-127,-85,103,77,-13,24,"); - add("88,-67,94,-29,-83,107,-108,-65,76,-141,-42,42,"); - add("-111,-69,79,75,-53,75,202,7,6,82,-38,55,"); - add("115,-27,42,136,-25,40,204,73,-82,-53,-57,69,"); - add("-93,-72,86,-150,-12,6,-157,0,-10,-113,-56,61,"); - add("-88,-76,87,-105,-74,82,-96,-71,78,-147,-70,71,"); - add("56,-32,44,112,17,-11,108,55,-57,163,21,-12,"); - add("143,-28,44,105,50,-54,71,78,-90,165,19,-14,"); - add("136,-37,50,150,25,-23,162,43,-49,127,8,-6,"); - add("109,-13,17,169,11,-12,154,-12,15,143,34,-43,"); - add("126,40,-51,112,90,-113,-210,52,-62,51,85,-108,"); - add("113,70,-92,97,61,-79,47,88,-116,0,90,-117,"); - add("-95,69,-88,-143,26,-32,-149,-21,30,-109,7,-8,"); - add("53,94,-126,-68,83,-110,-171,63,-86,117,-4,5,"); - add("-23,73,-99,-29,82,-113,-91,80,-113,-134,48,-69,"); - add("-81,47,-67,-50,85,-123,-36,83,-120,-40,84,-123,"); - add("-91,65,-98,-114,49,-77,-131,10,-21,-170,-1,-8,"); - add("40,14,-19,158,50,-66,-58,48,-74,3,15,-24,"); - add("128,39,-52,79,68,-101,63,78,-116,60,76,-117,"); - add("10,69,-108,-137,20,-37,-150,3,-12,-151,2,-11,"); - add("-198,-25,27,48,56,-86,63,67,-102,116,55,-81,"); - add("73,86,-136,-130,13,-29,-172,-18,17,-125,4,-17,"); - add(""); - //add("/*16*/"); - add("107,1,-8155,28629,-3723,"); - add("43,22,74,114,43,87,145,42,14,39,-6,-131,"); - add("-6,-21,-148,-12,-24,-151,-31,-28,-139,-45,-33,-139,"); - add("-123,-45,-76,-72,-40,-127,-132,-55,-107,-93,-12,98,"); - add("-74,-20,6,-81,-15,60,-49,9,155,-49,7,153,"); - add("-17,-12,-53,-6,-18,-105,12,-19,-152,17,-19,-152,"); - add("-76,-38,-93,-155,-41,44,-84,-7,118,-71,-3,126,"); - add("-63,2,143,-30,12,149,-75,-6,125,-103,-19,106,"); - add("-136,-31,101,-16,-15,-73,31,-7,-125,82,8,-136,"); - add("74,5,-129,44,-8,-146,35,-12,-147,24,-16,-149,"); - add("-75,-40,-97,-153,-48,19,-124,-37,26,-124,-25,98,"); - add("-70,-3,130,-87,-6,156,-108,-36,9,-131,-53,-43,"); - add("-145,-48,26,-55,1,138,-46,7,166,-26,8,121,"); - add("-37,7,149,-13,15,152,41,34,148,-9,14,143,"); - add("35,29,142,108,52,114,-85,-25,61,-85,-21,96,"); - add("-99,-27,92,-83,-19,116,-72,-14,140,-20,5,146,"); - add("75,42,168,150,55,-9,-25,-22,-156,57,21,0,"); - add("115,40,-23,5,9,95,60,32,128,-63,-12,140,"); - add("52,26,98,134,46,-35,97,27,-97,155,43,-139,"); - add("47,9,-88,125,37,-72,145,44,-49,139,50,50,"); - add("140,47,24,142,44,-22,144,45,1,147,45,5,"); - add("142,44,11,142,40,-31,131,32,-77,69,7,-136,"); - add("-56,-26,-110,-156,-49,-36,-143,-44,-18,-138,-44,-21,"); - add("-157,-48,5,-91,-36,-72,53,10,-68,141,45,13,"); - add("149,46,9,140,43,3,135,34,-52,119,26,-86,"); - add("-104,-33,-24,-118,-38,-32,3,-15,-141,-15,-17,-108,"); - add("21,4,-18,108,45,108,134,33,-41,111,19,-114,"); - add("-69,-37,-145,-15,-19,-114,"); - add(""); - //add("/*17*/"); - add("87,1,-27734,11163,2489,"); - add("19,13,151,8,-8,114,41,66,143,46,87,101,"); - add("23,15,150,38,58,119,51,92,110,48,75,125,"); - add("23,8,151,18,-5,151,6,-45,174,-52,-82,-123,"); - add("-24,-76,54,7,-30,134,17,-24,175,11,-4,84,"); - add("6,-40,142,33,17,158,-21,-103,125,-4,-70,140,"); - add("15,-33,154,8,-44,138,29,4,148,30,2,146,"); - add("-31,-125,96,-43,-133,48,-13,-95,115,-1,-71,127,"); - add("28,-12,151,33,-11,167,-25,-118,92,-62,-109,-91,"); - add("-74,-129,-116,17,-35,132,34,9,138,41,21,144,"); - add("40,10,150,39,11,143,33,-10,147,25,-31,147,"); - add("56,28,174,28,1,102,54,47,133,73,59,183,"); - add("6,95,-110,5,98,-119,-18,56,-147,-34,13,-147,"); - add("-26,37,-156,35,105,-27,-16,51,-142,-12,48,-123,"); - add("-27,26,-158,-10,45,-116,2,88,-143,-4,36,-84,"); - add("21,121,-126,-13,-44,25,-7,-7,-22,-7,70,-162,"); - add("6,72,-113,2,72,-129,-1,62,-134,-11,32,-121,"); - add("-30,7,-168,-3,53,-136,23,103,-108,13,79,-121,"); - add("-15,27,-150,-4,57,-164,-12,16,-116,-19,16,-168,"); - add("-24,-5,-136,-8,24,-127,-17,10,-152,-24,-7,-150,"); - add("-40,-51,-137,-30,-23,-156,-24,-20,-131,-39,-54,-141,"); - add("-37,-48,-143,-37,-57,-129,-54,-104,-106,-60,-143,-8,"); - add("-25,-50,-49,-33,-45,-160,"); - add(""); - //add("/*18*/"); - add("90,1,-15425,23492,10498,"); - add("-58,1,-87,-121,-46,-78,-123,-67,-36,-115,-76,-3,"); - add("-150,-98,-10,-111,-74,-9,-121,-91,15,-123,-90,8,"); - add("-140,-124,52,-108,-53,-58,-57,-91,109,-74,-19,-79,"); - add("-202,-127,-49,-95,-37,-76,59,-35,174,-100,-68,-17,"); - add("-123,-69,-56,-124,-80,-33,-59,-94,103,93,5,144,"); - add("92,25,97,70,-9,131,68,-15,139,65,-15,129,"); - add("77,6,109,128,39,115,109,47,69,-18,-33,37,"); - add("-91,-67,-3,22,-20,72,98,36,73,82,22,76,"); - add("29,-15,71,-129,-75,-42,-126,-83,-24,-120,-48,-86,"); - add("-25,-57,73,105,25,106,117,75,26,167,94,60,"); - add("55,14,53,138,110,-15,49,4,59,-67,-110,114,"); - add("-92,-81,24,-126,-104,16,10,-33,73,137,84,35,"); - add("2,-23,44,-76,-97,73,64,-24,128,138,100,5,"); - add("95,91,-35,139,135,-62,-112,-42,-70,7,42,-68,"); - add("168,143,-38,-94,-29,-72,-151,-107,-5,9,60,-100,"); - add("90,96,-57,109,58,39,166,93,46,-59,6,-90,"); - add("-109,-28,-94,50,45,-17,31,65,-82,110,82,-11,"); - add("122,87,-4,-28,62,-160,-90,-9,-107,-88,-16,-91,"); - add("-105,-24,-103,-11,43,-103,-60,20,-130,24,49,-67,"); - add("143,89,25,-21,50,-137,-98,-37,-69,-144,-84,-36,"); - add("14,29,-42,109,90,-28,142,98,3,114,74,10,"); - add("124,88,-10,127,75,23,36,67,-95,60,35,11,"); - add("112,50,53,"); - add(""); - //add("/*19*/"); - add("80,1,1236,-19143,-23066,"); - add("4,78,-64,-62,100,-85,-134,51,-49,-152,-25,15,"); - add("-51,9,-9,-6,134,-109,-98,76,-64,-52,106,-86,"); - add("-10,119,-94,-47,131,-104,132,74,-53,141,-39,35,"); - add("96,-86,71,153,-52,48,130,28,-16,140,50,-31,"); - add("184,72,-44,56,78,-56,49,121,-89,49,124,-90,"); - add("106,96,-64,26,-76,59,-28,-145,107,111,52,-31,"); - add("185,68,-34,34,89,-64,6,109,-81,60,113,-78,"); - add("86,128,-85,-13,95,-70,101,119,-75,101,59,-31,"); - add("124,67,-35,156,44,-13,120,51,-21,106,128,-77,"); - add("17,-60,44,-97,-101,58,-37,-121,81,-126,-90,50,"); - add("-22,-105,73,-98,-107,66,-161,-157,98,46,101,-70,"); - add("-19,-20,13,-150,-66,33,-21,-114,83,18,-66,51,"); - add("-79,-123,84,-127,-26,8,17,-62,48,-18,-95,71,"); - add("-63,-151,111,6,-115,90,33,-74,61,33,-132,109,"); - add("18,-117,95,106,-71,68,134,-48,53,68,-90,81,"); - add("-95,-89,64,-140,-46,24,-125,-73,48,-147,-47,27,"); - add("-111,-103,77,4,-80,69,30,-117,102,69,-104,96,"); - add("78,-95,91,-65,-52,40,-140,-75,54,-125,9,-18,"); - add("-117,69,-70,-87,88,-83,-64,99,-91,-71,102,-93,"); - add("-83,99,-89,-74,93,-83,-53,144,-123,"); - add(""); - //add("/*20*/"); - add("78,1,24076,9507,-15164,"); - add("72,-75,68,83,5,136,48,63,117,50,69,127,"); - add("79,-2,131,85,-69,98,67,-149,17,60,-142,10,"); - add("52,-139,2,27,-144,-44,40,-147,-23,64,-144,24,"); - add("35,-135,-20,25,-149,-43,59,-44,76,45,108,140,"); - add("61,-134,28,0,-120,-68,28,-143,-33,12,-137,-55,"); - add("20,-151,-45,-23,-78,-82,-26,-143,-118,-68,139,-44,"); - add("-67,-35,-130,24,-122,-21,90,-111,95,35,-131,-5,"); - add("-23,-58,-67,-46,-79,-116,-75,-39,-142,-69,93,-69,"); - add("-87,51,-117,-59,-72,-129,-41,-96,-108,-47,-146,-139,"); - add("-34,112,-4,-4,168,69,-58,-22,-101,-27,-107,-90,"); - add("-54,-93,-123,-9,-131,-71,-31,-83,-82,-93,-54,-162,"); - add("-1,-132,-55,-55,5,-80,-40,175,12,68,60,126,"); - add("0,101,43,28,143,103,-85,78,-93,13,73,52,"); - add("75,54,137,65,-48,78,35,93,96,45,111,120,"); - add("71,12,116,83,-91,88,54,-93,43,68,62,137,"); - add("8,122,73,-16,158,51,-19,113,25,3,134,74,"); - add("-11,130,50,-77,145,-48,-38,135,11,-128,111,-146,"); - add("-35,5,-54,-60,122,-28,-72,141,-35,-64,134,-25,"); - add("-26,135,36,23,98,92,-11,145,69,-46,146,16,"); - add("-67,132,-25,"); - add(""); - //add("/*21*/"); - add("83,1,2308,-19901,-22330,"); - add("-8,114,-102,37,64,-52,88,-4,12,15,49,-40,"); - add("143,-68,75,129,-20,33,58,130,-108,117,79,-53,"); - add("13,52,-44,159,-88,97,48,-95,90,-6,-118,104,"); - add("58,-104,101,115,-73,82,56,-86,87,28,-109,103,"); - add("-44,-49,39,-48,15,-21,137,-79,94,23,-106,102,"); - add("64,-21,31,128,-64,81,82,-62,72,125,-95,113,"); - add("111,-64,83,114,-43,62,54,-65,75,180,-33,68,"); - add("104,-70,91,75,-72,87,52,-95,106,89,-78,99,"); - add("92,-69,91,5,-84,88,28,-42,50,48,-41,54,"); - add("4,-88,93,43,-78,93,-69,-50,36,-151,-62,32,"); - add("-151,13,-47,-142,-55,28,-128,-40,15,-81,-36,22,"); - add("-166,-20,-10,-139,5,-32,-122,48,-75,-90,81,-102,"); - add("-75,81,-98,-121,75,-99,-19,93,-100,-36,101,-109,"); - add("-26,116,-123,95,51,-36,-142,51,-74,-6,106,-106,"); - add("64,76,-66,-8,10,-11,-117,26,-43,-130,40,-58,"); - add("-86,73,-83,130,90,-69,113,80,-60,71,52,-39,"); - add("-183,-124,91,-130,-69,48,-122,-15,-2,-89,-14,2,"); - add("-131,22,-38,101,77,-61,147,37,-17,75,28,-16,"); - add("-148,29,-47,47,27,-20,-128,29,-44,-120,64,-75,"); - add("-75,86,-89,-59,105,-105,-82,82,-84,-50,84,-81,"); - add("-93,114,-114,49,50,-39,"); - add(""); - //add("/*22*/"); - add("75,1,27917,-4121,-10180,"); - add("-55,-66,-125,-56,-60,-126,-57,-37,-134,-56,-23,-138,"); - add("-57,-18,-139,-57,-16,-138,-52,10,-134,-62,-21,-142,"); - add("-61,-38,-134,-55,13,-137,-48,51,-133,-62,-38,-130,"); - add("-64,-61,-123,-62,-52,-121,-63,-24,-134,-50,5,-112,"); - add("41,208,16,8,151,-34,46,99,69,64,39,130,"); - add("58,-28,139,58,-13,139,55,6,125,62,60,126,"); - add("35,106,46,37,122,49,42,130,59,62,14,144,"); - add("57,36,129,58,46,132,53,31,124,56,17,137,"); - add("49,109,92,42,-55,128,5,-142,61,33,-69,114,"); - add("52,21,133,54,10,146,53,21,139,49,-6,144,"); - add("49,22,134,52,36,139,37,135,61,50,96,115,"); - add("46,11,137,45,32,130,49,64,129,44,70,117,"); - add("32,-31,117,40,-15,136,44,24,140,45,29,144,"); - add("27,-48,110,-1,-141,51,9,-110,80,19,-109,115,"); - add("9,-45,53,-52,-16,-181,-41,3,-146,-48,-63,-137,"); - add("-36,-68,-93,-17,-140,4,-49,-31,-150,-46,-12,-146,"); - add("-49,-24,-145,-48,-52,-130,-49,-60,-128,-51,-35,-140,"); - add("-46,9,-142,-41,48,-142,-48,-18,-133,-52,-9,-148,"); - add("-52,-31,-132,-42,-26,-108,"); - add(""); - //add("/*23*/"); - add("73,1,11139,23963,-14202,"); - add("89,-95,-89,96,-86,-67,88,-87,-74,62,-93,-103,"); - add("27,-75,-102,-2,-91,-146,41,-93,-115,103,-92,-64,"); - add("82,-97,-84,49,-95,-108,72,-97,-91,71,-97,-90,"); - add("86,-97,-78,85,-98,-77,102,-97,-62,46,-94,-100,"); - add("21,-93,-116,65,-102,-94,106,-97,-53,82,-103,-79,"); - add("46,-100,-102,94,-101,-63,99,-102,-60,50,-103,-98,"); - add("-12,-80,-115,-153,136,60,-137,87,12,-101,-27,-114,"); - add("-59,-43,-100,5,-82,-103,-106,161,132,58,36,92,"); - add("-16,109,132,-15,93,115,18,72,113,-37,101,112,"); - add("-80,99,76,-103,98,60,-102,95,58,-98,96,63,"); - add("-108,86,43,-123,40,-33,-120,-28,-129,-46,-66,-128,"); - add("-22,-79,-126,-11,-17,-32,10,103,152,-23,94,117,"); - add("-41,96,110,-32,94,113,-21,90,119,-28,91,115,"); - add("-49,95,107,-44,93,110,-39,90,110,-28,92,123,"); - add("-42,94,116,-47,86,103,-77,88,84,-61,43,25,"); - add("-122,144,145,-50,96,124,-25,80,115,-34,76,105,"); - add("-87,97,101,32,59,126,80,-38,-4,18,-93,-149,"); - add("66,-71,-71,143,-69,-8,122,-18,64,55,-58,-55,"); - add(""); - //add("/*24*/"); - add("68,1,24092,5088,-17137,"); - add("14,-98,-10,-5,-145,-48,33,-140,7,93,-40,121,"); - add("96,-9,134,49,-171,25,57,-37,72,72,-13,102,"); - add("56,-137,47,123,-90,158,-21,70,-12,-5,154,32,"); - add("54,76,103,63,-11,91,88,-70,116,54,-134,47,"); - add("83,-56,112,82,-37,119,74,-87,95,36,-142,21,"); - add("41,-143,30,42,-141,33,-57,-49,-101,-54,145,-53,"); - add("-54,139,-51,-58,116,-63,-56,-80,-107,-75,2,-114,"); - add("-74,-50,-126,-60,146,-55,-78,-17,-121,-65,-72,-115,"); - add("-30,-130,-74,58,-132,56,28,-144,10,-1,-148,-32,"); - add("-21,-132,-58,-60,-86,-105,-70,-71,-115,-78,-52,-121,"); - add("-71,72,-88,-25,-40,-43,3,-135,-19,-55,-11,-80,"); - add("-62,126,-66,-30,143,-15,18,145,53,41,111,80,"); - add("-43,155,-30,-89,144,-92,-48,-107,-90,-25,-135,-62,"); - add("-6,-187,-45,-28,47,-29,-26,172,-2,-61,91,-64,"); - add("-61,132,-55,-17,146,9,25,128,63,-10,163,25,"); - add("4,129,36,30,118,71,-41,143,-19,15,171,66,"); - add("51,99,98,43,85,85,56,91,104,"); - add(""); - //add("/*25*/"); - add("68,1,-3077,27485,11624,"); - add("-135,-30,35,-65,39,-111,-105,10,-54,-99,-64,121,"); - add("-154,-21,2,-120,1,-38,-66,-57,110,-20,0,-4,"); - add("-33,53,-136,-80,19,-73,-139,-60,93,-102,32,-111,"); - add("-81,-55,100,-91,-36,52,-127,-52,72,-35,8,-32,"); - add("-7,58,-140,67,56,-108,-25,45,-117,-63,49,-144,"); - add("-114,16,-88,21,-24,67,-45,-62,133,-100,18,-85,"); - add("-92,-30,34,-25,-40,85,-48,-17,20,-111,-25,13,"); - add("-18,-25,52,131,3,50,151,20,17,116,-18,89,"); - add("-92,-52,85,59,-27,87,-70,-19,17,-141,-8,-40,"); - add("-184,-28,-14,47,-17,60,159,-3,75,33,-37,97,"); - add("90,-9,58,-7,-32,70,-65,-57,100,-173,-51,44,"); - add("79,-27,92,165,9,44,126,-28,110,44,-40,104,"); - add("116,-19,81,130,-23,95,170,15,27,110,36,-41,"); - add("101,29,-31,152,19,8,146,34,-28,138,43,-54,"); - add("144,30,-24,160,37,-36,77,51,-91,115,46,-73,"); - add("38,28,-52,37,37,-73,19,40,-85,-72,46,-121,"); - add("-70,39,-109,-20,60,-144,37,49,-104,"); - add(""); - //add("/*26*/"); - add("58,1,-26874,10130,8671,"); - add("-30,19,-117,-23,66,-151,-42,6,-144,-51,-24,-138,"); - add("-43,-88,-36,31,-48,163,11,-85,140,-45,-130,7,"); - add("-25,-118,58,4,-100,125,-32,-83,-7,-62,-49,-143,"); - add("-43,6,-149,-37,19,-145,-34,20,-136,-35,25,-152,"); - add("-32,27,-147,-55,-103,-67,2,-78,105,18,-88,166,"); - add("54,57,120,44,9,138,34,-28,142,40,-11,145,"); - add("50,23,132,51,8,154,28,-48,138,-3,-114,107,"); - add("-6,-95,79,34,16,85,63,116,69,64,135,53,"); - add("68,67,128,18,-60,109,53,-3,152,69,87,106,"); - add("54,3,144,53,-1,142,48,-14,141,27,-65,128,"); - add("48,29,96,70,121,68,2,113,-98,-17,86,-124,"); - add("-46,19,-139,-52,52,-189,58,60,97,-4,42,-55,"); - add("-57,-7,-146,0,99,-97,-7,69,-95,-41,28,-142,"); - add("-35,39,-140,-28,57,-142,-55,-27,-132,-47,19,-160,"); - add("-67,-83,-107,"); - add(""); - //add("/*27*/"); - add("56,1,12962,21402,-16551,"); - add("83,-38,16,93,-94,-47,24,-103,-113,56,-107,-91,"); - add("92,-105,-58,75,-108,-76,119,-90,-15,74,-104,-67,"); - add("76,-102,-64,114,-19,69,123,34,142,74,-101,-62,"); - add("123,-89,-5,138,-68,34,93,-120,-65,-16,-90,-120,"); - add("45,-102,-82,78,-121,-75,-106,20,-66,-130,85,-8,"); - add("-111,-5,-96,-35,58,38,51,73,126,74,50,120,"); - add("-52,98,73,-114,32,-57,-59,-67,-127,-156,66,-47,"); - add("-124,18,-77,-72,-56,-123,-64,-63,-122,-78,-53,-119,"); - add("-108,-43,-130,-113,119,50,-117,97,24,-127,81,-1,"); - add("-135,60,-29,-130,-6,-100,-136,31,-61,-222,90,-51,"); - add("53,27,67,-12,111,120,-41,101,89,-122,116,52,"); - add("50,-4,30,133,-79,0,125,-16,70,73,54,116,"); - add("107,29,113,63,62,122,53,69,124,39,77,125,"); - add("17,88,122,19,86,122,28,80,125,"); - add(""); - //add("/*28*/"); - add("49,1,-6596,29135,-2761,"); - add("64,5,-105,143,26,-49,-45,-23,-137,-7,-11,-80,"); - add("-52,-24,-120,-117,-14,109,-4,-7,-48,12,-16,-167,"); - add("-112,-12,117,-20,-17,-107,15,-13,-142,-115,-29,-16,"); - add("-102,-10,120,-70,-4,110,64,35,178,-97,-24,-2,"); - add("-46,4,143,-51,3,152,-58,-16,-15,11,-11,-139,"); - add("-6,-17,-145,-41,-26,-149,-146,-33,37,-68,-3,132,"); - add("2,16,151,51,28,150,21,17,128,12,17,157,"); - add("-43,0,130,-45,0,144,64,25,116,130,38,77,"); - add("128,36,64,141,33,-25,-48,-21,-136,56,7,-87,"); - add("145,32,-32,156,37,20,155,37,21,5,-7,-104,"); - add("-96,-31,-111,-131,-29,5,-136,-35,-40,-164,-37,32,"); - add("-15,-13,-109,72,4,-146,157,33,-47,128,29,-12,"); - add(""); - //add("/*29*/"); - add("50,1,-2179,24668,16933,"); - add("-94,-47,56,-114,2,-19,-121,-63,74,-71,-57,72,"); - add("55,-51,81,-74,-79,100,-74,-24,23,-140,1,-23,"); - add("-215,-15,-16,15,-80,115,25,-50,74,-131,-82,90,"); - add("69,-50,81,176,-48,94,-77,-77,92,-116,-97,110,"); - add("78,-13,30,150,24,-7,-7,-19,24,-155,-21,3,"); - add("-117,-60,58,-114,-68,70,-67,-96,113,136,-15,44,"); - add("-56,-41,42,101,-3,22,-24,-38,44,40,-22,35,"); - add("140,9,12,156,30,-14,130,61,-59,134,30,-19,"); - add("124,54,-53,169,33,-22,148,16,-3,87,67,-77,"); - add("60,91,-113,54,87,-110,-12,100,-135,4,79,-107,"); - add("-34,87,-123,50,59,-77,130,54,-61,66,69,-90,"); - add("-38,83,-120,-40,70,-104,-66,70,-108,-232,-9,-14,"); - add("-56,48,-76,"); - add(""); - //add("/*30*/"); - add("50,1,-8496,-28645,2696,"); - add("6,7,97,49,0,144,24,8,146,-32,25,135,"); - add("-71,36,135,-115,45,86,-123,47,78,-138,48,41,"); - add("-135,49,46,-138,49,36,-143,49,26,-145,47,-16,"); - add("-142,48,4,-141,51,18,-144,51,5,-134,43,-34,"); - add("-154,58,22,-65,9,-110,10,-22,-149,67,-40,-132,"); - add("140,-51,-5,133,-47,2,131,-52,-59,147,-52,-17,"); - add("62,-38,-146,114,-35,26,94,-18,115,144,-49,-11,"); - add("-14,-13,-167,-62,6,-134,96,-33,-22,-1,-9,-91,"); - add("43,-21,-74,-3,-8,-95,16,-15,-117,27,-18,-104,"); - add("129,-41,-1,104,-23,110,-59,29,117,5,7,92,"); - add("-49,28,130,53,-10,69,122,-30,76,62,-26,-69,"); - add("82,-16,90,54,-17,-7,-33,-5,-145,-65,6,-150,"); - add("110,-37,-35,"); - add(""); - //add("/*31*/"); - add("48,1,-16082,-24523,6323,"); - add("62,-6,135,71,-10,133,70,-10,134,98,-29,121,"); - add("35,19,149,50,7,135,-18,47,120,-72,37,-32,"); - add("-70,7,-129,-108,41,-100,-120,59,-71,-114,52,-85,"); - add("-119,59,-75,-119,66,-48,-126,76,-37,-158,98,-42,"); - add("-90,76,48,-125,77,-41,-60,16,-96,-79,27,-111,"); - add("6,-32,-100,10,-53,-177,66,-69,-86,106,-91,-66,"); - add("77,-31,92,56,6,173,62,-71,-105,26,-52,-137,"); - add("124,-87,-10,104,-47,95,106,-45,107,63,-54,-47,"); - add("-33,17,-21,-78,27,-102,-70,21,-104,-120,44,-157,"); - add("127,-72,60,-25,-5,-96,-64,3,-173,-15,-21,-138,"); - add("61,-36,23,33,3,116,90,-31,126,78,-22,127,"); - add("38,8,137,98,-37,112,48,5,145,"); - add(""); - //add("/*32*/"); - add("48,-1,-13245,26217,-6103,"); - add("-33,17,145,9,34,134,88,65,92,-23,16,132,"); - add("-12,24,141,56,55,134,71,62,134,67,53,99,"); - add("20,37,146,-27,10,130,31,23,44,30,2,-71,"); - add("45,45,128,43,-2,-129,7,-27,-165,-8,-15,-61,"); - add("47,61,209,-28,10,131,-81,-16,134,-34,-3,80,"); - add("147,46,-148,50,-2,-145,-7,-31,-150,-67,-54,-119,"); - add("-76,-59,-114,-44,-49,-140,20,-21,-151,57,0,-131,"); - add("122,46,-65,113,36,-81,117,32,-108,125,38,-90,"); - add("10,-8,-59,-144,-53,65,-133,-61,10,-154,-69,24,"); - add("-2,-31,-133,-11,-33,-121,-82,-67,-111,-15,-28,-88,"); - add("70,3,-126,39,-12,-127,20,0,-39,-135,-43,95,"); - add("-98,-23,100,-103,-25,110,-57,2,125,"); - add(""); - //add("/*33*/"); - add("47,1,-6930,29187,-252,"); - add("-51,-13,-133,84,20,-8,117,26,-82,65,13,-132,"); - add("-2,-5,-157,-116,-27,-23,-134,-30,78,-112,-25,89,"); - add("-11,1,173,-70,-16,98,-136,-33,52,-146,-37,22,"); - add("-139,-36,-46,-134,-35,28,-161,-44,34,-27,-6,117,"); - add("-79,-21,134,90,24,168,-115,-32,93,2,-2,158,"); - add("22,5,108,34,6,130,-10,-5,92,109,26,166,"); - add("-73,-24,108,-11,-8,138,67,12,154,164,41,55,"); - add("91,26,-33,146,35,46,85,27,-99,66,22,-142,"); - add("32,14,-143,-39,-5,-156,-64,-13,-131,-91,-20,-132,"); - add("-61,-15,-91,53,16,-144,-4,1,-154,36,9,-107,"); - add("132,34,-37,32,8,-118,82,20,-41,55,14,123,"); - add("133,32,-108,101,24,-60,"); - add(""); - //add("/*34*/"); - add("48,1,1042,29488,5419,"); - add("98,-20,87,52,-28,136,48,-30,145,90,-18,74,"); - add("119,-22,80,56,21,-116,10,26,-136,46,1,-20,"); - add("77,-17,65,58,4,-37,18,-24,117,-127,-21,144,"); - add("-84,-16,96,66,-25,107,145,9,-82,87,-4,-10,"); - add("-100,-22,137,57,-12,41,-157,-3,54,75,-34,135,"); - add("146,-18,44,54,-16,58,120,-27,82,3,44,-197,"); - add("-15,34,-151,32,26,-132,-23,34,-158,6,27,-135,"); - add("-22,32,-159,62,22,-133,69,16,-114,-170,29,-92,"); - add("-124,18,-61,-124,26,-103,-78,29,-141,-134,10,-20,"); - add("-23,-23,141,58,-27,135,68,-27,132,-9,-7,38,"); - add("-96,31,-142,-74,27,-129,-76,1,11,-52,-14,94,"); - add("-74,27,-137,-106,-7,63,-63,-14,94,"); - add(""); - //add("/*35*/"); - add("44,-1,14587,-2200,26122,"); - add("18,-53,-14,-39,-136,9,-28,-156,1,7,-151,-19,"); - add("52,-138,-43,34,-136,-35,-65,-137,21,28,-129,-31,"); - add("52,-143,-48,40,-135,-40,75,-119,-60,98,-83,-68,"); - add("86,-101,-64,19,-146,-33,37,-140,-44,83,-113,-67,"); - add("-4,-196,-31,100,-60,-69,118,-90,-87,54,91,-17,"); - add("-44,128,50,-47,126,49,-53,138,54,-57,134,55,"); - add("-15,150,31,-10,135,26,-63,145,57,-85,114,65,"); - add("-118,38,73,-68,131,56,69,122,-25,18,132,6,"); - add("-48,139,43,18,150,5,-67,130,52,3,147,12,"); - add("-9,143,18,-54,138,43,-47,140,37,-31,192,31,"); - add("-63,-85,29,-21,-147,1,-15,-153,-4,"); - add(""); - //add("/*36*/"); - add("44,-1,15944,24781,-5628,"); - add("93,-52,33,124,-87,-25,126,-79,19,127,-81,15,"); - add("127,-78,31,126,-81,22,126,-81,26,115,-62,80,"); - add("121,-74,51,111,-60,83,122,-74,64,118,-78,32,"); - add("107,-60,81,101,-54,99,119,-77,53,109,-66,77,"); - add("84,-39,121,67,-26,127,73,-22,171,52,-52,-63,"); - add("-4,-26,-148,-53,14,-135,-74,29,-129,-81,36,-126,"); - add("-113,69,-72,-121,88,-11,-87,45,-87,-77,36,-94,"); - add("-102,53,-98,-84,33,-122,-109,58,-87,-116,73,-41,"); - add("-107,52,-101,-84,68,40,-92,63,-6,-26,-2,-86,"); - add("-130,82,-29,-117,83,11,-119,89,37,-124,82,-1,"); - add("-123,85,16,-125,86,20,-122,95,65,"); - add(""); - //add("/*37*/"); - add("44,1,6601,28935,4379,"); - add("16,-21,118,74,-36,115,54,-21,53,5,-26,150,"); - add("77,-36,110,77,-8,-64,63,-35,120,137,-8,-153,"); - add("99,-9,-94,-67,34,-105,-78,32,-79,1,17,-112,"); - add("-95,35,-77,-28,26,-131,-93,35,-87,-13,23,-140,"); - add("-53,31,-142,-50,24,-95,-39,28,-148,-21,25,-161,"); - add("-7,20,-157,6,15,-149,-10,18,-150,-12,18,-148,"); - add("-31,21,-151,-53,22,-115,-115,35,-98,-143,30,10,"); - add("-62,2,131,40,-23,150,77,-27,112,14,-20,162,"); - add("-14,-14,160,-51,-2,116,-35,-8,136,20,-18,110,"); - add("-6,-21,176,29,-27,157,59,-32,142,15,-21,127,"); - add("45,-28,124,126,-39,69,80,-10,-54,"); - add(""); - //add("/*38*/"); - add("42,-1,-10564,27211,-6925,"); - add("-102,-15,98,-92,-3,131,66,56,126,44,48,128,"); - add("-57,9,136,-104,-63,-95,-54,-66,-186,-40,2,75,"); - add("9,41,155,35,51,160,133,62,44,-1,29,132,"); - add("-131,-12,184,91,59,109,63,45,100,124,63,73,"); - add("24,-12,-107,-3,-29,-133,85,0,-151,111,20,-101,"); - add("62,43,91,5,40,175,101,33,-17,61,-4,-125,"); - add("29,-22,-150,4,-30,-141,29,-27,-165,44,-16,-138,"); - add("31,-22,-139,26,-52,-249,-70,-3,91,-103,-4,137,"); - add("-17,20,107,-68,9,145,-127,-29,83,-63,-37,-57,"); - add("112,8,-146,-59,-26,-18,-81,-51,-84,-38,-43,-113,"); - add("-39,-46,-124,"); - add(""); - //add("/*39*/"); - add("42,-1,15744,-1075,25514,"); - add("6,-136,-9,63,-186,-49,95,83,-55,94,90,-55,"); - add("119,-70,-79,97,-30,-63,12,-169,-17,55,17,-35,"); - add("-7,158,13,95,44,-59,122,-38,-82,132,139,-81,"); - add("-154,62,105,36,92,-19,83,111,-51,82,122,-51,"); - add("58,107,-36,70,141,-44,14,129,-6,26,143,-16,"); - add("116,32,-79,133,71,-91,-25,92,18,-136,-72,93,"); - add("-92,61,63,-65,100,44,-74,99,49,-106,9,71,"); - add("-92,63,61,-106,-54,69,-100,-66,66,-117,11,75,"); - add("-123,-63,78,-116,-49,73,-53,-98,33,-59,-142,36,"); - add("-45,-145,26,35,-135,-25,-5,-167,0,-37,-133,19,"); - add("-39,-149,18,"); - add(""); - //add("/*40*/"); - add("41,-1,10098,22921,16512,"); - add("73,-48,22,138,-59,-3,139,-57,-9,146,-60,-11,"); - add("142,-45,-30,126,-12,-66,134,-54,-16,141,-51,-25,"); - add("138,-54,-20,147,-37,-50,94,-98,68,58,-99,93,"); - add("28,-94,108,-126,-8,97,-117,-8,91,-8,-77,107,"); - add("-15,-95,133,-18,-79,114,-148,-47,156,50,10,-45,"); - add("121,26,-112,31,60,-98,25,112,-163,21,49,-78,"); - add("108,22,-104,142,-26,-64,12,61,-90,-98,100,-65,"); - add("-59,95,-88,-67,119,-116,-45,3,27,-138,24,63,"); - add("-147,67,8,-111,47,11,-158,44,44,-137,49,23,"); - add("-164,88,-15,-109,6,60,-145,39,38,-141,48,21,"); - add(""); - //add("/*41*/"); - add("41,1,13989,-2192,-26448,"); - add("86,-38,49,159,11,84,-19,-147,3,-25,-168,2,"); - add("103,-47,60,110,-69,67,65,-124,49,84,-90,56,"); - add("118,-11,68,123,-16,72,99,59,50,-6,147,-20,"); - add("43,4,25,33,-150,35,103,-59,67,125,-26,76,"); - add("126,17,72,128,20,76,129,3,77,96,-39,64,"); - add("-67,-118,-28,-129,-48,-73,-115,-87,-58,-94,-19,-54,"); - add("-126,-33,-70,-108,-70,-55,-133,3,-77,-126,3,-73,"); - add("-125,47,-77,-109,65,-69,-126,46,-76,-104,90,-67,"); - add("-74,114,-54,-136,14,-74,-116,80,-71,47,156,9,"); - add("-83,70,-51,-84,109,-55,3,156,-13,72,103,29,"); - add(""); - //add("/*42*/"); - add("42,-1,119,4674,29633,"); - add("-31,-95,15,-26,-156,24,18,-132,19,-62,-159,23,"); - add("-136,104,-15,-64,53,-8,-123,30,-5,-88,126,-20,"); - add("-38,71,-11,-139,147,-25,-6,-84,13,-198,-34,1,"); - add("59,0,1,140,-44,10,126,-68,12,76,-142,22,"); - add("77,-71,11,119,-34,6,90,-119,17,-168,-97,12,"); - add("162,-8,2,59,-58,8,85,-120,15,-8,-136,17,"); - add("-64,-114,14,-133,-14,1,-143,29,-4,5,-38,4,"); - add("141,-66,9,144,-85,10,53,-82,9,12,12,-1,"); - add("65,176,-20,5,123,-15,18,141,-17,-3,172,-22,"); - add("-15,165,-22,-40,106,-15,22,154,-22,-38,130,-19,"); - add("37,142,-22,"); - add(""); - //add("/*43*/"); - add("38,-1,16496,-5129,24527,"); - add("30,-143,-51,63,-127,-70,-14,-142,-22,-2,-152,-34,"); - add("-16,-147,-24,6,-147,-40,-37,-135,-8,-79,-127,21,"); - add("-32,-147,-17,40,-121,-59,23,-149,-56,4,-137,-41,"); - add("-17,-147,-30,65,-116,-79,-4,-132,-36,-3,-139,-41,"); - add("80,-8,-57,66,36,-35,90,-60,-82,-28,223,88,"); - add("-65,92,72,4,149,41,4,148,40,24,146,23,"); - add("-14,143,49,31,146,18,82,121,-26,40,144,9,"); - add("-26,133,51,-64,103,69,-7,139,38,15,147,24,"); - add("-7,146,38,-7,149,37,-52,127,62,-73,108,73,"); - add("-84,19,60,"); - add(""); - //add("/*44*/"); - add("38,-1,18721,21147,10116,"); - add("-41,87,-107,-98,62,52,-143,106,36,-110,75,41,"); - add("-97,105,-49,-39,91,-123,-46,84,-102,-82,96,-61,"); - add("-35,-57,189,-109,39,111,-41,-10,94,-11,-64,155,"); - add("88,-98,52,-75,4,120,98,-117,73,-45,9,59,"); - add("-82,2,132,31,-83,115,63,-100,91,55,-99,103,"); - add("60,-102,97,96,-108,48,92,-108,53,108,-100,10,"); - add("112,-125,47,61,31,-157,50,-8,-69,81,-13,-111,"); - add("107,-67,-56,78,-43,-52,35,42,-143,60,12,-128,"); - add("7,52,-114,-103,91,4,-42,103,-130,-71,104,-81,"); - add("-14,51,-79,"); - add(""); - //add("/*45*/"); - add("36,1,-7108,28862,-4057,"); - add("112,21,-44,141,26,-58,70,-2,-127,59,-8,-140,"); - add("41,-15,-162,-132,-43,-72,-146,-39,-28,-93,-43,-120,"); - add("-79,-41,-127,-101,-41,-90,-99,-46,-118,-72,-42,-130,"); - add("-89,-47,-126,-104,-19,42,-139,-29,46,-140,-32,33,"); - add("-141,-45,-27,-129,-30,33,1,29,162,-10,20,126,"); - add("-22,20,151,107,46,95,125,53,110,13,24,123,"); - add("84,42,122,47,33,137,23,28,147,21,26,147,"); - add("19,25,147,47,31,140,148,38,-8,145,33,-34,"); - add("143,31,-45,90,7,-118,-2,-20,-139,"); - add(""); - //add("/*46*/"); - add("37,1,-12612,27178,1511,"); - add("72,38,-86,51,30,-137,29,20,-140,86,43,-98,"); - add("125,58,-54,2,5,-97,-129,-57,-48,-136,-62,-7,"); - add("-142,-65,0,-127,-59,-16,-136,-65,-10,-141,-68,27,"); - add("-101,-46,-110,-135,-65,-67,-7,-7,122,43,17,161,"); - add("-73,-39,70,-138,-70,15,-30,-19,113,92,41,116,"); - add("125,59,68,102,44,111,135,64,33,21,3,114,"); - add("-78,-46,138,-81,-44,78,-23,-22,149,-10,-16,146,"); - add("117,48,114,81,43,-43,56,36,-114,-34,-6,-149,"); - add("48,26,-31,141,69,-32,100,54,-100,42,28,-134,"); - add(""); - //add("/*47*/"); - add("37,1,29276,3899,5265,"); - add("22,-156,-12,20,-148,-7,25,-149,-40,23,-141,-38,"); - add("27,-130,-71,29,-62,-133,23,8,-143,17,59,-142,"); - add("16,48,-138,12,78,-134,5,102,-112,-8,137,-61,"); - add("-14,147,-29,-24,168,21,-25,121,59,-21,105,46,"); - add("-35,154,89,-29,151,46,-24,87,73,-36,155,77,"); - add("-27,94,71,-31,125,63,-36,109,111,-35,100,108,"); - add("-9,13,37,13,-41,-33,-21,12,111,40,-94,-140,"); - add("-21,-21,139,23,-150,12,9,-135,75,20,-154,24,"); - add("13,-144,45,8,-106,45,28,-187,-8,12,-81,-7,"); - add(""); - //add("/*48*/"); - add("36,1,23365,142,-18817,"); - add("54,94,69,71,84,90,55,106,71,-89,97,-109,"); - add("-51,107,-61,5,156,13,85,6,106,83,-108,102,"); - add("38,-107,44,63,-122,77,59,53,78,-71,119,-88,"); - add("-39,126,-45,12,149,21,2,179,13,60,-35,75,"); - add("58,-128,68,26,-140,27,34,-167,38,-33,-127,-46,"); - add("-5,-131,-9,-18,-143,-27,-26,-127,-33,5,-151,6,"); - add("-42,-120,-55,-55,-125,-68,-98,-123,-122,18,69,21,"); - add("51,128,63,35,139,44,20,146,25,-13,161,-16,"); - add("-91,11,-115,-90,-33,-115,-90,-48,-113,"); - add(""); - //add("/*49*/"); - add("37,1,12054,-19593,-19257,"); - add("58,-35,73,97,-42,105,128,-35,118,76,-28,78,"); - add("119,-11,92,139,38,53,138,60,31,139,47,46,"); - add("150,29,75,20,-63,80,-55,-105,73,-90,-108,53,"); - add("-102,-105,42,-115,-92,20,-144,-146,60,-2,-74,81,"); - add("-90,-96,45,-115,-98,31,-136,-92,12,-107,-61,-2,"); - add("-121,-47,-28,-125,-31,-47,-44,57,-94,2,89,-98,"); - add("-12,104,-125,-58,4,-41,-130,-56,-20,-12,60,-73,"); - add("56,106,-82,24,102,-94,-22,103,-124,4,65,-66,"); - add("55,112,-84,57,124,-94,51,106,-79,89,97,-43,"); - add(""); - //add("/*50*/"); - add("35,-1,19917,21699,5700,"); - add("29,-54,98,74,-89,80,71,-89,81,117,-98,-43,"); - add("149,-117,-89,-65,77,-55,-92,102,-55,-66,74,-48,"); - add("-63,79,-75,-15,46,-128,-73,99,-122,-7,36,-126,"); - add("0,20,-82,55,-15,-153,24,8,-132,59,-21,-154,"); - add("38,-6,-140,57,-21,-152,56,-26,-134,24,4,-131,"); - add("12,19,-164,-98,108,-91,-24,0,117,13,-42,160,"); - add("-47,15,150,-32,3,135,-31,-10,186,-40,10,120,"); - add("-62,32,114,-59,24,133,-18,-19,153,-60,19,148,"); - add("-14,-23,145,51,-77,121,"); - add(""); - //add("/*51*/"); - add("41,1,-4651,29635,-334,"); - add("-52,-9,-74,-147,-23,34,-42,-8,-77,-99,-18,-81,"); - add("-123,-20,85,-33,-7,-116,-111,-20,-20,-90,-14,125,"); - add("-50,-10,-19,-114,-21,-33,-8,1,154,-26,-4,153,"); - add("-56,-10,94,-19,-3,3,-17,-5,-154,-57,-12,-126,"); - add("-136,-26,27,-122,-24,97,-135,-27,24,-69,-14,135,"); - add("99,21,106,-44,-9,81,29,6,59,132,26,32,"); - add("192,38,20,-76,-15,25,68,13,79,90,16,80,"); - add("176,33,59,66,14,-123,115,21,-51,121,22,-35,"); - add("132,23,-23,-34,-5,-74,72,12,-59,92,16,-81,"); - add("130,21,-85,143,23,-50,127,19,-77,-47,-8,-78,"); - add(""); - //add("/*52*/"); - add("36,-1,-17857,23953,-2714,"); - add("-69,-60,-74,-114,-77,71,-109,-75,72,-111,-79,56,"); - add("-48,-29,82,11,18,91,-92,-64,75,-104,-78,30,"); - add("-34,-17,108,-110,-89,-23,-114,-97,-55,-121,-99,-25,"); - add("-87,-64,75,84,79,111,148,122,32,97,77,3,"); - add("108,81,-59,113,84,-44,119,88,-48,109,83,-14,"); - add("127,93,-33,122,88,-40,115,85,-19,118,82,-46,"); - add("120,84,-39,117,82,-19,111,82,21,20,10,-41,"); - add("-121,-93,-68,-89,-63,17,41,6,-221,-119,-96,-77,"); - add("-111,-88,-54,-84,-51,93,-21,-2,111,"); - add(""); - //add("/*53*/"); - add("35,1,18868,16148,-16830,"); - add("-118,111,-25,-43,93,43,11,86,96,13,65,80,"); - add("-48,105,49,114,-9,121,18,89,111,17,51,71,"); - add("110,-37,91,106,-88,33,119,-56,84,104,-67,55,"); - add("59,-94,-25,14,-90,-75,31,-109,-72,-118,47,-94,"); - add("-89,136,32,1,-144,-144,42,-99,-48,106,-129,-3,"); - add("109,-104,29,50,-132,-68,70,-135,-46,-4,-81,-81,"); - add("-71,16,-68,-57,139,63,-46,8,-45,42,-135,-77,"); - add("28,-89,-51,-151,124,-59,-109,73,-57,-77,126,31,"); - add("-77,126,31,-79,109,15,"); - add(""); - //add("/*54*/"); - add("34,-1,-21907,20246,3192,"); - add("-62,-57,-63,-62,-48,-135,-75,-66,-110,-9,14,-170,"); - add("89,99,-5,37,16,170,72,80,-15,8,22,-95,"); - add("-99,-99,-67,-102,-102,-62,-104,-108,-58,-69,-101,179,"); - add("-23,-35,65,4,-14,128,45,28,147,34,15,146,"); - add("79,69,114,66,51,126,59,41,134,78,57,154,"); - add("53,39,99,73,56,121,83,67,108,86,73,96,"); - add("96,95,30,-4,7,-52,-61,-36,-142,-38,-12,-144,"); - add("-92,-70,-152,-38,-33,-48,-3,24,-148,-11,13,-148,"); - add("-54,-35,-133,"); - add(""); - //add("/*55*/"); - add("35,-1,16309,24931,-3533,"); - add("24,-3,89,102,-57,80,68,-50,-39,119,-92,-89,"); - add("3,-15,-89,113,-84,-51,-16,8,-19,-118,83,21,"); - add("-65,59,106,-107,77,39,-82,40,-99,-36,5,-122,"); - add("95,-76,-91,106,-81,-69,108,-83,-62,121,-82,-3,"); - add("117,-79,4,120,-91,-49,114,-76,25,143,-110,-53,"); - add("45,-39,-40,151,-125,-101,-105,68,-46,-62,57,77,"); - add("-92,82,95,-114,79,-6,-96,70,18,-103,81,65,"); - add("-121,83,-3,-122,84,8,-113,84,57,-102,78,64,"); - add("-130,97,79,-13,30,141,"); - add(""); - //add("/*56*/"); - add("34,1,-15019,23246,-11578,"); - add("109,18,-104,-8,-59,-108,-129,-62,43,-61,-2,74,"); - add("-119,-114,-69,-118,-32,90,-114,-45,62,-120,-54,54,"); - add("-76,-47,10,-63,-67,-48,-110,-26,101,-106,-69,10,"); - add("-122,-55,61,-65,16,124,-4,20,46,-69,-112,-125,"); - add("-155,-65,94,-104,-37,77,-117,-37,99,-52,21,122,"); - add("94,83,26,134,97,-1,115,80,-6,112,50,-61,"); - add("129,45,-96,120,79,-9,126,83,-9,123,85,1,"); - add("117,61,-36,110,26,-100,108,20,-106,110,25,-95,"); - add("117,39,-76,"); - add(""); - //add("/*57*/"); - add("31,1,24179,-4896,-17070,"); - add("-65,75,-114,-78,42,-120,-77,49,-120,-76,50,-118,"); - add("-72,60,-113,-75,58,-116,-73,68,-113,-20,115,-55,"); - add("105,9,137,84,-42,122,87,-6,119,85,-18,122,"); - add("87,-9,122,82,-28,122,76,-55,122,38,-121,87,"); - add("63,-80,112,67,-61,115,75,-44,123,64,-73,116,"); - add("48,-105,102,6,-142,53,-20,-122,10,-9,-116,25,"); - add("-88,19,-138,-65,66,-119,-79,37,-127,-50,101,-104,"); - add("-46,108,-98,-25,98,-65,"); - add(""); - //add("/*58*/"); - add("32,-1,13075,24485,11382,"); - add("-40,52,-67,14,58,-144,17,52,-134,58,32,-141,"); - add("64,23,-131,84,3,-110,29,56,-168,-70,28,21,"); - add("28,-54,92,-76,-21,143,-85,-7,120,-75,-15,123,"); - add("-112,2,128,48,-60,76,21,-74,139,51,-82,117,"); - add("6,-62,126,108,-94,76,136,-62,-25,95,-80,56,"); - add("132,-88,31,-6,-35,77,19,-10,-1,87,45,-194,"); - add("-90,24,57,-82,74,-60,-55,107,-160,-47,-20,96,"); - add("-93,19,67,-130,74,-7,6,68,-152,"); - add(""); - //add("/*59*/"); - add("29,1,-3768,-29624,2870,"); - add("45,4,94,51,8,142,59,8,138,57,8,140,"); - add("32,14,147,-48,21,129,-31,19,118,-91,29,135,"); - add("-153,28,63,-79,26,117,-175,25,11,-15,23,147,"); - add("-106,32,113,-149,24,16,-144,16,-43,-99,-1,-109,"); - add("-16,-19,-150,25,-24,-149,63,-27,-134,90,-29,-121,"); - add("104,-29,-106,115,-28,-96,77,-26,-128,55,-24,-143,"); - add("18,-17,-146,25,-18,-143,94,-24,-118,135,-18,2,"); - add(""); - //add("/*60*/"); - add("30,1,-8205,28819,-1455,"); - add("-49,-18,-95,-107,-35,-74,-126,-34,63,-131,-39,-8,"); - add("-112,-37,-59,28,1,-121,135,35,-82,-84,-32,-116,"); - add("-139,-40,39,-129,-35,72,-87,-21,110,-125,-35,71,"); - add("-130,-38,69,-142,-45,39,-90,-25,91,165,60,100,"); - add("-39,-7,122,87,34,140,111,37,34,135,43,22,"); - add("151,48,-12,99,28,-61,93,23,-132,107,34,45,"); - add("114,37,99,118,37,66,92,23,-93,-35,-17,-168,"); - add("71,16,-104,"); - add(""); - //add("/*61*/"); - add("29,1,7341,28492,5857,"); - add("97,-32,32,101,-8,-91,129,-14,-97,162,-48,17,"); - add("98,-50,115,136,-21,-86,121,-12,-115,86,-3,-109,"); - add("72,-2,-102,-8,21,-96,-159,39,35,-146,40,12,"); - add("-144,44,-24,-140,46,-37,-124,42,-50,-140,56,-98,"); - add("-76,35,-88,-83,41,-114,-72,38,-113,-150,34,21,"); - add("-99,7,103,-38,-17,146,65,-39,131,10,-25,118,"); - add("113,-37,53,95,-48,123,24,-30,120,10,-30,139,"); - add(""); - //add("/*62*/"); - add("29,-1,13904,22523,14121,"); - add("-19,93,-130,-23,88,-121,-50,95,-107,-21,87,-123,"); - add("-56,98,-110,21,65,-132,94,11,-117,-1,23,-38,"); - add("-119,33,67,-106,103,-71,-21,80,-120,-112,91,-46,"); - add("-36,86,-118,14,66,-135,29,34,-93,-62,-54,165,"); - add("2,-75,134,67,-88,88,98,-84,48,7,-77,128,"); - add("102,-95,60,3,-81,136,40,-91,114,25,-96,136,"); - add("43,-85,97,37,-90,110,16,-85,122,27,-77,97,"); - add(""); - //add("/*63*/"); - add("28,1,25599,5928,-14475,"); - add("33,-94,20,47,-160,19,25,-90,9,54,-136,45,"); - add("62,-80,82,68,-111,82,64,-115,73,67,-111,84,"); - add("64,-114,80,67,-92,92,70,-85,104,66,-104,89,"); - add("83,-190,98,-58,18,-106,-67,77,-103,-69,92,-101,"); - add("-62,118,-76,-74,76,-112,-63,115,-76,-50,130,-45,"); - add("-49,115,-48,-82,54,-127,-63,120,-70,-85,80,-120,"); - add("-20,137,18,-2,140,50,-28,146,8,"); - add(""); - //add("/*64*/"); - add("32,-1,6784,26265,12812,"); - add("67,-5,-26,37,57,-138,-28,66,-122,80,12,-69,"); - add("61,44,-129,-45,71,-128,-100,88,-136,-27,-50,125,"); - add("-98,-3,60,-133,7,57,-138,81,-102,150,-27,-21,"); - add("-68,39,-49,-93,73,-111,-118,16,28,-118,39,-26,"); - add("-94,67,-101,3,-10,21,80,-70,114,132,-63,72,"); - add("51,-75,137,30,-24,37,111,-40,28,127,-51,42,"); - add("128,-39,13,-13,-32,75,-26,-49,117,-67,10,14,"); - add("-87,2,44,-6,-49,104,157,-56,33,"); - add(""); - //add("/*65*/"); - add("26,1,23238,12726,-14073,"); - add("76,-64,69,88,-121,37,88,-105,55,84,-121,34,"); - add("85,-121,37,85,-123,38,63,-143,-15,66,-149,-15,"); - add("20,-115,-62,24,-144,-78,-22,-86,-109,2,-174,-136,"); - add("-72,113,-31,-71,134,-10,-86,111,-53,-84,118,-43,"); - add("-72,126,-15,-71,138,0,-69,136,2,-69,134,1,"); - add("-84,129,-26,-57,123,16,-79,157,9,20,93,117,"); - add("66,-5,101,"); - add(""); - //add("/*66*/"); - add("30,-1,-15626,24491,7484,"); - add("-83,-67,46,-114,-88,46,-68,-5,-126,97,105,-140,"); - add("-44,-32,12,-109,-104,110,-71,-25,-74,17,58,-157,"); - add("56,86,-168,55,54,-62,99,90,-93,-46,-30,1,"); - add("-111,-81,30,-107,-95,90,51,32,2,18,-7,67,"); - add("-44,-71,143,-29,-57,126,-127,-117,107,61,42,-4,"); - add("84,48,25,129,58,89,23,-29,138,54,-12,150,"); - add("97,37,80,1,22,-66,-33,14,-112,39,65,-125,"); - add("78,80,-95,"); - add(""); - //add("/*67*/"); - add("28,1,5003,28957,-6038,"); - add("-142,13,-55,-88,-5,-93,-122,12,-36,6,39,188,"); - add("-80,41,141,-68,3,-37,111,-44,-128,-14,-26,-135,"); - add("-116,1,-81,-120,35,77,-93,33,90,63,26,174,"); - add("99,6,101,23,27,152,62,-3,38,127,-37,-87,"); - add("58,-6,16,1,28,142,27,27,171,115,-13,30,"); - add("134,-33,-55,109,-32,-70,98,-34,-89,43,-40,-165,"); - add("3,-30,-143,-109,2,-89,-95,20,19,"); - add(""); - //add("/*68*/"); - add("26,1,7323,-10567,-27106,"); - add("121,94,-3,142,73,11,122,50,15,31,-23,18,"); - add("-79,-118,23,-100,-126,21,-116,-102,8,-99,-88,8,"); - add("-118,-114,14,-116,-87,5,-129,-67,-7,-133,-64,-7,"); - add("-148,-82,-3,-104,-89,11,-126,-59,-5,-162,-43,-21,"); - add("-51,84,-47,121,97,-12,115,83,-7,115,86,-8,"); - add("145,83,2,105,59,3,128,90,-4,105,115,-18,"); - add("106,86,-6,"); - add(""); - //add("/*69*/"); - add("26,-1,-20783,20998,5211,"); - add("-67,-40,-109,-67,-36,-125,-76,-30,-203,-20,-37,79,"); - add("-61,-46,-71,-3,31,-149,-35,-6,-136,-49,-20,-142,"); - add("-48,-19,-142,-60,-36,-128,-82,-63,-113,-105,-93,-75,"); - add("-44,-64,90,45,20,138,58,32,135,44,16,144,"); - add("25,-6,149,1,-33,149,37,2,157,44,16,125,"); - add("87,62,112,80,63,76,114,121,-22,74,80,-27,"); - add("100,72,109,"); - add(""); - //add("/*70*/"); - add("27,1,-22450,-137,19899,"); - add("-70,14,-79,-99,23,-113,-98,19,-113,-86,-40,-100,"); - add("-104,11,-123,-96,32,-113,-97,9,-116,-84,-60,-104,"); - add("-22,-179,-28,-32,-108,-41,50,-137,58,-19,-49,-25,"); - add("-30,-140,-42,56,-135,63,66,-76,77,47,77,60,"); - add("23,0,27,79,-32,94,92,11,109,82,77,100,"); - add("97,22,114,89,69,105,33,101,41,70,117,83,"); - add("32,144,39,35,156,42,"); - add(""); - //add("/*71*/"); - add("25,1,23559,-1507,-18512,"); - add("27,-75,40,43,-174,71,-57,80,-80,-63,-34,-78,"); - add("-88,-88,-102,-96,83,-128,-85,-47,-100,-97,-34,-115,"); - add("-66,45,-84,-109,-20,-130,-84,-84,-92,-92,-58,-103,"); - add("-106,-83,-115,-37,97,-53,50,123,46,60,131,59,"); - add("87,78,95,102,9,121,87,54,99,99,35,117,"); - add("97,-53,123,84,32,102,97,-3,120,94,-4,119,"); - add(""); - //add("/*72*/"); - add("25,1,25640,-4315,-14965,"); - add("31,-45,66,54,-65,113,-15,-155,20,-76,-10,-128,"); - add("-74,-2,-127,-82,-20,-132,-78,-42,-117,-79,26,-139,"); - add("-74,13,-124,-72,1,-117,-70,50,-127,-81,13,-132,"); - add("-77,64,-138,-16,182,-75,15,-33,33,65,-78,123,"); - add("50,-80,100,83,61,115,72,4,114,69,-29,120,"); - add("79,35,120,80,57,116,85,40,131,72,15,117,"); - add(""); - //add("/*73*/"); - add("25,1,6329,18585,22684,"); - add("-107,-21,47,-119,-30,56,-133,-23,54,-136,-32,61,"); - add("-142,-5,39,-143,15,24,-151,47,-3,-153,-26,57,"); - add("-110,-33,51,-5,-114,92,127,-70,27,147,-37,-4,"); - add("135,-68,21,136,-61,15,141,-32,-11,132,-59,13,"); - add("114,-83,35,151,-27,-19,56,56,-58,26,118,-100,"); - add("-68,102,-61,-5,117,-92,38,106,-95,58,104,-101,"); - add(""); - //add("/*74*/"); - add("26,-1,7748,26705,11261,"); - add("129,-68,72,75,-7,-35,137,-55,31,-13,-50,125,"); - add("-161,55,-14,49,-48,77,-43,-4,39,-135,66,-60,"); - add("2,-12,25,126,-63,59,99,-70,91,122,-60,54,"); - add("141,-38,-16,147,-75,66,-108,0,77,30,-27,38,"); - add("172,-30,-57,50,41,-128,-18,56,-112,-120,65,-62,"); - add("-126,68,-62,-106,65,-74,-69,75,-127,-124,50,-29,"); - add("-152,41,9,"); - add(""); - //add("/*75*/"); - add("24,1,14610,-1401,-26164,"); - add("-43,-57,-21,-121,-61,-64,-114,-84,-57,-111,-85,-55,"); - add("-108,-95,-52,-127,-52,-64,-100,-97,-45,-86,-118,-37,"); - add("-64,-137,-22,-14,-151,6,-73,-146,-24,-89,52,-51,"); - add("-27,143,-26,41,133,10,95,100,40,117,78,55,"); - add("94,100,41,108,104,50,105,90,50,116,72,58,"); - add("117,80,58,121,59,63,112,86,57,"); - add(""); - //add("/*76*/"); - add("25,1,26396,-4371,-13570,"); - add("27,-28,63,47,-88,120,-11,-160,33,-56,-86,-80,"); - add("-64,15,-130,-65,22,-135,-62,42,-131,-63,33,-130,"); - add("-48,80,-115,-27,-30,-40,-87,-20,-155,-63,65,-133,"); - add("31,142,11,67,-4,122,35,47,51,74,2,136,"); - add("69,92,100,70,-21,139,-48,-125,-52,-73,-63,-118,"); - add("3,-64,27,69,-13,135,70,102,98,63,32,111,"); - add(""); - //add("/*77*/"); - add("23,1,26582,10216,-9436,"); - add("30,-17,65,49,-62,75,75,-102,105,70,-87,108,"); - add("50,-116,22,46,-147,-22,35,-144,-49,-19,-79,-135,"); - add("-30,-43,-131,-46,-32,-162,-77,83,-132,-44,43,-79,"); - add("-77,97,-116,-52,90,-53,-60,147,-15,-92,167,-77,"); - add("-58,74,-78,-40,143,40,36,48,144,48,-10,118,"); - add("63,-23,148,48,1,132,"); - add(""); - //add("/*78*/"); - add("23,1,-8254,28832,-761,"); - add("-97,-27,32,-31,-10,-50,-97,-30,-58,-158,-48,-10,"); - add("-145,-44,-22,-132,-40,25,-139,-43,23,-146,-46,14,"); - add("-16,-2,144,146,49,85,167,51,-32,34,13,112,"); - add("-19,-4,154,118,38,92,128,39,47,135,41,74,"); - add("140,41,77,82,23,-61,17,4,-155,43,11,-104,"); - add("41,10,-148,-16,-8,-141,"); - add(""); - //add("/*79*/"); - add("24,-1,14884,12125,23053,"); - add("-8,-117,67,30,-56,9,26,-101,36,-42,-130,92,"); - add("-29,-120,79,-101,-11,69,-108,-19,77,-76,-80,87,"); - add("-61,-124,97,-48,-109,82,-33,-127,80,-2,-59,28,"); - add("57,166,-112,62,118,-94,74,73,-82,52,104,-83,"); - add("117,0,-73,92,82,-99,54,95,-82,72,29,-62,"); - add("-24,146,-59,-33,131,-46,-56,133,-33,"); - add(""); - //add("/*80*/"); - add("24,1,-6839,29182,-1275,"); - add("-120,-28,3,-163,-38,26,40,6,-75,150,32,-101,"); - add("-80,-22,-42,-160,-38,24,-18,-7,-50,-43,-16,-102,"); - add("-84,-21,-8,-1,8,163,1,10,202,-56,-17,-58,"); - add("-100,-29,-83,-143,-37,2,-35,-4,135,14,11,157,"); - add("134,36,49,74,22,69,135,33,-19,158,41,35,"); - add("152,36,-3,91,18,-110,41,5,-116,"); - add(""); - //add("/*81*/"); - add("22,1,3600,19765,22280,"); - add("-77,-59,64,-106,-70,78,-159,-8,31,-4,-102,89,"); - add("93,-99,72,21,-114,94,35,-110,88,-12,-117,100,"); - add("13,-132,107,38,-71,53,123,-42,16,95,103,-100,"); - add("127,4,-24,82,36,-43,7,116,-98,-1,119,-100,"); - add("-19,110,-91,7,106,-91,-6,104,-89,-74,113,-87,"); - add("-86,90,-65,"); - add(""); - //add("/*82*/"); - add("22,1,17666,16854,-17432,"); - add("58,31,90,67,45,112,127,-40,93,77,-78,4,"); - add("118,-56,71,88,35,127,118,-100,28,110,-93,28,"); - add("132,-78,69,-25,0,-27,-25,-67,-93,41,-117,-70,"); - add("-50,-92,-141,-97,70,-37,-107,106,-14,-97,92,-15,"); - add("-122,47,-83,-86,-65,-151,-117,93,-33,-118,80,-43,"); - add("-51,74,19,"); - add(""); - //add("/*83*/"); - add("23,-1,5861,26752,12246,"); - add("82,-33,32,44,-67,125,76,-64,100,4,-66,137,"); - add("-2,-60,126,26,-61,114,56,-72,119,85,-65,91,"); - add("113,19,-91,-80,25,-13,-77,59,-82,-48,72,-125,"); - add("-16,64,-126,27,80,-182,83,25,-95,1,56,-122,"); - add("-73,49,-71,-16,-45,108,-29,-53,127,-52,-5,37,"); - add("-15,55,-111,-63,57,-93,"); - add(""); - //add("/*84*/"); - add("21,-1,-14603,25601,-5597,"); - add("-10,25,142,72,67,124,9,35,145,-23,16,145,"); - add("-38,6,147,-17,20,157,8,28,124,-63,-10,152,"); - add("-54,-3,159,20,6,-30,59,11,-131,70,16,-134,"); - add("72,16,-137,31,-8,-139,65,22,-75,81,21,-120,"); - add("-49,-52,-125,-49,-56,-141,-43,-51,-128,-51,-59,-142,"); - add(""); - //add("/*85*/"); - add("22,1,-5757,29270,-3178,"); - add("-36,-18,-100,-68,-28,-130,-59,-28,-136,-54,-28,-139,"); - add("-12,-22,-151,-104,-29,-57,-107,-3,153,-77,-12,39,"); - add("-63,-5,65,100,36,117,69,31,137,90,32,119,"); - add("-54,-10,14,-143,-35,-43,22,18,118,56,27,139,"); - add("125,32,58,110,32,92,119,26,24,9,-8,-107,"); - add("35,-5,-114,"); - add(""); - //add("/*86*/"); - add("21,-1,20081,22197,2006,"); - add("-52,51,-44,-84,68,86,-104,80,129,-69,58,28,"); - add("-120,102,37,-73,72,-95,-48,58,-182,-84,68,55,"); - add("-110,87,70,-18,8,85,64,-52,-33,78,-55,-118,"); - add("78,-70,26,34,-43,145,91,-86,70,115,-101,0,"); - add("61,-64,105,67,-57,-30,57,-37,-136,75,-56,-119,"); - add(""); - //add("/*87*/"); - add("20,1,-17819,21913,10114,"); - add("-28,11,-73,-142,-94,-50,-103,-82,-6,-124,-90,-31,"); - add("-113,-92,-6,-78,-105,82,23,-33,112,76,6,124,"); - add("103,33,114,116,67,63,95,87,-16,-56,30,-159,"); - add("-112,-81,-27,-102,-84,-3,-35,13,-90,78,74,-17,"); - add("142,85,72,90,79,-10,109,95,-13,"); - add(""); - //add("/*88*/"); - add("20,-1,7617,6776,28215,"); - add("-100,37,17,-132,61,21,-141,-23,42,-89,78,3,"); - add("-96,12,21,-102,53,13,7,147,-39,-119,93,6,"); - add("-141,-63,49,40,-153,29,77,-127,13,116,-87,-7,"); - add("54,-69,3,16,-124,25,121,-114,-4,95,65,-38,"); - add("115,89,-51,119,41,-40,150,29,-48,"); - add(""); - //add("/*89*/"); - add("19,1,10847,17337,21949,"); - add("-55,-34,54,-136,-1,68,-125,41,27,-145,19,54,"); - add("-134,22,45,-141,-18,79,-130,62,9,-164,26,53,"); - add("-47,-61,68,70,-81,33,147,-15,-54,141,-18,-50,"); - add("144,-61,-18,126,-37,-30,129,17,-74,133,12,-73,"); - add("135,5,-69,64,69,-85,"); - add(""); - //add("/*90*/"); - add("20,1,2092,29573,4591,"); - add("-46,-9,79,-90,13,-48,2,-21,135,-89,7,-11,"); - add("-133,16,-49,-43,-2,32,-29,-14,96,-26,-16,102,"); - add("78,-24,118,217,0,-82,-44,-15,105,58,-18,82,"); - add("160,-5,-33,149,-15,25,91,14,-122,30,20,-136,"); - add("19,23,-151,-57,26,-134,-157,12,-2,"); - add(""); - //add("/*91*/"); - add("20,-1,-20217,21829,-3845,"); - add("-71,-59,41,-110,-106,-18,-100,-95,2,-110,-103,7,"); - add("-95,-95,-14,-36,-35,-3,-92,-87,16,-71,-87,-94,"); - add("0,-28,-153,-18,-16,10,-98,-75,125,44,47,13,"); - add("84,99,88,78,86,54,114,110,-6,97,96,15,"); - add("98,90,-25,111,102,-14,116,111,14,"); - add(""); - //add("/*92*/"); - add("18,1,24559,5678,-16267,"); - add("45,23,76,82,-17,120,53,-117,40,48,-136,28,"); - add("29,-161,-10,79,-73,100,62,-105,63,-13,-129,-61,"); - add("-56,-87,-115,-34,-125,-90,-73,6,-110,-35,134,-13,"); - add("15,127,61,-34,158,-2,-54,138,-37,-51,138,-32,"); - add("-55,139,-37,"); - add(""); - //add("/*93*/"); - add("20,-1,7773,28919,-1814,"); - add("-89,16,-118,-83,13,-134,-41,10,2,-8,13,153,"); - add("162,-37,87,52,-6,135,18,3,148,-94,31,106,"); - add("-54,17,47,200,-56,-53,108,-26,75,31,-8,11,"); - add("11,-11,-150,130,-40,-79,27,-11,-54,-161,49,66,"); - add("-70,20,5,1,-8,-121,-91,22,-50,"); - add(""); - //add("/*94*/"); - add("19,1,28847,-786,-8199,"); - add("14,-81,55,17,10,63,33,-16,120,21,-153,93,"); - add("-27,-81,-85,-41,-5,-147,-26,-117,-78,-18,-132,-42,"); - add("-24,-120,-62,-43,-55,-138,-40,-73,-123,-13,54,-52,"); - add("-1,171,-32,26,67,75,42,57,133,23,143,60,"); - add("13,150,26,24,136,69,"); - add(""); - //add("/*95*/"); - add("19,-1,-13526,25075,-9397,"); - add("-104,-57,0,-169,-104,-31,-81,-44,5,-119,-56,27,"); - add("-136,-62,41,-155,-91,-5,21,21,24,125,71,-5,"); - add("135,72,-11,34,50,83,-79,4,130,-78,13,159,"); - add("39,17,-17,54,-22,-142,66,-7,-119,128,39,-89,"); - add("119,53,-33,130,72,1,"); - add(""); - //add("/*96*/"); - add("20,1,-8960,-28564,-1947,"); - add("-4,-7,116,-2,-8,149,17,-15,170,40,-19,128,"); - add("-19,-1,158,3,-7,144,-60,14,121,-106,34,-11,"); - add("-17,9,-106,-78,25,14,-77,27,-65,101,-30,-68,"); - add("12,1,-102,-83,31,-101,76,-21,-60,44,-10,-76,"); - add("-10,10,-123,16,4,-148,77,-15,-153,"); - add(""); - //add("/*97*/"); - add("17,-1,17593,2406,24180,"); - add("-46,-122,46,-2,-152,15,-14,-147,23,32,-145,-12,"); - add("61,-134,-35,60,-128,-35,91,-110,-59,82,-162,-52,"); - add("51,105,-43,-51,108,31,-94,101,62,-58,133,34,"); - add("-12,155,-3,-12,148,-4,-3,151,-11,-17,154,-2,"); - add(""); - //add("/*98*/"); - add("17,-1,7274,26419,12212,"); - add("-30,-53,132,-26,-63,149,90,-55,61,121,-62,59,"); - add("112,-69,77,111,-66,68,136,-77,76,45,47,-124,"); - add("109,9,-86,69,26,-97,-23,64,-119,-68,73,-111,"); - add("-118,65,-65,-148,50,-12,-139,44,-10,-135,48,-21,"); - add(""); - //add("/*99*/"); - add("18,1,-5378,29484,-1323,"); - add("7,-3,-94,-75,-18,-97,-134,-22,66,-123,-21,55,"); - add("-78,-18,-54,-45,-14,-99,-88,-13,91,-23,2,131,"); - add("-90,-13,129,-141,-28,38,-61,-8,119,130,29,54,"); - add("147,29,-35,140,28,5,121,21,-86,99,14,-122,"); - add("143,25,-49,"); - add(""); - //add("/*100*/"); - add("18,-1,13477,22776,14129,"); - add("109,-76,17,41,-79,87,-6,-77,128,-25,-78,145,"); - add("21,-91,121,32,-82,95,-81,-30,118,-6,-70,111,"); - add("92,-30,-39,85,48,-150,1,51,-78,-51,92,-93,"); - add("-5,96,-142,-21,78,-104,-25,85,-108,-32,83,-102,"); - add("-120,75,-7,"); - add(""); - //add("/*101*/"); - add("17,1,13832,17499,20061,"); - add("-49,-24,54,-87,-54,108,-99,-46,105,-113,-24,96,"); - add("-145,5,90,-63,-73,103,-121,-41,111,20,-94,65,"); - add("118,-79,-9,138,-22,-72,110,42,-106,81,58,-102,"); - add("102,48,-108,-30,92,-58,35,96,-105,73,73,-114,"); - add(""); - //add("/*102*/"); - add("17,1,24192,6529,-16496,"); - add("5,-81,-25,-12,-132,-68,-58,-89,-117,-44,-93,-99,"); - add("9,-107,-24,11,-90,-17,-48,-108,-106,-117,-38,-177,"); - add("-17,120,16,4,156,60,-22,140,20,-18,140,26,"); - add("28,112,82,69,65,123,82,-21,109,87,10,130,"); - add(""); - //add("/*103*/"); - add("16,-1,13005,-9227,25411,"); - add("89,107,-7,117,91,-28,96,129,-5,124,84,-36,"); - add("90,79,-20,135,59,-53,192,71,-80,-94,74,77,"); - add("-136,-44,59,-116,-94,30,-130,-64,47,-93,-97,15,"); - add("-108,-131,10,-73,-112,-2,-93,-119,5,"); - add(""); - //add("/*104*/"); - add("17,-1,12753,25778,8535,"); - add("52,-64,114,99,-58,27,-5,-49,150,9,-5,1,"); - add("88,-14,-90,143,-79,19,196,-98,-11,-76,66,-78,"); - add("-85,33,34,-159,84,-9,-83,82,-118,-127,73,-28,"); - add("-31,59,-134,-108,74,-64,-53,33,-23,131,-100,112,"); - add(""); - //add("/*105*/"); - add("17,-1,-16206,24956,-3814,"); - add("36,36,80,46,51,147,74,60,88,97,75,103,"); - add("123,82,32,170,122,119,112,64,-32,-8,-16,-86,"); - add("-85,-70,-130,-116,-86,-105,-110,-66,20,-171,-113,-32,"); - add("-59,-52,-95,72,44,-17,-35,-27,-34,-79,-59,-52,"); - add(""); - //add("/*106*/"); - add("16,1,-27904,9377,5782,"); - add("14,-34,121,-8,-99,117,14,-47,134,25,-36,169,"); - add("56,65,149,27,-4,118,34,-11,159,32,89,9,"); - add("-6,72,-124,-13,58,-137,-16,45,-140,-25,26,-147,"); - add("-27,16,-146,-35,-14,-143,-43,-42,-136,"); - add(""); - //add("/*107*/"); - add("16,1,24919,6169,-15523,"); - add("-15,-83,-57,15,-144,-32,30,-148,-7,46,-148,19,"); - add("27,-152,-11,-30,-15,-54,-79,68,-101,-85,43,-118,"); - add("-72,102,-77,-78,95,-86,-59,170,-28,55,27,94,"); - add("69,29,118,60,64,119,58,69,119,"); - add(""); - //add("/*108*/"); - add("15,1,25878,-4981,-14336,"); - add("-65,-92,-84,-74,-17,-126,-74,-48,-113,-75,-84,-102,"); - add("-71,-100,-87,-80,-25,-128,-62,61,-127,26,118,4,"); - add("71,113,81,76,61,110,79,105,100,67,7,115,"); - add("75,-1,131,72,-13,133,"); - add(""); - //add("/*109*/"); - add("16,1,5450,29486,-929,"); - add("-154,29,9,-133,25,53,15,0,102,55,-8,59,"); - add("-131,24,83,51,-6,146,117,-19,76,152,-27,86,"); - add("46,-9,-54,171,-34,-108,46,-11,-133,67,-16,-143,"); - add("2,-5,-140,-115,20,-79,-112,23,66,"); - add(""); - //add("/*110*/"); - add("16,-1,17357,24467,-289,"); - add("93,-67,-83,114,-83,-67,118,-86,-7,-13,8,-49,"); - add("-63,46,4,-131,96,35,-99,72,119,-113,81,37,"); - add("-79,53,-96,-30,19,-139,-102,66,-178,18,-10,75,"); - add("61,-39,123,40,-26,142,85,-58,90,"); - add(""); - //add("/*111*/"); - add("16,1,-10217,28170,-1431,"); - add("-65,-26,-59,-121,-47,-38,-112,-47,-83,-64,-32,-142,"); - add("-103,-35,66,-74,-21,123,-113,-36,147,-52,-14,123,"); - add("22,14,136,72,32,111,73,28,-15,127,46,-75,"); - add("129,46,-48,120,40,-116,91,30,-63,"); - add(""); - //add("/*112*/"); - add("15,1,29126,7027,-1524,"); - add("25,-95,61,35,-144,21,37,-153,29,32,-136,22,"); - add("32,-147,-4,36,-156,67,31,-153,-26,-10,34,-50,"); - add("-33,155,-14,-35,150,-55,-27,117,-36,-41,183,10,"); - add("-27,109,-30,-35,145,-19,"); - add(""); - //add("/*113*/"); - add("15,1,6145,29344,-1095,"); - add("-111,18,-111,-53,5,-138,-82,10,-139,-105,16,-86,"); - add("-147,32,55,-78,19,94,-45,14,107,69,-11,60,"); - add("-161,34,74,151,-26,74,141,-26,15,139,-26,36,"); - add("145,-29,16,127,-25,23,"); - add(""); - //add("/*114*/"); - add("15,1,24375,5854,-16479,"); - add("40,-64,35,43,-140,16,59,-133,43,58,-133,43,"); - add("65,-133,54,43,-126,24,37,-157,9,-33,-4,-52,"); - add("-54,137,-39,-51,140,-32,-78,112,-80,-58,111,-51,"); - add("-26,150,12,-23,147,17,"); - add(""); - //add("/*115*/"); - add("15,-1,-17689,24006,-3293,"); - add("3,-14,-112,-73,-60,-41,-34,-11,101,-70,-38,105,"); - add("-89,-57,66,-106,-88,-56,-163,-125,4,-104,-72,56,"); - add("44,39,37,120,91,-4,106,86,36,112,90,43,"); - add("115,84,-14,93,53,-126,"); - add(""); - //add("/*116*/"); - add("14,1,12744,-2905,-27003,"); - add("-5,-145,14,-77,-123,-22,-103,-99,-37,-63,-118,-14,"); - add("-67,-122,-15,-128,-69,-50,-133,51,-66,17,147,-12,"); - add("107,117,35,104,79,37,99,120,32,86,134,25,"); - add("119,58,49,"); - add(""); - //add("/*117*/"); - add("15,1,-12039,24973,-11465,"); - add("-64,-40,-18,-136,-75,-18,-97,-85,-81,-115,-86,-58,"); - add("-106,-47,12,-128,-64,5,-126,-69,-8,-7,38,87,"); - add("99,75,51,156,93,28,61,55,53,130,77,25,"); - add("140,57,-26,124,60,-2,"); - add(""); - //add("/*118*/"); - add("14,1,7404,28675,-4785,"); - add("-29,-17,-146,-17,-21,-148,7,-29,-149,-45,-11,-123,"); - add("-150,53,81,-131,42,51,-114,46,103,-17,24,116,"); - add("7,24,148,56,10,138,125,-25,35,146,-55,-111,"); - add("129,-30,17,"); - add(""); - //add("/*119*/"); - add("15,1,-18411,21935,8938,"); - add("-115,-81,-40,-37,-70,94,-16,-67,130,-6,-58,124,"); - add("71,2,136,-17,-59,103,77,18,109,131,91,45,"); - add("-20,35,-117,-69,-11,-111,-56,16,-148,-52,11,-130,"); - add("18,47,-75,70,90,-75,"); - add(""); - //add("/*120*/"); - add("16,-1,-19925,-10993,19549,"); - add("-85,60,-54,-81,131,-10,-95,132,-25,49,44,74,"); - add("124,-109,68,104,-49,79,-38,35,-20,-106,137,-32,"); - add("-67,38,-48,-111,-16,-125,11,-76,-29,64,-118,1,"); - add("29,-126,-41,51,-24,39,100,-47,78,"); - add(""); - //add("/*121*/"); - add("15,-1,-18321,23571,-2957,"); - add("-21,-25,-65,-55,-44,-12,-127,-88,93,-93,-71,26,"); - add("-105,-81,20,-118,-90,42,-124,-99,20,-24,-4,132,"); - add("89,77,41,107,79,-71,90,60,-111,99,80,11,"); - add("155,117,-44,66,45,-56,"); - add(""); - //add("/*122*/"); - add("13,1,-17336,22935,8569,"); - add("-77,9,-181,-36,-51,65,5,-50,144,-33,-72,123,"); - add("11,-49,149,36,-30,146,45,-23,142,99,30,115,"); - add("31,78,-136,-4,53,-140,-9,49,-144,-26,36,-146,"); - add(""); - //add("/*123*/"); - add("15,1,18292,-22847,6589,"); - add("17,51,129,65,27,-88,38,6,-87,81,84,64,"); - add("-109,-44,152,4,37,115,-16,21,109,75,88,88,"); - add("-100,-69,39,-92,-89,-47,-125,-112,-40,46,6,-100,"); - add("56,0,-148,7,-22,-92,"); - add(""); - //add("/*124*/"); - add("14,1,25183,6987,-14730,"); - add("-19,-68,-66,-34,-107,-106,-1,-140,-65,-8,-124,-68,"); - add("-18,-137,-89,-55,-30,-104,-61,102,-57,-40,142,-5,"); - add("-29,159,24,18,114,80,56,74,126,63,25,117,"); - add("76,10,133,"); - add(""); - //add("/*125*/"); - add("14,1,-8316,28793,1345,"); - add("-112,-33,14,-106,-36,84,-119,-39,70,-83,-31,115,"); - add("70,13,135,41,3,142,12,-7,156,99,28,19,"); - add("108,39,-100,95,35,-109,42,21,-148,-30,0,-150,"); - add("16,13,-150,"); - add(""); - //add("/*126*/"); - add("14,1,-20941,-20602,6087,"); - add("-57,78,65,-69,88,56,-96,95,-13,-76,82,8,"); - add("-54,95,123,-116,124,1,-64,28,-127,47,-74,-79,"); - add("82,-108,-69,97,-111,-29,98,-114,-42,84,-109,-75,"); - add("86,-65,78,"); - add(""); - //add("/*127*/"); - add("13,1,-4213,-29615,2279,"); - add("-54,18,127,-113,24,97,-128,26,79,-138,28,72,"); - add("-56,2,-82,112,-27,-103,78,-21,-118,-45,-5,-145,"); - add("-127,9,-160,135,-23,-23,80,-3,125,149,-19,48,"); - add(""); - //add("/*128*/"); - add("17,1,-7190,25393,-14265,"); - add("78,-15,-66,-8,-71,-121,96,22,-9,103,-22,-88,"); - add("-16,-69,-112,-123,-86,-89,-29,14,39,-51,17,54,"); - add("-61,-48,-53,-53,22,65,-54,65,139,-68,50,122,"); - add("-82,20,78,25,62,96,104,44,25,88,20,-10,"); - add(""); - //add("/*129*/"); - add("14,-1,-19493,22341,-4569,"); - add("21,-10,-138,-18,-17,-9,-18,15,150,-41,-7,140,"); - add("-104,-82,48,-110,-85,68,-76,-41,140,-11,27,201,"); - add("24,10,-64,19,-10,-144,124,90,-106,57,33,-93,"); - add("103,79,-54,"); - add(""); - //add("/*130*/"); - add("14,1,631,-8774,-28681,"); - add("-95,52,-18,-113,74,-25,-126,-17,4,-218,65,-21,"); - add("120,-18,6,3,62,-18,-151,163,-49,118,8,-2,"); - add("126,-59,18,142,-43,15,136,-62,21,142,-64,22,"); - add("-23,-89,26,"); - add(""); - //add("/*131*/"); - add("14,1,19698,-3856,-22297,"); - add("66,-19,63,94,-67,96,59,-115,73,41,-133,62,"); - add("33,-144,58,-56,-44,-42,-112,1,-101,-112,-2,-100,"); - add("-88,89,-95,-79,93,-87,-35,136,-55,18,126,-7,"); - add("109,85,80,"); - add(""); - //add("/*132*/"); - add("13,1,-11506,10377,-25689,"); - add("-24,-106,-32,45,-133,-73,-57,-146,-31,-32,-145,-41,"); - add("-112,-83,18,-96,90,78,-114,58,75,-114,81,84,"); - add("67,117,15,89,117,5,131,76,-30,133,55,-38,"); - add(""); - //add("/*133*/"); - add("13,1,3573,20459,21649,"); - add("-18,-82,80,-121,-55,70,-106,-79,91,11,-107,96,"); - add("42,-113,97,64,-95,76,145,-61,32,58,98,-98,"); - add("18,114,-107,15,110,-103,-40,114,-99,-24,107,-96,"); - add(""); - //add("/*134*/"); - add("14,1,-13127,24311,-11689,"); - add("32,-36,-111,-20,-65,-111,-11,-39,-67,119,108,88,"); - add("119,35,-57,12,-41,-96,-113,-93,-66,-148,-83,-6,"); - add("-78,-59,-31,-99,-15,79,15,71,124,81,88,89,"); - add("49,83,116,"); - add(""); - //add("/*135*/"); - add("14,-1,-27102,-7955,10108,"); - add("-41,40,-76,7,-121,-79,2,-95,-72,50,-76,73,"); - add("60,-59,116,54,-99,63,49,14,140,58,-112,59,"); - add("41,30,130,-56,115,-52,-55,104,-59,-68,105,-94,"); - add("-62,98,-88,"); - add(""); - //add("/*136*/"); - add("13,1,24282,5951,-16583,"); - add("1,-130,-43,-12,-124,-61,-62,-64,-112,21,-145,-17,"); - add("-12,-193,-80,-75,62,-87,-38,114,-17,22,137,75,"); - add("-22,152,20,1,137,49,74,1,106,62,51,109,"); - add(""); - //add("/*137*/"); - add("12,1,-26265,9394,11041,"); - add("-25,-130,52,61,-10,151,61,0,140,56,-11,136,"); - add("72,36,134,82,129,80,-33,84,-143,-47,8,-112,"); - add("-59,12,-145,-60,2,-141,-63,-12,-136,"); - add(""); - //add("/*138*/"); - add("13,1,959,-9398,-28474,"); - add("-96,40,-16,-137,30,-14,-46,96,-32,46,137,-43,"); - add("120,104,-29,106,43,-11,165,-34,17,122,-55,22,"); - add("71,-116,41,34,-132,44,-128,-70,17,-150,-39,7,"); - add(""); - //add("/*139*/"); - add("13,-1,14782,-8096,24818,"); - add("69,-20,-48,119,-33,-82,133,23,-74,129,-1,-79,"); - add("130,19,-76,172,44,-94,-52,24,41,-129,-22,74,"); - add("-124,-10,75,-135,-5,81,-127,-25,69,-127,11,80,"); - add(""); - //add("/*140*/"); - add("13,1,-18588,-22992,5084,"); - add("-30,41,75,-96,84,27,-117,108,51,-121,106,23,"); - add("-116,92,-23,16,-39,-112,126,-112,-27,33,-57,-133,"); - add("146,-119,7,-60,76,116,53,-45,-2,114,-97,-23,"); - add(""); - //add("/*141*/"); - add("13,1,10930,21399,-17962,"); - add("112,-57,2,131,-9,69,89,-43,5,131,-71,-1,"); - add("148,-86,-8,121,-90,-27,-34,-14,-38,-131,74,3,"); - add("-134,81,9,-140,53,-25,-138,61,-13,-155,53,-32,"); - add(""); - //add("/*142*/"); - add("13,-1,2123,5909,29336,"); - add("91,-78,9,130,-73,4,65,-131,20,-85,-112,28,"); - add("-40,-133,28,50,-162,25,34,36,-9,28,139,-28,"); - add("10,135,-25,8,152,-30,-103,116,-14,-132,66,-4,"); - add(""); - //add("/*143*/"); - add("14,-1,-17261,24337,-3127,"); - add("-106,-81,-41,-97,-73,-25,-70,-67,-119,-103,-69,48,"); - add("-89,-51,111,-27,0,147,30,31,74,43,21,-85,"); - add("52,29,-72,125,88,-25,82,75,129,15,1,-77,"); - add("94,67,-2,"); - add(""); - //add("/*144*/"); - add("15,-1,-17925,23424,5478,"); - add("-56,-22,-89,-109,-64,-90,-96,-63,-50,-158,-128,15,"); - add("-122,-105,33,71,48,36,88,74,-14,119,86,31,"); - add("133,87,74,-67,-52,0,43,22,48,109,65,81,"); - add("5,10,-29,16,17,-20,"); - add(""); - //add("/*145*/"); - add("12,1,-11151,25532,-11125,"); - add("-96,-60,-40,-113,-85,-80,-154,-96,-60,-89,-84,-95,"); - add("-39,41,132,43,56,79,187,120,81,-121,-59,-10,"); - add("37,33,37,135,73,29,132,34,-56,"); - add(""); - //add("/*146*/"); - add("13,1,-8245,28241,5871,"); - add("-116,-48,68,-111,-45,51,-55,-33,79,67,-11,142,"); - add("-65,-18,-4,-34,-28,75,111,13,96,134,24,67,"); - add("120,43,-35,8,38,-156,32,40,-143,-27,24,-145,"); - add(""); - //add("/*147*/"); - add("12,-1,-29258,6281,2126,"); - add("-23,-98,-32,-27,-136,29,-23,-141,72,-7,-82,123,"); - add("3,-46,145,8,-25,154,25,105,42,17,119,-83,"); - add("14,113,-102,8,88,-123,9,85,-120,"); - add(""); - //add("/*148*/"); - add("12,-1,15271,556,25816,"); - add("72,107,-45,84,120,-53,109,74,-69,73,123,-48,"); - add("14,199,-17,-60,-36,38,-94,-101,61,-101,-90,64,"); - add("-93,-105,59,-79,-120,50,19,-120,-8,"); - add(""); - //add("/*149*/"); - add("13,1,4573,29647,-405,"); - add("107,-16,122,127,-20,41,164,-26,40,74,-13,16,"); - add("63,-11,-54,48,-10,-152,-74,11,-130,-85,12,-108,"); - add("-165,28,-1,-109,18,26,-117,20,93,-78,13,54,"); - add(""); - //add("/*150*/"); - add("12,-1,9509,25746,12114,"); - add("-81,-25,114,107,-45,12,57,-63,87,-150,26,61,"); - add("42,-29,28,151,-65,19,165,-64,1,86,3,-73,"); - add("-2,67,-137,-128,58,-19,-139,62,-20,"); - add(""); - //add("/*151*/"); - add("12,1,10885,-3987,-27670,"); - add("-99,-113,-22,-113,-91,-30,-130,-74,-39,-127,-67,-37,"); - add("-158,-91,-44,-8,63,-13,108,109,23,122,81,33,"); - add("131,59,41,117,91,32,119,64,37,"); - add(""); - //add("/*152*/"); - add("12,1,-10784,27846,2885,"); - add("31,19,-71,-6,13,-150,-84,-23,-112,-140,-51,-40,"); - add("-139,-55,-1,-127,-56,54,-43,-30,122,55,9,143,"); - add("106,32,100,140,55,3,133,57,-42,"); - add(""); - //add("/*153*/"); - add("12,-1,-20095,-16594,14860,"); - add("-15,59,46,-47,134,85,5,91,106,32,39,83,"); - add("57,25,102,-93,188,76,-37,-61,-113,-25,-95,-134,"); - add("8,-95,-92,-9,-95,-115,80,-131,-38,"); - add(""); - //add("/*154*/"); - add("12,-1,-19229,22976,-1545,"); - add("-67,-58,-11,-88,-82,-108,-97,-85,-32,-80,-76,-92,"); - add("-72,-59,30,-25,-11,149,79,79,162,92,71,-119,"); - add("3,12,140,91,76,-35,97,78,-55,"); - add(""); - //add("/*155*/"); - add("11,1,-1931,-29525,-4956,"); - add("-34,25,-132,27,24,-147,46,23,-144,42,24,-147,"); - add("128,1,-45,118,-27,110,37,-28,139,-44,-23,143,"); - add("-82,-17,128,-119,-8,89,"); - add(""); - //add("/*156*/"); - add("11,1,-7314,-28817,-4011,"); - add("38,10,-135,63,4,-137,36,13,-147,80,3,-145,"); - add("86,-36,93,124,-44,90,31,-23,107,-108,11,103,"); - add("-109,12,101,-119,17,85,"); - add(""); - //add("/*157*/"); - add("14,1,-10998,25512,-11321,"); - add("41,-28,-103,-54,-61,-84,-107,-71,-54,-129,-62,-11,"); - add("25,48,82,-20,9,39,-150,-48,44,17,44,79,"); - add("187,57,-60,-74,-12,49,7,37,75,121,34,-43,"); - add("45,4,-36,"); - add(""); - //add("/*158*/"); - add("11,1,-29990,-14,-784,"); - add("-1,-139,84,-1,-155,84,4,-105,-129,1,-108,22,"); - add("-3,-4,154,-4,87,124,0,134,-44,0,128,-68,"); - add("1,125,-75,2,107,-82,"); - add(""); - //add("/*159*/"); - add("11,1,24220,-1670,-17623,"); - add("-21,-142,-16,-68,-99,-83,-84,-67,-106,-86,-7,-115,"); - add("-81,59,-114,-40,112,-64,55,102,63,79,92,96,"); - add("91,14,122,90,-31,124,"); - add(""); - //add("/*160*/"); - add("11,1,140,28342,-9835,"); - add("-148,16,46,-147,-2,-5,-152,14,45,-96,34,103,"); - add("101,41,118,139,17,48,150,-6,-21,122,-29,-85,"); - add("100,-38,-111,8,-41,-120,"); - add(""); - //add("/*161*/"); - add("11,1,9134,18840,21486,"); - add("134,-66,0,126,-91,25,135,-54,-13,113,-67,8,"); - add("137,-82,8,-43,62,-34,-97,100,-42,-91,95,-42,"); - add("-150,40,31,-124,74,-11,"); - add(""); - //add("/*162*/"); - add("11,1,-21516,19701,6996,"); - add("-54,-7,-149,-52,-18,-114,-56,-12,-145,-50,-13,-130,"); - add("-118,-89,-128,6,-28,106,77,37,149,69,26,145,"); - add("65,33,115,82,47,123,"); - add(""); - //add("/*163*/"); - add("12,1,-2471,26742,-13370,"); - add("-106,37,95,62,32,52,133,23,22,113,42,66,"); - add("158,-1,-29,145,13,5,63,-27,-64,-93,-46,-80,"); - add("-176,5,39,-113,-29,-42,-113,-42,-63,"); - add(""); - //add("/*164*/"); - add("12,1,-10150,-24537,13962,"); - add("-10,36,55,-102,82,68,-147,64,4,-127,49,-11,"); - add("-133,22,-63,-142,13,-86,47,-28,-11,123,-35,34,"); - add("144,-49,22,137,-52,12,136,-74,-31,"); - add(""); - //add("/*165*/"); - add("12,1,-15831,-23712,9333,"); - add("11,39,120,12,45,131,33,43,159,29,38,136,"); - add("-72,62,33,-54,0,-87,-65,29,-36,-103,35,-86,"); - add("60,-92,-122,18,-56,-109,34,-70,-119,"); - add(""); - //add("/*166*/"); - add("11,-1,-26860,12885,-3537,"); - add("-22,-68,-78,-64,-142,-24,-55,-120,-9,-54,-128,-42,"); - add("-98,-217,-5,28,66,16,59,138,29,57,135,39,"); - add("57,134,44,56,133,53,"); - add(""); - //add("/*167*/"); - add("10,-1,21555,20350,4610,"); - add("-13,-13,117,-23,-10,147,-11,-25,149,15,-65,193,"); - add("89,-66,-109,59,-32,-128,32,3,-154,-26,61,-143,"); - add("-71,111,-150,"); - add(""); - //add("/*168*/"); - add("12,1,25080,-2304,-16299,"); - add("36,-91,68,1,-152,24,5,-145,32,28,-138,68,"); - add("-28,-123,-22,-47,63,-85,-54,77,-96,14,96,4,"); - add("34,84,39,-33,137,-73,5,129,-10,"); - add(""); - //add("/*169*/"); - add("11,1,-5147,-29506,1706,"); - add("36,-1,84,-95,24,126,-104,26,108,-85,24,125,"); - add("-103,29,129,-55,5,-80,41,-19,-145,56,-20,-140,"); - add("89,-24,-121,131,-27,-73,"); - add(""); - //add("/*170*/"); - add("11,1,3601,24897,16346,"); - add("-94,-65,119,-106,-2,25,-143,-42,91,31,-83,117,"); - add("72,-63,79,161,-49,38,88,35,-69,12,73,-110,"); - add("37,67,-109,-8,83,-124,"); - add(""); - //add("/*171*/"); - add("12,1,-16031,-24558,6319,"); - add("-29,-8,-108,-28,-23,-166,19,-42,-123,130,-68,69,"); - add("-58,46,37,5,16,79,101,-54,43,132,-49,140,"); - add("-115,70,-13,-118,58,-72,14,12,83,"); - add(""); - //add("/*172*/"); - add("11,1,4179,29039,-6267,"); - add("73,-37,-121,-54,-26,-151,-57,-23,-136,-114,-7,-103,"); - add("-154,15,-24,-87,34,96,96,17,131,92,8,92,"); - add("101,10,108,59,10,82,"); - add(""); - //add("/*173*/"); - add("11,1,7225,28615,-5385,"); - add("-150,30,-40,-139,24,-51,-152,36,-3,-23,32,144,"); - add("-4,26,134,100,-10,76,124,-44,-80,137,-42,-45,"); - add("123,-46,-80,49,-24,-60,"); - add(""); - //add("/*174*/"); - add("10,1,27028,-4267,-12299,"); - add("-47,-101,-69,-68,-50,-128,-76,-143,-112,-39,74,-109,"); - add("-42,100,-123,53,124,69,69,41,132,55,-48,134,"); - add("67,29,136,"); - add(""); - //add("/*175*/"); - add("11,-1,17469,24240,2693,"); - add("-28,25,-38,-83,72,-130,-50,50,-130,-52,49,-133,"); - add("-57,55,-170,-37,23,45,59,-55,143,73,-63,123,"); - add("51,-50,127,70,-63,122,"); - add(""); - //add("/*176*/"); - add("11,1,9832,-4353,-28007,"); - add("-12,-95,11,-32,-144,12,-59,-142,3,-104,-107,-18,"); - add("-134,-122,-24,-2,72,-13,44,125,-7,81,123,7,"); - add("60,126,0,75,131,5,"); - add(""); - //add("/*177*/"); - add("11,-1,3662,25807,14853,"); - add("-135,2,28,-21,-77,138,-117,-27,73,-24,-53,95,"); - add("13,-75,123,53,-20,22,115,39,-92,129,32,-84,"); - add("65,57,-113,-8,65,-110,"); - add(""); - //add("/*178*/"); - add("10,1,-6841,-28848,-4579,"); - add("-89,40,-117,11,19,-132,-44,36,-150,0,26,-145,"); - add("120,-16,-75,82,-38,102,0,-25,145,26,-31,146,"); - add("-18,-20,148,"); - add(""); - //add("/*179*/"); - add("10,1,10303,-4850,-27755,"); - add("-3,-110,18,-87,-118,-10,-139,-39,-44,-145,-16,-49,"); - add("-168,-5,-59,51,128,-5,128,85,30,144,11,50,"); - add("127,49,38,"); - add(""); - //add("/*180*/"); - add("11,1,27435,-3603,-11592,"); - add("23,-70,78,-36,-77,-61,-56,-11,-129,-70,-5,-160,"); - add("-45,48,-118,-47,48,-121,14,73,10,61,-2,139,"); - add("60,0,137,60,1,140,"); - add(""); - //add("/*181*/"); - add("11,-1,-19573,-21914,6055,"); - add("-41,72,126,-22,58,133,28,17,146,73,-23,140,"); - add("-46,47,21,-91,40,-142,13,-52,-136,-19,-29,-159,"); - add("7,-23,-56,76,-90,-80,"); - add(""); - //add("/*182*/"); - add("10,1,-16090,-23678,8971,"); - add("67,-15,80,5,55,152,3,53,138,-68,112,164,"); - add("-100,20,-121,-81,-5,-154,100,-81,-30,55,-62,-63,"); - add("-13,-40,-128,"); - add(""); - //add("/*183*/"); - add("10,1,-7427,29059,-664,"); - add("-79,-23,-102,-94,-27,-62,-135,-36,-21,-102,-25,98,"); - add("-81,-19,122,31,12,139,154,41,18,142,38,-17,"); - add("130,32,-78,"); - add(""); - //add("/*184*/"); - add("10,1,22146,-6178,-19271,"); - add("-60,73,-92,-58,116,-102,55,130,23,75,-34,95,"); - add("107,-20,130,99,39,103,19,-78,46,-68,-127,-39,"); - add("-96,-82,-86,"); - add(""); - //add("/*185*/"); - add("11,-1,13300,25127,9578,"); - add("29,41,-150,-7,56,-141,23,35,-126,-131,89,-57,"); - add("-40,16,13,126,-92,70,-14,-37,123,9,-49,120,"); - add("-29,-40,146,39,-43,58,"); - add(""); - //add("/*186*/"); - add("10,-1,11562,21630,17276,"); - add("116,-40,-28,140,-47,-37,107,-42,-21,214,-140,24,"); - add("-64,64,-33,-121,92,-31,-136,91,-20,-132,38,42,"); - add("-104,7,62,"); - add(""); - //add("/*187*/"); - add("10,1,-25792,5633,14249,"); - add("-43,-12,-74,-78,-55,-120,-19,-181,35,-89,-108,-124,"); - add("22,-32,53,73,1,134,79,31,133,37,137,15,"); - add("34,178,-7,"); - add(""); - //add("/*188*/"); - add("10,1,-11381,25287,-11447,"); - add("56,-2,-59,-84,-68,-68,-114,-80,-60,-126,-71,-28,"); - add("-165,-107,-62,31,58,91,86,77,80,112,81,64,"); - add("118,75,46,"); - add(""); - //add("/*189*/"); - add("11,-1,-17257,23572,6821,"); - add("-79,-32,-89,-16,23,-121,-53,-38,-4,-103,-94,61,"); - add("-62,-78,109,-89,-94,93,16,8,12,124,83,35,"); - add("113,76,31,108,92,-44,"); - add(""); - //add("/*190*/"); - add("9,1,21029,-858,-21378,"); - add("-82,-38,-80,-104,-45,-99,-108,-41,-101,-166,25,-159,"); - add("75,53,68,106,28,100,109,16,104,108,13,105,"); - add(""); - //add("/*191*/"); - add("9,-1,16710,18554,16629,"); - add("40,-81,51,77,-100,31,90,-117,38,114,-123,18,"); - add("63,61,-130,-74,118,-54,-114,76,32,-75,122,-59,"); - add(""); - //add("/*192*/"); - add("10,1,-26154,13570,5641,"); - add("12,-36,142,-22,-92,112,-38,-97,53,-91,-175,-11,"); - add("33,46,40,70,120,43,37,119,-105,21,92,-118,"); - add("-14,33,-142,"); - add(""); - //add("/*193*/"); - add("10,1,-10691,-27735,4062,"); - add("89,-25,58,-53,43,153,-92,50,88,-103,49,54,"); - add("-119,59,77,-44,12,-36,69,-48,-127,98,-54,-100,"); - add("91,-52,-105,"); - add(""); - //add("/*194*/"); - add("9,1,5294,28803,-6509,"); - add("141,-38,-53,58,-14,-13,-125,-7,-132,-82,-14,-124,"); - add("-128,1,-92,-86,43,117,12,33,151,77,15,126,"); - add(""); - //add("/*195*/"); - add("10,1,-13366,24028,-12001,"); - add("65,-24,-120,-58,-49,-32,-118,-69,-5,-122,-71,-3,"); - add("-204,-95,43,57,44,22,133,68,-16,108,81,37,"); - add("61,66,65,"); - add(""); - //add("/*196*/"); - add("9,1,-13524,26719,1794,"); - add("-49,-16,-141,-59,-24,-103,-129,-63,-57,-127,-69,46,"); - add("11,-3,148,97,43,109,110,51,85,128,63,31,"); - add(""); - //add("/*197*/"); - add("10,-1,-19280,22118,-6250,"); - add("3,37,124,-25,20,152,-29,10,132,-36,9,154,"); - add("72,66,13,-1,-41,-155,5,-30,-131,31,-11,-139,"); - add("-4,-39,-126,"); - add(""); - //add("/*198*/"); - add("9,1,-5809,29420,-843,"); - add("-132,-27,-12,-164,-32,56,-135,-28,15,-23,-2,88,"); - add("83,20,143,154,33,14,113,21,-95,112,20,-106,"); - add(""); - //add("/*199*/"); - add("10,-1,-2866,4214,29564,"); - add("-77,-108,8,-26,-121,14,-26,-158,18,141,-133,31,"); - add("54,162,-16,-71,-12,-5,-48,38,-10,28,155,-18,"); - add("20,115,-14,"); - add(""); - //add("/*200*/"); - add("9,1,16380,-17659,-17885,"); - add("-77,86,-154,103,64,31,97,45,45,96,-26,114,"); - add("95,-32,121,-11,-89,78,-111,-41,-64,-107,11,-109,"); - add(""); - //add("/*201*/"); - add("8,1,2405,29362,5664,"); - add("-161,-1,74,55,-28,117,40,-40,180,167,-13,-2,"); - add("108,5,-68,27,32,-171,-115,17,-38,"); - add(""); - //add("/*202*/"); - add("10,-1,15812,18669,17362,"); - add("62,-1,-56,121,-24,-85,101,-18,-76,-52,103,-62,"); - add("26,105,-142,-85,18,62,-29,-52,84,-107,-11,112,"); - add("-38,-69,109,"); - add(""); - //add("/*203*/"); - add("9,-1,-22192,18429,-8241,"); - add("-24,-51,-48,-42,-105,-120,-45,-95,-83,3,-94,-206,"); - add("-31,-5,68,-7,65,158,63,115,82,45,106,111,"); - add(""); - //add("/*204*/"); - add("9,1,11904,-3476,-27317,"); - add("-52,-83,-12,-106,-103,-32,-102,-113,-28,-187,-67,-70,"); - add("48,72,10,85,121,20,114,88,37,122,81,42,"); - add(""); - //add("/*205*/"); - add("9,1,29712,544,-4112,"); - add("13,98,108,12,125,117,18,-20,133,2,-58,5,"); - add("-9,-130,-90,-10,-97,-91,-13,-138,-111,-12,92,-79,"); - add(""); - //add("/*206*/"); - add("9,1,9469,-5342,-27961,"); - add("-76,-64,-13,-89,-111,-8,-123,-76,-26,-193,-36,-55,"); - add("20,109,-15,111,75,21,140,40,38,133,73,30,"); - add(""); - //add("/*207*/"); - add("9,1,-4851,24586,-16492,"); - add("112,-15,-56,112,-35,-83,77,-73,-128,-49,-63,-78,"); - add("-117,34,82,-120,28,75,-155,20,75,46,45,53,"); - add(""); - //add("/*208*/"); - add("9,1,24496,6480,-16061,"); - add("42,-192,-12,-66,29,-89,-56,-72,-113,-60,-98,-126,"); - add("-32,66,-23,30,120,90,46,90,104,59,71,119,"); - add(""); - //add("/*209*/"); - add("9,1,-5809,29356,-2119,"); - add("25,-3,-102,10,-9,-147,-56,-22,-131,-154,-34,-30,"); - add("-109,-15,91,2,14,160,131,31,59,80,23,86,"); - add(""); - //add("/*210*/"); - add("9,-1,28373,6866,-6918,"); - add("16,-102,-31,-1,-97,-101,-9,-80,-107,-21,-107,-180,"); - add("-10,66,19,7,96,117,-9,131,86,7,89,112,"); - add(""); - //add("/*211*/"); - add("9,1,6654,-7693,-28223,"); - add("85,43,9,-37,-186,42,-30,-149,34,-106,-88,0,"); - add("-146,59,-50,24,144,-35,100,82,0,88,19,15,"); - add(""); - //add("/*212*/"); - add("9,1,23496,6501,17484,"); - add("57,-56,-56,91,-46,-107,87,15,-125,87,76,-150,"); - add("-52,72,45,-85,13,113,-84,-4,117,-82,-11,114,"); - add(""); - //add("/*213*/"); - add("9,-1,-6643,25925,-13555,"); - add("69,0,-34,128,-11,-84,105,-27,-99,109,-26,-98,"); - add("-71,-55,-69,-126,21,96,-97,28,97,-76,47,126,"); - add(""); - //add("/*214*/"); - add("9,1,-7497,28006,-7711,"); - add("-100,-11,58,-138,-24,49,27,14,24,77,47,98,"); - add("45,58,175,104,24,-16,36,-35,-168,12,-31,-128,"); - add(""); - //add("/*215*/"); - add("9,-1,-20663,19947,-8671,"); - add("-9,-40,-67,-99,-111,-19,-110,-98,41,-117,-97,63,"); - add("8,54,105,53,64,15,102,73,-80,114,93,-60,"); - add(""); - //add("/*216*/"); - add("9,1,4747,25258,15476,"); - add("-15,-47,81,-25,-76,129,-32,-73,126,23,-91,137,"); - add("39,12,-30,3,79,-126,12,80,-131,10,77,-128,"); - add(""); - //add("/*217*/"); - add("8,1,8037,27999,7173,"); - add("126,-37,4,70,13,-132,-8,42,-161,-67,37,-70,"); - add("-146,35,28,-97,4,97,30,-44,140,"); - add(""); - //add("/*218*/"); - add("8,1,-8206,28777,-2132,"); - add("89,20,-69,43,0,-147,-75,-30,-114,-146,-37,57,"); - add("-176,-46,61,49,22,105,122,42,81,"); - add(""); - //add("/*219*/"); - add("8,1,26623,-4311,-13138,"); - add("27,-94,85,6,-161,68,-36,-68,-50,-84,-1,-169,"); - add("-19,104,-74,-3,147,-55,61,86,94,"); - add(""); - //add("/*220*/"); - add("9,-1,-19193,23050,547,"); - add("-3,0,-116,-126,-104,-79,-91,-76,-9,-51,-45,93,"); - add("-32,-30,123,62,50,72,131,111,3,92,79,-39,"); - add(""); - //add("/*221*/"); - add("9,-1,-21968,17844,-9950,"); - add("-52,-145,-144,-65,-32,87,-53,11,139,-99,-72,94,"); - add("6,11,5,105,80,-92,45,-8,-115,86,123,27,"); - add(""); - //add("/*222*/"); - add("8,1,-9395,-28397,2317,"); - add("-3,14,145,-6,15,151,-50,30,144,-103,31,-45,"); - add("14,-17,-132,18,-21,-163,44,-26,-140,"); - add(""); - //add("/*223*/"); - add("8,1,-23532,-559,18600,"); - add("-51,-140,-71,78,10,100,72,112,94,44,111,58,"); - add("-18,153,-19,-74,-18,-94,-47,-129,-61,"); - add(""); - //add("/*224*/"); - add("8,1,29597,-880,-4821,"); - add("11,119,49,14,132,63,15,122,85,18,-57,120,"); - add("-6,-139,-20,-16,-129,-81,-21,-93,-116,"); - add(""); - //add("/*225*/"); - add("8,1,-4242,28374,8769,"); - add("-111,-19,10,-148,-19,-16,-174,-48,66,87,-11,80,"); - add("150,10,44,156,20,13,59,45,-115,"); - add(""); - //add("/*226*/"); - add("8,-1,23521,18132,-4238,"); - add("22,2,127,85,-98,57,62,-96,-62,2,-37,-146,"); - add("-18,-15,-158,-76,95,-24,-53,98,119,"); - add(""); - //add("/*227*/"); - add("9,-1,-12721,26335,-6680,"); - add("101,34,-59,-12,-37,-121,21,-30,-150,97,11,-132,"); - add("-22,-9,4,-87,-9,120,-32,24,149,-30,19,133,"); - add(""); - //add("/*228*/"); - add("8,1,28556,-1354,-9094,"); - add("4,-123,32,-10,-153,-7,-42,-14,-129,-41,-5,-126,"); - add("-13,145,-64,30,120,73,44,44,129,"); - add(""); - //add("/*229*/"); - add("9,-1,-13304,26737,-2855,"); - add("-76,-34,35,-77,-28,107,23,22,102,145,75,25,"); - add("91,53,92,49,18,-63,-12,-18,-126,-95,-61,-143,"); - add(""); - //add("/*230*/"); - add("9,1,-4166,24261,-17148,"); - add("79,-11,-35,76,-52,-91,33,-64,-96,128,-60,-112,"); - add("-52,-17,-11,-135,41,86,-105,58,105,-31,69,105,"); - add(""); - //add("/*231*/"); - add("10,-1,22208,16310,-11865,"); - add("-45,2,-82,-109,78,-95,-87,149,46,91,-49,101,"); - add("52,-108,-53,29,8,64,39,3,77,28,-4,47,"); - add("-22,-51,-112,"); - add(""); - //add("/*232*/"); - add("8,-1,18389,23461,-3379,"); - add("78,-58,17,126,-102,-8,148,-120,-6,-26,11,-72,"); - add("-120,91,-34,-120,92,-23,-123,105,59,"); - add(""); - //add("/*233*/"); - add("9,-1,-12115,27105,4305,"); - add("73,39,-40,98,61,-114,58,51,-174,-77,-33,0,"); - add("-134,-60,2,-95,-52,66,69,14,109,8,-12,101,"); - add(""); - //add("/*234*/"); - add("9,1,22705,-5,-19608,"); - add("49,-19,57,108,-56,126,-44,-88,-51,-88,25,-103,"); - add("-59,-15,-68,-104,-20,-119,-6,99,-7,89,57,101,"); - add(""); - //add("/*235*/"); - add("9,-1,-21304,20829,-3509,"); - add("-61,-67,-28,-89,-92,7,-93,-82,84,-97,-83,115,"); - add("17,17,-6,85,72,-102,93,83,-81,88,91,-4,"); - add(""); - //add("/*236*/"); - add("8,1,21301,-2864,-20930,"); - add("49,-109,66,-5,-141,14,-17,-126,3,-108,-60,-101,"); - add("-16,142,-38,0,130,-20,43,142,24,"); - add(""); - //add("/*237*/"); - add("8,1,-3541,26084,-14390,"); - add("91,-16,-52,143,-42,-108,-84,-54,-78,-183,-37,-22,"); - add("-110,17,58,-27,44,86,84,68,100,"); - add(""); - //add("/*238*/"); - add("9,1,-17503,-23888,4794,"); - add("98,-63,45,73,-33,99,90,-40,118,83,-41,84,"); - add("-47,33,-2,-82,42,-75,-89,41,-118,-87,42,-97,"); - add(""); - //add("/*239*/"); - add("8,1,-20659,21543,3021,"); - add("-20,-9,-74,-10,14,-179,-30,-5,-194,-34,-42,74,"); - add("-22,-39,146,-6,-28,161,69,56,82,"); - add(""); - //add("/*240*/"); - add("8,1,24748,-885,-16934,"); - add("0,-113,6,-74,-41,-105,-86,34,-125,-97,38,-141,"); - add("31,56,41,88,29,123,87,22,125,"); - add(""); - //add("/*241*/"); - add("8,1,22276,-3747,-19742,"); - add("48,-106,75,49,-132,82,14,-106,39,-61,-71,-56,"); - add("-56,105,-85,-48,125,-80,7,156,-22,"); - add(""); - //add("/*242*/"); - add("10,1,-16881,-24201,5419,"); - add("-73,37,-65,-75,32,-95,-64,29,-74,60,-59,-77,"); - add("117,-85,-15,9,15,101,70,-48,1,35,-8,76,"); - add("-39,49,98,"); - add(""); - //add("/*243*/"); - add("8,1,-26588,12735,5561,"); - add("-52,-110,-1,-64,-123,-29,-32,-112,98,26,1,117,"); - add("60,110,43,41,123,-81,39,119,-83,"); - add(""); - //add("/*244*/"); - add("8,-1,15516,21285,-14359,"); - add("23,35,76,93,9,115,97,-78,-10,65,-106,-84,"); - add("1,-79,-116,-126,63,-47,-117,100,21,"); - add(""); - //add("/*245*/"); - add("8,1,7216,28601,-5469,"); - add("-30,-19,-138,2,-31,-152,-102,13,-61,-63,39,115,"); - add("40,19,146,74,4,118,101,-17,42,"); - add(""); - //add("/*246*/"); - add("8,1,3833,29553,3454,"); - add("2,11,-94,-34,18,-128,11,16,-167,-129,16,5,"); - add("28,-19,150,-9,-15,145,51,-17,88,"); - add(""); - //add("/*247*/"); - add("8,1,8843,28172,5303,"); - add("87,-18,-50,96,-15,-85,-82,41,-80,-143,38,39,"); - add("-156,43,31,-1,-21,116,113,-45,51,"); - add(""); - //add("/*248*/"); - add("7,1,21050,-381,-21372,"); - add("-94,-69,-91,-60,-120,-55,-138,-33,-132,42,113,37,"); - add("87,98,82,100,30,97,"); - add(""); - //add("/*249*/"); - add("7,-1,3999,25672,14999,"); - add("-52,-42,85,-37,-69,127,-3,-123,204,68,48,-97,"); - add("34,74,-133,7,66,-113,"); - add(""); - //add("/*250*/"); - add("8,1,-26361,12892,6235,"); - add("1,-67,145,-25,-108,108,-66,-133,-7,7,-5,35,"); - add("64,140,-9,25,106,-109,6,79,-137,"); - add(""); - //add("/*251*/"); - add("7,1,5148,25410,15094,"); - add("-78,-27,72,-48,-71,134,82,-126,180,79,41,-93,"); - add("22,67,-118,-13,83,-135,"); - add(""); - //add("/*252*/"); - add("7,1,24083,-4111,-17411,"); - add("-86,-14,-114,-93,-6,-126,-79,82,-125,26,70,20,"); - add("82,-15,114,86,-24,122,"); - add(""); - //add("/*253*/"); - add("8,1,12234,-12996,-24113,"); - add("-13,134,-78,-26,127,-81,41,134,-49,38,-2,21,"); - add("7,-140,76,11,-113,66,-8,-133,66,"); - add(""); - //add("/*254*/"); - add("7,1,1263,19267,22961,"); - add("-88,-22,23,-158,-114,102,113,-77,58,145,-30,17,"); - add("99,111,-97,-85,84,-65,"); - add(""); - //add("/*255*/"); - add("7,1,24383,5280,-16661,"); - add("76,-40,99,82,-101,90,0,-112,-34,-83,-22,-130,"); - add("-94,69,-117,-28,126,-2,"); - add(""); - //add("/*256*/"); - add("7,1,-3500,28664,8132,"); - add("-101,3,-56,-87,-33,79,32,-31,122,146,-35,183,"); - add("74,35,-91,-25,38,-140,"); - add(""); - //add("/*257*/"); - add("8,-1,10996,25265,11864,"); - add("114,-70,44,116,-82,64,52,-26,5,-116,97,-94,"); - add("-74,86,-116,-38,46,-62,-72,-30,131,"); - add(""); - //add("/*258*/"); - add("7,1,-8489,-28676,2368,"); - add("-45,2,-135,100,-37,-107,135,-40,-4,125,-27,112,"); - add("-82,28,67,-130,43,60,"); - add(""); - //add("/*259*/"); - add("7,1,-8544,-28708,1696,"); - add("-64,29,149,-100,35,82,-99,28,-39,-66,10,-166,"); - add("105,-33,-17,131,-44,-61,"); - add(""); - //add("/*260*/"); - add("7,1,-13684,26583,2464,"); - add("-102,-45,-76,-137,-72,-1,-98,-61,98,57,23,82,"); - add("129,64,34,127,69,-25,"); - add(""); - //add("/*261*/"); - add("7,1,-26462,13710,-3429,"); - add("-39,-77,-11,-70,-135,9,-110,-205,50,42,81,-8,"); - add("70,130,-33,70,134,-11,"); - add(""); - //add("/*262*/"); - add("8,1,25177,-2424,-16132,"); - add("51,-55,88,15,-120,43,7,-149,35,-50,-56,-68,"); - add("-40,47,-72,-13,136,-42,-1,134,-23,"); - add(""); - //add("/*263*/"); - add("7,1,-3593,28752,7771,"); - add("-130,-26,38,52,-25,114,199,4,74,-100,25,-133,"); - add("94,-2,50,-8,17,-66,"); - add(""); - //add("/*264*/"); - add("7,-1,18992,23204,-949,"); - add("50,-38,79,76,-60,101,116,-98,-56,11,-14,-132,"); - add("-109,85,-121,-102,88,82,"); - add(""); - //add("/*265*/"); - add("8,-1,16204,715,25237,"); - add("81,6,-52,141,-44,-91,9,71,-7,57,116,-41,"); - add("-71,-2,46,-126,-45,84,-122,-29,79,"); - add(""); - //add("/*266*/"); - add("7,1,11947,21012,-17769,"); - add("90,-72,-26,194,-154,-48,-100,47,-12,-129,85,11,"); - add("-141,54,-30,6,35,45,"); - add(""); - //add("/*267*/"); - add("8,1,-16323,24985,3054,"); - add("-64,-37,-40,-137,-88,-25,45,14,127,106,64,47,"); - add("-94,-61,-2,45,28,14,119,78,0,"); - add(""); - //add("/*268*/"); - add("8,-1,7459,26926,10924,"); - add("54,-44,73,122,-54,47,141,-87,112,-11,22,-44,"); - add("-44,63,-124,-40,29,-43,-140,56,-39,"); - add(""); - //add("/*269*/"); - add("7,1,4421,25599,-15005,"); - add("-163,57,51,-149,43,31,21,58,107,177,-45,-28,"); - add("85,-78,-109,70,-35,-40,"); - add(""); - //add("/*270*/"); - add("7,1,-3740,24124,-17437,"); - add("101,-6,-30,60,-71,-110,103,-102,-159,-74,7,24,"); - add("-92,67,110,-103,58,101,"); - add(""); - //add("/*271*/"); - add("7,-1,1630,23899,18060,"); - add("-7,-73,97,26,-79,102,152,4,-20,36,74,-101,"); - add("-85,82,-100,-54,59,-73,"); - add(""); - //add("/*272*/"); - add("8,-1,17320,22752,-9075,"); - add("98,-58,42,126,-77,52,92,-86,-38,-16,-14,-65,"); - add("-118,74,-44,-114,64,-61,-33,40,37,"); - add(""); - //add("/*273*/"); - add("7,1,6068,25608,14403,"); - add("-109,-11,63,-81,-45,113,88,-96,131,38,13,-37,"); - add("76,40,-102,88,57,-137,"); - add(""); - //add("/*274*/"); - add("7,-1,17827,6043,23359,"); - add("31,69,-41,30,130,-58,-71,130,20,-122,-25,100,"); - add("-17,-150,53,104,-86,-57,"); - add(""); - //add("/*275*/"); - add("7,1,1364,-29308,-6258,"); - add("-135,6,-59,24,23,-99,160,6,5,116,9,-12,"); - add("-36,-41,177,-50,-18,77,"); - add(""); - //add("/*276*/"); - add("7,-1,-18191,-23193,5583,"); - add("-74,68,39,-13,62,212,-55,22,-91,-92,34,-161,"); - add("66,-58,-18,115,-88,14,"); - add(""); - //add("/*277*/"); - add("7,1,-5480,29422,-2079,"); - add("-34,-15,-115,-39,-20,-165,-65,-8,54,-52,0,129,"); - add("-26,6,157,144,28,11,"); - add(""); - //add("/*278*/"); - add("7,1,-26312,13467,5132,"); - add("-14,-64,92,38,20,140,63,44,193,-5,18,-68,"); - add("-32,5,-167,-49,-50,-118,"); - add(""); - //add("/*279*/"); - add("7,1,22241,13603,14842,"); - add("-48,6,67,-63,-46,135,-55,-108,176,47,-5,-64,"); - add("67,36,-130,39,71,-123,"); - add(""); - //add("/*280*/"); - add("7,-1,-10783,26096,-10136,"); - add("-73,-35,-11,-140,-53,13,-193,-93,-27,52,35,34,"); - add("133,61,9,143,53,-17,"); - add(""); - //add("/*281*/"); - add("7,1,29783,1256,-3378,"); - add("4,68,62,9,88,122,11,87,149,6,-96,12,"); - add("-11,-65,-136,-11,-87,-135,"); - add(""); - //add("/*282*/"); - add("6,1,-17758,24025,2727,"); - add("-29,-6,-136,-87,-59,-52,-36,-45,161,-5,-25,188,"); - add("115,91,-49,"); - add(""); - //add("/*283*/"); - add("7,-1,-23952,18049,730,"); - add("-55,-75,42,-87,-119,38,-109,-148,28,35,46,27,"); - add("86,118,-37,85,116,-45,"); - add(""); - //add("/*284*/"); - add("7,-1,-1959,8253,28776,"); - add("-85,-33,3,-109,-82,16,-4,-124,34,54,-81,27,"); - add("-38,210,-62,109,71,-12,"); - add(""); - //add("/*285*/"); - add("7,1,24446,-969,-17363,"); - add("-58,-41,-79,-90,6,-125,-105,28,-146,25,31,33,"); - add("90,3,124,90,-3,125,"); - add(""); - //add("/*286*/"); - add("8,1,2887,27868,10725,"); - add("80,24,-85,93,20,-77,7,53,-145,-59,-21,75,"); - add("-54,25,-53,-39,-26,81,-25,-45,125,"); - add(""); - //add("/*287*/"); - add("7,1,21419,-3233,-20756,"); - add("-24,-119,-5,12,-123,32,-51,-112,-33,-75,85,-91,"); - add("2,117,-17,84,108,68,"); - add(""); - //add("/*288*/"); - add("8,1,20078,-7369,-21038,"); - add("-57,-7,-51,-117,-24,-103,-4,61,-24,22,130,-24,"); - add("47,74,19,75,-19,78,19,-139,65,"); - add(""); - //add("/*289*/"); - add("7,1,10608,21446,-18098,"); - add("-155,71,-6,-130,74,14,-41,49,34,179,-75,14,"); - add("129,-71,-9,65,-54,-26,"); - add(""); - //add("/*290*/"); - add("7,1,16151,-1050,-25260,"); - add("73,-1,47,122,24,78,149,-61,101,-61,-44,-39,"); - add("-138,-12,-89,-119,62,-80,"); - add(""); - //add("/*291*/"); - add("7,1,6256,-8530,-28073,"); - add("-89,-10,-17,-70,70,-36,128,113,-6,110,109,-7,"); - add("42,-69,29,-89,-109,12,"); - add(""); - //add("/*292*/"); - add("7,1,21026,13541,-16569,"); - add("85,-69,51,75,-69,41,109,-154,15,-55,43,-35,"); - add("-94,98,-42,-107,95,-60,"); - add(""); - //add("/*293*/"); - add("8,-1,-18859,-22602,5789,"); - add("106,-54,128,-49,49,33,-140,115,-9,47,-48,-33,"); - add("-95,67,-50,48,-51,-39,45,-53,-57,"); - add(""); - //add("/*294*/"); - add("7,-1,13656,23661,12396,"); - add("32,42,-116,-54,77,-89,-37,92,-139,-18,-4,28,"); - add("39,-82,118,30,-82,124,"); - add(""); - //add("/*295*/"); - add("6,1,8006,23007,-17510,"); - add("-151,56,6,-121,86,60,17,53,78,158,-90,-50,"); - add("129,-58,-17,"); - add(""); - //add("/*296*/"); - add("6,1,3087,24735,16693,"); - add("-183,-19,61,72,-85,112,104,-38,36,118,33,-70,"); - add("-33,81,-113,"); - add(""); - //add("/*297*/"); - add("8,1,-12618,24857,-11088,"); - add("2,-45,-102,-53,-74,-102,-86,-31,27,-39,-19,5,"); - add("-60,-22,19,43,77,120,114,79,46,"); - add(""); - //add("/*298*/"); - add("7,1,-11749,25130,-11421,"); - add("-35,-49,-71,-110,-76,-53,-90,-82,-83,-13,29,76,"); - add("66,77,98,79,60,49,"); - add(""); - //add("/*299*/"); - add("6,1,25018,-660,-16543,"); - add("66,-4,101,79,41,119,27,-147,48,-86,-7,-132,"); - add("-78,19,-120,"); - add(""); - //add("/*300*/"); - add("6,1,-15854,-24577,6681,"); - add("-80,25,-102,-66,-1,-162,84,-61,-26,86,-28,105,"); - add("62,-4,134,"); - add(""); - //add("/*301*/"); - add("7,-1,-17115,24557,-2011,"); - add("-4,-10,-84,-33,-36,-146,-32,-36,-148,-29,-18,28,"); - add("31,35,137,43,41,129,"); - add(""); - //add("/*302*/"); - add("6,1,11398,-4172,-27435,"); - add("70,-114,47,-117,-58,-40,-136,-105,-39,19,127,-12,"); - add("86,103,19,"); - add(""); - //add("/*303*/"); - add("6,1,-7436,14318,25292,"); - add("-138,-58,-8,-83,-61,10,93,-96,81,117,106,-25,"); - add("98,110,-33,"); - add(""); - //add("/*304*/"); - add("6,1,23814,-745,-18231,"); - add("5,-93,11,-74,-60,-93,-123,36,-160,55,113,66,"); - add("88,29,112,"); - add(""); - //add("/*305*/"); - add("6,1,-1698,25570,15597,"); - add("-88,-23,28,-115,-50,69,-31,-88,138,120,34,-41,"); - add("93,65,-95,"); - add(""); - //add("/*306*/"); - add("6,1,-11912,25153,-11200,"); - add("122,17,-91,-65,-58,-60,-143,-93,-55,-30,42,124,"); - add("22,55,98,"); - add(""); - //add("/*307*/"); - add("7,-1,-20089,-9689,20064,"); - add("-66,89,-24,-76,153,-4,-18,-81,-56,69,-127,9,"); - add("0,-83,-41,39,-9,36,"); - add(""); - //add("/*308*/"); - add("6,-1,22251,15516,-12811,"); - add("-4,-87,-113,-86,26,-115,-20,54,30,-35,135,102,"); - add("72,-15,105,"); - add(""); - //add("/*309*/"); - add("6,1,-6458,14255,25595,"); - add("-96,-106,34,-5,-26,13,156,64,4,89,105,-36,"); - add("-32,97,-62,"); - add(""); - //add("/*310*/"); - add("6,1,24489,-4261,-16797,"); - add("-10,-92,9,-89,-34,-121,-92,55,-144,55,71,59,"); - add("88,1,127,"); - add(""); - //add("/*311*/"); - add("6,1,-3316,28682,8146,"); - add("-99,13,-88,-180,-9,-46,35,-13,63,114,-17,109,"); - add("104,-4,57,"); - add(""); - //add("/*312*/"); - add("6,1,23528,1053,-18582,"); - add("-67,39,-83,-53,129,-59,31,123,48,82,-81,98,"); - add("24,-132,22,"); - add(""); - //add("/*313*/"); - add("6,1,-6353,29317,-386,"); - add("14,2,-107,-3,-4,-150,-118,-26,-18,-33,-4,162,"); - add("41,10,114,"); - add(""); - //add("/*314*/"); - add("6,1,23124,-10704,15834,"); - add("-88,-20,114,-37,-123,-29,45,-75,-117,87,56,-90,"); - add("11,96,50,"); - add(""); - //add("/*315*/"); - add("6,1,-10965,-27064,6879,"); - add("25,16,101,-67,56,109,-142,44,-53,-20,-23,-122,"); - add("130,-66,-46,"); - add(""); - //add("/*316*/"); - add("6,-1,4917,27988,9617,"); - add("96,-21,12,87,14,-86,-36,72,-196,-54,-7,52,"); - add("-60,-39,146,"); - add(""); - //add("/*317*/"); - add("6,1,-11542,-27125,5570,"); - add("69,-16,65,6,36,182,-109,54,35,-56,5,-86,"); - add("48,-47,-128,"); - add(""); - //add("/*318*/"); - add("6,1,22858,-880,-19409,"); - add("54,-24,64,110,-68,135,-61,-87,-69,-99,7,-118,"); - add("-23,91,-31,"); - add(""); - //add("/*319*/"); - add("6,1,-27648,11150,3354,"); - add("-39,-102,17,-24,-74,43,36,42,159,49,126,-16,"); - add("5,55,-140,"); - add(""); - //add("/*320*/"); - add("6,1,4612,1962,29578,"); - add("-94,-31,17,-91,-132,22,33,-105,1,110,57,-20,"); - add("72,140,-20,"); - add(""); - //add("/*321*/"); - add("6,1,-1839,23767,-18214,"); - add("43,-51,-70,184,-58,-92,-78,-8,-5,-124,19,37,"); - add("-76,60,86,"); - add(""); - //add("/*322*/"); - add("6,1,-26596,11995,6985,"); - add("-39,-139,86,-29,-85,33,2,-50,90,31,136,-108,"); - add("38,127,-73,"); - add(""); - //add("/*323*/"); - add("6,1,23795,-164,-18269,"); - add("46,-55,61,-29,-158,-37,-96,-53,-122,18,74,22,"); - add("25,130,30,"); - add(""); - //add("/*324*/"); - add("6,-1,-22867,-15404,11824,"); - add("41,24,111,-8,76,82,-82,57,-84,-53,-42,-157,"); - add("49,-85,-16,"); - add(""); - //add("/*325*/"); - add("6,1,11693,24510,-12748,"); - add("-64,-20,-97,-125,88,56,42,40,114,136,-64,1,"); - add("67,-45,-25,"); - add(""); - //add("/*326*/"); - add("6,1,-11168,-26833,7435,"); - add("18,20,99,82,1,123,-42,34,56,-107,16,-99,"); - add("-14,-37,-154,"); - add(""); - //add("/*327*/"); - add("6,1,-13936,24051,-11284,"); - add("-74,-76,-70,-60,-62,-58,-96,-32,54,16,53,90,"); - add("118,80,24,"); - add(""); - //add("/*328*/"); - add("6,1,29225,434,-6762,"); - add("18,61,82,30,61,138,16,-62,70,-16,-81,-79,"); - add("-37,-17,-167,"); - add(""); - //add("/*329*/"); - add("5,1,-3608,-29413,4678,"); - add("-92,6,-37,-199,3,-144,96,-6,43,125,-3,78,"); - add(""); - //add("/*330*/"); - add("5,1,27658,11617,-322,"); - add("34,-81,36,84,-207,-52,-36,85,-79,-53,132,33,"); - add(""); - //add("/*331*/"); - add("5,1,-2705,-28959,7352,"); - add("-24,22,78,-115,57,175,-66,-24,-114,139,-38,-97,"); - add(""); - //add("/*332*/"); - add("5,-1,-15874,23873,-8837,"); - add("-68,-40,15,-221,-126,61,94,56,-19,128,75,-31,"); - add(""); - //add("/*333*/"); - add("5,1,-22981,137,19284,"); - add("-96,-29,-116,4,-81,5,107,-35,129,62,114,74,"); - add(""); - //add("/*334*/"); - add("6,1,-7340,25545,-13913,"); - add("87,9,-28,74,-38,-109,-2,-50,-89,-113,4,66,"); - add("-83,37,110,"); - add(""); - //add("/*335*/"); - add("5,1,1932,28169,-10137,"); - add("142,19,82,88,-34,-77,-105,-34,-118,-115,11,8,"); - add(""); - //add("/*336*/"); - add("5,1,-2239,29202,6500,"); - add("-27,-20,78,-46,-58,238,41,25,-94,42,36,-144,"); - add(""); - //add("/*337*/"); - add("5,-1,-24505,2604,17110,"); - add("-50,-99,-58,-20,-122,-12,90,19,128,35,129,31,"); - add(""); - //add("/*338*/"); - add("6,1,-20336,-21189,6121,"); - add("-11,37,90,-61,85,91,-79,63,-47,19,-48,-101,"); - add("71,-85,-53,"); - add(""); - //add("/*339*/"); - add("4,1,4254,3683,-29468,"); - add("320,25,52,-163,-16,-27,-105,-40,-21,"); - add(""); - //add("/*340*/"); - add("5,1,4284,29586,2515,"); - add("59,0,-105,-86,24,-147,-98,6,99,20,-12,112,"); - add(""); - //add("/*341*/"); - add("5,1,-26886,10733,7871,"); - add("29,-12,114,85,100,149,-24,16,-99,-51,-28,-135,"); - add(""); - //add("/*342*/"); - add("5,1,-13498,24234,-11425,"); - add("-105,-65,-12,-169,-85,22,68,62,51,135,68,-19,"); - add(""); - //add("/*343*/"); - add("6,-1,22043,16210,-12301,"); - add("-56,32,-58,-70,134,52,64,2,117,-33,-4,-66,"); - add("48,-85,-26,"); - add(""); - //add("/*344*/"); - add("5,1,22450,-6144,-18928,"); - add("-111,30,-140,55,152,16,59,16,65,15,-137,61,"); - add(""); - //add("/*345*/"); - add("5,1,20013,16577,-14989,"); - add("52,-6,63,140,-83,97,-48,-44,-114,-124,73,-85,"); - add(""); - //add("/*346*/"); - add("5,1,8227,28696,2972,"); - add("-15,23,-188,-99,29,-5,-66,8,107,111,-40,86,"); - add(""); - //add("/*347*/"); - add("5,1,-6380,29120,-3367,"); - add("-28,-18,-102,-113,-43,-141,-18,11,124,101,37,117,"); - add(""); - //add("/*348*/"); - add("5,1,23793,-10289,15101,"); - add("-94,-116,68,-13,-97,-48,94,56,-108,39,97,6,"); - add(""); - //add("/*349*/"); - add("5,1,18853,-3180,23118,"); - add("48,-117,-55,67,16,-53,-36,157,51,-37,80,41,"); - add(""); - //add("/*350*/"); - add("5,1,-2898,29718,2905,"); - add("106,19,-87,-6,15,-174,-95,-14,55,-20,-16,149,"); - add(""); - //add("/*351*/"); - add("5,1,4133,24673,-16558,"); - add("22,-39,-52,-49,-76,-124,-81,-28,-61,43,111,173,"); - add(""); - //add("/*352*/"); - add("5,1,-17359,23518,6748,"); - add("-106,-60,-61,-67,-75,87,88,36,99,82,64,-9,"); - add(""); - //add("/*353*/"); - add("5,1,24745,-5658,-15990,"); - add("-70,25,-116,-48,118,-113,42,17,57,54,-81,111,"); - add(""); - //add("/*354*/"); - add("5,1,-6134,29314,-1752,"); - add("-118,-26,-10,-166,-33,39,76,20,58,144,29,-27,"); - add(""); - //add("/*355*/"); - add("5,-1,-18455,-22892,5946,"); - add("-81,50,-58,-89,38,-136,53,-53,-39,76,-27,138,"); - add(""); - //add("/*356*/"); - add("5,1,7506,28869,-3200,"); - add("-114,35,46,63,-2,141,110,-29,-5,21,-19,-124,"); - add(""); - //add("/*357*/"); - add("5,1,-19149,-22531,5067,"); - add("-69,67,39,-156,123,-52,66,-66,-41,108,-86,30,"); - add(""); - //add("/*358*/"); - add("4,1,-11154,10714,-25706,"); - add("-86,-136,-19,-138,16,67,39,94,22,"); - add(""); - //add("/*359*/"); - add("5,1,-11977,-26541,7220,"); - add("35,14,107,21,37,167,-80,16,-72,-11,-35,-141,"); - add(""); - //add("/*360*/"); - add("5,-1,12975,18669,19573,"); - add("11,61,-65,-125,125,-37,-62,-53,91,109,-97,21,"); - add(""); - //add("/*361*/"); - add("5,1,-10778,27815,3183,"); - add("3,14,-112,-37,-4,-95,-103,-47,69,52,2,161,"); - add(""); - //add("/*362*/"); - add("5,1,5802,24352,16532,"); - add("54,21,-49,116,84,-168,-73,-13,47,-91,-61,122,"); - add(""); - //add("/*363*/"); - add("5,1,10271,19027,20796,"); - add("-105,-43,91,86,-57,9,138,-37,-34,-25,72,-53,"); - add(""); - //add("/*364*/"); - add("5,1,-3812,-7158,-28883,"); - add("-111,23,9,13,124,-32,177,-2,-23,-12,-93,24,"); - add(""); - //add("/*365*/"); - add("5,-1,-26344,13706,4261,"); - add("-48,-69,-76,-47,-96,15,4,-31,122,74,139,13,"); - add(""); - //add("/*366*/"); - add("4,1,4332,-21849,-20096,"); - add("26,-143,162,-151,20,-55,29,71,-71,"); - add(""); - //add("/*367*/"); - add("5,1,11385,17811,21287,"); - add("-72,-41,73,-16,-121,108,94,11,-58,28,107,-104,"); - add(""); - //add("/*368*/"); - add("5,1,-25127,12810,-10224,"); - add("-25,-70,-26,-55,-132,-27,-31,-66,-6,84,203,43,"); - add(""); - //add("/*369*/"); - add("5,1,12061,-19379,-19468,"); - add("5,59,-55,129,111,-29,57,-24,58,-99,-108,46,"); - add(""); - //add("/*370*/"); - add("5,1,14601,-4888,-25747,"); - add("-33,-105,1,-141,-47,-70,-24,67,-26,108,73,46,"); - add(""); - //add("/*371*/"); - add("5,1,3182,28027,10215,"); - add("85,25,-94,-63,50,-119,-84,-20,80,0,-45,125,"); - add(""); - //add("/*372*/"); - add("5,1,24760,-13205,-10611,"); - add("48,83,9,95,156,31,-11,-49,34,-80,-123,-34,"); - add(""); - //add("/*373*/"); - add("5,1,22676,-468,-19636,"); - add("56,-46,66,-18,-132,-18,-76,-21,-86,-5,159,-11,"); - add(""); - //add("/*374*/"); - add("5,1,-8077,26065,-12464,"); - add("24,-25,-69,23,-83,-185,-55,7,48,-13,63,140,"); - add(""); - //add("/*375*/"); - add("5,1,-16783,-24152,5918,"); - add("73,-71,-85,118,-89,-31,-30,39,75,-98,81,53,"); - add(""); - //add("/*376*/"); - add("5,1,3471,29597,3461,"); - add("97,-6,-45,40,14,-168,-80,10,-3,-41,-11,138,"); - add(""); - //add("/*377*/"); - add("5,1,-23913,14805,-10440,"); - add("-45,-76,-3,-118,-129,90,31,66,22,92,106,-63,"); - add(""); - //add("/*378*/"); - add("5,1,-13537,24149,-11558,"); - add("-78,-47,-6,-155,-73,31,19,38,57,133,62,-27,"); - add(""); - //add("/*379*/"); - add("5,1,25723,-3019,-15140,"); - add("2,-81,20,-24,-199,1,-13,55,-33,15,150,-7,"); - add(""); - //add("/*380*/"); - add("5,1,18791,-8648,-21728,"); - add("-47,28,-51,-101,94,-124,74,33,50,73,-79,94,"); - add(""); - //add("/*381*/"); - add("5,1,-8993,-28620,-183,"); - add("89,-27,-50,148,-46,22,-1,0,52,-139,43,28,"); - add(""); - //add("/*382*/"); - add("5,1,-8768,-28641,-1673,"); - add("23,-13,95,-32,2,151,-70,24,-46,16,3,-153,"); - add(""); - //add("/*383*/"); - add("5,-1,16062,838,25324,"); - add("49,20,-32,167,83,-110,-83,-10,54,-116,-55,76,"); - add(""); - //add("/*384*/"); - add("5,1,-26157,14015,4405,"); - add("-30,-67,29,-77,-171,83,22,47,-18,57,127,-58,"); - add(""); - //add("/*385*/"); - add("5,1,21813,15801,-13211,"); - add("-2,-58,-71,-52,-66,-164,-11,47,39,26,72,126,"); - add(""); - //add("/*386*/"); - add("5,-1,-19641,22184,4702,"); - add("-76,-56,-55,-110,-117,85,52,40,29,78,83,-59,"); - add(""); - //add("/*387*/"); - add("5,1,15005,-1299,-25945,"); - add("-59,-53,-32,-124,-41,-69,-8,102,-9,133,23,75,"); - add(""); - //add("/*388*/"); - add("5,1,-10453,11094,-25839,"); - add("67,-43,-46,-1,-102,-42,-151,-27,49,32,108,33,"); - add(""); - //add("/*389*/"); - add("5,1,-26735,12315,5795,"); - add("-46,-82,-39,-37,-127,97,35,47,62,40,120,-67,"); - add(""); - //add("/*390*/"); - add("5,-1,-16802,23231,-8833,"); - add("-19,-44,-78,-139,-124,-58,33,33,22,101,96,58,"); - add(""); - //add("/*391*/"); - add("5,1,14422,-5109,-25805,"); - add("-79,-114,-21,-125,-36,-62,57,63,19,112,85,45,"); - add(""); - //add("/*392*/"); - add("5,1,10064,-5982,-27621,"); - add("-68,-60,-12,-159,-76,-40,16,47,-5,131,70,32,"); - add(""); - //add("/*393*/"); - add("5,1,24783,-4317,-16345,"); - add("6,-74,28,-42,-75,-43,-68,125,-136,56,14,81,"); - add(""); - //add("/*394*/"); - add("5,1,-13180,26791,2922,"); - add("52,32,-58,2,16,-147,-90,-46,20,-26,-27,133,"); - add(""); - //add("/*395*/"); - add("4,1,-1749,25344,15957,"); - add("-94,-46,62,119,-78,137,-3,58,-93,"); - add(""); - //add("/*396*/"); - add("5,1,-26328,14008,-3259,"); - add("-27,-66,-62,-66,-147,-86,14,34,27,52,118,77,"); - add(""); - //add("/*397*/"); - add("4,1,24089,7261,-16340,"); - add("48,-182,-10,-71,8,-101,-20,136,32,"); - add(""); - //add("/*398*/"); - add("4,1,-7194,13999,25540,"); - add("129,4,33,19,128,-65,-131,-13,-29,"); - add(""); - //add("/*399*/"); - add("5,-1,-24613,17122,1025,"); - add("-3,-11,108,-31,-55,138,11,15,3,31,54,-135,"); - add(""); - //add("/*400*/"); - add("5,1,20152,-5943,21414,"); - add("-22,-105,-8,22,-119,-55,45,37,-32,-6,160,52,"); - add(""); - //add("/*401*/"); - add("5,1,-1915,23677,-18322,"); - add("-91,-20,-17,-173,3,23,42,15,15,142,5,-9,"); - add(""); - //add("/*402*/"); - add("5,1,-23760,17289,6048,"); - add("47,40,67,89,121,3,20,27,-4,-112,-147,-13,"); - add(""); - //add("/*403*/"); - add("5,1,-14558,23775,-11081,"); - add("15,-31,-86,-12,-74,-142,-40,-5,41,4,69,142,"); - add(""); - //add("/*404*/"); - add("5,1,-12479,24643,-11704,"); - add("-55,-50,-48,-152,-89,-22,17,26,36,120,74,27,"); - add(""); - //add("/*405*/"); - add("4,1,5264,29534,-120,"); - add("82,-15,-121,-123,21,-60,-42,9,160,"); - add(""); - //add("/*406*/"); - add("5,1,13262,-5908,-26253,"); - add("-65,-72,-16,-137,-56,-56,7,54,-9,131,60,52,"); - add(""); - //add("/*407*/"); - add("4,1,-20288,22087,756,"); - add("19,19,-81,-118,-104,-125,29,23,110,"); - add(""); - //add("/*408*/"); - add("5,1,19086,-2847,22970,"); - add("38,55,-25,26,149,-4,-46,33,42,-22,-149,1,"); - add(""); - //add("/*409*/"); - add("4,1,-2873,28899,7523,"); - add("-133,-13,0,14,-30,117,144,12,10,"); - add(""); - //add("/*410*/"); - add("5,1,15596,18597,-17633,"); - add("67,-43,14,89,-115,-41,-45,-18,-58,-66,96,41,"); - add(""); - //add("/*411*/"); - add("5,-1,-28925,7951,348,"); - add("9,27,78,35,121,116,-1,-1,-35,-24,-79,-152,"); - add(""); - //add("/*412*/"); - add("5,-1,9541,23385,16190,"); - add("-2,-50,73,79,-109,108,19,19,-38,-53,97,-107,"); - add(""); - //add("/*413*/"); - add("5,1,29210,473,-6823,"); - add("15,77,72,31,35,138,-2,-56,-13,-30,-68,-138,"); - add(""); - //add("/*414*/"); - add("5,1,-25829,15180,1561,"); - add("-4,2,-86,-23,-24,-175,1,0,31,20,19,148,"); - add(""); - //add("/*415*/"); - add("5,1,-20000,22355,530,"); - add("-25,-22,-75,-69,-59,-143,-15,-14,47,64,55,123,"); - add(""); - //add("/*416*/"); - add("4,1,-444,-28368,9750,"); - add("52,35,103,-161,22,54,22,-47,-132,"); - add(""); - //add("/*417*/"); - add("4,1,2286,29384,5600,"); - add("-108,22,-73,-64,-19,124,98,-19,59,"); - add(""); - //add("/*418*/"); - add("4,1,-9750,11346,-26004,"); - add("114,-63,-70,-93,-91,-4,-88,65,60,"); - add(""); - //add("/*419*/"); - add("4,1,29357,1075,-6086,"); - add("26,-12,125,3,-133,-7,-25,20,-118,"); - add(""); - //add("/*420*/"); - add("5,1,-4180,-7285,-28800,"); - add("-96,6,12,12,67,-18,173,35,-34,-21,-79,23,"); - add(""); - //add("/*421*/"); - add("4,1,21812,-2819,-20403,"); - add("43,-216,77,-30,61,-41,-39,132,-60,"); - add(""); - //add("/*422*/"); - add("4,1,-6475,29293,-129,"); - add("-137,-31,54,34,8,102,130,29,-57,"); - add(""); - //add("/*423*/"); - add("4,1,-9851,-28219,2574,"); - add("-20,18,125,-123,38,-61,54,-29,-113,"); - add(""); - //add("/*424*/"); - add("4,1,6163,-10670,-27353,"); - add("84,30,8,-8,-122,46,-130,-35,-16,"); - add(""); - //add("/*425*/"); - add("5,1,24033,10600,14493,"); - add("-1,-61,47,-4,-116,90,29,-16,-37,-1,119,-84,"); - add(""); - //add("/*426*/"); - add("4,1,-10404,28061,2080,"); - add("-168,-58,-65,15,0,83,149,52,44,"); - add(""); - //add("/*427*/"); - add("4,-1,-6287,25435,-14613,"); - add("-175,-65,-37,-33,20,50,109,54,46,"); - add(""); - //add("/*428*/"); - add("4,1,3313,24533,16946,"); - add("72,-54,64,137,8,-41,-83,49,-52,"); - add(""); - //add("/*429*/"); - add("5,1,-17749,22168,9672,"); - add("-55,-22,-51,-134,-84,-55,35,14,33,110,69,45,"); - add(""); - //add("/*430*/"); - add("4,1,-24211,14614,-10014,"); - add("-45,-101,-37,-61,-44,84,77,151,33,"); - add(""); - //add("/*431*/"); - add("5,1,6168,20534,20984,"); - add("78,-19,-5,155,-9,-37,-14,11,-7,-148,19,25,"); - add(""); - //add("/*432*/"); - add("4,1,25249,3517,-15816,"); - add("54,-55,75,-32,-104,-73,-61,98,-77,"); - add(""); - //add("/*433*/"); - add("5,1,24510,6812,-15901,"); - add("-3,-70,-35,-47,-99,-113,-7,16,-4,32,110,94,"); - add(""); - //add("/*434*/"); - add("4,1,8900,28579,2013,"); - add("-28,18,-145,-98,29,17,48,-23,129,"); - add(""); - //add("/*435*/"); - add("4,1,-19110,-22514,5287,"); - add("-134,112,-16,34,-47,-73,77,-68,-7,"); - add(""); - //add("/*436*/"); - add("4,1,-26431,12476,6763,"); - add("-53,-173,112,21,25,32,28,120,-106,"); - add(""); - //add("/*437*/"); - add("4,1,-6923,29146,-1603,"); - add("-11,-10,-135,-86,-21,-1,12,12,153,"); - add(""); - //add("/*438*/"); - add("4,1,-7322,29032,-1885,"); - add("-93,-29,-71,-84,-16,84,116,34,54,"); - add(""); - //add("/*439*/"); - add("4,1,3874,29626,2697,"); - add("158,-14,-71,-62,11,-39,-140,12,75,"); - add(""); - //add("/*440*/"); - add("5,-1,-20399,-10562,19296,"); - add("-47,54,-21,-103,82,-64,4,-32,-13,72,-61,43,"); - add(""); - //add("/*441*/"); - add("4,1,-12040,-26645,6714,"); - add("91,-7,132,-57,34,35,-79,-3,-151,"); - add(""); - //add("/*442*/"); - add("4,1,-8141,28851,-1154,"); - add("-44,-19,-149,-67,-18,19,46,19,149,"); - add(""); - //add("/*443*/"); - add("4,1,-26611,11542,7659,"); - add("-88,-157,-73,26,23,58,70,125,54,"); - add(""); - //add("/*444*/"); - add("4,1,-25420,7629,13987,"); - add("24,-119,108,39,84,24,-21,80,-81,"); - add(""); - //add("/*445*/"); - add("4,1,-361,26098,14791,"); - add("-10,-64,111,54,-28,50,26,82,-142,"); - add(""); - //add("/*446*/"); - add("4,1,-10298,18382,21356,"); - add("130,-27,85,49,46,-16,-147,13,-81,"); - add(""); - //add("/*447*/"); - add("4,1,-6714,29188,-1727,"); - add("-94,-24,-29,-73,-10,108,114,26,-7,"); - add(""); - //add("/*448*/"); - add("4,1,-14486,-9145,-24628,"); - add("-107,-23,72,0,72,-27,104,40,-76,"); - add(""); - //add("/*449*/"); - add("3,1,-12116,27417,1220,"); - add("-145,-70,134,73,33,-17,"); - add(""); - //add("/*450*/"); - add("4,1,12149,-27337,-2254,"); - add("-8,3,-82,91,46,-59,-14,-19,153,"); - add(""); - //add("/*451*/"); - add("3,1,4304,29609,2188,"); - add("-48,20,-185,-38,-3,124,"); - add(""); - //add("/*452*/"); - add("4,1,-12276,24972,-11211,"); - add("-4,-43,-90,-130,-57,15,74,60,50,"); - add(""); - //add("/*453*/"); - add("4,1,3993,24360,17048,"); - add("106,2,-27,-55,80,-102,-56,-28,53,"); - add(""); - //add("/*454*/"); - add("4,1,4361,29555,2736,"); - add("-38,14,-91,-116,16,2,75,-20,101,"); - add(""); - //add("/*455*/"); - add("4,1,-18479,-23127,4866,"); - add("-52,67,118,-61,35,-66,59,-62,-71,"); - add(""); - //add("/*456*/"); - add("4,-1,2259,21690,20602,"); - add("163,40,-61,-51,30,-26,-119,-48,64,"); - add(""); - //add("/*457*/"); - add("4,1,20331,14288,-16807,"); - add("113,-62,84,2,-51,-41,-116,87,-67,"); - add(""); - //add("/*458*/"); - add("4,1,-16786,-24244,5517,"); - add("-13,-14,-98,115,-77,10,-36,41,70,"); - add(""); - //add("/*459*/"); - add("4,1,-1657,25010,16486,"); - add("-107,31,-59,-27,-59,86,106,-9,25,"); - add(""); - //add("/*460*/"); - add("4,1,-1331,-20857,-21523,"); - add("-32,87,-81,12,31,-31,94,-42,35,"); - add(""); - //add("/*461*/"); - add("3,1,-26552,5728,12735,"); - add("86,-10,182,-41,30,-98,"); - add(""); - //add("/*462*/"); - add("3,1,-11118,27856,637,"); - add("-170,-68,5,82,32,63,"); - add(""); - //add("/*463*/"); - add("4,1,2831,-28218,9783,"); - add("42,27,67,-99,15,70,-19,-40,-108,"); - add(""); - //add("/*464*/"); - add("3,1,23950,2362,-17911,"); - add("20,-179,4,-44,82,-49,"); - add(""); - //add("/*465*/"); - add("3,1,29304,688,-6390,"); - add("3,-151,3,-18,18,-82,"); - add(""); - //add("/*466*/"); - add("3,1,-9197,-28136,4878,"); - add("-159,68,85,75,-37,-64,"); - add(""); - //add("/*467*/"); - add("4,1,-10259,28140,1705,"); - add("-56,-25,63,62,17,101,34,17,-76,"); - add(""); - //add("/*468*/"); - add("3,1,29280,766,-6487,"); - add("34,42,158,-23,-96,-116,"); - add(""); - //add("/*469*/"); - add("4,1,6865,26520,12229,"); - add("-38,-15,54,43,-56,96,50,31,-93,"); - add(""); - //add("/*470*/"); - add("3,1,13499,-19327,-18554,"); - add("45,135,-107,13,-80,93,"); - add(""); - //add("/*471*/"); - add("3,-1,16732,5918,24187,"); - add("-123,131,53,50,-84,-14,"); - add(""); - //add("/*472*/"); - add("3,1,13670,-4696,-26288,"); - add("-146,-71,-63,60,85,15,"); - add(""); - //add("/*473*/"); - add("3,1,2313,23926,-17950,"); - add("-161,-16,-41,80,47,72,"); - add(""); - //add("/*474*/"); - add("3,1,3781,28274,9290,"); - add("93,34,-146,-91,-6,58,"); - add(""); - //add("/*475*/"); - add("3,1,25584,3122,-15352,"); - add("-85,-26,-147,17,59,39,"); - add(""); - //add("/*476*/"); - add("3,1,29702,3744,-1936,"); - add("17,-153,-35,-15,89,-55,"); - add(""); - //add("/*477*/"); - add("3,1,24789,6574,-15566,"); - add("65,-169,34,-52,102,-40,"); - add(""); - //add("/*478*/"); - add("3,-1,-29247,6430,1802,"); - add("-11,-85,122,17,72,23,"); - add(""); - //add("/*479*/"); - add("3,1,-6095,14636,25468,"); - add("-135,-95,22,97,7,20,"); - add(""); - //add("/*480*/"); - add("3,1,-10821,10826,-25801,"); - add("-167,-23,61,65,41,-11,"); - add(""); - //add("/*481*/"); - add("3,1,29023,590,-7570,"); - add("34,-5,129,-19,-95,-79,"); - add(""); - //add("/*482*/"); - add("3,1,23976,5439,-17192,"); - add("39,-177,-1,-33,87,-18,"); - add(""); - //add("/*483*/"); - add("4,1,5247,29038,-5412,"); - add("-99,36,100,26,0,28,97,-32,-81,"); - add(""); - //add("/*484*/"); - add("4,1,-18202,-23335,4919,"); - add("15,5,73,-62,62,68,2,-22,-100,"); - add(""); - //add("/*485*/"); - add("3,1,5756,-9056,-28015,"); - add("57,-84,39,-130,-10,-23,"); - add(""); - //add("/*486*/"); - add("3,1,-11472,-27071,5962,"); - add("-89,67,132,14,-25,-86,"); - add(""); - //add("/*487*/"); - add("3,1,-12893,26395,6088,"); - add("-47,3,-113,-50,-50,112,"); - add(""); - //add("/*488*/"); - add("3,1,5886,-8242,-28239,"); - add("26,166,-42,24,-67,24,"); - add(""); - //add("/*489*/"); - add("4,1,8245,18657,21999,"); - add("-25,-59,59,73,-66,28,2,70,-60,"); - add(""); - //add("/*490*/"); - add("3,1,5232,21275,20494,"); - add("58,-123,112,-13,69,-68,"); - add(""); - //add("/*491*/"); - add("4,1,-16253,-24546,5776,"); - add("-9,-21,-120,76,-43,33,-12,23,62,"); - add(""); - //add("/*492*/"); - add("3,-1,9502,25942,11694,"); - add("165,-65,8,-75,35,-15,"); - add(""); - //add("/*493*/"); - add("3,1,-12159,27406,1045,"); - add("-141,-66,59,88,39,12,"); - add(""); - //add("/*494*/"); - add("3,1,5425,21100,20624,"); - add("135,-94,60,-70,58,-40,"); - add(""); - //add("/*495*/"); - add("3,-1,3389,22127,19973,"); - add("-144,69,-53,28,-42,42,"); - add(""); - //add("/*496*/"); - add("3,1,-29998,-271,-211,"); - add("1,-103,-27,-1,44,124,"); - add(""); - //add("/*497*/"); - add("3,1,-6646,3953,28986,"); - add("154,-35,40,-66,64,-23,"); - add(""); - //add("/*498*/"); - add("3,1,17776,-4397,-23763,"); - add("-125,-94,-76,59,61,33,"); - add(""); - //add("/*499*/"); - add("3,1,15919,-2901,-25262,"); - add("-86,-113,-41,2,103,-10,"); - add(""); - //add("/*500*/"); - add("3,1,10276,18702,21087,"); - add("34,-115,84,49,48,-65,"); - add(""); - //add("/*501*/"); - add("3,1,-27182,9729,8156,"); - add("24,-63,152,0,71,-83,"); - add(""); - //add("/*502*/"); - add("3,1,-5062,29557,-877,"); - add("-151,-26,15,102,19,47,"); - add(""); - //add("/*503*/"); - add("3,1,5323,-9639,-27906,"); - add("94,-7,20,-115,-91,10,"); - add(""); - //add("/*504*/"); - add("3,1,9566,21962,-18060,"); - add("80,-60,-30,-146,87,28,"); - add(""); - //add("/*505*/"); - add("3,1,7782,19198,21700,"); - add("98,-114,65,-23,74,-57,"); - add(""); - //add("/*506*/"); - add("3,1,-25374,8277,13699,"); - add("37,132,-12,-48,-43,-63,"); - add(""); - //add("/*507*/"); - add("3,1,-21077,21320,1096,"); - add("-106,-101,-82,53,50,70,"); - add(""); - //add("/*508*/"); - add("3,1,24281,-1036,-17589,"); - add("-21,-166,-18,-1,96,-8,"); - add(""); - //add("/*509*/"); - add("3,1,-22788,37,19512,"); - add("-85,-52,-100,83,-20,97,"); - add(""); - //add("/*510*/"); - add("3,1,5240,28832,-6422,"); - add("-69,36,103,119,-31,-39,"); - add(""); - //add("/*511*/"); - add("3,1,-7468,-28825,-3652,"); - add("127,-23,-73,-26,-5,83,"); - add(""); - //add("/*512*/"); - add("3,1,24788,6981,-15389,"); - add("-28,-91,-85,-27,111,6,"); - add(""); - //add("/*513*/"); - add("3,1,-23208,-6,19010,"); - add("-80,-82,-98,74,14,91,"); - add(""); - //add("/*514*/"); - add("3,1,-2403,29024,7200,"); - add("6,-38,153,37,26,-90,"); - add(""); - //add("/*515*/"); - add("3,1,-8354,27070,9869,"); - add("31,63,-147,-39,-31,53,"); - add(""); - //add("/*516*/"); - add("3,1,25819,2792,-15019,"); - add("68,-90,100,-56,16,-93,"); - add(""); - //add("/*517*/"); - add("3,1,-13037,26839,3117,"); - add("36,33,-139,-71,-42,72,"); - add(""); - //add("/*518*/"); - add("3,1,19424,15377,-16920,"); - add("93,-132,-12,-64,64,-15,"); - add(""); - //add("/*519*/"); - add("3,1,25368,-2667,-15790,"); - add("-16,-138,-3,-25,82,-54,"); - add(""); - //add("/*520*/"); - add("3,1,-27385,6432,10424,"); - add("17,-117,116,-6,67,-55,"); - add(""); - //add("/*521*/"); - add("3,1,-16689,-24298,5573,"); - add("100,-55,59,-44,42,51,"); - add(""); - //add("/*522*/"); - add("3,1,7818,28361,5876,"); - add("-144,51,-56,68,-29,50,"); - add(""); - //add("/*523*/"); - add("3,1,-1083,23630,-18452,"); - add("50,-78,-102,-92,30,44,"); - add(""); - //add("/*524*/"); - add("3,1,25414,6393,-14604,"); - add("-41,-106,-116,11,70,48,"); - add(""); - //add("/*525*/"); - add("3,1,-11631,906,-27639,"); - add("120,91,-47,-49,-80,18,"); - add(""); - //add("/*526*/"); - add("3,1,3474,212,29797,"); - add("-59,-123,8,98,50,-12,"); - add(""); - //add("/*527*/"); - add("3,1,2829,27930,10580,"); - add("17,48,-134,-69,-20,73,"); - add(""); - //add("/*528*/"); - add("3,1,-18229,-23261,5161,"); - add("-120,85,-43,79,-65,-12,"); - add(""); - //add("/*529*/"); - add("3,1,1852,23822,18140,"); - add("-125,-44,70,101,2,-12,"); - add(""); - //add("/*530*/"); - add("3,1,17469,17022,-17466,"); - add("116,-106,12,-62,33,-30,"); - add(""); - //add("/*531*/"); - add("3,1,-13668,26130,5512,"); - add("-117,-58,-16,61,16,79,"); - add(""); - //add("/*532*/"); - add("3,1,-16825,22385,-10761,"); - add("-69,-60,-18,116,107,41,"); - add(""); - //add("/*533*/"); - add("3,1,-17801,-23670,4779,"); - add("-107,95,71,39,-40,-52,"); - add(""); - //add("/*534*/"); - add("3,-1,-16972,24643,-2166,"); - add("-50,-47,-138,-6,3,78,"); - add(""); - //add("/*535*/"); - add("3,1,-29510,-1408,5213,"); - add("-15,-102,-117,12,23,79,"); - add(""); - //add("/*536*/"); - add("3,1,-8023,14394,25068,"); - add("-68,34,-40,15,-116,71,"); - add(""); - //add("/*537*/"); - add("3,1,18663,8080,22054,"); - add("-75,93,30,-31,-36,39,"); - add(""); - //add("/*538*/"); - add("3,1,20234,-5953,-21335,"); - add("-49,130,-81,31,-57,45,"); - add(""); - //add("/*539*/"); - add("3,1,9465,-4873,-28048,"); - add("-62,-145,5,10,86,-12,"); - add(""); - //add("/*540*/"); - add("3,1,11849,-3988,-27271,"); - add("-79,-106,-18,-3,100,-16,"); - add(""); - //add("/*541*/"); - add("3,1,19173,8661,21387,"); - add("61,-39,-39,-116,87,69,"); - add(""); - //add("/*542*/"); - add("3,1,-25383,8079,13799,"); - add("-8,-129,61,32,94,5,"); - add(""); - //add("/*543*/"); - add("3,1,-947,23612,-18482,"); - add("119,-50,-69,-79,-3,0,"); - add(""); - //add("/*544*/"); - add("3,1,-20303,-21276,5923,"); - add("-76,41,-110,64,-56,18,"); - add(""); - //add("/*545*/"); - add("3,1,-3266,29707,2611,"); - add("37,16,-138,-65,-11,47,"); - add(""); - //add("/*546*/"); - add("3,1,29437,5643,-1268,"); - add("24,-114,44,-6,9,-82,"); - add(""); - //add("/*547*/"); - add("3,1,5941,-8348,-28196,"); - add("33,-77,30,-118,6,-27,"); - add(""); - //add("/*548*/"); - add("3,1,8674,28665,1747,"); - add("63,-15,-64,-102,33,-41,"); - add(""); - //add("/*549*/"); - add("3,1,12119,-27290,-2892,"); - add("132,54,46,-68,-33,16,"); - add(""); - //add("/*550*/"); - add("3,1,16774,7079,-23844,"); - add("82,-124,22,-73,54,-36,"); - add(""); - //add("/*551*/"); - add("3,1,20757,13260,17126,"); - add("63,-128,22,-13,88,-51,"); - add(""); - //add("/*552*/"); - add("3,1,-23106,319,19132,"); - add("-14,-153,-16,23,75,27,"); - add(""); - //add("/*553*/"); - add("3,1,28708,8390,-2334,"); - add("41,-117,87,-18,41,-74,"); - add(""); - //add("/*554*/"); - add("3,-1,-17143,22854,-9157,"); - add("-56,-49,-15,111,102,47,"); - add(""); - //add("/*555*/"); - add("3,1,24593,-4420,-16602,"); - add("-58,81,-108,42,-1,63,"); - add(""); - //add("/*556*/"); - add("3,1,-5670,29343,-2618,"); - add("-124,-24,0,70,19,69,"); - add(""); - //add("/*557*/"); - add("3,1,29384,4265,-4286,"); - add("19,-142,-11,-16,73,-41,"); - add(""); - //add("/*558*/"); - add("3,-1,-26493,13413,-4266,"); - add("73,129,-48,-41,-79,9,"); - add(""); - //add("/*559*/"); - add("3,1,-12215,8751,25965,"); - add("50,90,-6,-110,-43,-38,"); - add(""); - //add("/*560*/"); - add("3,1,942,-9821,-28331,"); - add("-127,40,-18,18,36,-12,"); - add(""); - //add("/*561*/"); - add("3,1,5791,-10962,-27318,"); - add("72,-41,31,-101,-56,1,"); - add(""); - //add("/*562*/"); - add("3,1,-16110,-24557,6118,"); - add("-55,1,-140,52,-15,77,"); - add(""); - //add("/*563*/"); - add("3,1,24603,7780,-15303,"); - add("19,-130,-35,-41,81,-25,"); - add(""); - //add("/*564*/"); - add("3,1,-11587,7787,26554,"); - add("-77,78,-57,3,-100,31,"); - add(""); - //add("/*565*/"); - add("3,-1,-16566,24953,-1701,"); - add("-34,-32,-139,-15,-5,72,"); - add(""); - //add("/*566*/"); - add("3,1,-10538,27951,2769,"); - add("-113,-50,71,82,32,-2,"); - add(""); - //add("/*567*/"); - add("3,1,-26227,14265,-2946,"); - add("-29,-81,-126,8,32,76,"); - add(""); - //add("/*568*/"); - add("3,1,-29996,-410,275,"); - add("1,-64,-4,0,96,102,"); - add(""); - //add("/*569*/"); - add("3,1,-1328,24397,17407,"); - add("-88,-68,88,79,22,-24,"); - add(""); - //add("/*570*/"); - add("3,1,28640,5411,-7103,"); - add("16,-124,-30,-25,81,-41,"); - add(""); - //add("/*571*/"); - add("3,1,2879,27986,10415,"); - add("44,45,-133,-48,-14,52,"); - add(""); - //add("/*572*/"); - add("3,1,-10402,-26170,10341,"); - add("-140,40,-40,64,-24,4,"); - add(""); - //add("/*573*/"); - add("3,1,-10281,28087,2329,"); - add("-106,-42,34,78,24,50,"); - add(""); - //add("/*574*/"); - add("3,1,2742,27846,10820,"); - add("85,35,-111,-70,-7,34,"); - add(""); - //add("/*575*/"); - add("3,1,-3438,-29243,-5748,"); - add("43,20,-125,29,-18,76,"); - add(""); - //add("/*576*/"); - add("3,1,-26723,12841,4584,"); - add("-66,-110,-80,29,43,47,"); - add(""); - //add("/*577*/"); - add("3,1,-1401,24087,17828,"); - add("-1,-60,81,89,26,-28,"); - add(""); - //add("/*578*/"); - add("3,1,5935,-7944,-28314,"); - add("15,145,-37,11,-47,15,"); - add(""); - //add("/*579*/"); - add("3,1,22691,-404,-19620,"); - add("90,-40,105,-74,0,-86,"); - add(""); - //add("/*580*/"); - add("3,1,-615,23609,-18500,"); - add("-27,-62,-78,-73,25,34,"); - add(""); - //add("/*581*/"); - add("3,1,-7610,27327,9765,"); - add("86,9,39,11,34,-85,"); - add(""); - //add("/*582*/"); - add("3,1,3275,28106,9967,"); - add("66,34,-120,-66,-8,46,"); - add(""); - //add("/*583*/"); - add("3,1,-1798,26125,-14637,"); - add("-125,-47,-69,60,25,37,"); - add(""); - //add("/*584*/"); - add("3,1,3404,28154,9786,"); - add("16,34,-104,-83,-3,38,"); - add(""); - //add("/*585*/"); - add("3,1,-19236,-22431,5182,"); - add("-95,81,-4,41,-48,-59,"); - add(""); - //add("/*586*/"); - add("3,1,16386,-1104,25106,"); - add("-73,82,50,-24,-52,14,"); - add(""); - //add("/*587*/"); - add("3,1,19553,-4260,-22350,"); - add("63,-51,65,-69,-44,-52,"); - add(""); - //add("/*588*/"); - add("3,1,-22905,18425,5990,"); - add("96,104,47,-33,-35,-18,"); - add(""); - //add("/*589*/"); - add("3,1,-12241,25010,-11164,"); - add("-117,-70,-28,42,42,46,"); - add(""); - //add("/*590*/"); - add("3,1,-6089,-28902,-5253,"); - add("34,14,-117,43,-22,71,"); - add(""); - //add("/*591*/"); - add("3,1,14736,-4824,-25682,"); - add("-43,-106,-5,-40,63,-34,"); - add(""); - //add("/*592*/"); - add("3,1,19044,17073,-15679,"); - add("94,-108,-3,-64,54,-19,"); - add(""); - //add("/*593*/"); - add("3,1,-16277,25021,3001,"); - add("-102,-58,-78,32,15,59,"); - add(""); - //add("/*594*/"); - add("3,1,3248,24619,16833,"); - add("-38,-76,118,31,32,-52,"); - add(""); - //add("/*595*/"); - add("3,1,-19337,-22287,5420,"); - add("18,15,122,-54,25,-89,"); - add(""); - //add("/*596*/"); - add("3,1,3510,24558,16869,"); - add("47,-68,89,36,36,-59,"); - add(""); - //add("/*597*/"); - add("3,1,-6842,29209,-35,"); - add("-123,-29,15,65,16,45,"); - add(""); - //add("/*598*/"); - add("3,1,-15937,22907,-11013,"); - add("-119,-62,44,55,39,1,"); - add(""); - //add("/*599*/"); - add("3,1,27779,11315,-526,"); - add("-49,121,-23,9,-22,44,"); - add(""); - //add("/*600*/"); - add("3,1,-12034,25103,-11183,"); - add("-63,-58,-60,-41,5,55,"); - add(""); - //add("/*601*/"); - add("3,1,11603,-4113,-27358,"); - add("-14,-103,10,-64,53,-35,"); - add(""); - //add("/*602*/"); - add("3,1,12813,-2626,-26999,"); - add("-4,-132,12,-36,71,-25,"); - add(""); - //add("/*603*/"); - add("3,1,-25308,8431,13728,"); - add("38,-43,95,1,89,-52,"); - add(""); - //add("/*604*/"); - add("3,1,-25475,7114,14157,"); - add("31,120,-5,-42,-62,-45,"); - add(""); - //add("/*605*/"); - add("3,1,13199,-12085,-24077,"); - add("70,108,-16,5,-60,32,"); - add(""); - //add("/*606*/"); - add("3,1,-14219,23894,-11265,"); - add("-85,-85,-73,26,40,52,"); - add(""); - //add("/*607*/"); - add("3,1,4551,-23163,-18514,"); - add("29,-77,104,-49,25,-44,"); - add(""); - //add("/*608*/"); - add("3,1,5199,-9999,-27803,"); - add("75,10,11,-79,-92,18,"); - add(""); - //add("/*609*/"); - add("3,1,-3465,-29255,-5667,"); - add("-50,-13,95,-26,22,-95,"); - add(""); - //add("/*610*/"); - add("3,1,20448,-6320,21022,"); - add("74,-52,-87,-11,63,29,"); - add(""); - //add("/*611*/"); - add("3,1,-11210,-27380,4968,"); - add("-67,47,106,7,-15,-70,"); - add(""); - //add("/*612*/"); - add("3,1,-7114,29104,-1523,"); - add("-31,-14,-125,-26,-3,61,"); - add(""); - //add("/*613*/"); - add("3,1,11126,17559,21631,"); - add("8,-111,86,4,44,-38,"); - add(""); - //add("/*614*/"); - add("3,-1,-17516,22482,-9368,"); - add("-37,-44,-36,77,91,75,"); - add(""); - //add("/*615*/"); - add("3,1,23571,-1939,-18457,"); - add("-68,34,-90,37,41,43,"); - add(""); - //add("/*616*/"); - add("3,1,-6394,-28910,-4832,"); - add("-27,25,-112,68,-24,51,"); - add(""); - //add("/*617*/"); - add("3,1,5794,26057,13692,"); - add("-56,-45,108,58,8,-38,"); - add(""); - //add("/*618*/"); - add("3,1,-23934,17129,5813,"); - add("-32,-36,-30,79,85,78,"); - add(""); - //add("/*619*/"); - add("3,1,-23357,-76,18827,"); - add("-56,-97,-71,41,25,52,"); - add(""); - //add("/*620*/"); - add("3,1,7231,-5628,-28566,"); - add("-117,22,-34,64,34,9,"); - add(""); - //add("/*621*/"); - add("3,-1,8011,-2165,28829,"); - add("-86,-20,23,42,-72,-17,"); - add(""); - //add("/*622*/"); - add("3,1,-17637,-23714,5158,"); - add("-108,70,-51,50,-34,13,"); - add(""); - //add("/*623*/"); - add("3,1,21913,-8820,18494,"); - add("66,118,-23,-34,-46,20,"); - add(""); - //add("/*624*/"); - add("3,1,9869,19293,20746,"); - add("-85,-38,75,55,-24,-4,"); - add(""); - //add("/*625*/"); - add("3,1,22899,-4077,-18947,"); - add("-26,-86,-13,-37,52,-57,"); - add(""); - //add("/*626*/"); - add("3,1,-14038,23901,-11476,"); - add("-107,-72,-17,35,39,38,"); - add(""); - //add("/*627*/"); - add("3,1,4353,24653,16531,"); - add("69,-61,72,12,41,-63,"); - add(""); - //add("/*628*/"); - add("3,1,-18051,-23470,4832,"); - add("-30,48,118,-10,-6,-67,"); - add(""); - //add("/*629*/"); - add("3,1,28220,10019,-1806,"); - add("23,-82,-83,-25,72,3,"); - add(""); - //add("/*630*/"); - add("3,1,-20490,-21140,5764,"); - add("-5,32,100,-44,19,-85,"); - add(""); - //add("/*631*/"); - add("3,1,3983,28240,9309,"); - add("12,35,-113,-52,-6,40,"); - add(""); - //add("/*632*/"); - add("3,1,-18699,-22936,4930,"); - add("-91,67,-33,37,-37,-36,"); - add(""); - //add("/*633*/"); - add("3,1,627,18932,23264,"); - add("-84,-62,52,85,7,-8,"); - add(""); - //add("/*634*/"); - add("3,1,19354,14991,17340,"); - add("50,-98,28,14,46,-55,"); - add(""); - //add("/*635*/"); - add("3,1,-28747,8411,1693,"); - add("22,50,121,-5,-4,-59,"); - add(""); - //add("/*636*/"); - add("3,1,-8901,26791,10151,"); - add("-2,39,-105,-41,-14,0,"); - add(""); - //add("/*637*/"); - add("3,1,-1847,24835,16728,"); - add("-27,-53,75,84,19,-19,"); - add(""); - //add("/*638*/"); - add("3,1,-10396,25971,10836,"); - add("84,12,51,-45,21,-93,"); - add(""); - //add("/*639*/"); - add("3,1,-1746,26561,13836,"); - add("46,-54,110,4,27,-50,"); - add(""); - //add("/*640*/"); - add("3,-1,-16548,24985,-1391,"); - add("30,12,-123,-40,-23,44,"); - add(""); - //add("/*641*/"); - add("3,1,-23092,1143,19117,"); - add("-29,-97,-30,49,20,58,"); - add(""); - //add("/*642*/"); - add("3,-1,-9616,27575,-6867,"); - add("-86,-18,48,81,35,28,"); - add(""); - //add("/*643*/"); - add("3,1,37,-8773,-28689,"); - add("-83,89,-27,70,-24,8,"); - add(""); - //add("/*644*/"); - add("3,1,-5877,24660,-16042,"); - add("29,-63,-107,-41,19,43,"); - add(""); - //add("/*645*/"); - add("3,1,-7063,29124,1383,"); - add("-106,-24,-46,12,1,50,"); - add(""); - //add("/*646*/"); - add("3,1,9491,-28294,3062,"); - add("88,35,49,-28,-5,40,"); - add(""); - //add("/*647*/"); - add("3,1,-10563,28011,-1955,"); - add("-92,-37,-31,2,5,62,"); - add(""); - //add("/*648*/"); - add("3,1,-23006,339,19251,"); - add("-51,-80,-59,52,6,61,"); - add(""); - //add("/*649*/"); - add("3,-1,24368,17193,-3258,"); - add("40,-67,-52,-54,71,-25,"); - add(""); - //add("/*650*/"); - add("3,1,-8017,28176,6466,"); - add("-87,-36,52,72,15,24,"); - add(""); - //add("/*651*/"); - add("3,1,-26550,11424,8038,"); - add("29,-20,121,-1,36,-53,"); - add(""); - //add("/*652*/"); - add("3,1,28996,6412,-4254,"); - add("-29,112,-31,13,-29,48,"); - add(""); - //add("/*653*/"); - add("3,1,-11839,8554,26204,"); - add("61,27,19,-107,18,-54,"); - add(""); - //add("/*654*/"); - add("3,1,-20098,-21617,5362,"); - add("-31,53,101,-18,2,-58,"); - add(""); - //add("/*655*/"); - add("3,1,21155,4033,-20886,"); - add("40,-117,19,-35,34,-29,"); - add(""); - //add("/*656*/"); - add("3,1,5515,20897,20806,"); - add("103,-68,41,-37,35,-25,"); - add(""); - //add("/*657*/"); - add("3,1,-29988,-222,-832,"); - add("-2,50,61,3,22,-100,"); - add(""); - //add("/*658*/"); - add("3,1,5034,26084,13938,"); - add("21,-49,84,54,10,-38,"); - add(""); - //add("/*659*/"); - add("3,1,1691,19298,22907,"); - add("-89,3,4,81,-54,40,"); - add(""); - //add("/*660*/"); - add("3,1,2119,26865,13182,"); - add("-116,-3,25,58,-16,24,"); - add(""); - //add("/*661*/"); - add("3,1,10789,18377,21116,"); - add("-103,-6,58,62,-29,-7,"); - add(""); - //add("/*662*/"); - add("3,1,-11870,-26301,8207,"); - add("27,19,101,-65,14,-51,"); - add(""); - //add("/*663*/"); - add("3,1,-18344,-23246,4807,"); - add("-84,74,38,27,-34,-58,"); - add(""); - //add("/*664*/"); - add("3,1,-11295,25251,-11610,"); - add("-65,-58,-63,-15,21,60,"); - add(""); - //add("/*665*/"); - add("3,1,6300,20443,21033,"); - add("123,-14,-23,-36,19,-8,"); - add(""); - //add("/*666*/"); - add("3,1,29102,725,-7249,"); - add("27,3,111,-11,-45,-52,"); - add(""); - //add("/*667*/"); - add("3,1,-29997,-152,-412,"); - add("-1,22,82,1,52,-85,"); - add(""); - //add("/*668*/"); - add("3,1,-28040,10545,1595,"); - add("-32,-71,-94,4,4,55,"); - add(""); - //add("/*669*/"); - add("3,1,11026,18001,21316,"); - add("-97,-31,76,47,1,-24,"); - add(""); - //add("/*670*/"); - add("3,1,24332,1794,-17457,"); - add("32,101,56,1,-69,-6,"); - add(""); - //add("/*671*/"); - add("3,1,4781,16690,24466,"); - add("-96,20,5,32,-59,34,"); - add(""); - //add("/*672*/"); - add("3,1,21656,-5891,-19908,"); - add("21,116,-11,16,-38,28,"); - add(""); - //add("/*673*/"); - add("3,1,-19012,-22658,5013,"); - add("-83,57,-54,41,-38,-15,"); - add(""); - //add("/*674*/"); - add("3,-1,-25345,15903,2173,"); - add("-67,-106,-3,15,21,14,"); - add(""); - //add("/*675*/"); - add("3,1,22404,-4219,-19500,"); - add("44,-78,68,-52,23,-66,"); - add(""); - //add("/*676*/"); - add("3,1,-10163,28146,2130,"); - add("-89,-29,-52,21,3,69,"); - add(""); - //add("/*677*/"); - add("3,1,-725,25703,15454,"); - add("-107,19,-37,23,-25,44,"); - add(""); - //add("/*678*/"); - add("3,1,25446,6214,-14625,"); - add("2,-95,-36,-28,38,-33,"); - add(""); - //add("/*679*/"); - add("3,1,-18014,-23519,4728,"); - add("-68,67,75,12,-18,-46,"); - add(""); - //add("/*680*/"); - add("3,1,8350,18419,22159,"); - add("86,-67,23,-8,45,-34,"); - add(""); - //add("/*681*/"); - add("3,1,-16265,24998,3250,"); - add("-89,-55,-27,11,2,45,"); - add(""); - //add("/*682*/"); - add("3,1,-29435,3954,4235,"); - add("-7,-102,43,10,58,20,"); - add(""); - //add("/*683*/"); - add("3,1,14345,-4396,-25979,"); - add("-2,-120,20,-17,45,-17,"); - add(""); - //add("/*684*/"); - add("3,1,-20159,-21497,5615,"); - add("-47,63,68,-11,-7,-64,"); - add(""); - //add("/*685*/"); - add("3,1,17291,-23956,5209,"); - add("-23,-40,-109,33,32,41,"); - add(""); - //add("/*686*/"); - add("3,1,6171,20591,20926,"); - add("108,-24,-8,-25,33,-25,"); - add(""); - //add("/*687*/"); - add("3,1,-8736,-28700,-52,"); - add("-34,11,92,-38,11,-52,"); - add(""); - //add("/*688*/"); - add("3,1,-5134,25663,-14664,"); - add("63,-34,-82,-50,-7,5,"); - add(""); - //add("/*689*/"); - add("3,1,23474,-4238,-18194,"); - add("-71,-46,-80,21,43,16,"); - add(""); - //add("/*690*/"); - add("3,1,-12945,26676,4562,"); - add("4,17,-91,-51,-38,80,"); - add(""); - //add("/*691*/"); - add("3,1,11880,-13958,-23749,"); - add("-2,99,-60,27,-28,31,"); - add(""); - //add("/*692*/"); - add("3,1,9893,18457,21482,"); - add("67,-72,30,17,31,-34,"); - add(""); - //add("/*693*/"); - add("3,1,-14530,23658,-11366,"); - add("-35,-60,-80,-23,11,53,"); - add(""); - //add("/*694*/"); - add("3,1,-17616,-23753,5046,"); - add("-93,61,-37,33,-27,-10,"); - add(""); - //add("/*695*/"); - add("3,1,25086,-5507,-15503,"); - add("-51,11,-86,23,44,21,"); - add(""); - //add("/*696*/"); - add("3,1,-15610,-24492,7515,"); - add("-12,-16,-78,52,-2,101,"); - add(""); - //add("/*697*/"); - add("3,1,-15472,22928,-11615,"); - add("-58,-51,-24,-15,24,68,"); - add(""); - //add("/*698*/"); - add("3,1,-12165,24913,-11461,"); - add("34,-28,-96,-48,-12,24,"); - add(""); - //add("/*699*/"); - add("3,1,5310,21296,20452,"); - add("21,-66,64,46,12,-25,"); - add(""); - //add("/*700*/"); - add("3,-1,17800,23716,-4555,"); - add("58,-61,-85,-31,27,21,"); - add(""); - //add("/*701*/"); - add("3,1,18987,-4163,22851,"); - add("56,89,-31,-54,-31,40,"); - add(""); - //add("/*702*/"); - add("3,1,-13833,24181,-11133,"); - add("4,-47,-107,-21,7,43,"); - add(""); - //add("/*703*/"); - add("3,1,6651,29245,-700,"); - add("50,-11,4,-96,20,-60,"); - add(""); - //add("/*704*/"); - add("3,1,-25607,5901,14473,"); - add("-58,-52,-82,27,-3,49,"); - add(""); - //add("/*705*/"); - add("3,1,-19397,-22308,5108,"); - add("1,25,114,-14,3,-42,"); - add(""); - //add("/*706*/"); - add("3,1,-23259,-297,18946,"); - add("-53,-60,-67,39,-10,48,"); - add(""); - //add("/*707*/"); - add("3,1,-13405,24297,-11400,"); - add("11,-34,-86,-50,-16,26,"); - add(""); - //add("/*708*/"); - add("3,1,25842,-4398,-14590,"); - add("-3,-99,25,-21,27,-45,"); - add(""); - //add("/*709*/"); - add("3,1,-25303,12454,-10231,"); - add("-57,-52,78,24,41,-8,"); - add(""); - //add("/*710*/"); - add("3,1,-8255,26088,-12300,"); - add("82,-6,-67,-56,-15,5,"); - add(""); - //add("/*711*/"); - add("3,1,6152,-8008,-28249,"); - add("-89,40,-31,63,17,9,"); - add(""); - //add("/*712*/"); - add("3,1,-25934,14888,2405,"); - add("-36,-47,-101,8,8,37,"); - add(""); - //add("/*713*/"); - add("3,1,-6774,29199,-1229,"); - add("-15,-8,-109,-22,-3,41,"); - add(""); - //add("/*714*/"); - add("3,1,-1560,24786,16830,"); - add("-10,-53,77,53,17,-21,"); - add(""); - //add("/*715*/"); - add("3,-1,-21338,21065,-960,"); - add("-45,-41,97,19,19,-19,"); - add(""); - //add("/*716*/"); - add("3,1,-5625,24695,-16078,"); - add("11,-41,-67,-64,-5,15,"); - add(""); - //add("/*717*/"); - add("3,1,-26663,12045,6635,"); - add("-9,-70,90,11,38,-27,"); - add(""); - //add("/*718*/"); - add("3,1,-27183,11286,5804,"); - add("-3,-54,92,15,44,-17,"); - add(""); - //add("/*719*/"); - add("3,1,-20085,-21491,5891,"); - add("-63,66,28,2,-16,-51,"); - add(""); - //add("/*720*/"); - add("3,1,11920,-13784,-23831,"); - add("22,98,-45,15,-28,23,"); - add(""); - //add("/*721*/"); - add("3,1,-19179,-22536,4928,"); - add("-34,47,83,-13,-1,-57,"); - add(""); - //add("/*722*/"); - add("3,1,-355,23212,19002,"); - add("-92,11,-15,20,-33,40,"); - add(""); - //add("/*723*/"); - add("3,1,10541,18339,21273,"); - add("-78,-33,68,42,-8,-15,"); - add(""); - //add("/*724*/"); - add("3,1,-14382,25139,7820,"); - add("-90,-56,16,38,15,21,"); - add(""); - //add("/*725*/"); - add("3,1,-17775,-23685,4805,"); - add("-61,60,70,10,-16,-41,"); - add(""); - //add("/*726*/"); - add("3,1,15192,-711,-25859,"); - add("-36,-88,-18,-22,47,-15,"); - add(""); - //add("/*727*/"); - add("3,1,-25173,6788,14841,"); - add("3,81,-33,-30,-45,-31,"); - add(""); - //add("/*728*/"); - add("3,1,23886,-136,-18151,"); - add("33,-60,45,-38,-20,-50,"); - add(""); - //add("/*729*/"); - add("3,1,-17001,21978,11312,"); - add("-63,-71,42,24,10,16,"); - add(""); - //add("/*730*/"); - add("3,1,11428,-4389,-27389,"); - add("22,-99,25,-34,23,-17,"); - add(""); - //add("/*731*/"); - add("3,1,-14644,23549,-11447,"); - add("-47,-58,-57,-17,11,44,"); - add(""); - //add("/*732*/"); - add("3,1,20716,-6655,20653,"); - add("26,-20,-32,-11,92,40,"); - add(""); - //add("/*733*/"); - add("3,1,-27252,6392,10793,"); - add("0,-79,45,16,25,26,"); - add(""); - //add("/*734*/"); - add("3,1,8257,18817,21858,"); - add("-26,-56,57,41,-17,-1,"); - add(""); - //add("/*735*/"); - add("3,1,17728,-4370,-23804,"); - add("-69,-43,-43,-2,40,-9,"); - add(""); - //add("/*736*/"); - add("3,1,7081,29143,-744,"); - add("46,-10,33,-16,1,-93,"); - add(""); - //add("/*737*/"); - add("3,1,20340,-6075,-21198,"); - add("-58,54,-71,24,-5,24,"); - add(""); - //add("/*738*/"); - add("3,1,-10500,-27772,4297,"); - add("13,7,78,-57,18,-24,"); - add(""); - //add("/*739*/"); - add("3,1,-21551,16797,-12387,"); - add("-61,-25,74,20,27,1,"); - add(""); - //add("/*740*/"); - add("3,1,-23937,14156,-11253,"); - add("40,42,-32,-29,-72,-28,"); - add(""); - //add("/*741*/"); - add("3,1,2497,24497,17137,"); - add("31,52,-79,-35,-7,14,"); - add(""); - //add("/*742*/"); - add("3,1,21770,-2150,-20529,"); - add("-61,-66,-57,14,28,12,"); - add(""); - //add("/*743*/"); - add("3,1,-10876,-27085,6937,"); - add("24,15,94,-38,8,-29,"); - add(""); - //add("/*744*/"); - add("3,1,-26625,11639,7461,"); - add("-2,-58,82,13,34,-9,"); - add(""); - //add("/*745*/"); - add("3,-1,-25621,14760,-5070,"); - add("-8,16,87,27,22,-74,"); - add(""); - //add("/*746*/"); - add("3,1,-16344,22674,-10897,"); - add("-89,-53,23,21,14,-3,"); - add(""); - //add("/*747*/"); - add("3,1,-15599,23126,-11040,"); - add("-60,-53,-25,-14,9,38,"); - add(""); - //add("/*748*/"); - add("3,1,2618,27824,10908,"); - add("49,19,-60,-43,11,-19,"); - add(""); - //add("/*749*/"); - add("3,-1,13838,15180,21865,"); - add("70,-66,2,3,22,-18,"); - add(""); - //add("/*750*/"); - add("3,1,29104,5954,-4186,"); - add("-25,89,-43,9,-21,32,"); - add(""); - //add("/*751*/"); - add("3,-1,-17298,24161,-4125,"); - add("-9,-22,-94,-19,-8,36,"); - add(""); - //add("/*752*/"); - add("3,1,7494,29029,1081,"); - add("29,-6,-36,-80,21,-19,"); - add(""); - //add("/*753*/"); - add("3,-1,-19537,-11007,19928,"); - add("-32,64,4,-30,8,-25,"); - add(""); - //add("/*754*/"); - add("3,1,-18953,-22734,4895,"); - add("-43,49,59,-8,-4,-50,"); - add(""); - //add("/*755*/"); - add("3,1,13593,-5535,-26165,"); - add("-86,-27,-39,14,23,3,"); - add(""); - //add("/*756*/"); - add("3,-1,-19136,21815,-7612,"); - add("-73,-60,14,6,12,19,"); - add(""); - //add("/*757*/"); - add("3,1,-24002,17079,5677,"); - add("-28,-7,-99,6,1,24,"); - add(""); - //add("/*758*/"); - add("3,1,-26057,14705,-2194,"); - add("-28,-61,-74,6,16,44,"); - add(""); - //add("/*759*/"); - add("3,1,-25874,9131,12130,"); - add("37,-3,82,4,26,-11,"); - add(""); - //add("/*760*/"); - add("3,-1,-22516,16997,-10205,"); - add("-66,-59,49,14,16,-6,"); - add(""); - //add("/*761*/"); - add("3,1,15992,-257,25381,"); - add("-2,95,2,-18,-43,11,"); - add(""); - //add("/*762*/"); - add("3,1,-8284,26137,-12175,"); - add("54,-16,-71,-23,-10,-5,"); - add(""); - //add("/*763*/"); - add("3,1,-20414,-21222,5734,"); - add("10,12,81,-31,24,-22,"); - add(""); - //add("/*764*/"); - add("3,1,-15647,23076,-11075,"); - add("-62,-58,-33,0,15,30,"); - add(""); - //add("/*765*/"); - add("3,1,-28391,9662,-763,"); - add("-10,-37,-88,-2,-1,37,"); - add(""); - //add("/*766*/"); - add("3,1,23132,6353,18016,"); - add("60,-29,-68,-13,23,9,"); - add(""); - //add("/*767*/"); - add("3,-1,-24613,16950,2623,"); - add("-44,-58,-39,16,15,55,"); - add(""); - //add("/*768*/"); - add("3,-1,10870,-14991,23603,"); - add("35,-65,-58,7,21,11,"); - add(""); - //add("/*769*/"); - add("3,1,-27204,11625,4977,"); - add("-5,-47,82,5,20,-16,"); - add(""); - //add("/*770*/"); - add("3,1,-26269,14142,-3158,"); - add("-28,-66,-58,-1,3,22,"); - add(""); - //add("/*771*/"); - add("3,1,2537,27833,10903,"); - add("-20,-29,79,23,2,-9,"); - add(""); - //add("/*772*/"); - add("3,1,-27160,11434,5619,"); - add("0,-35,71,12,28,5,"); - add(""); - //add("/*773*/"); - add("3,1,29168,5584,-4248,"); - add("-10,72,27,7,-18,25,"); - add(""); - //add("/*774*/"); - add("3,1,29735,1076,-3832,"); - add("3,68,47,2,-31,8,"); - add(""); - //add("/*775*/"); - add("3,-1,-1224,25269,16124,"); - add("-57,-36,52,10,1,0,"); - add(""); - //add("/*776*/"); - add("3,1,-28530,9221,1000,"); - add("22,64,44,0,1,-17,"); - add(""); - add("0,"); - } - - private void add(String s) { - d.add(s); - } - - public List getLines() { - return d; - } - - -} \ No newline at end of file diff --git a/src/ext/plantuml/com/ctreber/acearth/MapDataReader.java b/src/ext/plantuml/com/ctreber/acearth/MapDataReader.java deleted file mode 100644 index f768c7e..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/MapDataReader.java +++ /dev/null @@ -1,110 +0,0 @@ -package ext.plantuml.com.ctreber.acearth; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import ext.plantuml.com.ctreber.acearth.util.Point3D; -import ext.plantuml.com.ctreber.acearth.util.Polygon; - -/** - * The map data file is a big array of short (16-bit) ints, as follows: - it is - * a sequence of closed curves - the first value in a curve is the number of - * points in the curve - the second value in a curve indicates land/water (1 or - * -1, respectively) - this is followed by an [x,y,z] triple that indicates a - * point on the unit sphere (each of x, y, and z has been scaled by 30000), - * where the x axis points "to the right" (towards 0 N 90 E), the y axis points - * "up" (towards the north pole), and the z axis points "out of the screen" - * (towards 0 N 0 E). this is the starting point of the curve. - this is - * followed by (one less than the number of points in the curve) triples - * [dx,dy,dz]; the [x,y,z] triple for each successive point in the curve is - * obtained by adding [dx,dy,dz] onto the previous [x,y,z] values. - the curves - * are [must be!] non-self-intersecting and traced in a counter-clockwise - * direction - * - * the curves are sampled at a (roughly) a 20 mile resolution. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public class MapDataReader { - /** Point value scale (devide value by this number). */ - private static final double MAP_DATA_SCALE = 30000.0; - - private static List fData; - private static List fPolygons; - private static int fIndex; - - /** - *

- * Read map data. - * - * @param pFileName - * Map data file name. - * @return Array of map polygons. - * @throws IOException - */ - public static Polygon[] readMapData() throws IOException { - final List lines = new MapData().getLines(); - - fData = new ArrayList(); - for (Iterator it = lines.iterator(); it.hasNext(); ) { - String lLine = (String) it.next(); - if (lLine.indexOf("/*") != -1) { - // Filter out comments. - continue; - } - - StringTokenizer lST = new StringTokenizer(lLine, ", "); - while (lST.hasMoreTokens()) { - String lToken = lST.nextToken(); - final Integer lValue = new Integer(lToken); - fData.add(lValue); - } - } - - fPolygons = new ArrayList(); - fIndex = 0; - while (getValue(fIndex) != 0) { - processCurve(); - } - - return (Polygon[]) fPolygons.toArray(new Polygon[0]); - } - - private static void processCurve() { - final int lNPoint = getValue(fIndex++); - final int lType = getValue(fIndex++); - - final Point3D[] lPoints = new Point3D[lNPoint]; - final Point3D lPoint3D = new Point3D(getValue(fIndex++) / MAP_DATA_SCALE, getValue(fIndex++) / MAP_DATA_SCALE, - getValue(fIndex++) / MAP_DATA_SCALE); - - lPoints[0] = lPoint3D; - for (int i = 1; i < lNPoint; i++) { - lPoints[i] = new Point3D(lPoints[i - 1].getX() + getValue(fIndex++) / MAP_DATA_SCALE, lPoints[i - 1].getY() - + getValue(fIndex++) / MAP_DATA_SCALE, lPoints[i - 1].getZ() + getValue(fIndex++) / MAP_DATA_SCALE); - } - - final Polygon lPolygon = new Polygon(lType, lPoints); - fPolygons.add(lPolygon); - } - - /** - *

- * Get value of raw data at specified point. - * - * @param pIndex - * Index of value. - * @return Value of raw data at specified point. - */ - private static int getValue(int pIndex) { - return ((Integer) fData.get(pIndex)).intValue(); - } - -} diff --git a/src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java b/src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java deleted file mode 100644 index 352ac37..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/gui/CanvasACearth.java +++ /dev/null @@ -1,21 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.gui; - -import ext.plantuml.com.ctreber.acearth.ACearth; - -/** - *

- * Adds some mouse magic to the normal PixelCanvas. - *

- * - *

- * © 2002 Christian Treber, ct@ctreber.com (Nov 8, 2002) - *

- * - * @author Christian Treber, ct@ctreber.com - * - */ -public class CanvasACearth extends PixelCanvas { - public CanvasACearth(ACearth pParent, int pWidth, int pHeight) { - super(pWidth, pHeight); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java b/src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java deleted file mode 100644 index 030d69e..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/gui/PixelCanvas.java +++ /dev/null @@ -1,72 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.gui; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; - -import javax.imageio.ImageIO; - -import ext.plantuml.com.ctreber.acearth.renderer.RenderTarget; - -/** - *

- * Swing compatible drawing surface for images and graphics. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public class PixelCanvas implements RenderTarget { - final private int fImageWidth; - final private int fImageHeight; - final private BufferedImage fEarthImage2; - - /** - *

- * Construct a canvas of the specified size. - * - * @param pWidth - * Width - * @param pHeight - * Height - */ - public PixelCanvas(int pWidth, int pHeight) { - fImageWidth = pWidth; - fImageHeight = pHeight; - fEarthImage2 = new BufferedImage(fImageWidth, fImageHeight, BufferedImage.TYPE_INT_RGB); - } - - public Graphics2D getGraphics2D() { - return fEarthImage2.createGraphics(); - } - - public void setPixel(int pX, int pY, int pA, int pR, int pG, int pB) { - setPixel(pX, pY, new Color(pR, pG, pB, pA)); - } - - public void setPixel(int pX, int pY, Color pColor) { - fEarthImage2.setRGB(pX, pY, pColor.getRGB()); - } - - public int getImageWidth() { - return fImageWidth; - } - - public int getImageHeight() { - return fImageHeight; - } - - public boolean saveToImage(String pFileName, String pFormat) throws IOException { - return ImageIO.write(fEarthImage2, pFormat, new File(pFileName)); - } - - public void saveToImage(OutputStream os) throws IOException { - ImageIO.write(fEarthImage2, "png", os); - } - -} diff --git a/src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java b/src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java deleted file mode 100644 index 85de4bb..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/plugins/Plugin.java +++ /dev/null @@ -1,46 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.plugins; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -import ext.plantuml.com.ctreber.acearth.ACearth; -import ext.plantuml.com.ctreber.acearth.gui.PixelCanvas; -import ext.plantuml.com.ctreber.acearth.projection.Projection; - -/** - *

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 6, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class Plugin implements ActionListener -{ - protected ACearth fParent; - protected boolean fActiveP = true; - protected Projection fProjection; - protected PixelCanvas fRenderTarget; - - public void actionPerformed(ActionEvent e) - { - } - - abstract public boolean hasGUIP(); - - abstract public void render(); - - public void setProjection(Projection pProjection) - { - fProjection = pProjection; - } - - public void setRenderTarget(PixelCanvas pRenderTarget) - { - fRenderTarget = pRenderTarget; - } - - public void setParent(ACearth pParent) - { - fParent = pParent; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java b/src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java deleted file mode 100644 index ccd8b15..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/plugins/markers/Marker.java +++ /dev/null @@ -1,187 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.plugins.markers; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics2D; -import java.util.List; - -import ext.plantuml.com.ctreber.acearth.gui.PixelCanvas; -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.projection.ProjectionOrtho; -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point2D; -import ext.plantuml.com.ctreber.acearth.util.Point3D; -import ext.plantuml.com.ctreber.acearth.util.StringParser; - -/** - *

- * Marks a location on the globe. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public class Marker { - private static final int MARKER_SIZE = 4; - - // types of marker label alignment - private static final int MarkerAlignDefault = 0; - private static final int MarkerAlignLeft = 1; - private static final int MarkerAlignRight = 2; - private static final int MarkerAlignAbove = 3; - private static final int MarkerAlignBelow = 4; - - private Marker(Coordinate pCoordinate, String pLabel, int pAlign) { - fCoordinate = pCoordinate; - fLabel = pLabel; - fAlign = pAlign; - } - - private Coordinate fCoordinate; - private String fLabel; - private int fAlign; - - // private static List fMarkers; - - /* - * builtin_marker_data[] contains the "built-in" marker data that is - * compiled into AC.earth. (My apologies for misspellings, omissions of your - * favorite location, or geographic inaccuracies. This is primarily just a - * pile of data that I had handy instead of an attempt to provide a sample - * that is "globally correct" in some sense.) - */ - // public static List loadMarkerFile(String pFileName) throws IOException { - // fMarkers = new ArrayList(); - // - // final LineNumberReader lReader = new LineNumberReader(new - // FileReader(pFileName)); - // String lLine; - // while ((lLine = lReader.readLine()) != null) { - // processLine(lLine); - // } - // - // lReader.close(); - // - // return fMarkers; - // } - // - // private static void processLine(String pLine) { - // final int lPos = pLine.indexOf('#'); - // if (lPos != -1) { - // // Remove comment - // pLine = pLine.substring(0, lPos); - // } - // - // final Marker lMarkerInfo = createFromLine(pLine); - // if (lMarkerInfo != null) { - // fMarkers.add(lMarkerInfo); - // } - // } - private static Marker createFromLine(String pLine) { - final List lWords = StringParser.parse(pLine); - - final double lLat = Double.parseDouble((String) lWords.get(0)); - final double lLong = Double.parseDouble((String) lWords.get(1)); - final String lLabel = (String) lWords.get(2); - - int lAlign = MarkerAlignDefault; - if (lWords.size() >= 4) { - String lAlignString = (String) lWords.get(3); - if (lAlignString.equalsIgnoreCase("left")) { - lAlign = MarkerAlignLeft; - } - if (lAlignString.equalsIgnoreCase("right")) { - lAlign = MarkerAlignRight; - } - if (lAlignString.equalsIgnoreCase("above")) { - lAlign = MarkerAlignAbove; - } - if (lAlignString.equalsIgnoreCase("below")) { - lAlign = MarkerAlignBelow; - } - } - - final Coordinate lPos = new Coordinate(lLat, lLong); - if (!lPos.check()) { - // ACearth.logError("latitude must be between -90 and 90, and - // longitude must be between -180 and 180"); - return null; - } - - return new Marker(lPos, lLabel, lAlign); - } - - public String toString() { - return fLabel + " (" + fCoordinate + "), align: " + fAlign; - } - - // --Recycle Bin START (10/28/02 2:24 PM): - // public String getLabel() - // { - // return fLabel; - // } - // --Recycle Bin STOP (10/28/02 2:24 PM) - - // --Recycle Bin START (10/28/02 2:24 PM): - // public int getAlign() - // { - // return fAlign; - // } - // --Recycle Bin STOP (10/28/02 2:24 PM) - - // --Recycle Bin START (10/28/02 2:24 PM): - // public Coordinate getLocation() - // { - // return fCoordinate; - // } - // --Recycle Bin STOP (10/28/02 2:24 PM) - - public void render(PixelCanvas pCanvas, Projection pProjection) { - final Point3D lPos = pProjection.rotate(fCoordinate.getPoint3D()); - - if ((pProjection instanceof ProjectionOrtho) && (lPos.getZ() <= 0)) { - // Back side of the Earth. - // Insight: We don't need to check if the marker is visible in other - // projections because they always show the whole earth - and all - // markers! - return; - } - - Point2D lPoint = pProjection.finalize(pProjection.project2D(lPos)); - final int lX = (int) lPoint.getX(); - final int lY = (int) lPoint.getY(); - - // Draw a circle - Graphics2D g2d = pCanvas.getGraphics2D(); - g2d.setColor(Color.red); - // pCanvas.drawCircle(lX, lY, MARKER_SIZE); - g2d.drawOval(lX, lY, MARKER_SIZE, MARKER_SIZE); - - if (fLabel != null) { - switch (fAlign) { - case Marker.MarkerAlignLeft: - break; - - case Marker.MarkerAlignRight: - case Marker.MarkerAlignDefault: - // pCanvas.drawText(lX + MARKER_SIZE, lY + 4, fLabel); - // fRenderTarget.setTextFont(fRenderTarget.getTextFont().deriveFont(9.0f)); - g2d.setFont(new Font("", Font.PLAIN, 9)); - g2d.drawString(fLabel, lX + MARKER_SIZE + 1, lY + 2); - break; - - case Marker.MarkerAlignAbove: - break; - - case Marker.MarkerAlignBelow: - break; - } - } - } - - public static Marker loadMarkerFile(String line) { - return createFromLine(line); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java b/src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java deleted file mode 100644 index f4757d8..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/plugins/markers/PluginMarkers.java +++ /dev/null @@ -1,72 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.plugins.markers; - -import java.util.Iterator; -import java.util.List; - -import ext.plantuml.com.ctreber.acearth.plugins.Plugin; - -/** - *

- * Renders markers to the render target. a - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public class PluginMarkers extends Plugin { - private List fMarkers; - - // private String fMarkerFileName = ACearth.getHomeDir() + - // "markersDefault.txt"; - - public PluginMarkers(List markers) { - // ACearth.indent("AC.earth Markers plug-in"); - // - // ACearth.log("Reading markers"); - // - // if(fMarkerFileName == null) - // { - // throw new RuntimeException("Marker file name not set"); - // } - - // try - // { - // fMarkers = Marker.loadMarkerFile(fMarkerFileName); - // } catch(IOException e) - // { - // ACearth.logError("Marker file not found"); - // return; - // } - - fMarkers = markers; - - // ACearth.outdent(); - } - - public boolean hasGUIP() { - return false; - } - - public void render() { - if (!fActiveP) { - return; - } - - // fRenderTarget.setTextFont(fRenderTarget.getTextFont().deriveFont(9.0f)); - Iterator lIt = fMarkers.iterator(); - while (lIt.hasNext()) { - Marker lMarker = (Marker) lIt.next(); - lMarker.render(fRenderTarget, fProjection); - } - } - - // public void setMarkerFileName(String pMarkerFileName) - // { - // fMarkerFileName = pMarkerFileName; - // } - - public String toString() { - return "AC.earth Markers plug-in"; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/projection/Projection.java b/src/ext/plantuml/com/ctreber/acearth/projection/Projection.java deleted file mode 100644 index 8fd3ebf..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/projection/Projection.java +++ /dev/null @@ -1,274 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.projection; - -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point2D; -import ext.plantuml.com.ctreber.acearth.util.Point3D; -import ext.plantuml.com.ctreber.acearth.util.Toolkit; - -/** - *

A projection for a globe on a flat surface (must be subclassed). - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class Projection -{ - // Target information - int fImageHeight; - int fImageWidth; - private double fXOffset; - private double fYOffset; - - //Viewing information - private int fShiftX; - private int fShiftY; - double fScale; - - private Coordinate fViewPos; - /**

In rads */ - private double fViewRotation; - double fViewMagnification; - - - //Transformation matrix parameters */ - private double fCosLat; - private double fSinLat; - private double fCosLon; - private double fSinLon; - private double fCosRot; - private double fSinRot; - - /** - *

Initialize transform parameters, set offset to center of image - * (plus shifts), set scale - */ - public void initTransformTable() - { - // Set transformation parameters - fCosLat = Math.cos(Toolkit.degsToRads(fViewPos.getLat())); - fSinLat = Math.sin(Toolkit.degsToRads(fViewPos.getLat())); - fCosLon = Math.cos(Toolkit.degsToRads(fViewPos.getLong())); - fSinLon = Math.sin(Toolkit.degsToRads(fViewPos.getLong())); - fCosRot = Math.cos(Toolkit.degsToRads(fViewRotation)); - fSinRot = Math.sin(Toolkit.degsToRads(fViewRotation)); - - fXOffset = (double)fImageWidth / 2 + fShiftX; - fYOffset = (double)fImageHeight / 2 + fShiftY; - - setScale(); - } - - abstract protected void setScale(); - - /** - *

Project 3D point on y axis. - */ - abstract public double projectY(double pY); - - abstract public double inverseProjectY(double pY); - - /** - *

Project 3D point on x axis. - */ - abstract protected double projectX(double pX, double pZ); - - abstract public double inverseProjectX(double pX); - - public abstract boolean isVisible(Point3D pPoint); - - public boolean isWithinImage(Point2D pPoint) - { - return (pPoint.getX() >= 0) && (pPoint.getX() < fImageWidth) && - (pPoint.getY() >= 0) && (pPoint.getY() < fImageHeight); - } - - /** - *

Translate screen point into coordinate on Earth. - * - * @param pX - * @param pY - * @return - */ - abstract public Coordinate getLocation(int pX, int pY); - - /** - *

Imagine view the globe, N is up, S is down, and N0E0 is in the center. - * x is right/left, y is up/down, and z is front/rear. - * - *

Map points are located on the surface of a unit sphere (diameter = 1). - * Latitude is the angle between x and y or z and y. Longitude is the angle - * between x and z. - * - *

Why? The way we choose our global coordinate system, longitude circles - * (latidude variable) always have the same size while the size of - * latidude circles (longitude variable) depends on the latitude. - * - * @param pPoint - * @return - */ - public Point2D project2D(Point3D pPoint) - { - return new Point2D(projectX(pPoint.getX(), pPoint.getZ()), - projectY(pPoint.getY())); - } - - public Point2D finalize(Point2D pPoint) - { - return new Point2D(finalizeX(pPoint.getX()), finalizeY(pPoint.getY())); - } - - /** - *

Since the final mapping is relative to the center of the image - * -PI and PI get mapped to the left and right border respectively. - * But see ProjectionOrtho.setScale(). - */ - public double finalizeX(double pX) - { - return fXOffset + fScale * pX; - } - - /** - *

Since the final mapping is relative to the center of the image - * -PI and PI get mapped to the bottom and top border respectively. - * But see ProjectionOrtho.setScale(). - */ - public double finalizeY(double pY) - { - return fYOffset - fScale * pY; - } - - /** - *

Transform screen to image coordinates. - */ - public double inverseFinalizeX(double x) - { - return (x - fXOffset) / fScale; - } - - /** - *

Transform screen to image coordinates. - */ - public double inverseFinalizeY(double y) - { - return (fYOffset - y) / fScale; - } - - /** - *

Rotate the point according to the current rotation of Earth. - */ - public Point3D rotate(Point3D pPoint) - { - double lX = pPoint.getX(); - double lY = pPoint.getY(); - double lZ = pPoint.getZ(); - - // Do NOT inline vars - it does not work (just inline _t_ for a try). - double _c_ = fCosLon; - double _s_ = fSinLon; - double _t_ = _c_ * lX - _s_ * lZ; - lZ = _s_ * lX + _c_ * lZ; - lX = _t_; - - _c_ = fCosLat; - _s_ = fSinLat; - _t_ = (_c_ * lY) - (_s_ * lZ); - lZ = (_s_ * lY) + (_c_ * lZ); - lY = _t_; - - _c_ = fCosRot; - _s_ = fSinRot; - _t_ = (_c_ * lX) - (_s_ * lY); - lY = (_s_ * lX) + (_c_ * lY); - lX = _t_; - - return new Point3D(lX, lY, lZ); - } - - public Point3D rotateReverse(Point3D pPoint) - { - // Set transformation parameters - final double fCosLat = Math.cos(Toolkit.degsToRads(-fViewPos.getLat())); - final double fSinLat = Math.sin(Toolkit.degsToRads(-fViewPos.getLat())); - final double fCosLon = Math.cos(Toolkit.degsToRads(-fViewPos.getLong())); - final double fSinLon = Math.sin(Toolkit.degsToRads(-fViewPos.getLong())); - final double fCosRot = Math.cos(Toolkit.degsToRads(-fViewRotation)); - final double fSinRot = Math.sin(Toolkit.degsToRads(-fViewRotation)); - - double lX = pPoint.getX(); - double lY = pPoint.getY(); - double lZ = pPoint.getZ(); - - // Do NOT inline vars - it does not work (just inline lTmp for a try). - double lCosFac; - double lSinFac; - double lTmp; - - // Note that the order of the three rotation had to be reversed as well. - lCosFac = fCosRot; - lSinFac = fSinRot; - lTmp = (lCosFac * lX) - (lSinFac * lY); - lY = (lSinFac * lX) + (lCosFac * lY); - lX = lTmp; - - lCosFac = fCosLat; - lSinFac = fSinLat; - lTmp = (lCosFac * lY) - (lSinFac * lZ); - lZ = (lSinFac * lY) + (lCosFac * lZ); - lY = lTmp; - - lCosFac = fCosLon; - lSinFac = fSinLon; - lTmp = (lCosFac * lX) - (lSinFac * lZ); - lZ = (lSinFac * lX) + (lCosFac * lZ); - lX = lTmp; - - return new Point3D(lX, lY, lZ); - } - - public double getScale() - { - return fScale; - } - - public Coordinate getViewPos() - { - return fViewPos; - } - - public void setViewMagnification(double pViewMagnification) - { - fViewMagnification = pViewMagnification; - setScale(); - } - - public void setViewPos(Coordinate pViewPos) - { - fViewPos = pViewPos; - } - - public void setShiftX(int pX) - { - fShiftX = pX; - } - - public void setShiftY(int pY) - { - fShiftY = pY; - } - - public void setViewRotation(double pViewRotation) - { - fViewRotation = pViewRotation; - } - - public void setImageWidth(int pImageWidth) - { - fImageWidth = pImageWidth; - } - - public void setImageHeight(int pImageHeight) - { - fImageHeight = pImageHeight; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java deleted file mode 100644 index e25071c..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionCyl.java +++ /dev/null @@ -1,72 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.projection; - -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - -/** - *

Cylindrical projection. Show Earth flatly spread out on rectangle. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class ProjectionCyl extends Projection -{ - /** - *

All of Earth is visible. - * - * @param pPoint - * @return - */ - public boolean isVisible(Point3D pPoint) - { - return true; - } - - public Coordinate getLocation(int pX, int pY) - { - final Coordinate lRaw = new Coordinate(Math.atan(inverseFinalizeY(pY)), - inverseFinalizeX(pX)); - - return rotateReverse(lRaw.getPoint3DRads()).getCoordinate(); - } - - /** - *

The scale is set so that a value of - * 2PI gets mapped to the full image width times the magnification. - * But see ProjectionOrtho.setScale(). - */ - protected void setScale() - { - // Makes 2PI come out as full image width - fScale = fViewMagnification * fImageWidth / (2 * Math.PI); - } - - /** - * @return Longitude (-PI to PI), linearly on x axis. - */ - public double projectX(double pX, double pZ) - { - return Math.atan2(pX, pZ); - } - - public double inverseProjectX(double pX) - { - return Math.sin(pX); - } - - /** - * @return Latitude (-PI/2 to PI/2), projected from center of Earth on - * y axis with a linear scale. - */ - public double projectY(double pY) - { - return (pY >= 0.9999999999) ? 1e6 : - (pY <= -0.9999999999) ? -1e6 : Math.tan(Math.asin(pY)); - } - - public double inverseProjectY(double y) - { - return Math.sin(Math.atan(y)); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java deleted file mode 100644 index 775e35a..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionMerc.java +++ /dev/null @@ -1,75 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.projection; - -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - - -/** - *

Mercator projection. Show Earth flatly spread out on rectangle. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class ProjectionMerc extends Projection -{ - /** - *

All of Earth is visible. - * - * @param pPoint - * @return - */ - public boolean isVisible(Point3D pPoint) - { - return true; - } - - public Coordinate getLocation(int pX, int pY) - { - final Coordinate lRaw = new Coordinate( - 2 * (Math.atan(Math.exp(inverseFinalizeY(pY))) - Math.PI / 4), - inverseFinalizeX(pX)); - - return rotateReverse(lRaw.getPoint3DRads()).getCoordinate(); - } - - /** - *

The scale is set so that a value of - * 2PI gets mapped to the full image width times the magnification. - * But see ProjectionOrtho.setScale(). - */ - protected void setScale() - { - // Makes 2PI come out as full image width - fScale = fViewMagnification * fImageWidth / (2 * Math.PI); - } - - /** - * @return Longitude (-PI to PI), linearly on x axis. - */ - public double projectX(double pX, double pZ) - { - return Math.atan2(pX, pZ); - } - - public double inverseProjectX(double pX) - { - return Math.sin(pX); - } - - /** - * @return Latitude (-PI/2 to PI/2), projected from center of Earth on - * y axis with a twist and a log scale. - */ - public double projectY(double pY) - { - return (pY >= 0.9999999999) ? 1e6 - : (pY <= -0.9999999999) ? -1e6 - : Math.log(Math.tan(Math.asin(pY) / 2 + Math.PI / 4)); - } - - public double inverseProjectY(double y) - { - return Math.sin(2 * (Math.atan(Math.exp(y)) - Math.PI / 4)); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java b/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java deleted file mode 100644 index 6ff24a6..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/projection/ProjectionOrtho.java +++ /dev/null @@ -1,71 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.projection; - -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - - -/** - *

Orthographic projection (show Earth as a ball). - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class ProjectionOrtho extends Projection -{ - /** - *

All of Earth is visible. - * - * @param pPoint - * @return - */ - public boolean isVisible(Point3D pPoint) - { - return pPoint.getZ() >= 0; - } - - public Coordinate getLocation(int pX, int pY) - { - final double lX = inverseFinalizeX(pX); - final double lY = inverseFinalizeY(pY); - final double lZ = Math.sqrt(1 - lX * lX - lY * lY); - final Point3D lP = new Point3D(lX, lY, lZ); - - return rotateReverse(lP).getCoordinate(); - } - - /** - * @return Longitude, not in rad but from -1 to 1. - */ - public double projectX(double pX, double pZ) - { - return pX; - } - - public double inverseProjectX(double pX) - { - return pX; - } - - /** - * @return Latitude, not in rad but from -1 to 1. - */ - public double projectY(double pY) - { - return pY; - } - - public double inverseProjectY(double pY) - { - return pY; - } - - /** - *

The scale is not from -PI to PI but from -1 to 1 in this case - * (the range of x, y, z of the points). - */ - protected void setScale() - { - fScale = Math.min(fImageHeight, fImageWidth) * fViewMagnification * 0.99 / 2; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java deleted file mode 100644 index 1b4881f..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/renderer/RenderTarget.java +++ /dev/null @@ -1,24 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.renderer; - -import java.awt.Color; - -/** - *

. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public interface RenderTarget { - - public void setPixel(int pX, int pY, int pA, int pR, int pG, int pB); - - public void setPixel(int pX, int pY, Color pColor); - - public int getImageWidth(); - - public int getImageHeight(); - -} diff --git a/src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java b/src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java deleted file mode 100644 index ae9f389..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/renderer/Renderer.java +++ /dev/null @@ -1,92 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.renderer; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import ext.plantuml.com.ctreber.acearth.shader.Shader; - -/** - *

- * Uses defined RowTypeRenderers and Shader to render to render target. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public class Renderer { - private Shader fShader; - private RenderTarget fRenderTarget; - private List fRowTypeRenderers = new ArrayList(); - - public Renderer(RenderTarget pRenderTarget) { - fRenderTarget = pRenderTarget; - } - - public void render() { - final Iterator lIt = fRowTypeRenderers.iterator(); - while (lIt.hasNext()) { - RowTypeRenderer lRowRenderer = (RowTypeRenderer) lIt.next(); - lRowRenderer.startNewRun(); - } - renderRows(); - } - - private void renderRows() { - for (int lRowNo = 0; lRowNo < fRenderTarget.getImageHeight(); lRowNo++) { - int[] lPixelTypes = getPixelTypes(lRowNo); - renderRow(lRowNo, lPixelTypes); - } - } - - /** - *

- * Get pixel types for whole row from all registered RowRenderers. - * - * @param pRowNo - * Row number. - * @return Pixel types for row. - */ - private int[] getPixelTypes(int pRowNo) { - // Create the types array - final int[] lPixelTypes = new int[fRenderTarget.getImageWidth()]; - - final Iterator lIt = fRowTypeRenderers.iterator(); - while (lIt.hasNext()) { - RowTypeRenderer lRowRenderer = (RowTypeRenderer) lIt.next(); - lRowRenderer.getPixelTypes(pRowNo, lPixelTypes); - } - - return lPixelTypes; - } - - /** - *

- * With help of Shader, render pixel types to actual colored pixels. - * - * @param pRowNo - * @param pPixelTypes - */ - private void renderRow(int pRowNo, int[] pPixelTypes) { - // For each pixel in row, render it. - final Color[] lPixelColors = fShader.getShadedColors(pRowNo, pPixelTypes); - for (int lColNo = 0; lColNo < fRenderTarget.getImageWidth(); lColNo++) { - fRenderTarget.setPixel(lColNo, pRowNo, lPixelColors[lColNo]); - } - } - - public void setShader(Shader pShader) { - fShader = pShader; - } - - public void setRenderTarget(RenderTarget pRenderTarget) { - fRenderTarget = pRenderTarget; - } - - public void addRowTypeRenderer(RowTypeRenderer pRowRenderer) { - fRowTypeRenderers.add(pRowRenderer); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java deleted file mode 100644 index 7ec8158..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRenderer.java +++ /dev/null @@ -1,26 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.renderer; - -/** - *

Renders a row of pixel types.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -public interface RowTypeRenderer -{ - /** - *

Each time when rendering an image, call startNewRun() first. - */ - public void startNewRun(); - - /** - *

Set pixel type for specified row number. Note some pixel types - * might be already set. The renderer can build on this information - * or overwrite it. - * - * @param pRowNo - * @param pPixelTypes - */ - public void getPixelTypes(int pRowNo, final int[] pPixelTypes); -} diff --git a/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java deleted file mode 100644 index 312ce54..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanBit.java +++ /dev/null @@ -1,82 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.renderer; - -import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMap; -import ext.plantuml.com.ctreber.acearth.scanbit.ScanBit; - -/** - *

Renders a row of ScanBits to pixel types.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -public class RowTypeRendererScanBit implements RowTypeRenderer -{ - private int fScanBitIndex; - private ScanBit[] fScanBits; - private final int[] fScanToPixelType = new int[256]; - - public void startNewRun() - { - fScanBitIndex = 0; - generateScanToPixelTypeTable(); - } - - public void getPixelTypes(int pRowNo, int[] pPixelTypes) - { - // For all ScanBits in specified row... - while((fScanBitIndex < fScanBits.length) && - (fScanBits[fScanBitIndex].getY() == pRowNo)) - { - for(int i = fScanBits[fScanBitIndex].getlXFrom(); - i <= fScanBits[fScanBitIndex].getXTo(); i++) - { - /** - * This is weird... why summing up the types? Note the row stays the - * same, but it possibly gets paved over a couple of times (There - * might be ScanBits painting on the same pixels). - * - * The polygons specify -1 as water and 1 as land. - * The type table says space is 0, Water is 1 to 64, Land is 65+. - * - * The outline paints the whole world as water (64). Adding a - * land pixel (1) creates a value of 65 (land). Adding a water - * pixel (-1) changes this back to 64 (water). - */ - pPixelTypes[i] += fScanBits[fScanBitIndex].getType(); - } - fScanBitIndex++; - } - - // Translate generateScanBits values into pixels types. - for(int lCol = 0; lCol < pPixelTypes.length; lCol++) - { - pPixelTypes[lCol] = fScanToPixelType[pPixelTypes[lCol] & 0xff]; - } - } - - private void generateScanToPixelTypeTable() - { - for(int i = 0; i < 256; i++) - { - if(i == 0) - { - // 0 is Space. - fScanToPixelType[i] = BitGeneratorMap.PixTypeSpace; - } else if(i > 64) - { - // Above 64 it's land. - fScanToPixelType[i] = BitGeneratorMap.PixTypeLand; - } else - { - // From 1 to 64 incl. it's water - fScanToPixelType[i] = BitGeneratorMap.PixTypeWater; - } - } - } - - public void setScanBits(ScanBit[] pScanBits) - { - fScanBits = pScanBits; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java b/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java deleted file mode 100644 index 3223094..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/renderer/RowTypeRendererScanDot.java +++ /dev/null @@ -1,60 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.renderer; - -import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMap; -import ext.plantuml.com.ctreber.acearth.scandot.ScanDot; - -/** - *

Renders a row of ScanDots to pixel types.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -public class RowTypeRendererScanDot implements RowTypeRenderer -{ - private int fScanDotIndex; - private ScanDot[] fScanDots; - - public void startNewRun() - { - fScanDotIndex = 0; - } - - public void getPixelTypes(int pRowNo, int[] pPixelTypes) - { - // For all ScanDots in specified row... - while((fScanDotIndex < fScanDots.length) && - (fScanDots[fScanDotIndex].getY() == pRowNo)) - { - ScanDot lDot = fScanDots[fScanDotIndex]; - - if(lDot.getType() == ScanDot.DotTypeStar) - { - if(pPixelTypes[lDot.getX()] == BitGeneratorMap.PixTypeSpace) - { - // Stars get only painted on Space. - pPixelTypes[lDot.getX()] = BitGeneratorMap.PixTypeStar; - } - } else - { - // The only other type for a dot (so far) is "grid". - switch(pPixelTypes[lDot.getX()]) - { - case BitGeneratorMap.PixTypeLand: - pPixelTypes[lDot.getX()] = BitGeneratorMap.PixTypeGridLand; - break; - - case BitGeneratorMap.PixTypeWater: - pPixelTypes[lDot.getX()] = BitGeneratorMap.PixTypeGridWater; - break; - } - } - fScanDotIndex++; - } - } - - public void setScanDots(ScanDot[] pScanDots) - { - fScanDots = pScanDots; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java deleted file mode 100644 index f907a70..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMap.java +++ /dev/null @@ -1,125 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scanbit; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.util.EdgeCrossing; -import ext.plantuml.com.ctreber.acearth.util.Point2D; -import ext.plantuml.com.ctreber.acearth.util.Point3D; -import ext.plantuml.com.ctreber.acearth.util.Polygon; -import ext.plantuml.com.ctreber.aclib.sort.CTSort; -import ext.plantuml.com.ctreber.aclib.sort.QuickSort; - -/** - *

- * A BitGeneratorMap scans a map into ScanBits. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public abstract class BitGeneratorMap extends ScanBitGenerator { - // Types of pixels. - public static final int PixTypeSpace = 0; - public static final int PixTypeLand = 1; - public static final int PixTypeWater = 2; - public static final int PixTypeStar = 3; - public static final int PixTypeGridLand = 4; - public static final int PixTypeGridWater = 5; - - // Parameters influencing generateScanBits buffer genertion. - private Polygon[] fMapData; - Projection fProjection; - private List fScanbitsVector = new ArrayList(); - // Created by scanPolygon - List fEdgeCrossings; - - abstract protected ScanBuf scanOutline(); - - abstract protected void handleCrossings(ScanBuf pScanBuf, EdgeCrossing[] pEdgeCrossings); - - abstract protected Comparator getEdgeXingComparator(); - - abstract protected void scanPolygon(ScanBuf pScanBuf, Point3D[] pPoints3D, Point2D[] pPoints2D, int pIndex); - - public BitGeneratorMap(Projection pProjection) { - fProjection = pProjection; - } - - /** - *

- * Create outline for the map, scan all polygons. - */ - public void generateScanBits() { - // Prepare data. - fScanbitsVector = new ArrayList(); - fProjection.setImageWidth(fImageWidth); - fProjection.setImageHeight(fImageHeight); - fProjection.initTransformTable(); - - // Trace outling and polygons. - final ScanBuf lScanBuf = scanOutline(); - fScanbitsVector.addAll(lScanBuf.getScanbits(64)); - scanPolygons(); - - // Dress results. - final CTSort lSort = new QuickSort(); - fScanBitsArray = (ScanBit[]) fScanbitsVector.toArray(new ScanBit[0]); - lSort.sort(fScanBitsArray); - } - - private void scanPolygons() { - for (int lPolyNo = 0; lPolyNo < fMapData.length; lPolyNo++) { - Polygon lPolygon = fMapData[lPolyNo]; - - Point3D[] lPoints3D = new Point3D[lPolygon.getSize()]; - Point2D[] lPoints2D = new Point2D[lPolygon.getSize()]; - transformPolygonPoints(lPolygon, lPoints3D, lPoints2D); - - // For all points in polygon... - fEdgeCrossings = new ArrayList(); - ScanBuf lScanBuf = new ScanBuf(fImageHeight, fImageWidth); - for (int i = 0; i < lPoints2D.length; i++) { - scanPolygon(lScanBuf, lPoints3D, lPoints2D, i); - } - - if (fEdgeCrossings.size() > 0) { - // Edge crossings have been generated, deal with them. - final EdgeCrossing[] xings = (EdgeCrossing[]) fEdgeCrossings.toArray(new EdgeCrossing[0]); - final CTSort lSort = new QuickSort(); - lSort.sort(xings, getEdgeXingComparator()); - handleCrossings(lScanBuf, xings); - } - - if (lScanBuf.containsPoints()) { - // Scan lines have been generated, transform them into ScanBit. - fScanbitsVector.addAll(lScanBuf.getScanbits(lPolygon.getType())); - } - } - } - - /** - * The transformation rotates 3D and projects 2D points from it - */ - private void transformPolygonPoints(Polygon pPolygon, Point3D[] pPoints3D, Point2D[] pPoints2D) { - for (int i = 0; i < pPolygon.getPoints().length; i++) { - Point3D lPoint = pPolygon.getPoints()[i]; - - Point3D lPointRotated = fProjection.rotate(lPoint); - pPoints3D[i] = lPointRotated; - pPoints2D[i] = fProjection.project2D(lPointRotated); - } - } - - public void setMapData(Polygon[] pMapData) { - fMapData = pMapData; - } - - protected void addEdgeXing(EdgeCrossing pEdgeXing) { - fEdgeCrossings.add(pEdgeXing); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java deleted file mode 100644 index 7a3e861..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapDefault.java +++ /dev/null @@ -1,265 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scanbit; - -import java.util.Comparator; - -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.util.EdgeCrossing; -import ext.plantuml.com.ctreber.acearth.util.Point2D; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - -/** - *

Map scanner for mercator and cylindrical projections. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class BitGeneratorMapDefault extends BitGeneratorMap -{ - public BitGeneratorMapDefault(Projection pProjection) - { - super(pProjection); - } - - protected Comparator getEdgeXingComparator() - { - return new EdgeXingComparator(); - } - - /** - * Seems to: walk along outline of projected area. - */ - protected ScanBuf scanOutline() - { - final ScanBuf lScanBuf = new ScanBuf(fImageHeight, fImageWidth); - - final double lLeft = fProjection.finalizeX(-Math.PI); - final double lRight = fProjection.finalizeX(Math.PI); - // Will be adjusted to fit height. - final double lTop = fProjection.finalizeY(1e6); - final double lBottom = fProjection.finalizeY(-1e6); - - // Top - lScanBuf.addLine(lRight, lTop, lLeft, lTop); - // Left - lScanBuf.addLine(lLeft, lTop, lLeft, lBottom); - // Bottom - lScanBuf.addLine(lLeft, lBottom, lRight, lBottom); - // Right - lScanBuf.addLine(lRight, lBottom, lRight, lTop); - - return lScanBuf; - } - - /** - *

Look at 2 neighboring points in polygon and find edge crossings - - * edge of the globe?! Edge of image? - */ - protected void scanPolygon(ScanBuf pScanBuf, - Point3D[] pPoints3D, Point2D[] pPoints2D, int pIndex) - { - final Point2D lCurr = pPoints2D[pIndex]; - final int lIndexPrev = pIndex - 1 >= 0 ? pIndex - 1 : pPoints2D.length - 1; - final Point2D lPrev = pPoints2D[lIndexPrev]; - double dx = lCurr.getX() - lPrev.getX(); - - if(Math.abs(dx) <= Math.PI) - { - // Perimeter not crossed. - pScanBuf.addLine( - fProjection.finalizeX(lPrev.getX()), fProjection.finalizeY(lPrev.getY()), - fProjection.finalizeX(lCurr.getX()), fProjection.finalizeY(lCurr.getY())); - return; - } - - // Perimeter crossed, we need to wrap the line around the edge. - int lAngle; - double mx; - double my = getYMidPoint(pPoints3D[lIndexPrev], pPoints3D[pIndex]); - if(dx > 0) - { - // Curve runs right - mx = -Math.PI; - lAngle = 2; - } else - { - mx = Math.PI; - lAngle = 0; - } - - // From previous point to edge... - pScanBuf.addLine( - fProjection.finalizeX(lPrev.getX()), fProjection.finalizeY(lPrev.getY()), - fProjection.finalizeX(mx), fProjection.finalizeY(my)); - addEdgeXing(new EdgeCrossing(EdgeCrossing.XingTypeExit, pIndex, mx, my, lAngle)); - - if(dx > 0) - { - mx = Math.PI; - lAngle = 0; - } else - { - mx = -Math.PI; - lAngle = 2; - } - - // ...and from edge to current point. - pScanBuf.addLine( - fProjection.finalizeX(mx), fProjection.finalizeY(my), - fProjection.finalizeX(lCurr.getX()), fProjection.finalizeY(lCurr.getY())); - addEdgeXing(new EdgeCrossing(EdgeCrossing.XingTypeEntry, pIndex, mx, my, lAngle)); - } - - /** - *

My educated guess is that the mid point between the current and - * the previous point is calculated, and - kind of - y of that point - * is returned. - */ - private double getYMidPoint(Point3D pPrev, Point3D pCurr) - { - double lY; - final double lZ; - - if(pCurr.getX() != 0) - { - // if xPrev is twice xCurr, ratio is 2 - double ratio = (pPrev.getX() / pCurr.getX()); - lY = pPrev.getY() - ratio * pCurr.getY(); - lZ = pPrev.getZ() - ratio * pCurr.getZ(); - } else - { - lY = pCurr.getY(); - lZ = pCurr.getZ(); - } - - final double lDistance = Math.sqrt((lY * lY) + (lZ * lZ)); - lY *= ((lZ > 0) ? -1 : 1) / lDistance; - - return fProjection.projectY(lY); - } - - /** - *

Side effect: Creates ScanBuf lines. - */ - protected void handleCrossings(ScanBuf pScanBuf, EdgeCrossing[] xings) - { - EdgeCrossing from; - EdgeCrossing to; - int lStart; - - if(xings[0].getType() == EdgeCrossing.XingTypeExit) - { - lStart = 0; - } else - { - // Type "entry". - from = xings[xings.length - 1]; - to = xings[0]; - addEdgeToScanbuf(pScanBuf, from, to); - lStart = 1; - } - - for(int i = lStart; i < xings.length - 1; i += 2) - { - from = xings[i]; - to = xings[i + 1]; - addEdgeToScanbuf(pScanBuf, from, to); - } - } - - /** - *

For handleCrossing(). Side effect: Creates ScanBuf lines. - * - * @param pScanBuf - * @param from - * @param to - */ - private void addEdgeToScanbuf(ScanBuf pScanBuf, EdgeCrossing from, - EdgeCrossing to) - { - int lAngleFrom = (int)from.getAngle(); - double lXFrom = fProjection.finalizeX(from.getX()); - double lYFrom = fProjection.finalizeY(from.getY()); - - // Step around in 90 degree increments until target angle is reached - while(lAngleFrom != (int)to.getAngle()) - { - int lAngleNew = 0; - double lXNew = 0; - double lYNew = 0; - - switch(lAngleFrom) - { - case 0: - // Top right - lXNew = fProjection.finalizeX(Math.PI); - lYNew = fProjection.finalizeY(1e6); - lAngleNew = 1; - break; - - case 1: - // Top left - lXNew = fProjection.finalizeX(-Math.PI); - lYNew = fProjection.finalizeY(1e6); - lAngleNew = 2; - break; - - case 2: - // Bottom left - lXNew = fProjection.finalizeX(-Math.PI); - lYNew = fProjection.finalizeY(-1e6); - lAngleNew = 3; - break; - - case 3: - // Bottom right - lXNew = fProjection.finalizeX(Math.PI); - lYNew = fProjection.finalizeY(-1e6); - lAngleNew = 0; - break; - } - - pScanBuf.addLine(lXFrom, lYFrom, lXNew, lYNew); - - lAngleFrom = lAngleNew; - lXFrom = lXNew; - lYFrom = lYNew; - } - - // ...and from last to final. - pScanBuf.addLine(lXFrom, lYFrom, fProjection.finalizeX(to.getX()), - fProjection.finalizeY(to.getY())); - } - - private static class EdgeXingComparator implements Comparator - { - public int compare(Object o1, Object o2) - { - final EdgeCrossing a = (EdgeCrossing)o1; - final EdgeCrossing b = (EdgeCrossing)o2; - - if(a.getAngle() < b.getAngle()) - { - return -1; - } - - if(a.getAngle() > b.getAngle()) - { - return 1; - } - - // Angles are equal. - if(a.getAngle() == 0) - { - return (a.getY() < b.getY()) ? -1 : (a.getY() > b.getY()) ? 1 : 0; - } - - if(a.getAngle() == 2) - { - return (a.getY() > b.getY()) ? -1 : (a.getY() < b.getY()) ? 1 : 0; - } - - throw new RuntimeException("No result"); - } - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java deleted file mode 100644 index 980b4e5..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scanbit/BitGeneratorMapOrtho.java +++ /dev/null @@ -1,170 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scanbit; - -import java.util.Comparator; - -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.util.EdgeCrossing; -import ext.plantuml.com.ctreber.acearth.util.Point2D; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - -/** - *

Map scanner for orthographic projection. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class BitGeneratorMapOrtho extends BitGeneratorMap -{ - public BitGeneratorMapOrtho(Projection pProjection) - { - super(pProjection); - } - - protected Comparator getEdgeXingComparator() - { - return new EdgeCrossingComparator(); - } - - protected ScanBuf scanOutline() - { - final ScanBuf lScanBuf = new ScanBuf(fImageHeight, fImageWidth); - addArcToScanbuf(lScanBuf, 1.0, 0.0, 0.0, 1.0, 0.0, 2 * Math.PI); - - return lScanBuf; - } - - private void addArcToScanbuf(ScanBuf pScanBuf, double pXFrom, double pYFrom, - double pAngleFrom, double pXTo, double pYTo, double pAngleTo) - { - double step = 1 / fProjection.getScale() * 10; - if(step > 0.05) - { - step = 0.05; - } - final int lAngleFrom = (int)Math.ceil(pAngleFrom / step); - final int lAngleTo = (int)Math.floor(pAngleTo / step); - - double prev_x = fProjection.finalizeX(pXFrom); - double prev_y = fProjection.finalizeY(pYFrom); - double curr_x; - double curr_y; - if(lAngleFrom <= lAngleTo) - { - double c_step = Math.cos(step); - double s_step = Math.sin(step); - - double angle = lAngleFrom * step; - double arc_x = Math.cos(angle); - double arc_y = Math.sin(angle); - - for(int i = lAngleFrom; i <= lAngleTo; i++) - { - curr_x = fProjection.finalizeX(arc_x); - curr_y = fProjection.finalizeY(arc_y); - pScanBuf.addLine(prev_x, prev_y, curr_x, curr_y); - - /* instead of repeatedly calling cos() and sin() to get the next - * values for arc_x and arc_y, simply rotate the existing values - */ - double tmp = (c_step * arc_x) - (s_step * arc_y); - arc_y = (s_step * arc_x) + (c_step * arc_y); - arc_x = tmp; - - prev_x = curr_x; - prev_y = curr_y; - } - } - - curr_x = fProjection.finalizeX(pXTo); - curr_y = fProjection.finalizeY(pYTo); - pScanBuf.addLine(prev_x, prev_y, curr_x, curr_y); - } - - protected void scanPolygon(ScanBuf pScanBuf, - Point3D[] pPoints3D, Point2D[] pPoints2D, int pIndex) - { - Point3D extra; - - Point3D lCurr = pPoints3D[pIndex]; - final int lIndexPrev = pIndex - 1 >= 0 ? pIndex - 1 : pPoints2D.length - 1; - Point3D lPrev = pPoints3D[lIndexPrev]; - - if(lPrev.getZ() <= 0) - { - if(lCurr.getZ() <= 0) - { - return; - } - - // Previous point not visible, but current one is: horizon crossed. - extra = findEdgeCrossing(lPrev, lCurr); - addEdgeXing(new EdgeCrossing(EdgeCrossing.XingTypeEntry, pIndex, - extra.getX(), extra.getY(), Math.atan2(extra.getY(), extra.getX()))); - lPrev = extra; - } else - { - if(lCurr.getZ() <= 0) - { - // Previous point visible, but current is not: horizon crossed. - extra = findEdgeCrossing(lPrev, lCurr); - addEdgeXing(new EdgeCrossing(EdgeCrossing.XingTypeExit, pIndex, - extra.getX(), extra.getY(), Math.atan2(extra.getY(), extra.getX()))); - lCurr = extra; - } - } - - pScanBuf.addLine( - fProjection.finalizeX(lPrev.getX()), fProjection.finalizeY(lPrev.getY()), - fProjection.finalizeX(lCurr.getX()), fProjection.finalizeY(lCurr.getY())); - } - - private Point3D findEdgeCrossing(Point3D pPrev, Point3D pCurr) - { - double tmp = pCurr.getZ() / (pCurr.getZ() - pPrev.getZ()); - final double r0 = pCurr.getX() - tmp * (pCurr.getX() - pPrev.getX()); - final double r1 = pCurr.getY() - tmp * (pCurr.getY() - pPrev.getY()); - - tmp = Math.sqrt((r0 * r0) + (r1 * r1)); - - return new Point3D(r0 / tmp, r1 / tmp, 0); - } - - protected void handleCrossings(ScanBuf pScanBuf, EdgeCrossing[] xings) - { - EdgeCrossing from; - EdgeCrossing to; - int lStart; - - if(xings[0].getType() == EdgeCrossing.XingTypeExit) - { - lStart = 0; - } else - { - from = xings[xings.length - 1]; - to = xings[0]; - addArcToScanbuf(pScanBuf, from.getX(), from.getY(), from.getAngle(), - to.getX(), to.getY(), to.getAngle() + 2 * Math.PI); - lStart = 1; - } - - for(int i = lStart; i < xings.length - 1; i += 2) - { - from = xings[i]; - to = xings[i + 1]; - addArcToScanbuf(pScanBuf, from.getX(), from.getY(), from.getAngle(), - to.getX(), to.getY(), to.getAngle()); - } - } - - private static class EdgeCrossingComparator implements Comparator - { - public int compare(Object o1, Object o2) - { - final EdgeCrossing a = (EdgeCrossing)o1; - final EdgeCrossing b = (EdgeCrossing)o2; - - return (a.getAngle() < b.getAngle()) ? -1 : (a.getAngle() > b.getAngle()) ? 1 : 0; - } - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java deleted file mode 100644 index d5f7624..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBit.java +++ /dev/null @@ -1,62 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scanbit; - -/** - *

Instruction to paint points xFrom to xTo on line y. - * - *

What I don't understand: why do values get summed to determine the - * pixel type? - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class ScanBit implements Comparable -{ - private int fY; - private int lXFrom; - private int fXTo; - private int fType; - - public ScanBit(int pY, int pLoX, int pHiX, int pType) - { - fY = pY; - lXFrom = pLoX; - fXTo = pHiX; - fType = pType; - } - - public int compareTo(Object o) - { - if(o instanceof ScanBit) - { - ScanBit lOther = (ScanBit)o; - return (fY > lOther.fY) ? 1 : (fY < lOther.fY) ? -1 : 0; - } - - throw new IllegalArgumentException("Can't compare with " + o.getClass()); - } - - public int getY() - { - return fY; - } - - public int getlXFrom() - { - return lXFrom; - } - - public int getXTo() - { - return fXTo; - } - - /** - *

See values for - * @see ext.plantuml.com.ctreber.acearth.util.Polygon - */ - public int getType() - { - return fType; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java deleted file mode 100644 index b8913bf..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBitGenerator.java +++ /dev/null @@ -1,32 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scanbit; - -/** - *

A ScanBitGenerator produces ScanBits.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class ScanBitGenerator -{ - int fImageHeight; - int fImageWidth; - protected ScanBit[] fScanBitsArray; - - abstract public void generateScanBits(); - - public void setImageHeight(int pImageHeight) - { - fImageHeight = pImageHeight; - } - - public void setImageWidth(int pImageWidth) - { - fImageWidth = pImageWidth; - } - - public ScanBit[] getScanBits() - { - return fScanBitsArray; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java b/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java deleted file mode 100644 index 102d2cf..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scanbit/ScanBuf.java +++ /dev/null @@ -1,193 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scanbit; - -import java.util.ArrayList; -import java.util.List; - -import ext.plantuml.com.ctreber.aclib.sort.CTSort; -import ext.plantuml.com.ctreber.aclib.sort.QuickSort; - -/** - *

For each line, the scanbuffer (= a raster divice) records the points hit - * I.e., line 5 (y=5) contains the values 2, 6, 40, and 46 (these line have - * been crossed). The values always come as pairs because we're dealing with - * polygons, which have a left and a right side which consists of a line. - * The points in between two values painted as filled. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -class ScanBuf -{ - private List[] fScanbuf; - private int fLineMin; - private int fLineMax; - private final int fLines; - private final int fPoints; - private boolean fScanBufsAdded; - - /** - *

Create a list for each line. - * - * @param pLines Number of lines aka screen height. - * @param pPoints Number of points per line aka screen width. - */ - public ScanBuf(int pLines, int pPoints) - { - fLines = pLines; - fPoints = pPoints; - - fLineMin = Integer.MAX_VALUE; - fLineMax = Integer.MIN_VALUE; - fScanBufsAdded = false; - - fScanbuf = new ArrayList[fLines]; - for(int i = 0; i < fScanbuf.length; i++) - { - fScanbuf[i] = new ArrayList(); - } - } - - /** - *

Add a line to the generateScanBits buffer. - */ - public void addLine(double pXFrom, double pYFrom, double pXTo, double pYTo) - { - int lYFrom; - int lYTo; - - // Do some rounding (but not in the way we expect it), limit values - if(pYFrom < pYTo) - { - // Round lYFrom (but .5 is handled oddly) - // 1.5001 - 2.5 -> 1.0001 - 2.0 -> 2 - lYFrom = (int)Math.ceil(pYFrom - 0.5); - // Round lYTo, substract 1 - // 1.5 - 2.4999 -> 1.0 - 1.9999 -> 1 - lYTo = (int)Math.floor(pYTo - 0.5); - - /** - * I don't know if this is intended, but in Java 3 == 3.001 is false - * (the left arg is converted to double), so the expr is true only when - * pYTo - 0.5 is exactly lYTo - */ - if(lYTo == pYTo - 0.5) - { - lYTo--; - } - } else - { - lYFrom = (int)Math.ceil(pYTo - 0.5); - lYTo = (int)Math.floor(pYFrom - 0.5); - - if(lYTo == pYFrom - 0.5) - { - lYTo--; - } - } - - // Limit y to size of image - if(lYFrom < 0) - { - lYFrom = 0; - } - if(lYTo >= fLines) - { - lYTo = fLines - 1; - } - - if(lYFrom > lYTo) - { - // No lines crossed. - return; - } - - // Note min/max settings so far - if(lYFrom < fLineMin) - { - fLineMin = lYFrom; - } - if(lYTo > fLineMax) - { - fLineMax = lYTo; - } - - // todo Curious: What happens if yFrom and yTo are equal? Shit? Or can't they be? - double lDx = (pXTo - pXFrom) / (pYTo - pYFrom); - double lX = pXFrom + lDx * ((lYFrom + 0.5) - pYFrom); - - // Record the x value for every line (y). - for(int lLineNo = lYFrom; lLineNo <= lYTo; lLineNo++) - { - fScanbuf[lLineNo].add(new Double(lX)); - lX += lDx; - } - fScanBufsAdded = true; - } - - public boolean containsPoints() - { - return fScanBufsAdded; - } - - /** - *

For each line, for each x value pair in line, create one ScanBit. - */ - public List getScanbits(int pCurveType) - { - final List fScanBits = new ArrayList(); - - // For each generateScanBits line containing points - for(int lLineNo = fLineMin; lLineNo <= fLineMax; lLineNo++) - { - // Sort so that lowest x values come first. - Double[] lScanLine = (Double[])fScanbuf[lLineNo].toArray(new Double[0]); - CTSort lSort = new QuickSort(); - lSort.sort(lScanLine); - - // The length will be divisible by 2 because we render closed polyons, - // so every generateScanBits line is crossed twice (left and right edge of polygon, - // no intersections allowed!). - for(int n = 0; n < lScanLine.length; n += 2) - { - // Round lLineFrom (but .5 is handled oddly) - // 1.5001 - 2.5 -> 1.0001 - 2.0 -> 2 - int lXLo = (int)Math.ceil(lScanLine[n].doubleValue() - 0.5); - // Round lLineTo, substract 1 - // 1.5 - 2.4999 -> 1.0 - 1.9999 -> 1 - int lXHi = (int)Math.floor(lScanLine[n + 1].doubleValue() - 0.5); - - // Limit low and high x to image dimensions - if(lXLo < 0) - { - lXLo = 0; - } - if(lXHi >= fPoints) - { - lXHi = fPoints - 1; - } - - if(lXLo <= lXHi) - { - /** - * Shouldn't that always be true since we sorted? "Yes", BUT the - * rounding might create lo 3.6 -> 4.0 and hi 3.7 -> 3.0 - */ - fScanBits.add(new ScanBit(lLineNo, lXLo, lXHi, pCurveType)); - } - } - } - - return fScanBits; - } - - public int getYMax() - { - return fLineMax; - } - - public int getYMin() - { - return fLineMin; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java b/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java deleted file mode 100644 index 5392a4e..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorLines.java +++ /dev/null @@ -1,72 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scandot; - -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point2D; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - -/** - *

Generate latitude and longitude grid as dots. - * - *

Refactored 08.11.2002 - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class DotGeneratorLines extends ScanDotGenerator -{ - private Projection fProjection; - private int fLineDivider; - private int fPointDivider; - private static final double PI = Math.PI; - private static final double TWOPI = 2 * PI; - private static final double HALFPI = PI / 2; - - public DotGeneratorLines(Projection pProjection, - int pLineDevider, int pPointDivider) - { - fProjection = pProjection; - fLineDivider = pLineDevider; - fPointDivider = pPointDivider; - } - - /** - *

Paint grid. - */ - public void generateScanDots() - { - double lLonStep = TWOPI / (fLineDivider * 4); - double lLatStep = PI / (fLineDivider * 2 * fPointDivider); - for(double lLon = -PI; lLon <= PI; lLon += lLonStep) - { - for(double lLat = -HALFPI; lLat <= HALFPI; lLat += lLatStep) - { - transformAndAddDot(new Coordinate(lLat, lLon)); - } - } - - lLatStep = TWOPI / (fLineDivider * 4); - lLonStep = PI / (fLineDivider * 2 * fPointDivider); - for(double lLat = -HALFPI; lLat <= HALFPI; lLat += lLatStep) - { - for(double lLon = -PI; lLon <= PI; lLon += lLonStep) - { - transformAndAddDot(new Coordinate(lLat, lLon)); - } - } - } - - private void transformAndAddDot(Coordinate pPos) - { - final Point3D lPointRotated = fProjection.rotate(pPos.getPoint3DRads()); - if(fProjection.isVisible(lPointRotated)) - { - Point2D lPoint = fProjection.finalize(fProjection.project2D(lPointRotated)); - if(fProjection.isWithinImage(lPoint)) - { - fDots.add(new ScanDot(ScanDot.DotTypeGrid, lPoint)); - } - } - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java b/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java deleted file mode 100644 index 09a4821..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scandot/DotGeneratorStars.java +++ /dev/null @@ -1,51 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scandot; - -import java.util.Random; - -/** - *

Generate random stars as dots. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class DotGeneratorStars extends ScanDotGenerator -{ - private final int fImageWidth; - private final int fImageHeight; - private int fBigStars; - private double fStarFrequency; - private final Random lRandom; - - public DotGeneratorStars(int pWidth, int pHeight, - double pStarFrequency, int pBigStars, Random rnd) - { - lRandom = rnd; - fImageWidth = pWidth; - fImageHeight = pHeight; - fStarFrequency = pStarFrequency; - fBigStars = pBigStars; - } - - public void generateScanDots() - { - // Make sure stars don't jump around between updates. - // final Random lRandom = new Random(ACearth.getStartTime()); - - final int lStarsMax = (int)(fImageWidth * fImageHeight * fStarFrequency); - for(int i = 0; i < lStarsMax; i++) - { - // "-1" to leave space for big stars. - int x = (int)(lRandom.nextDouble() * (fImageWidth - 1)); - int y = (int)(lRandom.nextDouble() * fImageHeight); - - fDots.add(new ScanDot(ScanDot.DotTypeStar, x, y)); - - // A big star is just two pixels wide. - if((fBigStars != 0) && (Math.random() * 100 < fBigStars)) - { - fDots.add(new ScanDot(ScanDot.DotTypeStar, x + 1, y)); - } - } - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java b/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java deleted file mode 100644 index ac0823a..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDot.java +++ /dev/null @@ -1,67 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scandot; - -import ext.plantuml.com.ctreber.acearth.util.Point2D; - -/** - *

A single scandot (opposed to a Polygon). - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class ScanDot implements Comparable -{ - // types of dots - public static final int DotTypeStar = 0; - public static final int DotTypeGrid = 1; - - private int fX; - private int fY; - private int fType; - - public ScanDot(int pType, int pX, int pY) - { - fType = pType; - fX = pX; - fY = pY; - } - - public ScanDot(int pType, Point2D pPoint) - { - fType = pType; - fX = (int)pPoint.getX(); - fY = (int)pPoint.getY(); - } - - public int compareTo(Object o) - { - if(o instanceof ScanDot) - { - ScanDot lOther = (ScanDot)o; - - return fY > lOther.fY ? 1 : (fY < lOther.fY ? -1 : 0); - } - - throw new IllegalArgumentException("Can't compare to " + o.getClass()); - } - - public int getType() - { - return fType; - } - - public int getX() - { - return fX; - } - - public int getY() - { - return fY; - } - - public String toString() - { - return fX + ", " + fY + ": " + fType; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java b/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java deleted file mode 100644 index 0013cf4..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/scandot/ScanDotGenerator.java +++ /dev/null @@ -1,27 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.scandot; - -import java.util.ArrayList; -import java.util.List; - - -/** - *

A ScanDotGenerator produces ScanDots. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class ScanDotGenerator -{ - List fDots = new ArrayList(); - - /** - *

Generate whatever dots are generated. - */ - abstract public void generateScanDots(); - - public List getScanDots() - { - return fDots; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/shader/Shader.java b/src/ext/plantuml/com/ctreber/acearth/shader/Shader.java deleted file mode 100644 index 3882a5c..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/shader/Shader.java +++ /dev/null @@ -1,131 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.shader; - -import java.awt.Color; - -import ext.plantuml.com.ctreber.acearth.projection.Projection; -import ext.plantuml.com.ctreber.acearth.scanbit.BitGeneratorMap; -import ext.plantuml.com.ctreber.acearth.util.Coordinate; -import ext.plantuml.com.ctreber.acearth.util.Point3D; - -/** - *

A shader computes Colors for a row of pixel types, depending - * on lighting parameters.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class Shader -{ - private static final Color COLOR_SPACE = Color.black; - private static final Color COLOR_STAR = Color.white; - private static final Color COLOR_WATER = Color.blue; - private static final Color COLOR_LAND = Color.green; - // Brown - //static final Color COLOR_LAND = new Color(255, 136, 25); - private static final Color COLOR_GRID_LAND = Color.white; - // Bright blue - private static final Color COLOR_GRID_WATER = new Color(128, 128, 255); - - /**

Needed to calculate lighting vectors. */ - Projection fProjection; - - // Stuff below only needed when shading. - private Coordinate fSunPos; - private double fNightSideBrightness; - private double fDaySideBrightness; - private double fTerminatorDiscontinuity; - - private double fDaySideValueBase; - private double fDaySideValueRange; - Point3D fLightVector; - - abstract public Color[] getShadedColors(int pRowNo, int[] pRowTypes); - - public void init() - { - // Precompute shading parameters. I personally find the terminator - // stuff is obscure and might as well be left out. - final double tmp = fTerminatorDiscontinuity / 100; - // 100%: day, 0%: night - fDaySideValueBase = (int)(tmp * fDaySideBrightness + - (1 - tmp) * fNightSideBrightness); - fDaySideValueRange = fDaySideBrightness - fDaySideValueBase; - fLightVector = fProjection.rotate(fSunPos.getPoint3D()); - } - - Color getShadedColorForType(int pType, double pSunValue) - { - double lBrightness; - - if(pSunValue < 0) - { - // The sun is below the horizon. - lBrightness = fNightSideBrightness / 100; - } else - { - // The sun is above the horizon. The brightness will range from - // the base to the maximum value. - lBrightness = (fDaySideValueBase + pSunValue * fDaySideValueRange) / 100; - } - if(lBrightness > 1.0) - { - lBrightness = 1.0; - } - - switch(pType) - { - case BitGeneratorMap.PixTypeSpace: - return COLOR_SPACE; - - case BitGeneratorMap.PixTypeStar: - return COLOR_STAR; - - case BitGeneratorMap.PixTypeGridLand: - return shade(COLOR_GRID_LAND, lBrightness); - - case BitGeneratorMap.PixTypeGridWater: - return shade(COLOR_GRID_WATER, lBrightness); - - case BitGeneratorMap.PixTypeLand: - return shade(COLOR_LAND, lBrightness); - - case BitGeneratorMap.PixTypeWater: - return shade(COLOR_WATER, lBrightness); - } - - return null; - } - - private static Color shade(Color pColor, double pBrightness) - { - return new Color((int)(pColor.getRed() * pBrightness), - (int)(pColor.getGreen() * pBrightness), - (int)(pColor.getBlue() * pBrightness)); - } - - public void setProjection(Projection pProjection) - { - fProjection = pProjection; - } - - public void setSunPos(Coordinate pSunPos) - { - fSunPos = pSunPos; - } - - public void setDaySideBrightness(double pDaySideBrightness) - { - fDaySideBrightness = pDaySideBrightness; - } - - public void setNightSideBrightness(double pNightSideBrightness) - { - fNightSideBrightness = pNightSideBrightness; - } - - public void setTerminatorDiscontinuity(double pTerminatorDiscontinuity) - { - fTerminatorDiscontinuity = pTerminatorDiscontinuity; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java deleted file mode 100644 index ffb01e4..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/shader/ShaderDefault.java +++ /dev/null @@ -1,59 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.shader; - -import java.awt.Color; - -/** - *

Shader for projections which display the whole surface.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -public class ShaderDefault extends Shader -{ - public Color[] getShadedColors(int pRowNo, int[] pRowTypes) - { - final double y = fProjection.inverseProjectY(fProjection.inverseFinalizeY(pRowNo)); - - // conceptually, on each iteration of the i loop, we want: - // - // x = Math.sin(INV_XPROJECT(i)) * sqrt(1 - (y*y)); - // z = cos(INV_XPROJECT(i)) * sqrt(1 - (y*y)); - // - // computing this directly is rather expensive, however, so we only - // compute the first (i=0) pair of values directly; all other pairs - // (i>0) are obtained through successive rotations of the original - // pair (by inv_proj_scale radians). - // - - // compute initial (x, z) values - double tmp = Math.sqrt(1 - (y * y)); - double x = Math.sin(fProjection.inverseFinalizeX(0)) * tmp; - double z = Math.cos(fProjection.inverseFinalizeX(0)) * tmp; - - // compute rotation coefficients used - // to find subsequent (x, z) values - tmp = 1 / fProjection.getScale(); - final double sin_theta = Math.sin(tmp); - final double cos_theta = Math.cos(tmp); - - // save a little computation in the inner loop - final double lYBySunVectorY = y * fLightVector.getY(); - - // use i_lim to encourage compilers to register loop limit - final Color[] lColors = new Color[pRowTypes.length]; - for(int lColNo = 0; lColNo < pRowTypes.length; lColNo++) - { - double lSunValue = (x * fLightVector.getX()) + lYBySunVectorY + - (z * fLightVector.getZ()); - lColors[lColNo] = getShadedColorForType(pRowTypes[lColNo], lSunValue); - - // compute next (x, z) values via 2-d rotation - tmp = (cos_theta * z) - (sin_theta * x); - x = (sin_theta * z) + (cos_theta * x); - z = tmp; - } - - return lColors; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java deleted file mode 100644 index a5b983a..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/shader/ShaderFlat.java +++ /dev/null @@ -1,24 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.shader; - -import java.awt.Color; - -/** - *

Flat shader (does not care for Projection).

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -public class ShaderFlat extends Shader -{ - public Color[] getShadedColors(int pRowNo, int[] pRowTypes) - { - final Color[] lColors = new Color[pRowTypes.length]; - for(int i = 0; i < pRowTypes.length; i++) - { - lColors[i] = getShadedColorForType(pRowTypes[i], 1.0); - } - - return lColors; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java b/src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java deleted file mode 100644 index 33c646b..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/shader/ShaderOrtho.java +++ /dev/null @@ -1,55 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.shader; - -import java.awt.Color; - -/** - *

Shader for the orthographic projection.

- * - *

© 2002 Christian Treber, ct@ctreber.com (Nov 11, 2002)

- * @author Christian Treber, ct@ctreber.com - * - */ -public class ShaderOrtho extends Shader -{ - private static double[] fXValues; - - public Color[] getShadedColors(int pRowNo, int[] pRowTypes) - { - if(pRowNo == 0) - { - fXValues = computeXValues(pRowTypes.length); - } - - final double y = fProjection.inverseProjectY(fProjection.inverseFinalizeY(pRowNo)); - final double tmp = 1 - (y * y); - final double lYBySunVectorY = y * fLightVector.getY(); - - final Color[] lColors = new Color[pRowTypes.length]; - for(int lColNo = 0; lColNo < pRowTypes.length; lColNo++) - { - double x = fXValues[lColNo]; - double z = Math.sqrt(tmp - (x * x)); - - double lSunValue = (x * fLightVector.getX()) + lYBySunVectorY + (z * fLightVector.getZ()); - lColors[lColNo] = getShadedColorForType(pRowTypes[lColNo], lSunValue); - } - - return lColors; - } - - /** - * - * @return X value for each column in image. - */ - private double[] computeXValues(int pWidth) - { - final double[] lTable = new double[pWidth]; - - for(int lColNo = 0; lColNo < pWidth; lColNo++) - { - lTable[lColNo] = fProjection.inverseProjectX(fProjection.inverseFinalizeX(lColNo)); - } - - return lTable; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java b/src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java deleted file mode 100644 index 76d16ae..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/Coordinate.java +++ /dev/null @@ -1,153 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -import java.io.IOException; -import java.io.Writer; - -/** - *

- * Latitude and longitude coordinate. Can be used as declination and right - * ascension as well. - * - *

- * © 2002 Christian Treber, ct@ctreber.com - * - * @author Christian Treber, ct@ctreber.com - * - */ -public class Coordinate { - /* - * MeanObliquity gives the mean obliquity of the earth's axis at epoch - * 1990.0 (computed as 23.440592 degrees according to the method given in - * duffett-smith, section 27) - */ - private static final double MEAN_OBLIQUITY = 23.440592 * Toolkit.TWOPI / 360; - - // Or DE - private double fLat; - // Or RA - private double fLong; - - public Coordinate() { - } - - /** - *

- * Construct a location specfied by two angles. Your choice if in degrees or - * rads, but keep track! - * - * @param pLong - * Longitude or RA - * @param pLat - * Latitude or DE - */ - public Coordinate(double pLat, double pLong) { - fLat = pLat; - fLong = pLong; - } - - public void renderAsXML(Writer writer) throws IOException { - writer.write("\n"); - writer.write(" " + fLat + "\n"); - writer.write(" " + fLong + "\n"); - writer.write("\n"); - } - - public Point3D getPoint3D() { - final double lLatRad = Toolkit.degsToRads(fLat); - final double lLongRad = Toolkit.degsToRads(fLong); - - final double lX = Math.cos(lLatRad) * Math.sin(lLongRad); - final double lY = Math.sin(lLatRad); - final double lZ = Math.cos(lLatRad) * Math.cos(lLongRad); - - return new Point3D(lX, lY, lZ); - } - - /** - *

- * Assumes coordinate is not in degrees but rads. - * - * @return - */ - public Point3D getPoint3DRads() { - final double lX = Math.cos(fLat) * Math.sin(fLong); - final double lY = Math.sin(fLat); - final double lZ = Math.cos(fLat) * Math.cos(fLong); - - return new Point3D(lX, lY, lZ); - } - - /** - *

- * Convert from ecliptic to equatorial coordinates (after duffett-smith, - * section 27) - */ - public Coordinate eclipticToEquatorial() { - final double sin_e = Math.sin(MEAN_OBLIQUITY); - final double cos_e = Math.cos(MEAN_OBLIQUITY); - - final double lRA = Math.atan2(Math.sin(fLong) * cos_e - Math.tan(fLat) * sin_e, Math.cos(fLong)); - final double lDE = Math.asin(Math.sin(fLat) * cos_e + Math.cos(fLat) * sin_e * Math.sin(fLong)); - - return new Coordinate(lDE, lRA); - } - - /** - *

- * Add position to this position, make sure coordinates are valid. - */ - public void add(Coordinate lOther) { - fLat += lOther.fLat; - fLong += lOther.fLong; - wrap(); - } - - /** - *

- * Warp coordinates exceeding valid values. Happens when latitudes and - * longitudes are added or substracted. - */ - public void wrap() { - if (fLat > 90) { - fLat = 180 - fLat; - fLong += 180; - } else if (fLat < -90) { - fLat = -180 - fLat; - fLong += 180; - } - - if (fLong > 180) { - do { - fLong -= 360; - } while (fLong > 180); - } else if (fLong < -180) { - do { - fLong += 360; - } while (fLong < -180); - } - } - - public double getLat() { - return fLat; - } - - public double getDE() { - return fLat; - } - - public double getLong() { - return fLong; - } - - public double getRA() { - return fLong; - } - - public boolean check() { - return (-90 <= fLat) && (fLat <= 90) && (-180 <= fLong) && (fLong <= 180); - } - - public String toString() { - return "lat: " + fLat + ", long: " + fLong; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java b/src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java deleted file mode 100644 index adc3e23..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/EdgeCrossing.java +++ /dev/null @@ -1,59 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -/** - *

Holds information about a line crossing "the edge of Earth". - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class EdgeCrossing -{ - public static final int XingTypeEntry = 0; - public static final int XingTypeExit = 1; - - private int fType; - private int fIndex; - private double fX; - private double fY; - private double fAngle; - - public EdgeCrossing(int pType, int pIndex, double pX, double pY, double pAngle) - { - fType = pType; - fX = pX; - fY = pY; - fAngle = pAngle; - fIndex = pIndex; - } - - public String toString() - { - return fType + ": " + fX + ", " + fY + ", " + fAngle + " (" + fIndex + ")"; - } - - public int getType() - { - return fType; - } - - public double getX() - { - return fX; - } - - public double getY() - { - return fY; - } - - public double getAngle() - { - return fAngle; - } - - public int getIndex() - { - return fIndex; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/Point2D.java b/src/ext/plantuml/com/ctreber/acearth/util/Point2D.java deleted file mode 100644 index 596f2b4..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/Point2D.java +++ /dev/null @@ -1,35 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -/** - *

A point in a 2 axis space. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class Point2D -{ - private double fX; - private double fY; - - public Point2D(double pX, double pY) - { - fX = pX; - fY = pY; - } - - public double getX() - { - return fX; - } - - public double getY() - { - return fY; - } - - public String toString() - { - return "x: " + fX + ", y: " + fY; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/Point3D.java b/src/ext/plantuml/com/ctreber/acearth/util/Point3D.java deleted file mode 100644 index 3d38bdc..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/Point3D.java +++ /dev/null @@ -1,48 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -/** - *

A point in a 2 axis space. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class Point3D -{ - private double fX; - private double fY; - private double fZ; - - public Point3D(double pX, double pY, double pZ) - { - fX = pX; - fY = pY; - fZ = pZ; - } - - public double getX() - { - return fX; - } - - public double getY() - { - return fY; - } - - public double getZ() - { - return fZ; - } - - public String toString() - { - return "x: " + fX + ", y: " + fY + ", z: " + fZ; - } - - public Coordinate getCoordinate() - { - return new Coordinate(Toolkit.radsToDegs(Math.asin(fY)), - Toolkit.radsToDegs(Math.atan2(fX, fZ))); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/Polygon.java b/src/ext/plantuml/com/ctreber/acearth/util/Polygon.java deleted file mode 100644 index 9ea5f71..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/Polygon.java +++ /dev/null @@ -1,49 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - - -/** - *

A polygon in a 3 axis space. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class Polygon -{ - public static final int LAND = 1; - public static final int WATER = -1; - - private int fType; - private Point3D[] fPoints; - - public Polygon(int pType, Point3D[] pPoints) - { - fType = pType; - fPoints = pPoints; - } - - public int getType() - { - return fType; - } - - public Point3D[] getPoints() - { - return fPoints; - } - - public Point3D getPoint(int pIndex) - { - return fPoints[pIndex]; - } - - public int getSize() - { - return fPoints.length; - } - - public String toString() - { - return "Type " + fType + ", " + fPoints.length + " points"; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/StringParser.java b/src/ext/plantuml/com/ctreber/acearth/util/StringParser.java deleted file mode 100644 index 3ba3b1c..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/StringParser.java +++ /dev/null @@ -1,99 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -import java.util.ArrayList; -import java.util.List; - -/** - *

Cuts a string in words separated by white space. Quotes and square - * brackets are recognized (that is, white space within is ignored). - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class StringParser -{ - public static List parse(String pLine) - { - final List lSections = new ArrayList(); - - // True if within word. - boolean lInSectionP = false; - // Current char - char lChar; - // Wait for this character before switching back to normal parsing. - char lSeparator = ' '; - // Part count. - int lSectionNo = 0; - // Part start position - int lSectionStart = 0; - // Part end position - int lSectionEnd = 0; - - final int lLen = pLine.length(); - for(int lCharNo = 0; lCharNo <= lLen; lCharNo++) - { - if(lCharNo < lLen) - { - lChar = pLine.charAt(lCharNo); - } else - { - // This is a fictional last character. - lChar = ' '; - } - - if(lInSectionP) - { - // In section. Termination is by space or specific separator. - if((lChar != ' ') || (lSeparator != ' ')) - { - // It's not a space, or it is a space, but we wait for a special separator. - if(lChar == lSeparator) - { - // We waited for this separator. Switch back to normal parsing. - lSeparator = ' '; - lSectionEnd = lCharNo - 1; - } else - { - lSectionEnd = lCharNo; - } - } else - { - // Section has ended (with a space). - lSections.add(pLine.substring(lSectionStart, lSectionEnd + 1)); - lSectionNo++; - lInSectionP = false; - } - } else - { - // Not in a section, skipping white space. - if(lChar != ' ') - { - // No white space: a section has started. - if(lChar == '"') - { - // Special parsing "string" - lSeparator = '"'; - lSectionStart = lCharNo + 1; - } else if(lChar == '[') - { - // Special parsing "square brackets" - lSeparator = ']'; - lSectionStart = lCharNo + 1; - } else - { - // Use normal parsing. - lSeparator = ' '; - lSectionEnd = lSectionStart = lCharNo; - } - lInSectionP = true; - } else - { - // More void... - } - } - } - - return lSections; - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java b/src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java deleted file mode 100644 index 736a2c3..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/SunPositionCalculator.java +++ /dev/null @@ -1,260 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; - -/** - *

Calculates the position of the point on Earth which is directly - * below the sun or the moon. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class SunPositionCalculator -{ - /* - * the epoch upon which these astronomical calculations are based is - * 1990 january 0.0, 631065600 seconds since the beginning of the - * "unix epoch" (00:00:00 GMT, Jan. 1, 1970) - * - * given a number of seconds since the start of the unix epoch, - * daysSinceEpoch() computes the number of days since the start of the - * astronomical epoch (1990 january 0.0) - */ - - private static final long EPOCH_START = 631065600000l; - - /* - * assuming the apparent orbit of the sun about the earth is circular, - * the rate at which the orbit progresses is given by RadsPerDay -- - * TWOPI radians per orbit divided by 365.242191 days per year: - */ - - private static final double RADS_PER_DAY = Toolkit.TWOPI / 365.242191; - - /* - * details of sun's apparent orbit at epoch 1990.0 (after - * duffett-smith, table 6, section 46) - * - * Epsilon_g (ecliptic longitude at epoch 1990.0) 279.403303 degrees - * OmegaBar_g (ecliptic longitude of perigee) 282.768422 degrees - * Eccentricity (eccentricity of orbit) 0.016713 - */ - - private static final double EPSILON_G = Toolkit.degsToRads(279.403303); - private static final double OMEGA_BAR_G = Toolkit.degsToRads(282.768422); - private static final double ECCENTRICITY = 0.016713; - - /* - * Lunar parameters, epoch January 0, 1990.0 - */ - private static final double MOON_MEAN_LONGITUDE = Toolkit.degsToRads(318.351648); - private static final double MOON_MEAN_LONGITUDE_PERIGEE = Toolkit.degsToRads(36.340410); - private static final double MOON_MEAN_LONGITUDE_NODE = Toolkit.degsToRads(318.510107); - private static final double MOON_INCLINATION = Toolkit.degsToRads(5.145396); - - private static final double SIDERAL_MONTH = 27.3217; - - /** - *

Calculate the position of the mean sun: where the sun would - * be if the earth's orbit were circular instead of ellipictal. - * - *

Verified. - * - * @param pDays days since ephemeris epoch - */ - private static double getMeanSunLongitude(double pDays) - { - double N, M; - - N = RADS_PER_DAY * pDays; - N = Toolkit.fmod(N, 0, Toolkit.TWOPI); - if(N < 0) - { - N += Toolkit.TWOPI; - } - - M = N + EPSILON_G - OMEGA_BAR_G; - if(M < 0) - { - M += Toolkit.TWOPI; - } - - return M; - } - - /** - *

Compute ecliptic longitude of sun (in radians) - * (after duffett-smith, section 47) - * - *

Verified. - * - * @param pMillis Milliseconds since unix epoch - */ - private static double getSunEclipticLongitude(long pMillis) - { - final double lDays = daysSinceEpoch(pMillis); - final double M_sun = getMeanSunLongitude(lDays); - - final double E = doKepler(M_sun); - final double v = 2 * Math.atan(Math.sqrt((1 + ECCENTRICITY) / (1 - ECCENTRICITY)) * Math.tan(E / 2)); - - return (v + OMEGA_BAR_G); - } - - static double daysSinceEpoch(long pMillis) - { - return (double)(pMillis - EPOCH_START) / 24 / 3600 / 1000; - } - - /** - * solve Kepler's equation via Newton's method - * (after duffett-smith, section 47) - * - *

Verified. - */ - private static double doKepler(double M) - { - double E; - double lDelta; - - E = M; - while(true) - { - lDelta = E - ECCENTRICITY * Math.sin(E) - M; - if(Math.abs(lDelta) <= 1e-10) - { - break; - } - E -= lDelta / (1 - ECCENTRICITY * Math.cos(E)); - } - - return E; - } - - - /** - *

computing julian dates (assuming gregorian calendar, thus this is - * only valid for dates of 1582 oct 15 or later) - * (after duffett-smith, section 4) - * - *

Verified. - * - * @param pYear year (e.g. 19xx) - * @param pMonth month (jan=1, feb=2, ...) - * @param pDay day of month - */ - private static double getJulianDate(int pYear, int pMonth, int pDay) - { - if((pMonth == 1) || (pMonth == 2)) - { - pYear -= 1; - pMonth += 12; - } - - final int A = pYear / 100; - final int B = 2 - A + (A / 4); - final int C = (int)(365.25 * pYear); - final int D = (int)(30.6001 * (pMonth + 1)); - - return B + C + D + pDay + 1720994.5; - } - - - /** - *

compute greenwich mean sidereal time (getGST) corresponding to a given - * number of milliseconds since the unix epoch - * (after duffett-smith, section 12) - * - *

Verified. - */ - private static double getGST(long pMillis) - { - final Calendar lCal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - lCal.setTime(new Date(pMillis)); - - final double lJulianDate = getJulianDate(lCal.get(Calendar.YEAR), lCal.get(Calendar.MONTH) + 1, - lCal.get(Calendar.DAY_OF_MONTH)); - final double T = (lJulianDate - 2451545) / 36525; - double T0 = ((T + 2.5862e-5) * T + 2400.051336) * T + 6.697374558; - - T0 = Toolkit.fmod(T0, 0, 24.0); - if(T0 < 0) - { - T0 += 24; - } - - final double UT = lCal.get(Calendar.HOUR_OF_DAY) + - (lCal.get(Calendar.MINUTE) + lCal.get(Calendar.SECOND) / 60.0) / 60.0; - - T0 += UT * 1.002737909; - T0 = Toolkit.fmod(T0, 0, 24.0); - if(T0 < 0) - { - T0 += 24; - } - - return T0; - } - - /** - *

Given a particular time (expressed in milliseconds since the unix - * epoch), compute position on the earth (lat, lon) such that sun is - * directly overhead. - * - *

Verified. - * - * @param pMillis seconds since unix epoch - * - */ - public static Coordinate getSunPositionOnEarth(long pMillis) - { - final Coordinate lSunPosEc = new Coordinate(0.0, getSunEclipticLongitude(pMillis)); - final Coordinate lSunPosEq = lSunPosEc.eclipticToEquatorial(); - - final double lRA = Toolkit.limitRads(lSunPosEq.getRA() - (Toolkit.TWOPI / 24) * getGST(pMillis)); - - return new Coordinate(Toolkit.radsToDegs(lSunPosEq.getDE()), Toolkit.radsToDegs(lRA)); - } - - /** - *

Given a particular time (expressed in milliseconds since the unix - * epoch), compute position on the earth (lat, lon) such that the - * moon is directly overhead. - * - * Based on duffett-smith **2nd ed** section 61; combines some steps - * into single expressions to reduce the number of extra variables. - * - *

Verified. - */ - public static Coordinate getMoonPositionOnEarth(long pMillis) - { - final double lDays = daysSinceEpoch(pMillis); - double lSunLongEc = getSunEclipticLongitude(pMillis); - final double Ms = getMeanSunLongitude(lDays); - - double L = Toolkit.limitRads(Toolkit.fmod(lDays / SIDERAL_MONTH, 0, 1.0) * Toolkit.TWOPI + MOON_MEAN_LONGITUDE); - double Mm = Toolkit.limitRads(L - Toolkit.degsToRads(0.1114041 * lDays) - MOON_MEAN_LONGITUDE_PERIGEE); - double N = Toolkit.limitRads(MOON_MEAN_LONGITUDE_NODE - Toolkit.degsToRads(0.0529539 * lDays)); - final double Ev = Toolkit.degsToRads(1.2739) * Math.sin(2.0 * (L - lSunLongEc) - Mm); - final double Ae = Toolkit.degsToRads(0.1858) * Math.sin(Ms); - Mm += Ev - Ae - Toolkit.degsToRads(0.37) * Math.sin(Ms); - final double Ec = Toolkit.degsToRads(6.2886) * Math.sin(Mm); - L += Ev + Ec - Ae + Toolkit.degsToRads(0.214) * Math.sin(2.0 * Mm); - L += Toolkit.degsToRads(0.6583) * Math.sin(2.0 * (L - lSunLongEc)); - N -= Toolkit.degsToRads(0.16) * Math.sin(Ms); - - L -= N; - lSunLongEc = Toolkit.limitRads((Math.abs(Math.cos(L)) < 1e-12) ? - (N + Math.sin(L) * Math.cos(MOON_INCLINATION) * Math.PI / 2) : - (N + Math.atan2(Math.sin(L) * Math.cos(MOON_INCLINATION), Math.cos(L)))); - final double lSunLatEc = Math.asin(Math.sin(L) * Math.sin(MOON_INCLINATION)); - - final Coordinate lSunPosEq = new Coordinate(lSunLatEc, lSunLongEc).eclipticToEquatorial(); - final double lRA = Toolkit.limitRads(lSunPosEq.getRA() - (Toolkit.TWOPI / 24) * getGST(pMillis)); - - return new Coordinate(Toolkit.radsToDegs(lSunPosEq.getDE()), Toolkit.radsToDegs(lRA)); - } -} diff --git a/src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java b/src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java deleted file mode 100644 index 12f3655..0000000 --- a/src/ext/plantuml/com/ctreber/acearth/util/Toolkit.java +++ /dev/null @@ -1,135 +0,0 @@ -package ext.plantuml.com.ctreber.acearth.util; - -import java.util.HashSet; -import java.util.StringTokenizer; - -/** - *

Some tools. - * - *

© 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class Toolkit -{ - public static final double TWOPI = Math.PI * 2; - public static final double PI = Math.PI; - public static final double HALFPI = Math.PI / 2; - private static final HashSet fsNoCap; - - static - { - fsNoCap = new HashSet(); - fsNoCap.add("a"); - fsNoCap.add("as"); - fsNoCap.add("to"); - fsNoCap.add("of"); - fsNoCap.add("the"); - fsNoCap.add("off"); - fsNoCap.add("and"); - fsNoCap.add("mid"); - } - - public static double degsToRads(double pDegrees) - { - return pDegrees * TWOPI / 360; - } - - public static double radsToDegs(double pRadians) - { - return pRadians * 360 / TWOPI; - } - - /** - * Force an angular value into the range [-PI, +PI] - */ - public static double limitRads(double x) - { - return fmod(x, -Math.PI, Math.PI); - } - - /** - *

Verified. - */ - public static double fmod(double pValue, double pMod) - { - while(pValue < 0) - { - pValue += pMod; - } - while(pValue > pMod) - { - pValue -= pMod; - } - - return pValue; - } - - /** - *

Examples: min -2, max 2: range 4 - * - *

- */ - public static double fmod(double pValue, double pMinValue, double pMaxValue) - { - final double lRange = pMaxValue - pMinValue; - int lFact = (int)((pValue - pMinValue) / lRange); - if(pValue < pMinValue) - { - lFact--; - } - - return pValue - lFact * lRange; - } - - /** - *

Capitalize String. Uppercase words smaller/equal than 3 chars, - * lowercase defined exceptions. Capitalize within word after '.' and '-'. - * Capitalize all others. - */ - public static String intelligentCapitalize(String pText) - { - boolean lDoCap = false; - final StringTokenizer lST = new StringTokenizer(pText, ".- ", true); - final StringBuffer lSB = new StringBuffer(50); - while(lST.hasMoreTokens()) - { - String lWord = lST.nextToken(); - - if(lWord.equals(".") || lWord.equals("-")) - { - lDoCap = true; - lSB.append(lWord); - continue; - } - if(lWord.equals(" ")) - { - lDoCap = false; - lSB.append(lWord); - continue; - } - - if(lDoCap || (lWord.length() > 3)) - { - lSB.append(Character.toUpperCase(lWord.charAt(0))); - lSB.append(lWord.substring(1).toLowerCase()); - } else - { - if(fsNoCap.contains(lWord.toLowerCase())) - { - lSB.append(lWord.toLowerCase()); - } else - { - lSB.append(lWord.toUpperCase()); - } - } - } - - return lSB.toString(); - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java deleted file mode 100644 index 814b927..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MOBoolean.java +++ /dev/null @@ -1,38 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - -/** - *

- * - *

© 2002 Christian Treber, ct@ctreber.com

- * @author Christian Treber, ct@ctreber.com - * - */ -public class MOBoolean extends MonitoredObject -{ - private boolean fBoolean; - - public MOBoolean() - { - } - - public MOBoolean(boolean pBoolean) - { - fBoolean = pBoolean; - } - - public void set(boolean pValue) - { - fBoolean = pValue; - fireValueChanged(); - } - - public boolean get() - { - return fBoolean; - } - - public boolean checkRange() - { - return true; - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java deleted file mode 100644 index 2941637..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MOChangeListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - -/** - *

Implemented by classes interetested in MonitoredObject values changes.

- * - *

© 2002 Christian Treber, ct@ctreber.com

- * @author Christian Treber, ct@ctreber.com - * - */ -public interface MOChangeListener -{ - public void valueChanged(MonitoredObject pObject); -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java b/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java deleted file mode 100644 index 722a5db..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MODouble.java +++ /dev/null @@ -1,74 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - -/** - *

- * - *

© 2002 Christian Treber, ct@ctreber.com

- * @author Christian Treber, ct@ctreber.com - * - */ -public class MODouble extends MonitoredObject -{ - private double fDouble; - private boolean fCheckRange = false; - private double fMin; - private double fMax; - - public MODouble() - { - } - - public MODouble(double pDouble) - { - fDouble = pDouble; - } - - public MODouble(double pDouble, double pMin, double pMax) - { - fMin = pMin; - fMax = pMax; - fCheckRange = true; - set(pDouble); - } - - public void set(double pDouble) - { - if(!checkRange(pDouble)) - { - throw new IllegalArgumentException("Argument '" + pDouble + - "' out of range [" + niceFormat(fMin) + "; " + niceFormat(fMax) + "]"); - } - fDouble = pDouble; - fireValueChanged(); - } - - private static String niceFormat(double pDouble) - { - if(pDouble == Double.MAX_VALUE) - { - return "Infinity"; - } - - if(pDouble == Double.MIN_VALUE) - { - return "-Infinity"; - } - - return Double.toString(pDouble); - } - - public double get() - { - return fDouble; - } - - private boolean checkRange(double pDouble) - { - return !fCheckRange || (fMin <= pDouble) && (pDouble <= fMax); - } - - public boolean checkRange() - { - return checkRange(fDouble); - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java deleted file mode 100644 index f2b3cbf..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MOEnum.java +++ /dev/null @@ -1,86 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - -import java.util.HashSet; - -/** - *

- * Monitored enumeration value. - *

- * - *

- * © 2002 Christian Treber, ct@ctreber.com - *

- * - * @author Christian Treber, ct@ctreber.com - * - */ -public class MOEnum extends MonitoredObject { - private HashSet fValidValues = new HashSet(); - /** - *

- * null if no value selected - */ - private Object fValue; - - public void addValidValue(Object pValue) { - fValidValues.add(pValue); - } - - public void set(Object pValue) { - if (pValue != null) { - checkValue(pValue); - } - - fValue = pValue; - fireValueChanged(); - } - - public Object get() { - return fValue; - } - - public boolean is(Object pObject) { - checkValue(pObject); - - return this.equals(pObject); - } - - public int hashCode() { - if (fValue == null) { - return 0; - } - - return fValue.hashCode(); - } - - private void checkValue(Object pValue) { - if (!fValidValues.contains(pValue)) { - throw new IllegalArgumentException("Illegal enum value '" + pValue + "'"); - } - } - - public boolean equals(Object obj) { - if (obj instanceof MOEnum) { - MOEnum lOther = (MOEnum) obj; - if (fValue == null) { - return lOther.fValue == null; - } - - return fValue.equals(lOther.fValue); - } - - if (fValue == null) { - return obj.equals(null); - } - - return fValue.equals(obj); - } - - public HashSet getValidValues() { - return fValidValues; - } - - public boolean checkRange() { - return true; - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java deleted file mode 100644 index 0816615..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MOInteger.java +++ /dev/null @@ -1,74 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - -/** - *

- * - *

© 2002 Christian Treber, ct@ctreber.com

- * @author Christian Treber, ct@ctreber.com - * - */ -public class MOInteger extends MonitoredObject -{ - private int fInteger; - private boolean fCheckRange = false; - private int fMin; - private int fMax; - - public MOInteger() - { - } - - public MOInteger(int pInteger) - { - fInteger = pInteger; - } - - public MOInteger(int pInteger, int pMin, int pMax) - { - fMin = pMin; - fMax = pMax; - fCheckRange = true; - set(pInteger); - } - - public void set(int pInteger) - { - if(!checkRange(pInteger)) - { - throw new IllegalArgumentException("Argument '" + pInteger + - "' out of range [" + niceFormat(fMin) + "; " + niceFormat(fMax) + "]"); - } - fInteger = pInteger; - fireValueChanged(); - } - - private static String niceFormat(int pInteger) - { - if(pInteger == Integer.MAX_VALUE) - { - return "Infinity"; - } - - if(pInteger == Integer.MIN_VALUE) - { - return "-Infinity"; - } - - return Integer.toString(pInteger); - } - - public int get() - { - return fInteger; - } - - private boolean checkRange(int pInteger) - { - return !fCheckRange || (fMin <= pInteger) && (pInteger <= fMax); - } - - public boolean checkRange() - { - return checkRange(fInteger); - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java b/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java deleted file mode 100644 index dc1f92e..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MOString.java +++ /dev/null @@ -1,36 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - - - -/** - *

- * - *

© 2002 Christian Treber, ct@ctreber.com

- * @author Christian Treber, ct@ctreber.com - * - */ -public class MOString extends MonitoredObject -{ - private String fString; - - public MOString(String pString) - { - fString = pString; - } - - public void set(String pString) - { - fString = pString; - fireValueChanged(); - } - - public String get() - { - return fString; - } - - public boolean checkRange() - { - return true; - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java b/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java deleted file mode 100644 index 8bb4824..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/gui/MonitoredObject.java +++ /dev/null @@ -1,44 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.gui; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - *

- *

- * - *

- * © 2002 Christian Treber, ct@ctreber.com - *

- * - * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class MonitoredObject { - private List fListeners = new ArrayList(); - - public void addChangeListener(MOChangeListener pListener) { - fListeners.add(pListener); - } - - public void removeChangeListener(MOChangeListener pListener) { - fListeners.remove(pListener); - } - - void fireValueChanged() { - final Iterator lIt = fListeners.iterator(); - while (lIt.hasNext()) { - MOChangeListener lListener = (MOChangeListener) lIt.next(); - lListener.valueChanged(this); - } - } - - /** - *

- * Check value agains (possibly defined) constraints. - * - * @return True if value is within range or range is not checked. - */ - abstract public boolean checkRange(); -} diff --git a/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java b/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java deleted file mode 100644 index 4e9950b..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/sort/CTSort.java +++ /dev/null @@ -1,20 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.sort; - -import java.util.Comparator; - -/** - *

Teehee - found that Comparator allready exists. - * - * © 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -abstract public class CTSort -{ - public void sort(Object[] items) - { - sort(items, new DefaultComparator()); - } - - abstract public void sort(Object[] items, Comparator comparator); -} diff --git a/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java b/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java deleted file mode 100644 index b183e41..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/sort/DefaultComparator.java +++ /dev/null @@ -1,19 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.sort; - -import java.util.Comparator; - -/** - *

Implements a default Comparator based on Comparable and a ascending - * sort order. Requires that the two objects are Comparable. - * - * © 2002 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - * - */ -public class DefaultComparator implements Comparator -{ - public int compare(Object o1, Object o2) - { - return ((Comparable)o1).compareTo(o2); - } -} diff --git a/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java b/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java deleted file mode 100644 index a0922db..0000000 --- a/src/ext/plantuml/com/ctreber/aclib/sort/QuickSort.java +++ /dev/null @@ -1,96 +0,0 @@ -package ext.plantuml.com.ctreber.aclib.sort; - -import java.util.Comparator; - -/** - * © 2001 Christian Treber, ct@ctreber.com - * @author Christian Treber, ct@ctreber.com - */ -public class QuickSort extends CTSort -{ - public void sort(Object[] items, Comparator comparator) - { - if(items.length <= 1) - { - // Nothing to sort t all or only one element. - return; - } - - qsort(items, comparator, 0, items.length - 1); - insertionSort(items, comparator, 0, items.length - 1); - } - - private void qsort(Object[] items, Comparator comparator, int l, int r) - { - final int M = 4; - int i; - int j; - Object v; - - if((r - l) > M) - { - i = (r + l) / 2; - if(comparator.compare(items[l], items[i]) > 0) - { - swap(items, l, i); - } - if(comparator.compare(items[l], items[r]) > 0) - { - swap(items, l, r); - } - if(comparator.compare(items[i], items[r]) > 0) - { - swap(items, i, r); - } - - j = r - 1; - swap(items, i, j); - i = l; - v = items[j]; - while(true) - { - while(comparator.compare(items[++i], v) < 0) - { - } - while(comparator.compare(items[--j], v) > 0) - { - } - if(j < i) - { - break; - } - swap(items, i, j); - } - swap(items, i, r - 1); - qsort(items, comparator, l, j); - qsort(items, comparator, i + 1, r); - } - } - - private static void swap(Object[] items, int i, int j) - { - final Object tmp; - tmp = items[i]; - items[i] = items[j]; - items[j] = tmp; - } - - private static void insertionSort(Object[] items, Comparator comparator, int lo0, int hi0) - { - int i; - int j; - Object v; - - for(i = lo0 + 1; i <= hi0; i++) - { - v = items[i]; - j = i; - while((j > lo0) && (comparator.compare(items[j - 1], v) > 0)) - { - items[j] = items[j - 1]; - j--; - } - items[j] = v; - } - } -} diff --git a/src/net/sourceforge/plantuml/DirWatcher.java b/src/net/sourceforge/plantuml/DirWatcher.java index 3b681a6..73934e5 100644 --- a/src/net/sourceforge/plantuml/DirWatcher.java +++ b/src/net/sourceforge/plantuml/DirWatcher.java @@ -37,83 +37,77 @@ package net.sourceforge.plantuml; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeMap; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; -import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.FileWithSuffix; -@Deprecated public class DirWatcher { - final private File dir; - final private Option option; - final private String pattern; + private final File dir; + private final Option option; + private final String pattern; - final private Map modifieds = new HashMap(); + private final Map modifieds = new ConcurrentHashMap(); + private final ExecutorService executorService; public DirWatcher(File dir, Option option, String pattern) { this.dir = dir; this.option = option; this.pattern = pattern; - } - - public List buildCreatedFiles() throws IOException, InterruptedException { - boolean error = false; - final List result = new ArrayList(); - for (File f : dir.listFiles()) { - if (error) { - continue; - } - if (f.isFile() == false) { - continue; - } - if (fileToProcess(f.getName()) == false) { - continue; - } - final FileWatcher watcher = modifieds.get(f); + final int nb = Option.defaultNbThreads(); + this.executorService = Executors.newFixedThreadPool(nb); - if (watcher == null || watcher.hasChanged()) { - final SourceFileReader sourceFileReader = new SourceFileReader(Defines.createWithFileName(f), f, - option.getOutputDir(), option.getConfig(), option.getCharset(), option.getFileFormatOption()); - final Set files = FileWithSuffix.convert(sourceFileReader.getIncludedFiles()); - files.add(f); - for (GeneratedImage g : sourceFileReader.getGeneratedImages()) { - result.add(g); - if (option.isFailfastOrFailfast2() && g.lineErrorRaw() != -1) { - error = true; - } - } - modifieds.put(f, new FileWatcher(files)); - } - } - Collections.sort(result); - return Collections.unmodifiableList(result); } - public File getErrorFile() throws IOException, InterruptedException { - for (File f : dir.listFiles()) { - if (f.isFile() == false) { - continue; - } - if (fileToProcess(f.getName()) == false) { - continue; - } - final FileWatcher watcher = modifieds.get(f); + public Map>> buildCreatedFiles() throws IOException { + final Map>> result = new TreeMap>>(); + if (dir.listFiles() != null) { + for (final File f : dir.listFiles()) { + if (!f.isFile()) { + continue; + } + if (!fileToProcess(f.getName())) { + continue; + } + final FileWatcher watcher = modifieds.get(f); - if (watcher == null || watcher.hasChanged()) { - final SourceFileReader sourceFileReader = new SourceFileReader(Defines.createWithFileName(f), f, - option.getOutputDir(), option.getConfig(), option.getCharset(), option.getFileFormatOption()); - if (sourceFileReader.hasError()) { - return f; + if (watcher == null || watcher.hasChanged()) { + final SourceFileReader sourceFileReader = new SourceFileReader(option.getDefaultDefines(f), f, + option.getOutputDir(), option.getConfig(), option.getCharset(), + option.getFileFormatOption()); + modifieds.put(f, new FileWatcher(Collections.singleton(f))); + final Future> value = executorService + .submit(new Callable>() { + public List call() { + try { + final List generatedImages = sourceFileReader + .getGeneratedImages(); + final Set files = FileWithSuffix.convert(sourceFileReader + .getIncludedFiles()); + files.add(f); + modifieds.put(f, new FileWatcher(files)); + return Collections.unmodifiableList(generatedImages); + } catch (Exception e) { + e.printStackTrace(); + return Collections.emptyList(); + } + } + }); + result.put(f, value); } } } - return null; + return Collections.unmodifiableMap(result); } private boolean fileToProcess(String name) { @@ -124,7 +118,13 @@ public class DirWatcher { return dir; } - // public void setPattern(String pattern) { - // this.pattern = pattern; - // } + public void cancel() { + executorService.shutdownNow(); + } + + public void waitEnd() throws InterruptedException { + executorService.shutdown(); + executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); + } + } diff --git a/src/net/sourceforge/plantuml/DirWatcher2.java b/src/net/sourceforge/plantuml/DirWatcher2.java deleted file mode 100644 index 2e3c6b6..0000000 --- a/src/net/sourceforge/plantuml/DirWatcher2.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml; - -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.concurrent.Callable; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import net.sourceforge.plantuml.preproc.FileWithSuffix; - -public class DirWatcher2 { - - final private File dir; - final private Option option; - final private String pattern; - - final private Map modifieds = new ConcurrentHashMap(); - final private ExecutorService executorService; - - public DirWatcher2(File dir, Option option, String pattern) { - this.dir = dir; - this.option = option; - this.pattern = pattern; - final int nb = Option.defaultNbThreads(); - this.executorService = Executors.newFixedThreadPool(nb); - - } - - public Map>> buildCreatedFiles() throws IOException, InterruptedException { - final Map>> result = new TreeMap>>(); - if (dir.listFiles() != null) { - for (final File f : dir.listFiles()) { - if (f.isFile() == false) { - continue; - } - if (fileToProcess(f.getName()) == false) { - continue; - } - final FileWatcher watcher = modifieds.get(f); - - if (watcher == null || watcher.hasChanged()) { - final SourceFileReader sourceFileReader = new SourceFileReader(option.getDefaultDefines(f), f, - option.getOutputDir(), option.getConfig(), option.getCharset(), - option.getFileFormatOption()); - modifieds.put(f, new FileWatcher(Collections.singleton(f))); - final Future> value = executorService - .submit(new Callable>() { - public List call() throws Exception { - try { - final List generatedImages = sourceFileReader - .getGeneratedImages(); - final Set files = FileWithSuffix.convert(sourceFileReader - .getIncludedFiles()); - files.add(f); - modifieds.put(f, new FileWatcher(files)); - return Collections.unmodifiableList(generatedImages); - } catch (Exception e) { - e.printStackTrace(); - return Collections.emptyList(); - } - } - }); - result.put(f, value); - } - } - } - return Collections.unmodifiableMap(result); - } - - private boolean fileToProcess(String name) { - return name.matches(pattern); - } - - public final File getDir() { - return dir; - } - - public void cancel() { - executorService.shutdownNow(); - } - - public void waitEnd() throws InterruptedException { - executorService.shutdown(); - executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); - } - -} diff --git a/src/net/sourceforge/plantuml/Option.java b/src/net/sourceforge/plantuml/Option.java index 4bb0e8d..55f150f 100644 --- a/src/net/sourceforge/plantuml/Option.java +++ b/src/net/sourceforge/plantuml/Option.java @@ -77,7 +77,6 @@ public class Option { private boolean splash = false; private boolean textProgressBar = false; private int nbThreads = 0; - private int ftpPort = -1; private boolean hideMetadata = false; private boolean checkMetadata = false; private int imageIndex = 0; @@ -353,13 +352,6 @@ public class Option { if (nb.matches("\\d+")) { this.imageIndex = Integer.parseInt(nb); } - } else if (StringUtils.goLowerCase(s).startsWith("-ftp")) { - final int x = s.indexOf(':'); - if (x == -1) { - this.ftpPort = 4242; - } else { - this.ftpPort = Integer.parseInt(s.substring(x + 1)); - } } else if (s.startsWith("-c")) { s = s.substring(2); config.add(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(s)); @@ -369,10 +361,6 @@ public class Option { } } - public int getFtpPort() { - return ftpPort; - } - private void addInConfig(final FileReader source) throws IOException { BufferedReader br = null; try { diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index 41abd02..b0e7545 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -35,11 +35,6 @@ */ package net.sourceforge.plantuml; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.acearth.PSystemXearthFactory; import net.sourceforge.plantuml.activitydiagram.ActivityDiagramFactory; import net.sourceforge.plantuml.activitydiagram3.ActivityDiagramFactory3; import net.sourceforge.plantuml.api.PSystemFactory; @@ -58,13 +53,6 @@ import net.sourceforge.plantuml.directdot.PSystemDotFactory; import net.sourceforge.plantuml.ditaa.PSystemDitaaFactory; import net.sourceforge.plantuml.donors.PSystemDonorsFactory; import net.sourceforge.plantuml.donors.PSystemSkinparameterListFactory; -import net.sourceforge.plantuml.eggs.PSystemAppleTwoFactory; -import net.sourceforge.plantuml.eggs.PSystemCharlieFactory; -import net.sourceforge.plantuml.eggs.PSystemColorsFactory; -import net.sourceforge.plantuml.eggs.PSystemEggFactory; -import net.sourceforge.plantuml.eggs.PSystemLostFactory; -import net.sourceforge.plantuml.eggs.PSystemPathFactory; -import net.sourceforge.plantuml.eggs.PSystemRIPFactory; import net.sourceforge.plantuml.eggs.PSystemWelcomeFactory; import net.sourceforge.plantuml.flowdiagram.FlowDiagramFactory; import net.sourceforge.plantuml.font.PSystemListFontsFactory; @@ -76,7 +64,6 @@ import net.sourceforge.plantuml.math.PSystemMathFactory; import net.sourceforge.plantuml.nwdiag.NwDiagramFactory; import net.sourceforge.plantuml.openiconic.PSystemListOpenIconicFactory; import net.sourceforge.plantuml.openiconic.PSystemOpenIconicFactory; -import net.sourceforge.plantuml.oregon.PSystemOregonFactory; import net.sourceforge.plantuml.postit.PostIdDiagramFactory; import net.sourceforge.plantuml.printskin.PrintSkinFactory; import net.sourceforge.plantuml.project3.GanttDiagramFactory; @@ -84,13 +71,16 @@ import net.sourceforge.plantuml.salt.PSystemSaltFactory; import net.sourceforge.plantuml.sequencediagram.SequenceDiagramFactory; import net.sourceforge.plantuml.statediagram.StateDiagramFactory; import net.sourceforge.plantuml.stats.StatsUtilsIncrement; -import net.sourceforge.plantuml.sudoku.PSystemSudokuFactory; import net.sourceforge.plantuml.timingdiagram.TimingDiagramFactory; 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; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public class PSystemBuilder { public static final long startTime = System.currentTimeMillis(); @@ -144,7 +134,6 @@ public class PSystemBuilder { private List getAllFactories() { final List factories = new ArrayList(); factories.add(new PSystemWelcomeFactory()); - factories.add(new PSystemColorsFactory()); factories.add(new SequenceDiagramFactory()); factories.add(new ClassDiagramFactory()); factories.add(new ActivityDiagramFactory()); @@ -175,23 +164,12 @@ public class PSystemBuilder { factories.add(new PSystemJcckitFactory(DiagramType.JCCKIT)); factories.add(new PSystemJcckitFactory(DiagramType.UML)); factories.add(new PSystemLogoFactory()); - factories.add(new PSystemSudokuFactory()); } factories.add(new PSystemDefinitionFactory()); factories.add(new PSystemMathFactory(DiagramType.MATH)); factories.add(new PSystemLatexFactory(DiagramType.LATEX)); // factories.add(new PSystemStatsFactory()); factories.add(new PSystemCreoleFactory()); - factories.add(new PSystemEggFactory()); - factories.add(new PSystemAppleTwoFactory()); - factories.add(new PSystemRIPFactory()); - factories.add(new PSystemLostFactory()); - factories.add(new PSystemPathFactory()); - factories.add(new PSystemOregonFactory()); - factories.add(new PSystemCharlieFactory()); - if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) { - factories.add(new PSystemXearthFactory()); - } factories.add(new GanttDiagramFactory(DiagramType.GANTT)); factories.add(new GanttDiagramFactory(DiagramType.UML)); factories.add(new FlowDiagramFactory()); diff --git a/src/net/sourceforge/plantuml/QString.java b/src/net/sourceforge/plantuml/QString.java deleted file mode 100644 index caeaea5..0000000 --- a/src/net/sourceforge/plantuml/QString.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml; - -public class QString { - - private final String data; - private final long mask; - - public QString(String data) { - this.data = data; - this.mask = getMask(data); - } - - @Override - public String toString() { - return data; - } - - public boolean containsQ(QString other) { - if ((this.mask & other.mask) != other.mask) { - return false; - } - return this.data.contains(other.data); - } - - static long getMask(String s) { - long result = 0; - for (int i = 0; i < s.length(); i++) { - result |= getMask(s.charAt(i)); - } - return result; - } - - static long getMask(char c) { - if (c >= '0' && c <= '9') { - final int n = c - '0'; - return 1L << n; - } - if (c >= 'a' && c <= 'z') { - final int n = c - 'a' + 10; - return 1L << n; - } - if (c >= 'A' && c <= 'Z') { - final int n = c - 'A' + 10 + 26; - return 1L << n; - } - if (c == '_') { - return 1L << (10 + 26 + 26); - } - if (c == '(') { - return 1L << 63; - } - return 0; - } - -} diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java index e19d033..de2a827 100644 --- a/src/net/sourceforge/plantuml/Run.java +++ b/src/net/sourceforge/plantuml/Run.java @@ -62,7 +62,6 @@ import net.sourceforge.plantuml.code.Transcoder; import net.sourceforge.plantuml.code.TranscoderUtil; import net.sourceforge.plantuml.command.UmlDiagramFactory; import net.sourceforge.plantuml.descdiagram.DescriptionDiagramFactory; -import net.sourceforge.plantuml.ftp.FtpServer; import net.sourceforge.plantuml.objectdiagram.ObjectDiagramFactory; import net.sourceforge.plantuml.png.MetadataTag; import net.sourceforge.plantuml.preproc.Stdlib; @@ -136,11 +135,6 @@ public class Run { return; } - if (option.getFtpPort() != -1) { - goFtp(option); - return; - } - forceOpenJdkResourceLoad(); if (option.getPreprocessorOutputMode() == OptionPreprocOutputMode.CYPHER) { cypher = new LanguageDescriptor().getCypher(); @@ -311,13 +305,6 @@ public class Run { return sb.toString(); } - private static void goFtp(Option option) throws IOException { - final int ftpPort = option.getFtpPort(); - System.err.println("ftpPort=" + ftpPort); - final FtpServer ftpServer = new FtpServer(ftpPort, option.getFileFormatOption().getFileFormat()); - ftpServer.go(); - } - public static void printFonts() { final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); for (Font f : fonts) { diff --git a/src/net/sourceforge/plantuml/SingleLine.java b/src/net/sourceforge/plantuml/SingleLine.java deleted file mode 100644 index b11916f..0000000 --- a/src/net/sourceforge/plantuml/SingleLine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml; - -import net.sourceforge.plantuml.core.Diagram; - -public interface SingleLine { - - Diagram getSystemFromSingleLine(String singleLine); -} diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearth.java b/src/net/sourceforge/plantuml/acearth/PSystemXearth.java deleted file mode 100644 index fc3a861..0000000 --- a/src/net/sourceforge/plantuml/acearth/PSystemXearth.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.acearth; - -import java.io.IOException; -import java.io.OutputStream; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.api.ImageDataSimple; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; - -import ext.plantuml.com.ctreber.acearth.ACearth; -import ext.plantuml.com.ctreber.acearth.ConfigurationACearth; -import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker; - -public class PSystemXearth extends AbstractPSystem { - - final private int width; - final private int height; - final private Map config; - final private List markers; - - final private Collection enums = Arrays.asList("viewPositionType"); - final private Collection doubles = Arrays.asList("sunPosRelLat", "sunPosRelLong", "orbitPeriod", - "orbitInclination", "viewPosLat", "viewPosLong", "starFrequency", "viewMagnification"); - final private Collection integers = Arrays.asList("daySideBrightness", "nightSideBrightness", - "terminatorDiscontinuity", "gridDivision", "gridPixelDivision", "bigStars"); - final private Collection booleans = Arrays.asList("shadeP", "gridP", "starsP"); - - public PSystemXearth(int width, int height, Map config, List markers) { - this.width = width; - this.height = height; - this.config = config; - this.markers = markers; - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final ACearth earth = new ACearth(markers); - final ConfigurationACearth conf = earth.getConf(); - conf.setInt("imageWidth", width); - conf.setInt("imageHeight", height); - - for (Map.Entry ent : config.entrySet()) { - final String key = ent.getKey(); - final String value = ent.getValue(); - if (key.equalsIgnoreCase("GMT")) { - final Date date = extractGmt(value); - conf.setInt("fixedTime", (int) (date.getTime() / 1000L)); - } else if (enums.contains(key)) { - conf.getMOEnum(key).set(value); - } else if (doubles.contains(key)) { - conf.setDouble(key, Double.parseDouble(value)); - } else if (integers.contains(key)) { - conf.setInt(key, Integer.parseInt(value)); - } else if (booleans.contains(key)) { - conf.setBoolean(key, value.equalsIgnoreCase("true")); - } else { - throw new UnsupportedOperationException(key); - } - } - earth.exportPng(os); - return new ImageDataSimple(width, height); - } - - private Date extractGmt(String s) { - final SimpleDateFormat timeFormat; - if (s.matches("\\d{4}/\\d{2}/\\d{2} \\d{2}:\\d{2}:\\d{2}")) { - timeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US); - } else if (s.matches("\\d{4}/\\d{2}/\\d{2} \\d{2}:\\d{2}")) { - timeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.US); - } else { - throw new UnsupportedOperationException(s); - } - timeFormat.setTimeZone(TimeZone.getTimeZone("GMT")); - try { - return timeFormat.parse(s); - } catch (ParseException e) { - throw new UnsupportedOperationException(s); - } - - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(XEarth)"); - } - -} diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java deleted file mode 100644 index a4cfd66..0000000 --- a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java +++ /dev/null @@ -1,107 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.acearth; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import net.sourceforge.plantuml.command.PSystemBasicFactory; -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; - -import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker; - -public class PSystemXearthFactory extends PSystemBasicFactory { - - private final Map config = new LinkedHashMap(); - private final List markers = new ArrayList(); - private int width; - private int height; - - public PSystemXearth init(String startLine) { - this.width = 512; - this.height = 512; - this.config.clear(); - this.markers.clear(); - return null; - } - - private void extractDimension(String startLine) { - final Pattern2 p = MyPattern.cmpile("\\((\\d+),(\\d+)\\)"); - final Matcher2 m = p.matcher(startLine); - final boolean ok = m.find(); - if (ok) { - width = Integer.parseInt(m.group(1)); - height = Integer.parseInt(m.group(2)); - } - } - - @Override - public PSystemXearth executeLine(PSystemXearth system, String line) { - if (system == null && line.startsWith("xearth")) { - extractDimension(line); - system = new PSystemXearth(width, height, config, markers); - return system; - } - if (system == null) { - return null; - } - if (line.startsWith("#") || line.startsWith("'")) { - return system; - } - final Pattern2 p = MyPattern.cmpile("(\\w+)[%s]*=[%s]*(.*)"); - final Matcher2 m = p.matcher(line); - if (m.find()) { - config.put(m.group(1), m.group(2)); - return system; - } - try { - final Marker marker = Marker.loadMarkerFile(line); - if (marker != null) { - markers.add(marker); - return system; - } - } catch (Exception e) { - e.printStackTrace(); - return null; - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/api/CountRate.java b/src/net/sourceforge/plantuml/api/CountRate.java deleted file mode 100644 index 6f8264d..0000000 --- a/src/net/sourceforge/plantuml/api/CountRate.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api; - -public final class CountRate { - - private final MagicArray lastMinute = new MagicArray(60); - private final MagicArray lastHour = new MagicArray(60); - private final MagicArray lastDay = new MagicArray(140); - - public void increment() { - final long now = System.currentTimeMillis(); - lastMinute.incKey(now / 1000L); - lastHour.incKey(now / (60 * 1000L)); - lastDay.incKey(now / (10 * 60 * 1000L)); - } - - public void increment(int value) { - final long now = System.currentTimeMillis(); - lastMinute.incKey(now / 1000L, value); - lastHour.incKey(now / (60 * 1000L), value); - lastDay.incKey(now / (10 * 60 * 1000L), value); - } - - public long perMinute() { - return lastMinute.getSum(); - } - - public long perHour() { - return lastHour.getSum(); - } - - public long perDay() { - return lastDay.getSum(); - } - - public long perMinuteMax() { - return lastMinute.getMaxSum(); - } - - public long perHourMax() { - return lastHour.getMaxSum(); - } - - public long perDayMax() { - return lastDay.getMaxSum(); - } - -} diff --git a/src/net/sourceforge/plantuml/api/MagicArray.java b/src/net/sourceforge/plantuml/api/MagicArray.java deleted file mode 100644 index 55c3292..0000000 --- a/src/net/sourceforge/plantuml/api/MagicArray.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api; - -public final class MagicArray { - - private final int data[]; - private final int size; - private long lastUpdatedKey = -1; - private int lastUpdatedValue; - private long sum; - private long maxSum; - - public MagicArray(int size) { - this.data = new int[size]; - this.size = size; - } - - synchronized public void incKey(long key) { - incKey(key, 1); - } - - synchronized public void incKey(long key, int delta) { - if (key < lastUpdatedKey) { - return; - } - if (key != lastUpdatedKey) { - if (lastUpdatedKey != -1) { - setValue(lastUpdatedKey, lastUpdatedValue); - for (long i = lastUpdatedKey + 1; i < key; i++) { - setValue(i, 0); - } - } - lastUpdatedValue = 0; - lastUpdatedKey = key; - } - lastUpdatedValue += delta; - } - - private void setValue(long key, int value) { - final int i = (int) (key % size); - sum += value - data[i]; - if (sum > maxSum) { - maxSum = sum; - } - data[i] = value; - } - - synchronized public long getSum() { - return sum; - } - - synchronized public long getMaxSum() { - return maxSum; - } - - private long getSumSlow() { - long tmp = 0; - for (int d : data) { - tmp += d; - } - return tmp; - } - -} diff --git a/src/net/sourceforge/plantuml/api/NiceNumber.java b/src/net/sourceforge/plantuml/api/NiceNumber.java deleted file mode 100644 index dddccb8..0000000 --- a/src/net/sourceforge/plantuml/api/NiceNumber.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api; - -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.Locale; - -public class NiceNumber { - - public static int getNicer(final int value) { - if (value <= 18) { - return value; - } - if (value < 93) { - return ((value + 2) / 5) * 5; - } - if (value < 100) { - return ((value + 5) / 10) * 10; - } - int m = 1; - double head = value; - while (head >= 100) { - head = head / 10.0; - m *= 10; - } - return getNicer((int) Math.round(head)) * m; - } - - public static String format(final long v) { - final DecimalFormat df = new DecimalFormat(); - df.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); - df.setGroupingSize(3); - df.setMaximumFractionDigits(0); - final String t = df.format(v).replace(',', ' '); - return t; - } -} diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java deleted file mode 100644 index c275066..0000000 --- a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java +++ /dev/null @@ -1,184 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License aint with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - */ -package net.sourceforge.plantuml.api; - -import java.util.StringTokenizer; -import java.util.concurrent.atomic.AtomicLong; -import java.util.prefs.Preferences; - -import net.sourceforge.plantuml.Log; - -public class NumberAnalyzed2 implements INumberAnalyzed { - - private static final int SLIDING_WINDOW = 512; - - private final AtomicLong nb = new AtomicLong(); - private final AtomicLong sum = new AtomicLong(); - private final AtomicLong min = new AtomicLong(); - private final AtomicLong max = new AtomicLong(); - private final AtomicLong sumOfSquare = new AtomicLong(); - // See https://fossies.org/linux/haproxy/include/proto/freq_ctr.h - private final AtomicLong sliddingSum = new AtomicLong(); - private final String name; - - public NumberAnalyzed2(String name) { - this.name = name; - } - - public void reset() { - this.nb.set(0); - this.sum.set(0); - this.min.set(0); - this.max.set(0); - this.sumOfSquare.set(0); - this.sliddingSum.set(0); - } - - public NumberAnalyzed2() { - this(""); - } - - public final void save(Preferences prefs) { - if (name.length() == 0) { - throw new UnsupportedOperationException(); - } - prefs.put(name + ".saved", getSavedString()); - } - - protected String getSavedString() { - final String value = longToString(nb) + ";" + longToString(sum) + ";" + longToString(min) + ";" - + longToString(max) + ";" + longToString(sumOfSquare) + ";" + longToString(sliddingSum); - return value; - } - - protected final String longToString(AtomicLong val) { - return Long.toString(val.get(), 36); - } - - public static NumberAnalyzed2 load(String name, Preferences prefs) { - final String value = prefs.get(name + ".saved", ""); - if (value.length() == 0) { - System.err.println("Cannot load " + name); - return null; - } - try { - final StringTokenizer st = new StringTokenizer(value, ";"); - return new NumberAnalyzed2(name, Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), - Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong( - st.nextToken(), 36), Long.parseLong(st.nextToken(), 36)); - } catch (Exception e) { - e.printStackTrace(); - Log.info("Error reading " + value); - return null; - } - } - - @Override - public String toString() { - return "sum=" + sum + " nb=" + nb + " min=" + min + " max=" + max + " mean=" + getMean(); - } - - protected NumberAnalyzed2(String name, long nb, long sum, long min, long max, long sumOfSquare, long sliddingSum) { - this(name); - this.nb.set(nb); - this.sum.set(sum); - this.min.set(min); - this.max.set(max); - this.sumOfSquare.set(sumOfSquare); - this.sliddingSum.set(sliddingSum); - } - - public INumberAnalyzed getCopyImmutable() { - final NumberAnalyzed2 copy = new NumberAnalyzed2(name, nb.get(), sum.get(), min.get(), max.get(), - sumOfSquare.get(), sliddingSum.get()); - return copy; - } - - public void addValue(long v) { - nb.incrementAndGet(); - if (nb.get() == 1) { - min.set(v); - max.set(v); - } else if (v > max.get()) { - max.set(v); - } else if (v < min.get()) { - min.set(v); - } - sum.addAndGet(v); - sumOfSquare.addAndGet(v * v); - sliddingSum.set(sliddingSum.get() * (SLIDING_WINDOW - 1) / SLIDING_WINDOW + v); - } - - public void add(NumberAnalyzed2 other) { - this.sum.addAndGet(other.sum.get()); - this.nb.addAndGet(other.nb.get()); - this.min.set(Math.min(this.min.get(), other.min.get())); - this.max.set(Math.max(this.max.get(), other.max.get())); - } - - public final long getNb() { - return nb.get(); - } - - public final long getSum() { - return sum.get(); - } - - public final long getMin() { - return min.get(); - } - - public final long getMax() { - return max.get(); - } - - public final long getMean() { - if (nb.get() == 0) { - return 0; - } - // Bad - return sum.get() / nb.get(); - } - - public final long getSliddingMean() { - if (nb.get() == 0) { - return 0; - } - if (nb.get() < SLIDING_WINDOW) { - return sum.get() / nb.get(); - } - // Bad - return sliddingSum.get() / nb.get(); - } - - final public String getName() { - return name; - } - -} diff --git a/src/net/sourceforge/plantuml/api/PlantumlUtils.java b/src/net/sourceforge/plantuml/api/PlantumlUtils.java deleted file mode 100644 index 5a02064..0000000 --- a/src/net/sourceforge/plantuml/api/PlantumlUtils.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api; - -import java.util.List; - -import net.sourceforge.plantuml.BlockUml; -import net.sourceforge.plantuml.SourceStringReader; -import net.sourceforge.plantuml.core.Diagram; - -public class PlantumlUtils { - - public static boolean hasCMapData(String uml) { - List blocks = new SourceStringReader(uml).getBlocks(); - if (blocks.size() == 0) { - uml = "@startuml\n" + uml + "\n@enduml"; - blocks = new SourceStringReader(uml).getBlocks(); - if (blocks.size() == 0) { - return false; - } - } - final BlockUml block = blocks.get(0); - final Diagram diagram = block.getDiagram(); - return diagram.hasUrl(); - } - -} diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java b/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java deleted file mode 100644 index 15fde47..0000000 --- a/src/net/sourceforge/plantuml/api/mda/option2/MDADiagram.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api.mda.option2; - -import java.util.Collection; - -public interface MDADiagram { - public Collection getPackages(); -} diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java b/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java deleted file mode 100644 index c60f5e4..0000000 --- a/src/net/sourceforge/plantuml/api/mda/option2/MDAEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api.mda.option2; - -public interface MDAEntity { - public String getName(); - -} diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java b/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java deleted file mode 100644 index 0f7c3fb..0000000 --- a/src/net/sourceforge/plantuml/api/mda/option2/MDAPackage.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api.mda.option2; - -import java.util.Collection; - -public interface MDAPackage { - - public String getName(); - - public Collection getEntities(); - -} diff --git a/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java b/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java deleted file mode 100644 index e09f968..0000000 --- a/src/net/sourceforge/plantuml/api/mda/option2/MDAUtils.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api.mda.option2; - -import net.sourceforge.plantuml.mda.MDADiagramImpl; - -public class MDAUtils { - - public static MDADiagram getMDADiagram(String plantumlDiagramSource) { - return MDADiagramImpl.create(plantumlDiagramSource); - } -} diff --git a/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java b/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java deleted file mode 100644 index 5bbbec4..0000000 --- a/src/net/sourceforge/plantuml/api/mda/option3/MDAVisitor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.api.mda.option3; - -public interface MDAVisitor { -} diff --git a/src/net/sourceforge/plantuml/bpm/FootPrint.java b/src/net/sourceforge/plantuml/bpm/FootPrint.java deleted file mode 100644 index 1b8e30d..0000000 --- a/src/net/sourceforge/plantuml/bpm/FootPrint.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.bpm; - -import java.util.HashSet; -import java.util.Set; - -public class FootPrint { - - private final Set cells = new HashSet(); - -} diff --git a/src/net/sourceforge/plantuml/code/Spiral.java b/src/net/sourceforge/plantuml/code/Spiral.java deleted file mode 100644 index 0ba7d43..0000000 --- a/src/net/sourceforge/plantuml/code/Spiral.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.code; - -public class Spiral { - - private PairInt current = new PairInt(0, 0); - private PairInt direction = new PairInt(1, 0); - private int step = 0; - private int lim = 1; - private int len = 1; - private int cpt = 0; - - public PairInt nextPoint() { - final PairInt result = current; - oneStep(); - return result; - } - - private void oneStep() { - this.current = this.current.plus(this.direction); - step++; - if (step == lim) { - this.direction = this.direction.rotate(); - cpt++; - if (cpt == 2) { - cpt = 0; - len++; - } - lim += len; - } - } - -} diff --git a/src/net/sourceforge/plantuml/code/SpiralOnRectangle.java b/src/net/sourceforge/plantuml/code/SpiralOnRectangle.java deleted file mode 100644 index 5b3db4f..0000000 --- a/src/net/sourceforge/plantuml/code/SpiralOnRectangle.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.code; - -public class SpiralOnRectangle { - - private final Spiral spiral = new Spiral(); - private final int width; - private final int height; - private final PairInt delta; - - public SpiralOnRectangle(int width, int height) { - this.width = width; - this.height = height; - this.delta = new PairInt(width / 2, height / 2); - } - - private boolean inside(PairInt point) { - final int x = point.getX(); - final int y = point.getY(); - return x >= 0 && x < width && y >= 0 && y < height; - } - - public PairInt nextPoint() { - do { - final PairInt result = spiral.nextPoint().plus(delta); - if (inside(result)) { - return result; - } - } while (true); - } -} diff --git a/src/net/sourceforge/plantuml/creole/UCreole.java b/src/net/sourceforge/plantuml/creole/UCreole.java deleted file mode 100644 index 5fab0ec..0000000 --- a/src/net/sourceforge/plantuml/creole/UCreole.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.creole; - -import net.sourceforge.plantuml.ugraphic.UShape; - - -public interface UCreole extends UShape { -} diff --git a/src/net/sourceforge/plantuml/eggs/EggUtils.java b/src/net/sourceforge/plantuml/eggs/EggUtils.java deleted file mode 100644 index 780b829..0000000 --- a/src/net/sourceforge/plantuml/eggs/EggUtils.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.math.BigInteger; - -import net.sourceforge.plantuml.StringUtils; - -public class EggUtils { - - public static String fromByteArrays(byte data[]) { - final StringBuilder sb = new StringBuilder(); - for (byte b : data) { - final String hex = Integer.toHexString(b & 0xFF); - if (hex.length() == 1) { - sb.append('0'); - } - sb.append(hex); - } - return sb.toString(); - } - - public static byte[] toByteArrays(String s) { - final byte[] result = new byte[s.length() / 2]; - for (int i = 0; i < result.length; i++) { - result[i] = (byte) Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16); - } - return result; - } - - public static BigInteger fromSecretSentence(String s) { - BigInteger result = BigInteger.ZERO; - final BigInteger twentySix = BigInteger.valueOf(26); - s = s.replace('\u00E9', 'e'); - s = s.replace('\u00EA', 'e'); - for (char c : s.toCharArray()) { - final int num = convertChar(c); - if (num != -1) { - result = result.multiply(twentySix); - result = result.add(BigInteger.valueOf(num)); - - } - } - return result; - - } - - private static int convertChar(char c) { - c = StringUtils.goLowerCase(c); - if (c >= 'a' && c <= 'z') { - return c - 'a'; - } - return -1; - } - - public static byte[] xor(byte data[], byte key[]) { - final byte[] result = new byte[data.length]; - int pos = 0; - for (int i = 0; i < result.length; i++) { - result[i] = (byte) (data[i] ^ key[pos++]); - if (pos == key.length) { - pos = 0; - } - - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/GraphicsPath.java b/src/net/sourceforge/plantuml/eggs/GraphicsPath.java deleted file mode 100644 index 4def25a..0000000 --- a/src/net/sourceforge/plantuml/eggs/GraphicsPath.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; - -import net.sourceforge.plantuml.EmptyImageBuilder; -import net.sourceforge.plantuml.api.ImageDataSimple; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.png.PngIO; -import net.sourceforge.plantuml.ugraphic.ColorMapper; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UMotif; -import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d; - -public class GraphicsPath { - - private final String path; - private final ColorMapper colorMapper; - - public GraphicsPath(ColorMapper colorMapper, String path) { - this.path = path; - this.colorMapper = colorMapper; - } - - public ImageData writeImage(OutputStream os) throws IOException { - final BufferedImage im = createImage(); - PngIO.write(im, os, 96); - return new ImageDataSimple(im.getWidth(), im.getHeight()); - } - - private BufferedImage createImage() { - final EmptyImageBuilder builder = new EmptyImageBuilder(50, 50, Color.WHITE); - final BufferedImage im = builder.getBufferedImage(); - final Graphics2D g2d = builder.getGraphics2D(); - - final UGraphicG2d ug = new UGraphicG2d(colorMapper, g2d, 1.0); - ug.setBufferedImage(im); - final UMotif motif = new UMotif(path); - motif.drawHorizontal(ug.apply(new UChangeColor(HtmlColorUtils.BLACK)), 20, 20, 1); - - g2d.dispose(); - return im; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java deleted file mode 100644 index 436cb6b..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.graphic.GraphicPosition; -import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.svek.TextBlockBackcolored; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; -import net.sourceforge.plantuml.version.PSystemVersion; - -public class PSystemAppleTwo extends AbstractPSystem { - - private final List strings = new ArrayList(); - private final BufferedImage image; - - public PSystemAppleTwo() throws IOException { - strings.add(" Apple //e for ever ! "); - strings.add(" "); - - image = PSystemVersion.getApple2Image(); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final TextBlockBackcolored result = getGraphicStrings(); - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(), - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - private TextBlockBackcolored getGraphicStrings() throws IOException { - // final UFont font = new UFont("SansSerif", Font.PLAIN, 12); - final TextBlockBackcolored result = GraphicStrings.createBlackOnWhite(strings, image, GraphicPosition.BOTTOM); - // final GraphicStrings result = new GraphicStrings(strings, font, HtmlColorUtils.BLACK, HtmlColorUtils.WHITE, - // image, GraphicPosition.BOTTOM); - // result.setMinWidth(200); - return result; - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Apple //e)"); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java deleted file mode 100644 index fda68bd..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.IOException; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; - -public class PSystemAppleTwoFactory extends PSystemSingleLineFactory { - - @Override - protected AbstractPSystem executeLine(String line) { - if (line.equalsIgnoreCase("apple //e") || line.equalsIgnoreCase("apple ][") - || line.equalsIgnoreCase("apple II") || line.equalsIgnoreCase("Steve Jobs") - || line.equalsIgnoreCase("Steve Wozniak")) { - try { - return new PSystemAppleTwo(); - } catch (IOException e) { - Log.error("Error " + e); - e.printStackTrace(); - } - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java b/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java deleted file mode 100644 index 92539d8..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - */ -package net.sourceforge.plantuml.eggs; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UImage; -import net.sourceforge.plantuml.version.PSystemVersion; - -public class PSystemCharlie extends AbstractPSystem { - - private BufferedImage image; - - PSystemCharlie() { - image = PSystemVersion.getCharlieImage(); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.BLACK, - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(new UDrawable() { - - public void drawU(UGraphic ug) { - final UImage im = new UImage(image); - ug.draw(im); - } - }); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Je Suis Charlie)"); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java deleted file mode 100644 index e21bcb0..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemCharlieFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; - -public class PSystemCharlieFactory extends PSystemSingleLineFactory { - - @Override - protected AbstractPSystem executeLine(String line) { - if (line.equalsIgnoreCase("charlie") || line.equalsIgnoreCase("jesuischarlie")) { - return new PSystemCharlie(); - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemColors.java b/src/net/sourceforge/plantuml/eggs/PSystemColors.java deleted file mode 100644 index cd3fca6..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemColors.java +++ /dev/null @@ -1,282 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.awt.geom.Dimension2D; -import java.awt.geom.Point2D; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.BackSlash; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.SpriteContainerEmpty; -import net.sourceforge.plantuml.core.DiagramDescription; -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.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorSetSimple; -import net.sourceforge.plantuml.graphic.HtmlColorSimple; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; -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; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -// http://www.redblobgames.com/grids/hexagons/ -public class PSystemColors extends AbstractPSystem implements UDrawable { - - private final double rectangleHeight = 28; - private final double rectangleWidth = 175; - private final HtmlColorSetSimple colors = new HtmlColorSetSimple(); - private final String paletteCentralColor; - private final double size = 60; - - public PSystemColors(String option) { - if (option == null) { - this.paletteCentralColor = null; - } else { - this.paletteCentralColor = option.replaceAll("\\#", ""); - } - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE, - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(this); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Colors)"); - } - - public void drawU(UGraphic ug) { - if (colors.getColorIfValid(paletteCentralColor) instanceof HtmlColorSimple) { - drawPalette(ug); - } else { - drawFull(ug); - } - } - - private void drawPalette(UGraphic ug) { - double x = (centerHexa(2, 0).getX() + centerHexa(3, 0).getX()) / 2; - double y = centerHexa(0, 2).getY() + corner(1).getY(); - ug = ug.apply(new UTranslate(x, y)); - final UPolygon hexa = getHexa(); - - final List friends = getColorsCloseTo(paletteCentralColor); - int idx = 0; - drawOneHexa(ug, friends.get(idx++), 0, 0, hexa); - - drawOneHexa(ug, friends.get(idx++), 1, 0, hexa); - drawOneHexa(ug, friends.get(idx++), 0, 1, hexa); - drawOneHexa(ug, friends.get(idx++), -1, 1, hexa); - drawOneHexa(ug, friends.get(idx++), -1, 0, hexa); - drawOneHexa(ug, friends.get(idx++), -1, -1, hexa); - drawOneHexa(ug, friends.get(idx++), 0, -1, hexa); - - drawOneHexa(ug, friends.get(idx++), 2, 0, hexa); - drawOneHexa(ug, friends.get(idx++), 1, 1, hexa); - drawOneHexa(ug, friends.get(idx++), 1, 2, hexa); - drawOneHexa(ug, friends.get(idx++), 0, 2, hexa); - drawOneHexa(ug, friends.get(idx++), -1, 2, hexa); - drawOneHexa(ug, friends.get(idx++), -2, 1, hexa); - drawOneHexa(ug, friends.get(idx++), -2, 0, hexa); - drawOneHexa(ug, friends.get(idx++), -2, -1, hexa); - drawOneHexa(ug, friends.get(idx++), -1, -2, hexa); - drawOneHexa(ug, friends.get(idx++), 0, -2, hexa); - drawOneHexa(ug, friends.get(idx++), 1, -2, hexa); - drawOneHexa(ug, friends.get(idx++), 1, -1, hexa); - } - - private Point2D centerHexa(int i, int j) { - final double width = getWidth(); - final double x = width * i + (j % 2 == 0 ? 0 : width / 2); - final double y = size * j * 1.5; - return new Point2D.Double(x, y); - - } - - private double getWidth() { - return Math.sqrt(3) / 2 * 2 * size; - } - - private void drawOneHexa(UGraphic ug, String colorName, int i, int j, UPolygon hexa) { - final HtmlColorSimple color = (HtmlColorSimple) colors.getColorIfValid(colorName); - ug = applyColor(ug, color); - ug = ug.apply(new UTranslate(centerHexa(i, j))); - ug.draw(hexa); - - final UFont font = UFont.sansSerif(14).bold(); - - TextBlock tt = getTextName(font, colorName, color); - Dimension2D dimText = tt.calculateDimension(ug.getStringBounder()); - if (dimText.getWidth() > getWidth()) { - tt = getTextName(font, findShortest(ug.getStringBounder(), font, colorName), color); - dimText = tt.calculateDimension(ug.getStringBounder()); - } - tt.drawU(ug.apply(new UTranslate(-dimText.getWidth() / 2, -dimText.getHeight() / 2))); - } - - private String findShortest(StringBounder stringBounder, UFont font, String colorName) { - String result = null; - double min = Double.MAX_VALUE; - for (int i = 1; i < colorName.length() - 1; i++) { - if (Character.isLowerCase(colorName.charAt(i))) { - continue; - } - final String candidat = colorName.substring(0, i) + BackSlash.BS_BS_N + colorName.substring(i); - final TextBlock tt = getTextName(font, candidat, (HtmlColorSimple) HtmlColorUtils.BLACK); - final double width = tt.calculateDimension(stringBounder).getWidth(); - if (width < min) { - result = candidat; - min = width; - } - } - return result; - } - - private UGraphic applyColor(UGraphic ug, HtmlColor color) { - return ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color)); - } - - private Point2D corner(int i) { - double angle_deg = 60 * i + 30; - double angle_rad = Math.PI / 180 * angle_deg; - return new Point2D.Double(size * Math.cos(angle_rad), size * Math.sin(angle_rad)); - } - - private UPolygon getHexa() { - final UPolygon result = new UPolygon(); - for (int i = 0; i < 6; i++) { - result.addPoint(corner(i)); - } - return result; - } - - private List getColorsCloseTo(String other) { - final List result = new ArrayList(colors.names()); - for (Iterator it = result.iterator(); it.hasNext();) { - final String candidat = it.next(); - final String similar = candidat.replaceAll("Gray", "Grey"); - if (candidat.equals(similar)) { - continue; - } - if (result.contains(similar)) { - it.remove(); - } - } - if (containsCaseInsensitive(result, other) == false) { - result.add(other); - } - Collections.sort(result, closeComparator(paletteCentralColor)); - return result; - } - - private boolean containsCaseInsensitive(Collection source, String target) { - for (String s : source) { - if (s.equalsIgnoreCase(target)) { - return true; - } - } - return false; - } - - private Comparator closeComparator(String center) { - final HtmlColorSimple centerColor = (HtmlColorSimple) colors.getColorIfValid(center); - return new Comparator() { - public int compare(String col1, String col2) { - final double dist1 = centerColor.distance((HtmlColorSimple) colors.getColorIfValid(col1)); - final double dist2 = centerColor.distance((HtmlColorSimple) colors.getColorIfValid(col2)); - return (int) Math.signum(dist1 - dist2); - } - }; - } - - private void drawFull(UGraphic ug) { - final UFont font = UFont.sansSerif(14).bold(); - - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - int i = 0; - int j = 0; - for (String name : colors.names()) { - UGraphic tmp = getPositioned(ug, i, j); - final HtmlColorSimple color = (HtmlColorSimple) colors.getColorIfValid(name); - applyColor(tmp, color).draw(new URectangle(rectangleWidth, rectangleHeight)); - final TextBlock tt = getTextName(font, name, color); - final Dimension2D dimText = tt.calculateDimension(ug.getStringBounder()); - final double dy = (rectangleHeight - dimText.getHeight()) / 2; - final double dx = (rectangleWidth - dimText.getWidth()) / 2; - tt.drawU(tmp.apply(new UTranslate(dx, dy))); - if (j++ == 20) { - j = 0; - i++; - } - } - } - - private TextBlock getTextName(final UFont font, String name, final HtmlColorSimple color) { - final HtmlColorSimple opposite = color.opposite(); - final FontConfiguration fc = new FontConfiguration(font, opposite, HtmlColorUtils.BLUE, true); - final TextBlock tt = Display.getWithNewlines(name).create(fc, HorizontalAlignment.CENTER, - new SpriteContainerEmpty()); - return tt; - } - - private UGraphic getPositioned(UGraphic ug, int i, int j) { - return ug.apply(new UTranslate(rectangleWidth * i, rectangleHeight * j)); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemColorsFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemColorsFactory.java deleted file mode 100644 index af056db..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemColorsFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; - -public class PSystemColorsFactory extends PSystemSingleLineFactory { - - @Override - protected AbstractPSystem executeLine(String line) { - final Pattern pattern = Pattern.compile("^colors?\\s*(#?\\w+)?\\s*$"); - final Matcher matcher = pattern.matcher(line); - if (matcher.matches()) { - return new PSystemColors(matcher.group(1)); - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java deleted file mode 100644 index 0ef2d90..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.svek.TextBlockBackcolored; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; - -public class PSystemEgg extends AbstractPSystem { - - private final List strings = new ArrayList(); - - PSystemEgg(String sentence) { - final StringTokenizer st = new StringTokenizer(sentence, "|"); - while (st.hasMoreTokens()) { - strings.add(st.nextToken()); - } - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final TextBlockBackcolored result = getGraphicStrings(); - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(), - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - private TextBlockBackcolored getGraphicStrings() throws IOException { - return GraphicStrings.createBlackOnWhite(strings); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Easter Eggs)"); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java deleted file mode 100644 index b65c325..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemEggFactory.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.UnsupportedEncodingException; -import java.util.Arrays; -import java.util.List; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; - -public class PSystemEggFactory extends PSystemSingleLineFactory { - - final static private List all = Arrays - .asList(EggUtils - .toByteArrays("56092d35fce86a0dd88047a766c1d6541a7c5fd5ba212fa02db9a32a463422febd71a75a934eb135dec7d6c6325ddd17fd2fa437eba863462b28e3e92514998306a72790d93501335ed6b1262ea46ab79573142c28f8e92508978255a533d9cf7903394f9ab73a33b230a2b273033633adf16044888243b92f9bd8351f3d4f9aa2302fb264afa37546368424fa6a07919152bd2990d935092e49d9a02038b437aeb528"), - EggUtils.toByteArrays("421e5b773c5df733a1194f716f18e8842155196b3b")); - - @Override - protected AbstractPSystem executeLine(String line) { - try { - for (byte[] crypted : all) { - final SentenceDecoder decoder = new SentenceDecoder(line, crypted); - if (decoder.isOk()) { - return new PSystemEgg(decoder.getSecret()); - } - } - } catch (UnsupportedEncodingException e) { - return null; - } - - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemLost.java b/src/net/sourceforge/plantuml/eggs/PSystemLost.java deleted file mode 100644 index c5d063e..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemLost.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.svek.TextBlockBackcolored; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; - -public class PSystemLost extends AbstractPSystem { - - private final List strings = new ArrayList(); - - public PSystemLost() { - strings.add("Thank you for choosing Oceanic Airlines."); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final TextBlockBackcolored result = getGraphicStrings(); - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(), - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - private TextBlockBackcolored getGraphicStrings() throws IOException { - return GraphicStrings.createBlackOnWhite(strings); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Lost)"); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java deleted file mode 100644 index 6edc532..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemLostFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; - -public class PSystemLostFactory extends PSystemSingleLineFactory { - - @Override - protected AbstractPSystem executeLine(String line) { - if (line.matches("^4\\D+8\\D+15\\D+16\\D+23\\D+42")) { - return new PSystemLost(); - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemPath.java b/src/net/sourceforge/plantuml/eggs/PSystemPath.java deleted file mode 100644 index f148eed..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemPath.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.IOException; -import java.io.OutputStream; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; - -public class PSystemPath extends AbstractPSystem { - - private final GraphicsPath path; - - public PSystemPath(String s) { - this.path = new GraphicsPath(new ColorMapperIdentity(), s); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - return path.writeImage(os); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Path)"); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java deleted file mode 100644 index f4ba758..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemPathFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; - -public class PSystemPathFactory extends PSystemSingleLineFactory { - - final private static Pattern2 p = MyPattern.cmpile("(?i)^path[%s]+([0-9A-Za-z]+)$"); - - @Override - protected AbstractPSystem executeLine(String line) { - final Matcher2 m = p.matcher(line); - if (m.find() == false) { - return null; - } - return new PSystemPath(m.group(1)); - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemRIP.java b/src/net/sourceforge/plantuml/eggs/PSystemRIP.java deleted file mode 100644 index d9a5fca..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemRIP.java +++ /dev/null @@ -1,464 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import javax.imageio.ImageIO; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.graphic.GraphicPosition; -import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.svek.TextBlockBackcolored; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; - -public class PSystemRIP extends AbstractPSystem { - - private final List strings = new ArrayList(); - private final BufferedImage image; - - public PSystemRIP() throws IOException { - strings.add(" To my Grandfather,"); - strings.add(" A mon grand-pere,"); - strings.add(" "); - strings.add(" Jean CANOUET"); - strings.add(" "); - strings.add(" 31-OCT-1921 (Neuilly-Sur-Seine, France)"); - strings.add(" 15-SEP-2009 (Nanterre, France)"); - strings.add(" "); - strings.add(" Requiescat In Pace"); - strings.add(" "); - - final InputStream is = new ByteArrayInputStream(imm); - image = ImageIO.read(is); - is.close(); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final TextBlockBackcolored result = getGraphicStrings(); - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(), - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - private TextBlockBackcolored getGraphicStrings() throws IOException { - return GraphicStrings.createBlackOnWhite(strings, image, GraphicPosition.BOTTOM); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(RIP)"); - } - - private static final byte imm[] = new byte[] { (byte) 255, (byte) 216, (byte) 255, (byte) 224, (byte) 0, (byte) 16, - (byte) 74, (byte) 70, (byte) 73, (byte) 70, (byte) 0, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 88, - (byte) 2, (byte) 88, (byte) 0, (byte) 0, (byte) 255, (byte) 219, (byte) 0, (byte) 67, (byte) 0, (byte) 13, - (byte) 9, (byte) 10, (byte) 11, (byte) 10, (byte) 8, (byte) 13, (byte) 11, (byte) 10, (byte) 11, (byte) 14, - (byte) 14, (byte) 13, (byte) 15, (byte) 19, (byte) 32, (byte) 21, (byte) 19, (byte) 18, (byte) 18, - (byte) 19, (byte) 39, (byte) 28, (byte) 30, (byte) 23, (byte) 32, (byte) 46, (byte) 41, (byte) 49, - (byte) 48, (byte) 46, (byte) 41, (byte) 45, (byte) 44, (byte) 51, (byte) 58, (byte) 74, (byte) 62, - (byte) 51, (byte) 54, (byte) 70, (byte) 55, (byte) 44, (byte) 45, (byte) 64, (byte) 87, (byte) 65, - (byte) 70, (byte) 76, (byte) 78, (byte) 82, (byte) 83, (byte) 82, (byte) 50, (byte) 62, (byte) 90, - (byte) 97, (byte) 90, (byte) 80, (byte) 96, (byte) 74, (byte) 81, (byte) 82, (byte) 79, (byte) 255, - (byte) 219, (byte) 0, (byte) 67, (byte) 1, (byte) 14, (byte) 14, (byte) 14, (byte) 19, (byte) 17, - (byte) 19, (byte) 38, (byte) 21, (byte) 21, (byte) 38, (byte) 79, (byte) 53, (byte) 45, (byte) 53, - (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, - (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, - (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, - (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, - (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, - (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 79, (byte) 255, (byte) 192, (byte) 0, (byte) 17, - (byte) 8, (byte) 0, (byte) 135, (byte) 0, (byte) 162, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2, - (byte) 17, (byte) 1, (byte) 3, (byte) 17, (byte) 1, (byte) 255, (byte) 196, (byte) 0, (byte) 31, (byte) 0, - (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, - (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3, - (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) 255, (byte) 196, - (byte) 0, (byte) 181, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4, - (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1, - (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65, - (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50, - (byte) 129, (byte) 145, (byte) 161, (byte) 8, (byte) 35, (byte) 66, (byte) 177, (byte) 193, (byte) 21, - (byte) 82, (byte) 209, (byte) 240, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) 130, (byte) 9, - (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39, - (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, - (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, - (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99, - (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116, - (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 131, (byte) 132, (byte) 133, - (byte) 134, (byte) 135, (byte) 136, (byte) 137, (byte) 138, (byte) 146, (byte) 147, (byte) 148, (byte) 149, - (byte) 150, (byte) 151, (byte) 152, (byte) 153, (byte) 154, (byte) 162, (byte) 163, (byte) 164, (byte) 165, - (byte) 166, (byte) 167, (byte) 168, (byte) 169, (byte) 170, (byte) 178, (byte) 179, (byte) 180, (byte) 181, - (byte) 182, (byte) 183, (byte) 184, (byte) 185, (byte) 186, (byte) 194, (byte) 195, (byte) 196, (byte) 197, - (byte) 198, (byte) 199, (byte) 200, (byte) 201, (byte) 202, (byte) 210, (byte) 211, (byte) 212, (byte) 213, - (byte) 214, (byte) 215, (byte) 216, (byte) 217, (byte) 218, (byte) 225, (byte) 226, (byte) 227, (byte) 228, - (byte) 229, (byte) 230, (byte) 231, (byte) 232, (byte) 233, (byte) 234, (byte) 241, (byte) 242, (byte) 243, - (byte) 244, (byte) 245, (byte) 246, (byte) 247, (byte) 248, (byte) 249, (byte) 250, (byte) 255, (byte) 196, - (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, - (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, - (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, - (byte) 11, (byte) 255, (byte) 196, (byte) 0, (byte) 181, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2, - (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1, - (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33, - (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19, - (byte) 34, (byte) 50, (byte) 129, (byte) 8, (byte) 20, (byte) 66, (byte) 145, (byte) 161, (byte) 177, - (byte) 193, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) 240, (byte) 21, (byte) 98, (byte) 114, - (byte) 209, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) 225, (byte) 37, (byte) 241, (byte) 23, - (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53, - (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, - (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, - (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, - (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, - (byte) 122, (byte) 130, (byte) 131, (byte) 132, (byte) 133, (byte) 134, (byte) 135, (byte) 136, (byte) 137, - (byte) 138, (byte) 146, (byte) 147, (byte) 148, (byte) 149, (byte) 150, (byte) 151, (byte) 152, (byte) 153, - (byte) 154, (byte) 162, (byte) 163, (byte) 164, (byte) 165, (byte) 166, (byte) 167, (byte) 168, (byte) 169, - (byte) 170, (byte) 178, (byte) 179, (byte) 180, (byte) 181, (byte) 182, (byte) 183, (byte) 184, (byte) 185, - (byte) 186, (byte) 194, (byte) 195, (byte) 196, (byte) 197, (byte) 198, (byte) 199, (byte) 200, (byte) 201, - (byte) 202, (byte) 210, (byte) 211, (byte) 212, (byte) 213, (byte) 214, (byte) 215, (byte) 216, (byte) 217, - (byte) 218, (byte) 226, (byte) 227, (byte) 228, (byte) 229, (byte) 230, (byte) 231, (byte) 232, (byte) 233, - (byte) 234, (byte) 242, (byte) 243, (byte) 244, (byte) 245, (byte) 246, (byte) 247, (byte) 248, (byte) 249, - (byte) 250, (byte) 255, (byte) 218, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17, - (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) 180, (byte) 48, (byte) 6, (byte) 69, (byte) 84, - (byte) 212, (byte) 135, (byte) 250, (byte) 49, (byte) 235, (byte) 214, (byte) 174, (byte) 116, (byte) 246, - (byte) 170, (byte) 154, (byte) 144, (byte) 205, (byte) 153, (byte) 61, (byte) 121, (byte) 21, (byte) 200, - (byte) 246, (byte) 61, (byte) 8, (byte) 124, (byte) 72, (byte) 202, (byte) 94, (byte) 7, (byte) 29, - (byte) 233, (byte) 24, (byte) 100, (byte) 127, (byte) 58, (byte) 114, (byte) 99, (byte) 181, (byte) 4, - (byte) 113, (byte) 222, (byte) 176, (byte) 59, (byte) 8, (byte) 226, (byte) 228, (byte) 103, (byte) 29, - (byte) 41, (byte) 177, (byte) 227, (byte) 127, (byte) 20, (byte) 228, (byte) 198, (byte) 211, (byte) 206, - (byte) 41, (byte) 163, (byte) 137, (byte) 61, (byte) 168, (byte) 1, (byte) 95, (byte) 168, (byte) 232, - (byte) 42, (byte) 212, (byte) 24, (byte) 242, (byte) 151, (byte) 57, (byte) 224, (byte) 246, (byte) 170, - (byte) 210, (byte) 18, (byte) 112, (byte) 42, (byte) 205, (byte) 191, (byte) 250, (byte) 159, (byte) 188, - (byte) 122, (byte) 211, (byte) 20, (byte) 182, (byte) 36, (byte) 7, (byte) 23, (byte) 72, (byte) 115, - (byte) 220, (byte) 113, (byte) 90, (byte) 135, (byte) 238, (byte) 140, (byte) 117, (byte) 205, (byte) 100, - (byte) 183, (byte) 19, (byte) 171, (byte) 99, (byte) 161, (byte) 28, (byte) 85, (byte) 249, (byte) 174, - (byte) 226, (byte) 133, (byte) 112, (byte) 207, (byte) 207, (byte) 160, (byte) 173, (byte) 32, (byte) 99, - (byte) 81, (byte) 55, (byte) 107, (byte) 22, (byte) 20, (byte) 117, (byte) 233, (byte) 214, (byte) 148, - (byte) 116, (byte) 108, (byte) 250, (byte) 214, (byte) 83, (byte) 106, (byte) 172, (byte) 14, (byte) 35, - (byte) 143, (byte) 143, (byte) 122, (byte) 106, (byte) 106, (byte) 115, (byte) 110, (byte) 249, (byte) 163, - (byte) 4, (byte) 103, (byte) 165, (byte) 105, (byte) 116, (byte) 79, (byte) 179, (byte) 145, (byte) 179, - (byte) 143, (byte) 148, (byte) 99, (byte) 138, (byte) 204, (byte) 214, (byte) 135, (byte) 203, (byte) 23, - (byte) 63, (byte) 197, (byte) 82, (byte) 195, (byte) 168, (byte) 71, (byte) 39, (byte) 13, (byte) 149, - (byte) 57, (byte) 232, (byte) 106, (byte) 13, (byte) 93, (byte) 131, (byte) 197, (byte) 27, (byte) 43, - (byte) 103, (byte) 230, (byte) 235, (byte) 69, (byte) 197, (byte) 20, (byte) 212, (byte) 181, (byte) 28, - (byte) 169, (byte) 38, (byte) 6, (byte) 8, (byte) 198, (byte) 61, (byte) 41, (byte) 205, (byte) 20, - (byte) 196, (byte) 13, (byte) 178, (byte) 1, (byte) 248, (byte) 81, (byte) 24, (byte) 118, (byte) 81, - (byte) 243, (byte) 246, (byte) 167, (byte) 180, (byte) 76, (byte) 64, (byte) 196, (byte) 173, (byte) 159, - (byte) 76, (byte) 212, (byte) 131, (byte) 96, (byte) 177, (byte) 200, (byte) 62, (byte) 83, (byte) 43, - (byte) 123, (byte) 226, (byte) 164, (byte) 17, (byte) 156, (byte) 99, (byte) 123, (byte) 126, (byte) 117, - (byte) 24, (byte) 140, (byte) 175, (byte) 222, (byte) 118, (byte) 231, (byte) 190, (byte) 105, (byte) 193, - (byte) 71, (byte) 77, (byte) 199, (byte) 241, (byte) 52, (byte) 196, (byte) 72, (byte) 34, (byte) 83, - (byte) 213, (byte) 155, (byte) 39, (byte) 142, (byte) 180, (byte) 162, (byte) 36, (byte) 201, (byte) 201, - (byte) 63, (byte) 157, (byte) 51, (byte) 9, (byte) 158, (byte) 88, (byte) 115, (byte) 239, (byte) 78, - (byte) 81, (byte) 24, (byte) 39, (byte) 230, (byte) 20, (byte) 132, (byte) 39, (byte) 151, (byte) 31, - (byte) 181, (byte) 20, (byte) 252, (byte) 197, (byte) 234, (byte) 40, (byte) 160, (byte) 46, (byte) 76, - (byte) 7, (byte) 168, (byte) 170, (byte) 218, (byte) 128, (byte) 255, (byte) 0, (byte) 67, (byte) 127, - (byte) 194, (byte) 174, (byte) 1, (byte) 199, (byte) 61, (byte) 42, (byte) 190, (byte) 160, (byte) 191, - (byte) 232, (byte) 114, (byte) 96, (byte) 83, (byte) 123, (byte) 10, (byte) 59, (byte) 163, (byte) 13, - (byte) 6, (byte) 6, (byte) 41, (byte) 89, (byte) 72, (byte) 247, (byte) 52, (byte) 168, (byte) 164, - (byte) 119, (byte) 193, (byte) 167, (byte) 50, (byte) 156, (byte) 26, (byte) 231, (byte) 108, (byte) 236, - (byte) 34, (byte) 140, (byte) 114, (byte) 221, (byte) 51, (byte) 81, (byte) 168, (byte) 30, (byte) 103, - (byte) 34, (byte) 165, (byte) 139, (byte) 134, (byte) 61, (byte) 233, (byte) 164, (byte) 226, (byte) 83, - (byte) 199, (byte) 90, (byte) 10, (byte) 65, (byte) 42, (byte) 227, (byte) 233, (byte) 86, (byte) 109, - (byte) 128, (byte) 48, (byte) 231, (byte) 112, (byte) 94, (byte) 123, (byte) 213, (byte) 121, (byte) 58, - (byte) 116, (byte) 233, (byte) 79, (byte) 50, (byte) 8, (byte) 236, (byte) 152, (byte) 224, (byte) 18, - (byte) 125, (byte) 104, (byte) 90, (byte) 147, (byte) 45, (byte) 136, (byte) 238, (byte) 231, (byte) 253, - (byte) 246, (byte) 200, (byte) 136, (byte) 220, (byte) 58, (byte) 181, (byte) 49, (byte) 85, (byte) 187, - (byte) 245, (byte) 61, (byte) 205, (byte) 71, (byte) 2, (byte) 28, (byte) 100, (byte) 247, (byte) 171, - (byte) 208, (byte) 71, (byte) 131, (byte) 156, (byte) 113, (byte) 90, (byte) 109, (byte) 161, (byte) 73, - (byte) 13, (byte) 138, (byte) 14, (byte) 121, (byte) 228, (byte) 85, (byte) 143, (byte) 32, (byte) 40, - (byte) 199, (byte) 74, (byte) 181, (byte) 111, (byte) 16, (byte) 61, (byte) 112, (byte) 125, (byte) 51, - (byte) 83, (byte) 203, (byte) 26, (byte) 4, (byte) 31, (byte) 39, (byte) 228, (byte) 105, (byte) 1, - (byte) 143, (byte) 44, (byte) 56, (byte) 233, (byte) 154, (byte) 169, (byte) 59, (byte) 72, (byte) 19, - (byte) 110, (byte) 114, (byte) 1, (byte) 200, (byte) 21, (byte) 181, (byte) 34, (byte) 140, (byte) 30, - (byte) 0, (byte) 250, (byte) 86, (byte) 124, (byte) 241, (byte) 130, (byte) 50, (byte) 71, (byte) 229, - (byte) 66, (byte) 97, (byte) 107, (byte) 133, (byte) 165, (byte) 202, (byte) 200, (byte) 161, (byte) 93, - (byte) 176, (byte) 122, (byte) 114, (byte) 106, (byte) 198, (byte) 3, (byte) 30, (byte) 95, (byte) 233, - (byte) 205, (byte) 99, (byte) 74, (byte) 165, (byte) 36, (byte) 201, (byte) 30, (byte) 226, (byte) 181, - (byte) 45, (byte) 36, (byte) 134, (byte) 120, (byte) 182, (byte) 202, (byte) 16, (byte) 17, (byte) 222, - (byte) 180, (byte) 49, (byte) 156, (byte) 109, (byte) 169, (byte) 58, (byte) 136, (byte) 192, (byte) 193, - (byte) 97, (byte) 249, (byte) 212, (byte) 170, (byte) 177, (byte) 131, (byte) 156, (byte) 138, (byte) 114, - (byte) 8, (byte) 66, (byte) 241, (byte) 183, (byte) 138, (byte) 148, (byte) 24, (byte) 123, (byte) 117, - (byte) 250, (byte) 80, (byte) 101, (byte) 113, (byte) 170, (byte) 98, (byte) 235, (byte) 149, (byte) 247, - (byte) 226, (byte) 156, (byte) 101, (byte) 128, (byte) 1, (byte) 128, (byte) 51, (byte) 158, (byte) 160, - (byte) 82, (byte) 230, (byte) 48, (byte) 49, (byte) 131, (byte) 207, (byte) 160, (byte) 163, (byte) 204, - (byte) 78, (byte) 56, (byte) 63, (byte) 247, (byte) 205, (byte) 50, (byte) 70, (byte) 249, (byte) 145, - (byte) 255, (byte) 0, (byte) 181, (byte) 255, (byte) 0, (byte) 124, (byte) 209, (byte) 78, (byte) 243, - (byte) 71, (byte) 247, (byte) 91, (byte) 242, (byte) 162, (byte) 150, (byte) 131, (byte) 47, (byte) 99, - (byte) 143, (byte) 173, (byte) 87, (byte) 191, (byte) 81, (byte) 246, (byte) 73, (byte) 51, (byte) 233, - (byte) 87, (byte) 48, (byte) 14, (byte) 122, (byte) 213, (byte) 123, (byte) 209, (byte) 254, (byte) 137, - (byte) 39, (byte) 166, (byte) 41, (byte) 189, (byte) 136, (byte) 142, (byte) 232, (byte) 231, (byte) 208, - (byte) 102, (byte) 158, (byte) 220, (byte) 28, (byte) 10, (byte) 106, (byte) 227, (byte) 138, (byte) 151, - (byte) 4, (byte) 142, (byte) 245, (byte) 204, (byte) 118, (byte) 144, (byte) 32, (byte) 204, (byte) 135, - (byte) 53, (byte) 27, (byte) 224, (byte) 75, (byte) 199, (byte) 173, (byte) 74, (byte) 56, (byte) 147, - (byte) 6, (byte) 152, (byte) 227, (byte) 247, (byte) 216, (byte) 52, (byte) 13, (byte) 4, (byte) 131, - (byte) 229, (byte) 206, (byte) 42, (byte) 180, (byte) 161, (byte) 152, (byte) 172, (byte) 125, (byte) 135, - (byte) 38, (byte) 174, (byte) 74, (byte) 0, (byte) 66, (byte) 7, (byte) 165, (byte) 64, (byte) 235, - (byte) 209, (byte) 179, (byte) 205, (byte) 84, (byte) 55, (byte) 6, (byte) 75, (byte) 12, (byte) 125, - (byte) 1, (byte) 206, (byte) 49, (byte) 82, (byte) 77, (byte) 113, (byte) 228, (byte) 97, (byte) 81, - (byte) 55, (byte) 53, (byte) 62, (byte) 220, (byte) 101, (byte) 50, (byte) 8, (byte) 233, (byte) 82, - (byte) 89, (byte) 36, (byte) 127, (byte) 104, (byte) 221, (byte) 112, (byte) 192, (byte) 51, (byte) 30, - (byte) 51, (byte) 218, (byte) 173, (byte) 110, (byte) 13, (byte) 216, (byte) 91, (byte) 75, (byte) 240, - (byte) 236, (byte) 18, (byte) 96, (byte) 87, (byte) 60, (byte) 100, (byte) 138, (byte) 213, (byte) 16, - (byte) 130, (byte) 157, (byte) 141, (byte) 23, (byte) 246, (byte) 118, (byte) 182, (byte) 234, (byte) 140, - (byte) 204, (byte) 24, (byte) 48, (byte) 4, (byte) 48, (byte) 82, (byte) 42, (byte) 72, (byte) 118, - (byte) 199, (byte) 18, (byte) 146, (byte) 202, (byte) 85, (byte) 135, (byte) 20, (byte) 89, (byte) 18, - (byte) 165, (byte) 116, (byte) 103, (byte) 94, (byte) 98, (byte) 221, (byte) 119, (byte) 177, (byte) 206, - (byte) 122, (byte) 10, (byte) 200, (byte) 123, (byte) 208, (byte) 220, (byte) 52, (byte) 100, (byte) 15, - (byte) 90, (byte) 222, (byte) 146, (byte) 15, (byte) 58, (byte) 38, (byte) 157, (byte) 212, (byte) 178, - (byte) 47, (byte) 124, (byte) 116, (byte) 172, (byte) 233, (byte) 252, (byte) 150, (byte) 66, (byte) 172, - (byte) 128, (byte) 46, (byte) 113, (byte) 144, (byte) 59, (byte) 209, (byte) 161, (byte) 92, (byte) 198, - (byte) 93, (byte) 202, (byte) 228, (byte) 43, (byte) 1, (byte) 197, (byte) 45, (byte) 140, (byte) 209, - (byte) 37, (byte) 198, (byte) 37, (byte) 25, (byte) 83, (byte) 198, (byte) 49, (byte) 82, (byte) 204, - (byte) 134, (byte) 37, (byte) 10, (byte) 72, (byte) 62, (byte) 135, (byte) 218, (byte) 170, (byte) 194, - (byte) 234, (byte) 147, (byte) 169, (byte) 35, (byte) 60, (byte) 250, (byte) 85, (byte) 33, (byte) 61, - (byte) 81, (byte) 209, (byte) 164, (byte) 208, (byte) 237, (byte) 218, (byte) 128, (byte) 227, (byte) 217, - (byte) 77, (byte) 60, (byte) 72, (byte) 167, (byte) 162, (byte) 177, (byte) 255, (byte) 0, (byte) 128, - (byte) 154, (byte) 72, (byte) 231, (byte) 27, (byte) 70, (byte) 17, (byte) 200, (byte) 199, (byte) 101, - (byte) 169, (byte) 145, (byte) 201, (byte) 255, (byte) 0, (byte) 150, (byte) 111, (byte) 84, (byte) 114, - (byte) 49, (byte) 155, (byte) 207, (byte) 64, (byte) 173, (byte) 255, (byte) 0, (byte) 124, (byte) 208, - (byte) 95, (byte) 166, (byte) 99, (byte) 111, (byte) 202, (byte) 165, (byte) 220, (byte) 199, (byte) 164, - (byte) 109, (byte) 75, (byte) 185, (byte) 207, (byte) 30, (byte) 89, (byte) 252, (byte) 233, (byte) 8, - (byte) 103, (byte) 154, (byte) 223, (byte) 243, (byte) 204, (byte) 254, (byte) 84, (byte) 83, (byte) 240, - (byte) 255, (byte) 0, (byte) 243, (byte) 207, (byte) 245, (byte) 162, (byte) 139, (byte) 129, (byte) 108, - (byte) 142, (byte) 106, (byte) 43, (byte) 197, (byte) 205, (byte) 164, (byte) 131, (byte) 167, (byte) 202, - (byte) 106, (byte) 206, (byte) 61, (byte) 122, (byte) 212, (byte) 87, (byte) 35, (byte) 54, (byte) 210, - (byte) 103, (byte) 251, (byte) 166, (byte) 155, (byte) 216, (byte) 148, (byte) 245, (byte) 57, (byte) 164, - (byte) 83, (byte) 145, (byte) 215, (byte) 138, (byte) 148, (byte) 1, (byte) 154, (byte) 106, (byte) 14, - (byte) 112, (byte) 106, (byte) 80, (byte) 56, (byte) 237, (byte) 154, (byte) 229, (byte) 103, (byte) 109, - (byte) 202, (byte) 216, (byte) 253, (byte) 233, (byte) 166, (byte) 203, (byte) 254, (byte) 180, (byte) 26, - (byte) 148, (byte) 2, (byte) 37, (byte) 250, (byte) 211, (byte) 102, (byte) 95, (byte) 222, (byte) 140, - (byte) 154, (byte) 16, (byte) 192, (byte) 168, (byte) 96, (byte) 42, (byte) 213, (byte) 212, (byte) 17, - (byte) 164, (byte) 33, (byte) 112, (byte) 8, (byte) 198, (byte) 106, (byte) 187, (byte) 175, (byte) 203, - (byte) 212, (byte) 226, (byte) 172, (byte) 135, (byte) 13, (byte) 102, (byte) 197, (byte) 190, (byte) 241, - (byte) 92, (byte) 125, (byte) 106, (byte) 224, (byte) 50, (byte) 188, (byte) 16, (byte) 70, (byte) 223, - (byte) 42, (byte) 147, (byte) 130, (byte) 123, (byte) 28, (byte) 84, (byte) 255, (byte) 0, (byte) 101, - (byte) 119, (byte) 159, (byte) 129, (byte) 140, (byte) 112, (byte) 42, (byte) 27, (byte) 77, (byte) 194, - (byte) 69, (byte) 29, (byte) 171, (byte) 106, (byte) 37, (byte) 87, (byte) 56, (byte) 12, (byte) 1, - (byte) 199, (byte) 122, (byte) 173, (byte) 68, (byte) 244, (byte) 27, (byte) 112, (byte) 215, (byte) 18, - (byte) 90, (byte) 195, (byte) 28, (byte) 164, (byte) 58, (byte) 196, (byte) 48, (byte) 6, (byte) 59, - (byte) 85, (byte) 41, (byte) 110, (byte) 30, (byte) 17, (byte) 177, (byte) 85, (byte) 126, (byte) 113, - (byte) 223, (byte) 156, (byte) 86, (byte) 156, (byte) 144, (byte) 21, (byte) 66, (byte) 210, (byte) 55, - (byte) 3, (byte) 144, (byte) 23, (byte) 189, (byte) 101, (byte) 198, (byte) 130, (byte) 123, (byte) 163, - (byte) 185, (byte) 130, (byte) 250, (byte) 3, (byte) 218, (byte) 158, (byte) 251, (byte) 132, (byte) 82, - (byte) 38, (byte) 180, (byte) 184, (byte) 157, (byte) 108, (byte) 165, (byte) 137, (byte) 27, (byte) 247, - (byte) 114, (byte) 12, (byte) 50, (byte) 213, (byte) 9, (byte) 163, (byte) 85, (byte) 93, (byte) 170, - (byte) 8, (byte) 238, (byte) 125, (byte) 234, (byte) 218, (byte) 68, (byte) 233, (byte) 118, (byte) 99, - (byte) 71, (byte) 24, (byte) 60, (byte) 143, (byte) 66, (byte) 105, (byte) 243, (byte) 71, (byte) 34, - (byte) 130, (byte) 90, (byte) 62, (byte) 71, (byte) 189, (byte) 14, (byte) 227, (byte) 178, (byte) 76, - (byte) 206, (byte) 146, (byte) 47, (byte) 58, (byte) 84, (byte) 80, (byte) 6, (byte) 91, (byte) 214, - (byte) 179, (byte) 221, (byte) 190, (byte) 207, (byte) 119, (byte) 141, (byte) 155, (byte) 130, (byte) 55, - (byte) 74, (byte) 189, (byte) 44, (byte) 158, (byte) 84, (byte) 193, (byte) 240, (byte) 1, (byte) 0, - (byte) 145, (byte) 143, (byte) 90, (byte) 207, (byte) 11, (byte) 52, (byte) 243, (byte) 240, (byte) 187, - (byte) 153, (byte) 143, (byte) 65, (byte) 84, (byte) 132, (byte) 246, (byte) 58, (byte) 107, (byte) 121, - (byte) 76, (byte) 145, (byte) 171, (byte) 136, (byte) 142, (byte) 8, (byte) 233, (byte) 154, (byte) 156, - (byte) 23, (byte) 255, (byte) 0, (byte) 158, (byte) 120, (byte) 252, (byte) 106, (byte) 59, (byte) 88, - (byte) 231, (byte) 72, (byte) 85, (byte) 10, (byte) 32, (byte) 192, (byte) 171, (byte) 24, (byte) 151, - (byte) 31, (byte) 193, (byte) 154, (byte) 163, (byte) 141, (byte) 140, (byte) 5, (byte) 241, (byte) 247, - (byte) 7, (byte) 231, (byte) 74, (byte) 60, (byte) 206, (byte) 161, (byte) 71, (byte) 231, (byte) 78, - (byte) 219, (byte) 47, (byte) 251, (byte) 20, (byte) 170, (byte) 178, (byte) 231, (byte) 239, (byte) 47, - (byte) 229, (byte) 64, (byte) 134, (byte) 252, (byte) 222, (byte) 139, (byte) 249, (byte) 209, (byte) 82, - (byte) 121, (byte) 114, (byte) 255, (byte) 0, (byte) 121, (byte) 104, (byte) 164, (byte) 23, (byte) 44, - (byte) 149, (byte) 39, (byte) 165, (byte) 71, (byte) 58, (byte) 159, (byte) 33, (byte) 198, (byte) 63, - (byte) 132, (byte) 212, (byte) 248, (byte) 7, (byte) 138, (byte) 108, (byte) 171, (byte) 251, (byte) 166, - (byte) 250, (byte) 98, (byte) 171, (byte) 161, (byte) 11, (byte) 115, (byte) 150, (byte) 140, (byte) 124, - (byte) 220, (byte) 84, (byte) 219, (byte) 121, (byte) 166, (byte) 42, (byte) 146, (byte) 216, (byte) 29, - (byte) 141, (byte) 78, (byte) 163, (byte) 154, (byte) 228, (byte) 123, (byte) 157, (byte) 197, (byte) 82, - (byte) 15, (byte) 152, (byte) 41, (byte) 179, (byte) 175, (byte) 206, (byte) 9, (byte) 169, (byte) 153, - (byte) 79, (byte) 154, (byte) 41, (byte) 147, (byte) 174, (byte) 25, (byte) 73, (byte) 206, (byte) 40, - (byte) 24, (byte) 99, (byte) 9, (byte) 142, (byte) 105, (byte) 208, (byte) 32, (byte) 101, (byte) 37, - (byte) 219, (byte) 104, (byte) 3, (byte) 34, (byte) 159, (byte) 183, (byte) 40, (byte) 112, (byte) 57, - (byte) 237, (byte) 87, (byte) 108, (byte) 236, (byte) 100, (byte) 40, (byte) 124, (byte) 193, (byte) 141, - (byte) 195, (byte) 165, (byte) 105, (byte) 74, (byte) 46, (byte) 79, (byte) 66, (byte) 39, (byte) 53, - (byte) 21, (byte) 118, (byte) 80, (byte) 183, (byte) 31, (byte) 48, (byte) 30, (byte) 245, (byte) 173, - (byte) 110, (byte) 152, (byte) 249, (byte) 143, (byte) 65, (byte) 84, (byte) 163, (byte) 128, (byte) 195, - (byte) 115, (byte) 176, (byte) 245, (byte) 7, (byte) 154, (byte) 211, (byte) 141, (byte) 51, (byte) 149, - (byte) 238, (byte) 106, (byte) 154, (byte) 177, (byte) 92, (byte) 221, (byte) 72, (byte) 46, (byte) 238, - (byte) 55, (byte) 28, (byte) 100, (byte) 243, (byte) 85, (byte) 226, (byte) 183, (byte) 93, (byte) 187, - (byte) 152, (byte) 114, (byte) 122, (byte) 123, (byte) 83, (byte) 117, (byte) 8, (byte) 38, (byte) 102, - (byte) 45, (byte) 19, (byte) 99, (byte) 29, (byte) 133, (byte) 85, (byte) 84, (byte) 185, (byte) 85, - (byte) 206, (byte) 72, (byte) 230, (byte) 132, (byte) 104, (byte) 147, (byte) 104, (byte) 89, (byte) 3, - (byte) 67, (byte) 117, (byte) 149, (byte) 99, (byte) 128, (byte) 106, (byte) 244, (byte) 178, (byte) 9, - (byte) 34, (byte) 221, (byte) 237, (byte) 89, (byte) 66, (byte) 41, (byte) 158, (byte) 113, (byte) 184, - (byte) 182, (byte) 220, (byte) 242, (byte) 107, (byte) 96, (byte) 162, (byte) 139, (byte) 124, (byte) 142, - (byte) 167, (byte) 138, (byte) 24, (byte) 164, (byte) 236, (byte) 97, (byte) 94, (byte) 129, (byte) 146, - (byte) 9, (byte) 193, (byte) 199, (byte) 21, (byte) 14, (byte) 155, (byte) 230, (byte) 11, (byte) 164, - (byte) 219, (byte) 183, (byte) 35, (byte) 212, (byte) 113, (byte) 79, (byte) 212, (byte) 207, (byte) 250, - (byte) 70, (byte) 220, (byte) 227, (byte) 2, (byte) 173, (byte) 104, (byte) 214, (byte) 141, (byte) 33, - (byte) 105, (byte) 3, (byte) 225, (byte) 151, (byte) 167, (byte) 28, (byte) 85, (byte) 35, (byte) 57, - (byte) 187, (byte) 35, (byte) 106, (byte) 53, (byte) 159, (byte) 3, (byte) 123, (byte) 174, (byte) 125, - (byte) 133, (byte) 60, (byte) 71, (byte) 38, (byte) 57, (byte) 113, (byte) 159, (byte) 165, (byte) 34, - (byte) 197, (byte) 40, (byte) 31, (byte) 52, (byte) 205, (byte) 159, (byte) 165, (byte) 56, (byte) 198, - (byte) 248, (byte) 229, (byte) 216, (byte) 211, (byte) 57, (byte) 67, (byte) 99, (byte) 224, (byte) 130, - (byte) 252, (byte) 253, (byte) 41, (byte) 66, (byte) 201, (byte) 221, (byte) 248, (byte) 250, (byte) 81, - (byte) 229, (byte) 147, (byte) 140, (byte) 187, (byte) 82, (byte) 136, (byte) 207, (byte) 247, (byte) 219, - (byte) 31, (byte) 90, (byte) 96, (byte) 46, (byte) 195, (byte) 255, (byte) 0, (byte) 61, (byte) 13, - (byte) 20, (byte) 121, (byte) 63, (byte) 237, (byte) 55, (byte) 231, (byte) 69, (byte) 23, (byte) 21, - (byte) 139, (byte) 152, (byte) 201, (byte) 247, (byte) 164, (byte) 117, (byte) 249, (byte) 79, (byte) 166, - (byte) 41, (byte) 195, (byte) 20, (byte) 132, (byte) 124, (byte) 164, (byte) 85, (byte) 16, (byte) 115, - (byte) 32, (byte) 126, (byte) 240, (byte) 129, (byte) 235, (byte) 82, (byte) 117, (byte) 224, (byte) 83, - (byte) 74, (byte) 226, (byte) 118, (byte) 235, (byte) 212, (byte) 212, (byte) 161, (byte) 79, (byte) 28, - (byte) 243, (byte) 92, (byte) 143, (byte) 115, (byte) 182, (byte) 229, (byte) 121, (byte) 0, (byte) 14, - (byte) 50, (byte) 41, (byte) 207, (byte) 3, (byte) 202, (byte) 192, (byte) 39, (byte) 62, (byte) 167, - (byte) 210, (byte) 174, (byte) 195, (byte) 100, (byte) 101, (byte) 96, (byte) 207, (byte) 144, (byte) 61, - (byte) 43, (byte) 78, (byte) 27, (byte) 116, (byte) 81, (byte) 133, (byte) 0, (byte) 98, (byte) 183, - (byte) 167, (byte) 69, (byte) 189, (byte) 89, (byte) 140, (byte) 235, (byte) 168, (byte) 236, (byte) 83, - (byte) 176, (byte) 177, (byte) 0, (byte) 130, (byte) 252, (byte) 227, (byte) 214, (byte) 180, (byte) 210, - (byte) 60, (byte) 47, (byte) 35, (byte) 156, (byte) 212, (byte) 144, (byte) 198, (byte) 20, (byte) 142, - (byte) 42, (byte) 114, (byte) 163, (byte) 56, (byte) 29, (byte) 235, (byte) 174, (byte) 49, (byte) 81, - (byte) 86, (byte) 71, (byte) 28, (byte) 230, (byte) 228, (byte) 238, (byte) 204, (byte) 125, (byte) 86, - (byte) 216, (byte) 161, (byte) 89, (byte) 194, (byte) 251, (byte) 54, (byte) 59, (byte) 84, (byte) 105, - (byte) 40, (byte) 40, (byte) 174, (byte) 189, (byte) 71, (byte) 167, (byte) 90, (byte) 223, (byte) 186, - (byte) 183, (byte) 89, (byte) 160, (byte) 42, (byte) 195, (byte) 130, (byte) 48, (byte) 107, (byte) 154, - (byte) 8, (byte) 246, (byte) 183, (byte) 13, (byte) 4, (byte) 199, (byte) 31, (byte) 221, (byte) 61, - (byte) 136, (byte) 172, (byte) 106, (byte) 199, (byte) 170, (byte) 58, (byte) 104, (byte) 78, (byte) 234, - (byte) 204, (byte) 149, (byte) 8, (byte) 147, (byte) 118, (byte) 72, (byte) 235, (byte) 154, (byte) 99, - (byte) 40, (byte) 42, (byte) 113, (byte) 131, (byte) 138, (byte) 35, (byte) 27, (byte) 36, (byte) 200, - (byte) 28, (byte) 19, (byte) 79, (byte) 102, (byte) 11, (byte) 209, (byte) 125, (byte) 248, (byte) 172, - (byte) 108, (byte) 117, (byte) 166, (byte) 85, (byte) 224, (byte) 238, (byte) 35, (byte) 29, (byte) 42, - (byte) 1, (byte) 57, (byte) 84, (byte) 62, (byte) 220, (byte) 1, (byte) 235, (byte) 83, (byte) 207, - (byte) 242, (byte) 41, (byte) 218, (byte) 58, (byte) 251, (byte) 209, (byte) 97, (byte) 109, (byte) 188, - (byte) 153, (byte) 88, (byte) 12, (byte) 3, (byte) 133, (byte) 250, (byte) 250, (byte) 213, (byte) 70, - (byte) 23, (byte) 100, (byte) 212, (byte) 154, (byte) 138, (byte) 185, (byte) 3, (byte) 104, (byte) 13, - (byte) 112, (byte) 158, (byte) 107, (byte) 204, (byte) 86, (byte) 86, (byte) 228, (byte) 140, (byte) 112, - (byte) 42, (byte) 75, (byte) 125, (byte) 60, (byte) 89, (byte) 194, (byte) 82, (byte) 89, (byte) 93, - (byte) 73, (byte) 63, (byte) 120, (byte) 30, (byte) 43, (byte) 105, (byte) 27, (byte) 229, (byte) 7, - (byte) 20, (byte) 247, (byte) 69, (byte) 117, (byte) 33, (byte) 128, (byte) 32, (byte) 245, (byte) 205, - (byte) 110, (byte) 233, (byte) 163, (byte) 139, (byte) 219, (byte) 73, (byte) 238, (byte) 103, (byte) 36, - (byte) 42, (byte) 121, (byte) 243, (byte) 73, (byte) 255, (byte) 0, (byte) 129, (byte) 84, (byte) 130, - (byte) 20, (byte) 35, (byte) 33, (byte) 219, (byte) 254, (byte) 250, (byte) 172, (byte) 251, (byte) 203, - (byte) 83, (byte) 167, (byte) 75, (byte) 231, (byte) 196, (byte) 187, (byte) 161, (byte) 39, (byte) 230, - (byte) 83, (byte) 218, (byte) 174, (byte) 91, (byte) 205, (byte) 105, (byte) 60, (byte) 97, (byte) 208, - (byte) 168, (byte) 227, (byte) 167, (byte) 165, (byte) 100, (byte) 213, (byte) 141, (byte) 58, (byte) 93, - (byte) 18, (byte) 249, (byte) 49, (byte) 255, (byte) 0, (byte) 120, (byte) 243, (byte) 254, (byte) 213, - (byte) 30, (byte) 84, (byte) 93, (byte) 50, (byte) 127, (byte) 239, (byte) 170, (byte) 81, (byte) 228, - (byte) 15, (byte) 238, (byte) 81, (byte) 254, (byte) 142, (byte) 23, (byte) 248, (byte) 41, (byte) 8, - (byte) 60, (byte) 168, (byte) 127, (byte) 188, (byte) 127, (byte) 239, (byte) 170, (byte) 41, (byte) 63, - (byte) 209, (byte) 255, (byte) 0, (byte) 216, (byte) 162, (byte) 141, (byte) 7, (byte) 115, (byte) 67, - (byte) 29, (byte) 232, (byte) 199, (byte) 81, (byte) 235, (byte) 79, (byte) 160, (byte) 138, (byte) 163, - (byte) 51, (byte) 152, (byte) 117, (byte) 38, (byte) 233, (byte) 148, (byte) 15, (byte) 226, (byte) 34, - (byte) 180, (byte) 173, (byte) 237, (byte) 48, (byte) 1, (byte) 97, (byte) 255, (byte) 0, (byte) 214, - (byte) 169, (byte) 160, (byte) 176, (byte) 219, (byte) 44, (byte) 147, (byte) 75, (byte) 221, (byte) 142, - (byte) 209, (byte) 87, (byte) 226, (byte) 139, (byte) 208, (byte) 126, (byte) 116, (byte) 233, (byte) 210, - (byte) 183, (byte) 188, (byte) 199, (byte) 86, (byte) 173, (byte) 215, (byte) 42, (byte) 35, (byte) 142, - (byte) 53, (byte) 94, (byte) 49, (byte) 83, (byte) 249, (byte) 67, (byte) 32, (byte) 140, (byte) 84, - (byte) 137, (byte) 22, (byte) 57, (byte) 53, (byte) 32, (byte) 94, (byte) 245, (byte) 185, (byte) 206, - (byte) 49, (byte) 83, (byte) 10, (byte) 24, (byte) 118, (byte) 52, (byte) 253, (byte) 185, (byte) 96, - (byte) 77, (byte) 57, (byte) 70, (byte) 65, (byte) 200, (byte) 169, (byte) 54, (byte) 240, (byte) 41, - (byte) 12, (byte) 16, (byte) 238, (byte) 5, (byte) 79, (byte) 81, (byte) 84, (byte) 53, (byte) 61, - (byte) 60, (byte) 93, (byte) 33, (byte) 3, (byte) 135, (byte) 31, (byte) 116, (byte) 214, (byte) 134, - (byte) 222, (byte) 132, (byte) 83, (byte) 156, (byte) 110, (byte) 92, (byte) 142, (byte) 162, (byte) 144, - (byte) 211, (byte) 105, (byte) 221, (byte) 28, (byte) 121, (byte) 183, (byte) 185, (byte) 137, (byte) 138, - (byte) 156, (byte) 241, (byte) 237, (byte) 71, (byte) 152, (byte) 234, (byte) 62, (byte) 97, (byte) 205, - (byte) 116, (byte) 146, (byte) 91, (byte) 164, (byte) 255, (byte) 0, (byte) 49, (byte) 24, (byte) 35, - (byte) 140, (byte) 138, (byte) 161, (byte) 45, (byte) 178, (byte) 36, (byte) 152, (byte) 35, (byte) 154, - (byte) 194, (byte) 81, (byte) 104, (byte) 236, (byte) 133, (byte) 85, (byte) 35, (byte) 13, (byte) 163, - (byte) 121, (byte) 166, (byte) 85, (byte) 60, (byte) 100, (byte) 214, (byte) 196, (byte) 80, (byte) 4, - (byte) 9, (byte) 26, (byte) 224, (byte) 119, (byte) 168, (byte) 4, (byte) 5, (byte) 175, (byte) 14, - (byte) 209, (byte) 192, (byte) 239, (byte) 90, (byte) 98, (byte) 220, (byte) 44, (byte) 91, (byte) 137, - (byte) 201, (byte) 29, (byte) 42, (byte) 233, (byte) 167, (byte) 185, (byte) 157, (byte) 121, (byte) 105, - (byte) 98, (byte) 154, (byte) 41, (byte) 85, (byte) 83, (byte) 219, (byte) 161, (byte) 169, (byte) 151, - (byte) 142, (byte) 61, (byte) 63, (byte) 149, (byte) 72, (byte) 209, (byte) 0, (byte) 132, (byte) 122, - (byte) 115, (byte) 81, (byte) 99, (byte) 24, (byte) 173, (byte) 142, (byte) 113, (byte) 110, (byte) 33, - (byte) 73, (byte) 237, (byte) 200, (byte) 97, (byte) 199, (byte) 67, (byte) 244, (byte) 174, (byte) 94, - (byte) 214, (byte) 69, (byte) 176, (byte) 212, (byte) 222, (byte) 7, (byte) 251, (byte) 164, (byte) 227, - (byte) 165, (byte) 117, (byte) 145, (byte) 99, (byte) 12, (byte) 167, (byte) 21, (byte) 205, (byte) 248, - (byte) 146, (byte) 31, (byte) 42, (byte) 120, (byte) 231, (byte) 69, (byte) 231, (byte) 161, (byte) 250, - (byte) 138, (byte) 206, (byte) 162, (byte) 208, (byte) 214, (byte) 139, (byte) 215, (byte) 151, (byte) 185, - (byte) 171, (byte) 190, (byte) 35, (byte) 252, (byte) 56, (byte) 252, (byte) 40, (byte) 221, (byte) 22, - (byte) 51, (byte) 183, (byte) 255, (byte) 0, (byte) 29, (byte) 168, (byte) 236, (byte) 174, (byte) 60, - (byte) 251, (byte) 84, (byte) 125, (byte) 135, (byte) 36, (byte) 96, (byte) 212, (byte) 197, (byte) 184, - (byte) 255, (byte) 0, (byte) 86, (byte) 213, (byte) 137, (byte) 67, (byte) 124, (byte) 216, (byte) 191, - (byte) 186, (byte) 127, (byte) 239, (byte) 154, (byte) 41, (byte) 124, (byte) 207, (byte) 250, (byte) 100, - (byte) 223, (byte) 149, (byte) 20, (byte) 12, (byte) 209, (byte) 198, (byte) 120, (byte) 169, (byte) 35, - (byte) 143, (byte) 113, (byte) 246, (byte) 20, (byte) 152, (byte) 61, (byte) 106, (byte) 196, (byte) 73, - (byte) 182, (byte) 44, (byte) 250, (byte) 214, (byte) 145, (byte) 87, (byte) 102, (byte) 82, (byte) 118, - (byte) 34, (byte) 88, (byte) 183, (byte) 201, (byte) 147, (byte) 208, (byte) 118, (byte) 171, (byte) 11, - (byte) 31, (byte) 124, (byte) 83, (byte) 97, (byte) 24, (byte) 82, (byte) 125, (byte) 77, (byte) 90, - (byte) 3, (byte) 3, (byte) 21, (byte) 165, (byte) 204, (byte) 200, (byte) 74, (byte) 99, (byte) 154, - (byte) 66, (byte) 184, (byte) 197, (byte) 78, (byte) 87, (byte) 62, (byte) 244, (byte) 214, (byte) 92, - (byte) 227, (byte) 210, (byte) 139, (byte) 136, (byte) 131, (byte) 163, (byte) 98, (byte) 165, (byte) 2, - (byte) 145, (byte) 151, (byte) 231, (byte) 252, (byte) 42, (byte) 80, (byte) 56, (byte) 161, (byte) 140, - (byte) 140, (byte) 112, (byte) 219, (byte) 79, (byte) 122, (byte) 90, (byte) 71, (byte) 24, (byte) 193, - (byte) 29, (byte) 169, (byte) 123, (byte) 231, (byte) 214, (byte) 129, (byte) 145, (byte) 178, (byte) 158, - (byte) 171, (byte) 138, (byte) 169, (byte) 120, (byte) 141, (byte) 144, (byte) 248, (byte) 233, (byte) 214, - (byte) 175, (byte) 16, (byte) 122, (byte) 83, (byte) 72, (byte) 12, (byte) 118, (byte) 176, (byte) 224, - (byte) 138, (byte) 26, (byte) 186, (byte) 176, (byte) 70, (byte) 78, (byte) 46, (byte) 230, (byte) 84, - (byte) 17, (byte) 147, (byte) 48, (byte) 53, (byte) 121, (byte) 211, (byte) 10, (byte) 5, (byte) 71, - (byte) 111, (byte) 9, (byte) 75, (byte) 135, (byte) 95, (byte) 238, (byte) 244, (byte) 171, (byte) 18, - (byte) 142, (byte) 71, (byte) 214, (byte) 148, (byte) 21, (byte) 145, (byte) 85, (byte) 37, (byte) 205, - (byte) 34, (byte) 177, (byte) 4, (byte) 231, (byte) 138, (byte) 132, (byte) 175, (byte) 31, (byte) 90, - (byte) 182, (byte) 87, (byte) 4, (byte) 212, (byte) 44, (byte) 160, (byte) 49, (byte) 21, (byte) 68, - (byte) 21, (byte) 199, (byte) 202, (byte) 224, (byte) 254, (byte) 117, (byte) 71, (byte) 196, (byte) 16, - (byte) 249, (byte) 154, (byte) 116, (byte) 140, (byte) 163, (byte) 37, (byte) 112, (byte) 195, (byte) 250, - (byte) 214, (byte) 139, (byte) 167, (byte) 28, (byte) 117, (byte) 166, (byte) 74, (byte) 162, (byte) 88, - (byte) 25, (byte) 8, (byte) 206, (byte) 84, (byte) 138, (byte) 77, (byte) 93, (byte) 21, (byte) 23, - (byte) 102, (byte) 153, (byte) 207, (byte) 104, (byte) 55, (byte) 18, (byte) 24, (byte) 90, (byte) 61, - (byte) 160, (byte) 224, (byte) 250, (byte) 214, (byte) 182, (byte) 249, (byte) 127, (byte) 184, (byte) 63, - (byte) 58, (byte) 231, (byte) 52, (byte) 150, (byte) 150, (byte) 45, (byte) 65, (byte) 145, (byte) 72, - (byte) 29, (byte) 143, (byte) 21, (byte) 209, (byte) 126, (byte) 255, (byte) 0, (byte) 213, (byte) 115, - (byte) 88, (byte) 29, (byte) 19, (byte) 90, (byte) 134, (byte) 249, (byte) 255, (byte) 0, (byte) 184, - (byte) 159, (byte) 157, (byte) 20, (byte) 126, (byte) 251, (byte) 213, (byte) 127, (byte) 42, (byte) 40, - (byte) 185, (byte) 54, (byte) 53, (byte) 209, (byte) 114, (byte) 192, (byte) 26, (byte) 179, (byte) 39, - (byte) 220, (byte) 0, (byte) 81, (byte) 69, (byte) 109, (byte) 29, (byte) 140, (byte) 36, (byte) 245, - (byte) 31, (byte) 18, (byte) 141, (byte) 192, (byte) 122, (byte) 10, (byte) 177, (byte) 138, (byte) 40, - (byte) 160, (byte) 66, (byte) 116, (byte) 56, (byte) 161, (byte) 128, (byte) 234, (byte) 40, (byte) 162, - (byte) 129, (byte) 12, (byte) 97, (byte) 215, (byte) 233, (byte) 73, (byte) 25, (byte) 36, (byte) 81, - (byte) 69, (byte) 3, (byte) 7, (byte) 25, (byte) 28, (byte) 83, (byte) 87, (byte) 238, (byte) 224, - (byte) 209, (byte) 69, (byte) 48, (byte) 23, (byte) 60, (byte) 82, (byte) 48, (byte) 252, (byte) 232, - (byte) 162, (byte) 128, (byte) 19, (byte) 0, (byte) 190, (byte) 238, (byte) 132, (byte) 140, (byte) 26, - (byte) 107, (byte) 140, (byte) 156, (byte) 122, (byte) 81, (byte) 69, (byte) 2, (byte) 68, (byte) 108, - (byte) 188, (byte) 212, (byte) 110, (byte) 189, (byte) 40, (byte) 162, (byte) 129, (byte) 145, (byte) 55, - (byte) 99, (byte) 81, (byte) 72, (byte) 187, (byte) 64, (byte) 97, (byte) 235, (byte) 69, (byte) 20, - (byte) 193, (byte) 28, (byte) 124, (byte) 136, (byte) 209, (byte) 235, (byte) 178, (byte) 5, (byte) 114, - (byte) 191, (byte) 188, (byte) 61, (byte) 43, (byte) 162, (byte) 242, (byte) 164, (byte) 219, (byte) 254, - (byte) 185, (byte) 191, (byte) 33, (byte) 69, (byte) 21, (byte) 206, (byte) 247, (byte) 58, (byte) 166, - (byte) 244, (byte) 66, (byte) 249, (byte) 18, (byte) 255, (byte) 0, (byte) 207, (byte) 193, (byte) 255, - (byte) 0, (byte) 190, (byte) 104, (byte) 162, (byte) 138, (byte) 68, (byte) 159, (byte) 255, (byte) 217 - - }; - -} diff --git a/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java deleted file mode 100644 index 95fb2f0..0000000 --- a/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.IOException; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; - -public class PSystemRIPFactory extends PSystemSingleLineFactory { - - @Override - protected AbstractPSystem executeLine(String line) { - if (line.equalsIgnoreCase("jean canouet")) { - try { - return new PSystemRIP(); - } catch (IOException e) { - Log.error("Error " + e); - e.printStackTrace(); - } - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java b/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java deleted file mode 100644 index 37902a2..0000000 --- a/src/net/sourceforge/plantuml/eggs/SentenceDecoder.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.UnsupportedEncodingException; - -public class SentenceDecoder { - - private final String secret; - - public SentenceDecoder(String sentence1, byte[] crypted) throws UnsupportedEncodingException { - final byte[] key = EggUtils.fromSecretSentence(sentence1).toByteArray(); - final byte[] sen2 = EggUtils.xor(crypted, key); - this.secret = new String(sen2, "UTF-8"); - } - - public boolean isOk() { - for (char c : secret.toCharArray()) { - if ((int) c > 256) { - return false; - } - if (Character.isDefined(c) == false) { - return false; - } - if (Character.isISOControl(c)) { - return false; - } - } - return true; - } - - public String getSecret() { - return secret; - } - -} diff --git a/src/net/sourceforge/plantuml/eggs/SentenceProducer.java b/src/net/sourceforge/plantuml/eggs/SentenceProducer.java deleted file mode 100644 index 88124c0..0000000 --- a/src/net/sourceforge/plantuml/eggs/SentenceProducer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.eggs; - -import java.io.UnsupportedEncodingException; - -public class SentenceProducer { - - private final String secret; - - public SentenceProducer(String sentence1, String sentence2) throws UnsupportedEncodingException { - final byte[] key = EggUtils.fromSecretSentence(sentence1).toByteArray(); - final byte[] sen2 = sentence2.getBytes("UTF-8"); - final byte[] crypted = EggUtils.xor(sen2, key); - this.secret = EggUtils.fromByteArrays(crypted); - } - - public String getSecret() { - return secret; - } - -} diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java index c0ad1a3..4cf8b7f 100644 --- a/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java +++ b/src/net/sourceforge/plantuml/flashcode/FlashCodeFactory.java @@ -38,17 +38,7 @@ package net.sourceforge.plantuml.flashcode; public class FlashCodeFactory { public static FlashCodeUtils getFlashCodeUtils() { - final String name = "net.sourceforge.plantuml.flashcode.FlashCodeUtilsZxing"; - try { - final Class cl = Class.forName(name); - return (FlashCodeUtils) cl.newInstance(); - } catch (ClassNotFoundException e) { - return new FlashCodeUtilsNone(); - } catch (InstantiationException e) { - return new FlashCodeUtilsNone(); - } catch (IllegalAccessException e) { - return new FlashCodeUtilsNone(); - } + return new FlashCodeUtilsZxing(); } } diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java deleted file mode 100644 index b5d496d..0000000 --- a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsNone.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.flashcode; - -import java.awt.Color; -import java.awt.image.BufferedImage; - -public class FlashCodeUtilsNone implements FlashCodeUtils { - - public BufferedImage exportFlashcode(String s, Color fore, Color back) { - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/ftp/FtpConnexion.java b/src/net/sourceforge/plantuml/ftp/FtpConnexion.java deleted file mode 100644 index 2ff0369..0000000 --- a/src/net/sourceforge/plantuml/ftp/FtpConnexion.java +++ /dev/null @@ -1,206 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.ftp; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -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.BlockUml; -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.SourceStringReader; -import net.sourceforge.plantuml.core.DiagramDescription; - -public class FtpConnexion { - - private final String user; - private final Map incoming = new HashMap(); - private final Map outgoing = new HashMap(); - private final Set futureOutgoing = new HashSet(); - - private FileFormat fileFormat; - - public FtpConnexion(String user, FileFormat defaultfileFormat) { - this.user = user; - this.fileFormat = defaultfileFormat; - } - - public synchronized void addIncoming(String fileName, String data) { - if (fileName.startsWith("/")) { - throw new IllegalArgumentException(); - } - incoming.put(fileName, data); - } - - public synchronized void futureOutgoing(String fileName) { - outgoing.remove(fileName); - futureOutgoing.add(fileName); - } - - public synchronized Collection getFiles() { - final List result = new ArrayList(incoming.keySet()); - result.addAll(outgoing.keySet()); - result.addAll(futureOutgoing); - return Collections.unmodifiableCollection(result); - } - - public synchronized boolean willExist(String fileName) { - if (incoming.containsKey(fileName)) { - return true; - } - if (outgoing.containsKey(fileName)) { - return true; - } - if (futureOutgoing.contains(fileName)) { - return true; - } - return false; - } - - public synchronized boolean doesExist(String fileName) { - if (incoming.containsKey(fileName)) { - return true; - } - if (outgoing.containsKey(fileName)) { - return true; - } - return false; - } - - public synchronized byte[] getData(String fileName) throws InterruptedException { - if (fileName.startsWith("/")) { - throw new IllegalArgumentException(); - } - final String data = incoming.get(fileName); - if (data != null) { - return data.getBytes(); - } - // do { - // if (willExist(fileName) == false) { - // return null; - // } - final byte data2[] = outgoing.get(fileName); - if (data2 == null) { - return new byte[1]; - } - // if (data2 != null) { - return data2; - // } - // Thread.sleep(200L); - // } while (true); - } - - public synchronized int getSize(String fileName) { - if (fileName.startsWith("/")) { - throw new IllegalArgumentException(); - } - final String data = incoming.get(fileName); - if (data != null) { - return data.length(); - } - final byte data2[] = outgoing.get(fileName); - if (data2 != null) { - return data2.length; - } - return 0; - } - - public void processImage(String fileName) throws IOException { - if (fileName.startsWith("/")) { - throw new IllegalArgumentException(); - } - final String pngFileName = getFutureFileName(fileName); - boolean done = false; - try { - final SourceStringReader sourceStringReader = new SourceStringReader(incoming.get(fileName)); - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - final FileFormat format = getFileFormat(); - final DiagramDescription desc = sourceStringReader.generateDiagramDescription(new FileFormatOption(format)); - final List blocks = sourceStringReader.getBlocks(); - if (blocks.size() > 0) { - blocks.get(0).getDiagram().exportDiagram(baos, 0, new FileFormatOption(format)); - } - final String errorFileName = pngFileName.substring(0, pngFileName.length() - 4) + ".err"; - synchronized (this) { - outgoing.remove(pngFileName); - futureOutgoing.remove(pngFileName); - outgoing.remove(errorFileName); - if (desc != null && desc.getDescription() != null) { - outgoing.put(pngFileName, baos.toByteArray()); - done = true; - if (desc.getDescription().startsWith("(Error)")) { - final ByteArrayOutputStream errBaos = new ByteArrayOutputStream(); - sourceStringReader.outputImage(errBaos, new FileFormatOption(FileFormat.ATXT)); - errBaos.close(); - outgoing.put(errorFileName, errBaos.toByteArray()); - } - } - } - } finally { - if (done == false) { - outgoing.put(pngFileName, new byte[0]); - } - } - } - - public String getFutureFileName(String fileName) { - return getFileFormat().changeName(fileName, 0); - } - - private FileFormat getFileFormat() { - return fileFormat; - } - - public synchronized void delete(String fileName) { - incoming.remove(fileName); - outgoing.remove(fileName); - futureOutgoing.add(fileName); - } - - public void setFileFormat(FileFormat fileFormat) { - this.fileFormat = fileFormat; - - } - -} diff --git a/src/net/sourceforge/plantuml/ftp/FtpLoop.java b/src/net/sourceforge/plantuml/ftp/FtpLoop.java deleted file mode 100644 index 06d21c8..0000000 --- a/src/net/sourceforge/plantuml/ftp/FtpLoop.java +++ /dev/null @@ -1,333 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.ftp; - -// server - -// FtpServer.java -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.UnknownHostException; -import java.util.Collection; -import java.util.StringTokenizer; - -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileUtils; -import net.sourceforge.plantuml.StringUtils; - -class FtpLoop implements Runnable { - enum Mode { - ACTIF, PASSIF - }; - - final private Socket incoming; - final private FtpServer ftpServer; - final private BufferedReader br; - final private PrintWriter pw; - - private FtpConnexion connexion; - private String ipClient = null; - private int port = -1; - private Mode mode; - - public FtpLoop(Socket socket, FtpServer ftpServer) throws IOException { - this.incoming = socket; - this.ftpServer = ftpServer; - this.br = new BufferedReader(new InputStreamReader(incoming.getInputStream(), ftpServer.getCharset())); - this.pw = new PrintWriter(incoming.getOutputStream(), true); - } - - // http://www.ncftp.com/libncftp/doc/ftp_overview.html - // http://www.nsftools.com/tips/RawFTP.htm - // http://www.commentcamarche.net/contents/internet/ftp.php3 - // http://en.wikipedia.org/wiki/List_of_FTP_server_return_codes - // http://www.freefire.org/articles/ftpexample.php - // http://forum.hardware.fr/hfr/Programmation/VB-VBA-VBS/transfert-sujet_59989_1.htm - // http://www.excel-downloads.com/forum/104130-telechargement-ftp-via-vba.html - // http://www.pcreview.co.uk/forums/ftp-vba-macro-t949945.html - private void runInternal() throws IOException, InterruptedException { - localLog("Starting Loop"); - myOut("220 PlantUML"); - while (true) { - final String s = br.readLine(); - localLog("s=" + s); - if (s == null) { - pw.close(); - br.close(); - return; - } - final boolean finish = manage(s); - if (finish) { - return; - } - } - } - - private boolean manage(final String cmd) throws UnknownHostException, IOException, InterruptedException { - final String upper = StringUtils.goUpperCase(cmd); - if (upper.startsWith("USER")) { - myOut("331 Password required"); - final String user = cmd.substring("USER ".length()); - connexion = ftpServer.getFtpConnexion(user); - } else if (upper.startsWith("PASS")) { - myOut("230 Logged in."); - } else if (upper.startsWith("PWD")) { - // myOut("/"); - // myOut("200 OK /"); - myOut("257 \"/\" is current directory."); - } else if (upper.startsWith("CWD")) { - final String dir = cmd.substring("CWD ".length()); - myOut("250 \"" + dir + "\" is new working directory.."); - } else if (upper.startsWith("TYPE")) { - myOut("200 Command okay."); - // localLog("type=" + s); - } else if (upper.startsWith("PORT")) { - mode = Mode.ACTIF; - final StringTokenizer st = new StringTokenizer(cmd, " ,"); - st.nextToken(); - ipClient = st.nextToken() + "." + st.nextToken() + "." + st.nextToken() + "." + st.nextToken(); - port = Integer.parseInt(st.nextToken()) * 256 + Integer.parseInt(st.nextToken()); - // localLog("ipClient=" + ipClient); - // localLog("port=" + port); - - myOut("200 Command okay."); - } else if (upper.startsWith("LIST")) { - if (mode == Mode.ACTIF) { - listActif(); - } else { - listPassif(); - } - } else if (upper.startsWith("STOR")) { - if (mode == Mode.ACTIF) { - storActif(cmd); - } else { - storPassif(cmd); - } - } else if (upper.startsWith("PASV")) { - mode = Mode.PASSIF; - port = ftpServer.getFreePort(); - final int p1 = port / 256; - final int p2 = port % 256; - assert port == p1 * 256 + p2; - localLog("adr=" + incoming.getInetAddress().getHostAddress()); - final String ipServer = ftpServer.getIpServer(); - localLog("server=" + ipServer); - myOut("227 Entering Passive Mode (" + ipServer.replace('.', ',') + "," + p1 + "," + p2 + ")."); - ipClient = ipServer; - } else if (upper.startsWith("RETR")) { - if (mode == Mode.ACTIF) { - retrActif(cmd); - } else { - retrPassif(cmd); - } - } else if (upper.startsWith("DELE")) { - final String file = cmd.substring("DELE ".length()); - connexion.delete(file); - myOut("200 Command okay."); - } else if (upper.startsWith("QUIT")) { - myOut("221 Goodbye."); - return true; - } else if (upper.startsWith("SYST")) { - myOut("215 UNIX Type: L8."); - } else { - myOut("502 Command not implemented."); - } - return false; - } - - private void localLog(String s) { - } - - private void retr(final String fileName, Socket soc) throws UnknownHostException, IOException, InterruptedException { - final OutputStream os = soc.getOutputStream(); - final byte[] data = connexion.getData(fileName); - - if (data != null) { - os.write(data); - } - os.flush(); - os.close(); - soc.close(); - myOut("226 Transfer complete."); - } - - private void retrPassif(final String s) throws UnknownHostException, IOException, InterruptedException { - String fileName = s.substring("STOR ".length()); - fileName = removeStartingsSlash(fileName); - if (connexion.willExist(fileName) == false) { - myOut("550 No such file."); - return; - } - myOut("150 Opening"); - waitForMe(fileName); - final ServerSocket ss = new ServerSocket(port); - final Socket incoming = ss.accept(); - retr(fileName, incoming); - ss.close(); - } - - private void waitForMe(String fileName) throws InterruptedException { - do { - if (connexion.doesExist(fileName)) { - return; - } - Thread.sleep(200L); - } while (true); - } - - private void retrActif(final String s) throws UnknownHostException, IOException, InterruptedException { - String fileName = s.substring("STOR ".length()); - fileName = removeStartingsSlash(fileName); - if (connexion.willExist(fileName) == false) { - myOut("550 No such file."); - return; - } - myOut("150 Opening"); - waitForMe(fileName); - final Socket soc = new Socket(ipClient, port); - retr(fileName, soc); - } - - private void storActif(final String s) throws IOException { - final String fileName = removeStartingsSlash(s.substring("STOR ".length())); - myOut("150 FILE: " + fileName); - final Socket soc = new Socket(ipClient, port); - stor(fileName, soc); - } - - private void storPassif(final String s) throws IOException { - final String fileName = removeStartingsSlash(s.substring("STOR ".length())); - myOut("150 FILE: " + fileName); - final ServerSocket ss = new ServerSocket(port); - final Socket incoming = ss.accept(); - stor(fileName, incoming); - ss.close(); - } - - private String removeStartingsSlash(String fileName) { - while (fileName.startsWith("/")) { - fileName = fileName.substring(1); - } - return fileName; - } - - private void stor(String fileName, Socket socket) throws UnknownHostException, IOException { - final InputStream is = socket.getInputStream(); - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - FileUtils.copyToStream(is, baos); - - myOut("226 Transfer complete."); - - if ("png".equalsIgnoreCase(fileName)) { - connexion.setFileFormat(FileFormat.PNG); - } else if ("svg".equalsIgnoreCase(fileName)) { - connexion.setFileFormat(FileFormat.SVG); - } else if ("eps".equalsIgnoreCase(fileName)) { - connexion.setFileFormat(FileFormat.EPS); - } - - if (fileName.length() > 3) { - final String data = new String(baos.toByteArray(), ftpServer.getCharset()); - final String pngFileName = connexion.getFutureFileName(fileName); - connexion.futureOutgoing(pngFileName); - connexion.addIncoming(fileName, data); - - ftpServer.processImage(connexion, fileName); - } - } - - private void listActif() throws UnknownHostException, IOException { - myOut("150 Opening ASCII mode data"); - final Socket soc = new Socket(ipClient, port); - list(soc); - } - - private void listPassif() throws UnknownHostException, IOException { - myOut("150 Opening ASCII mode data"); - final ServerSocket ss = new ServerSocket(port); - final Socket incoming = ss.accept(); - list(incoming); - ss.close(); - } - - private void list(final Socket soc) throws IOException { - final PrintWriter listing = new PrintWriter(soc.getOutputStream(), true); - final Collection files = connexion.getFiles(); - if (files.size() > 0) { - int total = 0; - for (String n : files) { - total += (connexion.getSize(n) + 511) / 512; - } - listing.println("total " + total); - // localLog(total); - for (String n : files) { - final String ls = String.format("%10s %4d %-8s %-8s %8d %3s %2s %5s %s", "-rw-rw-r--", 1, "plantuml", - "plantuml", connexion.getSize(n), "Sep", 28, 2006, n); - listing.println(ls); - // localLog(ls); - } - } - listing.flush(); - listing.close(); - soc.close(); - myOut("226 Listing completed."); - } - - private void myOut(String s) { - if (s.indexOf('\t') != -1) { - throw new IllegalArgumentException(); - } - pw.println(s); - pw.flush(); - } - - public void run() { - try { - runInternal(); - } catch (Throwable t) { - t.printStackTrace(); - } - - } - -} diff --git a/src/net/sourceforge/plantuml/ftp/FtpServer.java b/src/net/sourceforge/plantuml/ftp/FtpServer.java deleted file mode 100644 index b6f0a7a..0000000 --- a/src/net/sourceforge/plantuml/ftp/FtpServer.java +++ /dev/null @@ -1,128 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.ftp; - -// server - -// FtpServer.java -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.Map; -import java.util.TreeMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import net.sourceforge.plantuml.FileFormat; - -public class FtpServer { - - private final Map datas = new TreeMap(); - private final ExecutorService exeImage = Executors.newFixedThreadPool(2); - private final String charset = "UTF-8"; - - private final int listenPort; - - private int portFree = 10042; - private String ip; - private final FileFormat defaultfileFormat; - - public FtpServer(int listenPort, FileFormat defaultfileFormat) { - this.listenPort = listenPort; - this.defaultfileFormat = defaultfileFormat == null ? FileFormat.PNG : defaultfileFormat; - } - - public synchronized int getFreePort() { - portFree++; - // Log.println("port=" + portFree); - return portFree; - } - - public void go() throws IOException { - final ServerSocket s = new ServerSocket(listenPort); - final ExecutorService exe = Executors.newCachedThreadPool(); - while (true) { - final Socket incoming = s.accept(); - ip = incoming.getLocalAddress().getHostAddress(); - System.out.println("New Client Connected from " + incoming.getInetAddress().getHostName() + "... "); - exe.submit(new FtpLoop(incoming, this)); - } - } - - public String getIpServer() { - return ip; - } - - public synchronized FtpConnexion getFtpConnexion(String user) { - if (user == null) { - throw new IllegalArgumentException(); - } - FtpConnexion data = datas.get(user); - if (data == null) { - data = new FtpConnexion(user, defaultfileFormat); - datas.put(user, data); - } - return data; - } - - public static void main(String[] args) throws IOException { - System.out.println("****************************** ************************************************** "); - System.out.println("****************************** FTP SERVER***********************************"); - - System.out.println("****************************** ************************************************** "); - System.out.println("Server Started..."); - System.out.println("Waiting for connections..."); - System.out.println(" "); - new FtpServer(4242, FileFormat.PNG).go(); - } - - public void processImage(final FtpConnexion connexion, final String name) { - exeImage.submit(new Runnable() { - public void run() { - try { - connexion.processImage(name); - } catch (IOException e) { - e.printStackTrace(); - } - } - }); - } - - public final String getCharset() { - return charset; - } - -} diff --git a/src/net/sourceforge/plantuml/geom/AbstractFigure.java b/src/net/sourceforge/plantuml/geom/AbstractFigure.java deleted file mode 100644 index a49223c..0000000 --- a/src/net/sourceforge/plantuml/geom/AbstractFigure.java +++ /dev/null @@ -1,315 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -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.Log; - -abstract class AbstractFigure { - - private final Set segments = new HashSet(); - - @Override - public String toString() { - return segments.toString(); - } - - @Override - final public boolean equals(Object obj) { - final AbstractFigure other = (AbstractFigure) obj; - return segments.equals(other.segments); - } - - @Override - final public int hashCode() { - return segments.hashCode(); - } - - protected boolean knowThisPoint(Point2DInt p) { - for (LineSegmentInt seg : segments) { - if (seg.getP1().equals(p) || seg.getP2().equals(p)) { - return true; - } - } - return false; - } - - LineSegmentInt existingSegment(Point2DInt p1, Point2DInt p2) { - for (LineSegmentInt seg : segments) { - if (seg.getP1().equals(p1) && seg.getP2().equals(p2)) { - return seg; - } - if (seg.getP1().equals(p2) && seg.getP2().equals(p1)) { - return seg; - } - } - return null; - } - - Collection getSegmentsWithExtremity(Point2DInt extremity, Collection exceptions) { - final Collection result = new HashSet(); - for (LineSegmentInt seg : segments) { - if (exceptions.contains(seg)) { - continue; - } - if (seg.getP1().equals(extremity) || seg.getP2().equals(extremity)) { - result.add(seg); - } - } - return Collections.unmodifiableCollection(result); - } - - public void addSegment(LineSegmentInt seg) { - segments.add(seg); - } - - protected final Set getSegments() { - return Collections.unmodifiableSet(segments); - } - - @Deprecated - public Polyline addPath(Point2DInt start, Point2DInt end) { - if (knowThisPoint(start) && knowThisPoint(end)) { - return getPath(start, end); - } - final LineSegmentInt direct = new LineSegmentInt(start, end); - addSegment(direct); - return new PolylineImpl(start, end); - } - - public Polyline addDirectLink(Point2DInt start, Point2DInt end) { - final LineSegmentInt direct = new LineSegmentInt(start, end); - addSegment(direct); - Log.println("AbstractFigure::addDirectLink " + direct); - return new PolylineImpl(start, end); - } - - public boolean isSimpleSegmentPossible(Point2DInt start, Point2DInt end) { - final LineSegmentInt direct = new LineSegmentInt(start, end); - return hasIntersectionStrict(direct) == false; - } - - public Polyline getPath(Pointable start, Pointable end) { - if (knowThisPoint(start.getPosition()) == false) { - throw new IllegalArgumentException(); - } - if (knowThisPoint(end.getPosition()) == false) { - throw new IllegalArgumentException("" + end.getPosition()); - } - if (isSimpleSegmentPossible(start.getPosition(), end.getPosition())) { - throw new IllegalArgumentException(); - // return new PolylineImpl(start, end); - } - if (arePointsConnectable(start.getPosition(), end.getPosition()) == false) { - return null; - } - return findBestPath(start, end); - } - - private Polyline findBestPath(Pointable start, Pointable end) { - Log.println("start=" + start.getPosition()); - Log.println("end=" + end.getPosition()); - final Set points = getAllPoints(); - if (points.contains(start.getPosition()) == false || points.contains(end.getPosition()) == false) { - throw new IllegalArgumentException(); - } - points.remove(start.getPosition()); - points.remove(end.getPosition()); - final List neighborhoods = new ArrayList(); - for (Point2DInt p : points) { - neighborhoods.addAll(getSingularity(p).getNeighborhoods()); - } - for (int i = 0; i < neighborhoods.size(); i++) { - Log.println("N" + (i + 1) + " " + neighborhoods.get(i)); - } - final Dijkstra dijkstra = new Dijkstra(neighborhoods.size() + 2); - Log.println("size=" + dijkstra.getSize()); - for (int i = 0; i < neighborhoods.size(); i++) { - if (isConnectable(start.getPosition(), neighborhoods.get(i))) { - dijkstra.addLink(0, i + 1, distance(start.getPosition(), neighborhoods.get(i).getCenter())); - } - } - for (int i = 0; i < neighborhoods.size(); i++) { - for (int j = 0; j < neighborhoods.size(); j++) { - if (i == j) { - continue; - } - if (isConnectable(neighborhoods.get(i), neighborhoods.get(j))) { - dijkstra.addLink(i + 1, j + 1, distance(neighborhoods.get(i).getCenter(), neighborhoods.get(j) - .getCenter())); - } - } - } - for (int i = 0; i < neighborhoods.size(); i++) { - if (isConnectable(end.getPosition(), neighborhoods.get(i))) { - dijkstra.addLink(i + 1, neighborhoods.size() + 1, distance(end.getPosition(), neighborhoods.get(i) - .getCenter())); - } - } - final List path = dijkstra.getBestPath(); - if (path.get(path.size() - 1) != neighborhoods.size() + 1) { - throw new IllegalStateException("No Path"); - } - assert path.size() > 2; - - Log.println("PATH=" + path); - final List usedNeighborhoods = new ArrayList(); - for (int i = 1; i < path.size() - 1; i++) { - final int idx = path.get(i) - 1; - usedNeighborhoods.add(neighborhoods.get(idx)); - } - return findApproximatePath(start, end, usedNeighborhoods); - } - - private Polyline findApproximatePath(Pointable start, Pointable end, final List neighborhoods) { - System.err - .println("findApproximatePath " + start.getPosition() + " " + end.getPosition() + " " + neighborhoods); - final PolylineImpl result = new PolylineImpl(start, end); - for (Neighborhood n : neighborhoods) { - Log.println("Neighborhood =" + n); - final double d = getProximaDistance(n.getCenter()) / 2; - final double a = n.getMiddle(); - Log.println("d=" + d); - Log.println("a=" + a * 180 / Math.PI); - final double deltaX = d * Math.cos(a); - final double deltaY = d * Math.sin(a); - assert d > 0; - Log.println("Result = " + n.getCenter().translate((int) deltaX, (int) deltaY)); - result.addIntermediate(n.getCenter().translate((int) deltaX, (int) deltaY)); - } - return result; - } - - private double getProximaDistance(Point2DInt center) { - double result = Double.MAX_VALUE; - for (Point2DInt p : getAllPoints()) { - if (center.equals(p)) { - continue; - } - final double cur = new LineSegmentInt(p, center).getLength(); - result = Math.min(result, cur); - } - return result; - } - - static private double distance(Point2DInt p1, Point2DInt p2) { - return new LineSegmentInt(p1, p2).getLength(); - } - - public boolean isConnectable(Point2DInt p, Neighborhood n) { - final LineSegmentInt seg = new LineSegmentInt(n.getCenter(), p); - if (hasIntersectionStrict(seg)) { - return false; - } - final double angle = Singularity.convertAngle(seg.getAngle()); - return n.isInAngleLarge(angle); - } - - public boolean isConnectable(Neighborhood n1, Neighborhood n2) { - final boolean result = isConnectableInternal(n1, n2); - assert result == isConnectableInternal(n2, n1); - return result; - } - - private boolean isConnectableInternal(Neighborhood n1, Neighborhood n2) { - if (n1.getCenter().equals(n2.getCenter())) { - return false; - } - final LineSegmentInt seg1 = new LineSegmentInt(n1.getCenter(), n2.getCenter()); - if (hasIntersectionStrict(seg1)) { - return false; - } - final double angle1 = Singularity.convertAngle(seg1.getAngle()); - final double angle2 = Singularity.convertAngle(seg1.getOppositeAngle()); - assert angle2 == Singularity.convertAngle(new LineSegmentInt(n2.getCenter(), n1.getCenter()).getAngle()); - if (n1.isInAngleStrict(angle1) && n2.isInAngleStrict(angle2)) { - return true; - } - if (n1.isAngleLimit(angle1) && n2.isAngleLimit(angle2)) { - if (n1.is360() || n2.is360()) { - return true; - } - final Orientation o1 = n1.getOrientationFrom(angle1); - final Orientation o2 = n2.getOrientationFrom(angle2); - return o1 != o2; - } - return false; - } - - private boolean hasIntersectionStrict(LineSegmentInt direct) { - for (LineSegmentInt seg : getSegments()) { - if (seg.atLeastOneCommonExtremities(direct)) { - continue; - } - if (seg.doesIntersect(direct)) { - Log.println("seg=" + seg); - Log.println("direct=" + direct); - Log.println("AbstractFigure::hasIntersectionStrict true"); - return true; - } - } - Log.println("AbstractFigure::hasIntersectionStrict false"); - return false; - } - - public Singularity getSingularity(Point2DInt center) { - final Singularity singularity = new Singularity(center); - for (LineSegmentInt seg : getSegments()) { - if (seg.containsPoint(center)) { - singularity.addLineSegment(seg); - } - } - return singularity; - } - - private Set getAllPoints() { - final Set result = new HashSet(); - for (LineSegmentInt seg : segments) { - result.add(seg.getP1()); - result.add(seg.getP2()); - } - return result; - } - - abstract boolean arePointsConnectable(Point2DInt p1, Point2DInt p2); - -} diff --git a/src/net/sourceforge/plantuml/geom/AbstractPolyline.java b/src/net/sourceforge/plantuml/geom/AbstractPolyline.java deleted file mode 100644 index bc0c1af..0000000 --- a/src/net/sourceforge/plantuml/geom/AbstractPolyline.java +++ /dev/null @@ -1,200 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.awt.geom.GeneralPath; - -abstract class AbstractPolyline implements Polyline { - - private final Pointable start; - private final Pointable end; - - public AbstractPolyline(Pointable start, Pointable end) { - this.start = start; - this.end = end; - } - - @Override - final public String toString() { - return segments().toString(); - } - - final public boolean doesTouch(Polyline other) { - final boolean result = doesTouchInternal(other); - assert result == ((AbstractPolyline) other).doesTouchInternal(this); - return result; - } - - private boolean doesTouchInternal(Polyline other) { - for (int i = 0; i < nbSegments(); i++) { - final LineSegmentInt seg1 = segments().get(i); - for (int j = 0; j < other.nbSegments(); j++) { - final LineSegmentInt seg2 = other.segments().get(j); - final boolean ignoreExtremities = i == 0 || i == nbSegments() - 1 || j == 0 - || j == other.nbSegments() - 1; - if (ignoreExtremities == false && seg1.doesIntersect(seg2)) { - return true; - } - if (ignoreExtremities && seg1.doesIntersectButNotSameExtremity(seg2)) { - return true; - } - } - } - return false; - } - - final public LineSegmentInt getFirst() { - return segments().get(0); - } - - final public LineSegmentInt getLast() { - return segments().get(nbSegments() - 1); - } - - final public double getLength() { - double result = 0; - for (LineSegmentInt seg : segments()) { - result += seg.getLength(); - } - return result; - } - - final public Point2DInt clipStart(Box box) { - assert box.doesIntersect(segments().get(0)); - final Point2DInt inter[] = box.intersect(segments().get(0)); - assert inter.length == 1; - segments().set( - 0, - new LineSegmentInt(inter[0].getXint(), inter[0].getYint(), segments().get(0).getP2().getXint(), - segments().get(0).getP2().getYint())); - return inter[0]; - } - - final public Point2DInt clipEnd(Box box) { - final int last = nbSegments() - 1; - if (last == -1) { - return null; - } - assert box.doesIntersect(segments().get(last)); - final Point2DInt inter[] = box.intersect(segments().get(last)); - assert inter.length == 1; - segments().set( - last, - new LineSegmentInt(segments().get(last).getP1().getXint(), segments().get(last).getP1().getYint(), - inter[0].getXint(), inter[0].getYint())); - return inter[0]; - } - - final public boolean intersectBox(Box b) { - for (LineSegmentInt seg : segments()) { - if (b.doesIntersect(seg)) { - return true; - } - } - return false; - } - - final public double getDistance(Box b) { - double result = Double.MAX_VALUE; - for (LineSegmentInt seg : segments()) { - if (b.doesIntersect(seg)) { - result = Math.min(result, seg.getDistance(b.getCenterPoint())); - } - } - return result; - } - - final public double getDistance(Polyline other) { - double result = 0; - for (LineSegmentInt seg1 : segments()) { - for (LineSegmentInt seg2 : other.segments()) { - result += seg1.getDistance(seg2); - } - } - return result; - } - - final public GeneralPath asGeneralPath() { - final GeneralPath generalPath = new GeneralPath(); - - for (LineSegmentInt seg : segments()) { - generalPath.append(seg, false); - } - - return generalPath; - } - - final public int getMinX() { - int result = Integer.MAX_VALUE; - for (LineSegmentInt seg : segments()) { - result = Math.min(result, seg.getMinX()); - } - return result; - } - - final public int getMinY() { - int result = Integer.MAX_VALUE; - for (LineSegmentInt seg : segments()) { - result = Math.min(result, seg.getMinY()); - } - return result; - } - - final public int getMaxX() { - int result = Integer.MIN_VALUE; - for (LineSegmentInt seg : segments()) { - result = Math.max(result, seg.getMaxX()); - } - return result; - } - - final public int getMaxY() { - int result = Integer.MIN_VALUE; - for (LineSegmentInt seg : segments()) { - result = Math.max(result, seg.getMaxY()); - } - return result; - } - - public final Pointable getStart() { - return start; - } - - public final Pointable getEnd() { - return end; - } - -} diff --git a/src/net/sourceforge/plantuml/geom/Box.java b/src/net/sourceforge/plantuml/geom/Box.java deleted file mode 100644 index 222171b..0000000 --- a/src/net/sourceforge/plantuml/geom/Box.java +++ /dev/null @@ -1,240 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -public class Box implements XMoveable, Pointable { - - private int x; - private int y; - final private int width; - final private int height; - - public Box(int x, int y, int width, int height) { - if (width <= 0 || height <= 0) { - throw new IllegalArgumentException(); - } - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - - @Override - public String toString() { - return "Box [" + x + "," + y + "] " + width + "," + height; - } - - public Point2DInt[] getCorners() { - final Point2DInt p1 = new Point2DInt(getX(), getY()); - final Point2DInt p2 = new Point2DInt(getX() + getWidth(), getY()); - final Point2DInt p3 = new Point2DInt(getX() + getWidth(), getY() + getHeight()); - final Point2DInt p4 = new Point2DInt(getX(), getY() + getHeight()); - return new Point2DInt[] { p1, p2, p3, p4 }; - } - - public Point2DInt[] getCornersOfOneSide(LineSegmentInt seg, int sgn) { - final Point2DInt[] corners = getCorners(); - final double sgn0 = seg.side(corners[0]); - final double sgn1 = seg.side(corners[1]); - final double sgn2 = seg.side(corners[2]); - final double sgn3 = seg.side(corners[3]); - int nb = 0; - if (Math.signum(sgn0) == sgn) { - nb++; - } - if (Math.signum(sgn1) == sgn) { - nb++; - } - if (Math.signum(sgn2) == sgn) { - nb++; - } - if (Math.signum(sgn3) == sgn) { - nb++; - } - final Point2DInt[] result = new Point2DInt[nb]; - int i = 0; - if (Math.signum(sgn0) == sgn) { - result[i++] = corners[0]; - } - if (Math.signum(sgn1) == sgn) { - result[i++] = corners[1]; - } - if (Math.signum(sgn2) == sgn) { - result[i++] = corners[2]; - } - if (Math.signum(sgn3) == sgn) { - result[i++] = corners[3]; - } - assert nb == i; - return result; - } - - public boolean doesIntersect(LineSegmentInt seg) { - return intersect(seg).length > 0; - } - - public Point2DInt[] intersect(LineSegmentInt seg) { - if (seg.side(this) != 0) { - return new Point2DInt[0]; - } - // Log.println("THIS=" + this); - // Log.println("LineSegment=" + seg); - final Point2DInt corners[] = getCorners(); - final LineSegmentInt seg1 = new LineSegmentInt(corners[0], corners[1]); - final LineSegmentInt seg2 = new LineSegmentInt(corners[1], corners[2]); - final LineSegmentInt seg3 = new LineSegmentInt(corners[2], corners[3]); - final LineSegmentInt seg4 = new LineSegmentInt(corners[3], corners[0]); - final Point2DInt i1 = seg.getSegIntersection(seg1); - Point2DInt i2 = seg.getSegIntersection(seg2); - Point2DInt i3 = seg.getSegIntersection(seg3); - Point2DInt i4 = seg.getSegIntersection(seg4); - - // Log.println("i1="+i1); - // Log.println("i2="+i2); - // Log.println("i3="+i3); - // Log.println("i4="+i4); - - if (i2 != null && i2.equals(i1)) { - i2 = null; - } - if (i3 != null && (i3.equals(i1) || i3.equals(i2))) { - i3 = null; - } - if (i4 != null && (i4.equals(i1) || i4.equals(i2) || i4.equals(i3))) { - i4 = null; - } - - final int nb = countNotNull(i1, i2, i3, i4); - assert nb >= 0 && nb <= 3 : nb; - int i = 0; - final Point2DInt result[] = new Point2DInt[nb]; - if (i1 != null) { - result[i++] = i1; - } - if (i2 != null) { - result[i++] = i2; - } - if (i3 != null) { - result[i++] = i3; - } - if (i4 != null) { - result[i++] = i4; - } - assert i == nb; - assert getCornersOfOneSide(seg, 0).length + getCornersOfOneSide(seg, 1).length - + getCornersOfOneSide(seg, -1).length == 4; - return result; - } - - private int countNotNull(Point2DInt i1, Point2DInt i2, Point2DInt i3, Point2DInt i4) { - int n = 0; - if (i1 != null) { - n++; - } - if (i2 != null) { - n++; - } - if (i3 != null) { - n++; - } - if (i4 != null) { - n++; - } - return n; - } - - public Box outerBox(int margin) { - return new Box(x - margin, y - margin, width + 2 * margin, height + 2 * margin); - } - - public Point2DInt getCenterPoint() { - return new Point2DInt(x + width / 2, y + height / 2); - } - - public void moveX(int delta) { - this.x += delta; - } - - public boolean intersectBox(Box other) { - return other.x + other.width > this.x && other.y + other.height > this.y && other.x < this.x + this.width - && other.y < this.y + this.height; - } - - public final int getX() { - return x; - } - - public final int getY() { - return y; - } - - public final int getWidth() { - return width; - } - - public final int getHeight() { - return height; - } - - public int getMinX() { - return x; - } - - public int getMinY() { - return y; - } - - public int getMaxX() { - return x + width; - } - - public int getMaxY() { - return y + height; - } - - public int getCenterX() { - return x + width / 2; - } - - public int getCenterY() { - return y + height / 2; - } - - public Point2DInt getPosition() { - return getCenterPoint(); - } - -} diff --git a/src/net/sourceforge/plantuml/geom/ClosedArea.java b/src/net/sourceforge/plantuml/geom/ClosedArea.java deleted file mode 100644 index 7b81ca0..0000000 --- a/src/net/sourceforge/plantuml/geom/ClosedArea.java +++ /dev/null @@ -1,297 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -public class ClosedArea extends AbstractFigure { - - private final List points = new ArrayList(); - private final List segmentsList = new ArrayList(); - - private int minY = Integer.MAX_VALUE; - private int minX = Integer.MAX_VALUE; - private int maxX = Integer.MIN_VALUE; - private int maxY = Integer.MIN_VALUE; - - public ClosedArea() { - assert isConsistent(); - } - - @Override - public String toString() { - return points.toString(); - } - - public boolean contains(Point2DInt point) { - return contains(point.getXint(), point.getYint()); - } - - private boolean contains(int x, int y) { - if (points.size() <= 2) { - return false; - } - if (x > maxX) { - return false; - } - if (x < minX) { - return false; - } - if (y > maxY) { - return false; - } - if (y < minY) { - return false; - } - if (isOnFrontier(new Point2DInt(x, y))) { - return true; - } - int hits = 0; - - int lastx = getLastPoint().getXint(); - int lasty = getLastPoint().getYint(); - int curx; - int cury; - - // Walk the edges of the polygon - for (int i = 0; i < points.size(); lastx = curx, lasty = cury, i++) { - curx = points.get(i).getXint(); - cury = points.get(i).getYint(); - - if (cury == lasty) { - continue; - } - - final int leftx; - if (curx < lastx) { - if (x >= lastx) { - continue; - } - leftx = curx; - } else { - if (x >= curx) { - continue; - } - leftx = lastx; - } - - final double test1; - final double test2; - if (cury < lasty) { - if (y < cury || y >= lasty) { - continue; - } - if (x < leftx) { - hits++; - continue; - } - test1 = x - curx; - test2 = y - cury; - } else { - if (y < lasty || y >= cury) { - continue; - } - if (x < leftx) { - hits++; - continue; - } - test1 = x - lastx; - test2 = y - lasty; - } - - if (test1 < test2 / (lasty - cury) * (lastx - curx)) { - hits++; - } - - } - return (hits & 1) != 0; - - } - - private boolean isConsistent() { - assert getSegments().size() == segmentsList.size(); - assert getSegments().equals(new HashSet(segmentsList)); - if (getSegments().size() > 0) { - assert getSegments().size() + 1 == points.size() : "points=" + points + " getSegment()=" + getSegments(); - } - for (int i = 0; i < segmentsList.size(); i++) { - final LineSegmentInt seg = segmentsList.get(i); - if (seg.sameExtremities(new LineSegmentInt(points.get(i), points.get(i + 1))) == false) { - return false; - } - } - return true; - } - - public boolean isOnFrontier(Point2DInt point) { - for (LineSegmentInt seg : segmentsList) { - if (seg.containsPoint(point)) { - return true; - } - } - return false; - } - - public boolean isClosed() { - if (getSegments().size() < 3) { - return false; - } - if (getFirstSegment().atLeastOneCommonExtremities(getLastSegment())) { - return true; - } - return false; - } - - ClosedArea append(LineSegmentInt other) { - if (isClosed()) { - throw new IllegalStateException(); - } - if (getSegments().contains(other)) { - throw new IllegalArgumentException(); - } - final ClosedArea result = new ClosedArea(); - for (LineSegmentInt seg : segmentsList) { - result.addSegment(seg); - } - if (result.getSegments().size() > 0 && result.getLastSegment().atLeastOneCommonExtremities(other) == false) { - throw new IllegalArgumentException(); - } - if (points.contains(other.getP1()) && points.contains(other.getP2()) - && other.getP1().equals(getFirstPoint()) == false && other.getP2().equals(getFirstPoint()) == false) { - return null; - } - result.addSegment(other); - assert result.isConsistent(); - - return result; - } - - @Override - public void addSegment(LineSegmentInt seg) { - super.addSegment(seg); - minY = Math.min(minY, seg.getMinY()); - maxY = Math.max(maxY, seg.getMaxY()); - minX = Math.min(minX, seg.getMinX()); - maxX = Math.max(maxX, seg.getMaxX()); - segmentsList.add(seg); - if (points.size() == 0) { - assert getSegments().size() == 1; - points.add(seg.getP1()); - points.add(seg.getP2()); - } else if (points.size() == 2) { - assert segmentsList.size() == 2; - final LineSegmentInt seg0 = segmentsList.get(0); - final LineSegmentInt seg1 = segmentsList.get(1); - points.clear(); - final Point2DInt common = seg0.getCommonExtremities(seg1); - if (common == null) { - throw new IllegalArgumentException(); - } - assert common.equals(seg1.getCommonExtremities(seg0)); - points.add(seg0.getOtherExtremity(common)); - points.add(common); - points.add(seg1.getOtherExtremity(common)); - - } else { - final Point2DInt lastPoint = getLastPoint(); - points.add(seg.getOtherExtremity(lastPoint)); - } - assert isConsistent(); - } - - private Point2DInt getLastPoint() { - return points.get(points.size() - 1); - } - - private Point2DInt getFirstPoint() { - return points.get(0); - } - - public LineSegmentInt getLastSegment() { - return segmentsList.get(segmentsList.size() - 1); - } - - private LineSegmentInt getFirstSegment() { - return segmentsList.get(0); - } - - public Point2DInt getFreePoint() { - if (isClosed()) { - throw new IllegalStateException(); - } - return getLastPoint(); - } - - public int getMinY() { - return minY; - } - - public int getMinX() { - return minX; - } - - public int getMaxY() { - return maxY; - } - - public int getMaxX() { - return maxX; - } - - public boolean contains(ClosedArea other) { - if (isClosed() == false) { - throw new IllegalStateException(); - } - for (Point2DInt point : other.points) { - if (this.contains(point) == false) { - return false; - } - } - return true; - } - - @Override - boolean arePointsConnectable(Point2DInt p1, Point2DInt p2) { - if (isOnFrontier(p1) || isOnFrontier(p2)) { - return true; - } - final boolean pos1 = contains(p1); - final boolean pos2 = contains(p2); - return pos1 == pos2; - } -} diff --git a/src/net/sourceforge/plantuml/geom/CollectionUtils.java b/src/net/sourceforge/plantuml/geom/CollectionUtils.java deleted file mode 100644 index fd587b0..0000000 --- a/src/net/sourceforge/plantuml/geom/CollectionUtils.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -public class CollectionUtils { - - public static Collection> selectUpTo(List original, int nb) { - final List> result = new ArrayList>(); - for (int i = 1; i <= nb; i++) { - result.addAll(selectExactly(original, i)); - } - return Collections.unmodifiableList(result); - } - - public static Collection> selectExactly(List original, int nb) { - if (nb < 0) { - throw new IllegalArgumentException(); - } - if (nb == 0) { - return Collections.emptyList(); - } - if (nb == 1) { - final List> result = new ArrayList>(); - for (E element : original) { - result.add(Collections.singletonList(element)); - } - return result; - - } - if (nb > original.size()) { - return Collections.emptyList(); - } - if (nb == original.size()) { - return Collections.singletonList(original); - } - final List> result = new ArrayList>(); - - for (List subList : selectExactly(original.subList(1, original.size()), nb - 1)) { - final List newList = new ArrayList(); - newList.add(original.get(0)); - newList.addAll(subList); - result.add(Collections.unmodifiableList(newList)); - } - result.addAll(selectExactly(original.subList(1, original.size()), nb)); - - return Collections.unmodifiableList(result); - } -} diff --git a/src/net/sourceforge/plantuml/geom/Dijkstra.java b/src/net/sourceforge/plantuml/geom/Dijkstra.java deleted file mode 100644 index 150a4ce..0000000 --- a/src/net/sourceforge/plantuml/geom/Dijkstra.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -public class Dijkstra { - - final private double basic[][]; - final private double dist[]; - final private int previous[]; - final private Set q = new HashSet(); - final private int size; - - public Dijkstra(int size) { - this.size = size; - this.basic = new double[size][size]; - this.dist = new double[size]; - this.previous = new int[size]; - for (int i = 0; i < size; i++) { - for (int j = 0; j < size; j++) { - this.basic[i][j] = i == j ? 0 : Double.MAX_VALUE; - } - } - } - - public void addLink(int n1, int n2, double d) { -// Log.println("Adding " + n1 + " " + n2 + " " + d); - if (n1 == n2) { - throw new IllegalArgumentException(); - } - basic[n1][n2] = d; - basic[n2][n1] = d; - - } - - private void init() { - for (int i = 0; i < size; i++) { - this.dist[i] = Double.MAX_VALUE; - this.previous[i] = -1; - this.q.add(i); - } - this.dist[0] = 0; - } - - private void computePrevious() { - init(); - while (q.size() > 0) { - final int u = smallest(); - if (dist[u] == Double.MAX_VALUE) { - return; - } - q.remove(u); - for (int v = 0; v < size; v++) { - if (basic[u][v] == Double.MAX_VALUE) { - continue; - } - final double alt = dist[u] + basic[u][v]; - if (alt < dist[v]) { - dist[v] = alt; - previous[v] = u; - } - } - } - } - - public List getBestPath() { - final List result = new ArrayList(); - computePrevious(); - int u = size - 1; - while (previous[u] >= 0) { - result.add(0, u); - u = previous[u]; - } - result.add(0, 0); - return Collections.unmodifiableList(result); - } - - private int smallest() { - int result = -1; - for (Integer i : q) { - if (result == -1 || dist[i] < dist[result]) { - result = i; - } - } - return result; - } - - public final int getSize() { - return size; - } - -} diff --git a/src/net/sourceforge/plantuml/geom/InflateData.java b/src/net/sourceforge/plantuml/geom/InflateData.java deleted file mode 100644 index 8d7afb0..0000000 --- a/src/net/sourceforge/plantuml/geom/InflateData.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -public class InflateData implements Comparable { - - private final int pos; - private final int inflation; - - public InflateData(int pos, int inflation) { - if (inflation % 2 != 0) { - throw new IllegalArgumentException(); - } - this.pos = pos; - this.inflation = inflation; - } - - public final int getPos() { - return pos; - } - - public final int getInflation() { - return inflation; - } - - public int compareTo(InflateData other) { - return -(this.pos - other.pos); - } - - @Override - public String toString() { - return "" + pos + " (" + inflation + ")"; - } -} diff --git a/src/net/sourceforge/plantuml/geom/InflationTransform.java b/src/net/sourceforge/plantuml/geom/InflationTransform.java deleted file mode 100644 index b557ff3..0000000 --- a/src/net/sourceforge/plantuml/geom/InflationTransform.java +++ /dev/null @@ -1,211 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.ListIterator; -import java.util.SortedSet; -import java.util.TreeSet; - -class Point2DIntComparatorDistance implements Comparator { - - private final Point2DInt center; - - public Point2DIntComparatorDistance(Point2DInt center) { - this.center = center; - } - - public int compare(Point2DInt p1, Point2DInt p2) { - return (int) Math.signum(p1.distance(center) - p2.distance(center)); - } - -} - -public class InflationTransform { - - private final List inflateX = new ArrayList(); - private final List inflateY = new ArrayList(); - - public void addInflationX(int xpos, int inflation) { - add(inflateX, xpos, inflation); - } - - @Override - public String toString() { - return "inflateX = " + inflateX + " inflateY = " + inflateY; - } - - public void addInflationY(int ypos, int inflation) { - add(inflateY, ypos, inflation); - } - - static private void add(List list, int ypos, int inflation) { - for (final ListIterator it = list.listIterator(); it.hasNext();) { - final InflateData cur = it.next(); - if (cur.getPos() == ypos) { - it.set(new InflateData(ypos, Math.max(inflation, cur.getInflation()))); - return; - } - } - list.add(new InflateData(ypos, inflation)); - Collections.sort(list); - } - - Collection cutPoints(LineSegmentInt original) { - - // Log.println("original=" + original); - // Log.println("inflateX=" + inflateX); - // Log.println("inflateY=" + inflateY); - - final SortedSet result = new TreeSet(new Point2DIntComparatorDistance(original.getP1())); - - if (original.isHorizontal() == false) { - for (InflateData x : inflateX) { - final LineSegmentInt vertical = new LineSegmentInt(x.getPos(), original.getMinY(), x.getPos(), original - .getMaxY()); - final Point2DInt inter = original.getSegIntersection(vertical); - if (inter != null) { - result.add(inter); - } - } - } - if (original.isVertical() == false) { - for (InflateData y : inflateY) { - final LineSegmentInt horizontal = new LineSegmentInt(original.getMinX(), y.getPos(), - original.getMaxX(), y.getPos()); - final Point2DInt inter = original.getSegIntersection(horizontal); - if (inter != null) { - result.add(inter); - } - } - } - return result; - } - - Collection cutSegments(LineSegmentInt original) { - final List result = new ArrayList(); - Point2DInt cur = original.getP1(); - final Collection cutPoints = cutPoints(original); - for (Point2DInt inter : cutPoints) { - if (cur.equals(inter)) { - continue; - } - result.add(new LineSegmentInt(cur, inter)); - cur = inter; - } - if (cur.equals(original.getP2()) == false) { - result.add(new LineSegmentInt(cur, original.getP2())); - } - return result; - } - - Collection cutSegments(Collection segments) { - final List result = new ArrayList(); - for (LineSegmentInt seg : segments) { - result.addAll(cutSegments(seg)); - } - return result; - } - - private LineSegmentInt inflateSegment(LineSegmentInt seg) { - if (isOnGrid(seg.getP1()) || isOnGrid(seg.getP2())) { - return new LineSegmentInt(inflatePoint2DInt(seg.getP1()), inflatePoint2DInt(seg.getP2())); - } - for (InflateData x : inflateX) { - seg = seg.inflateXAlpha(x); - } - for (InflateData y : inflateY) { - seg = seg.inflateYAlpha(y); - } - return seg; - } - - private boolean isOnGrid(Point2DInt point) { - boolean onGrid = false; - for (InflateData x : inflateX) { - if (point.getX() == x.getPos()) { - onGrid = true; - } - } - if (onGrid == false) { - return false; - } - for (InflateData y : inflateY) { - if (point.getY() == y.getPos()) { - return true; - } - } - return false; - - } - - public Point2DInt inflatePoint2DInt(Point2DInt point) { - for (InflateData x : inflateX) { - point = point.inflateX(x); - } - for (InflateData y : inflateY) { - point = point.inflateY(y); - } - return point; - } - - List inflateSegmentCollection(Collection segments) { - final List result = new ArrayList(); - for (LineSegmentInt seg : segments) { - result.add(inflateSegment(seg)); - } - return result; - } - - public List inflate(Collection segments) { - final List result = new ArrayList(); - LineSegmentInt last = null; - final Collection cutSegments = cutSegments(segments); - for (LineSegmentInt seg : inflateSegmentCollection(cutSegments)) { - if (last != null && last.getP2().equals(seg.getP1()) == false) { - result.add(new LineSegmentInt(last.getP2(), seg.getP1())); - } - result.add(seg); - last = seg; - - } - return result; - } -} diff --git a/src/net/sourceforge/plantuml/geom/Kingdom.java b/src/net/sourceforge/plantuml/geom/Kingdom.java deleted file mode 100644 index fa50fb8..0000000 --- a/src/net/sourceforge/plantuml/geom/Kingdom.java +++ /dev/null @@ -1,123 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -public class Kingdom extends AbstractFigure { - - private Set buildClosedArea(ClosedArea area) { - if (area.isClosed()) { - throw new IllegalArgumentException(); - } - final Set result = new HashSet(); - for (LineSegmentInt seg : getSegmentsWithExtremity(area.getFreePoint(), area.getSegments())) { - final ClosedArea newArea = area.append(seg); - if (newArea != null) { - result.add(newArea); - } - } - return Collections.unmodifiableSet(result); - } - - private void grow(Set areas) { - for (ClosedArea area : new HashSet(areas)) { - if (area.isClosed() == false) { - areas.addAll(buildClosedArea(area)); - } - } - } - - public Set getAllClosedArea() { - final Set result = new HashSet(); - for (LineSegmentInt seg : getSegments()) { - result.add(new ClosedArea().append(seg)); - } - int lastSize; - do { - lastSize = result.size(); - grow(result); - } while (result.size() != lastSize); - for (final Iterator it = result.iterator(); it.hasNext();) { - final ClosedArea area = it.next(); - if (area.isClosed() == false) { - it.remove(); - } - } - return Collections.unmodifiableSet(result); - } - - // public Set getAllSmallClosedArea() { - // final Set all = getAllClosedArea(); - // final Set result = new HashSet(all); - // - // for (final Iterator it = result.iterator(); it.hasNext();) { - // final ClosedArea area = it.next(); - // if (containsAnotherArea(area, all)) { - // it.remove(); - // } - // } - // - // return Collections.unmodifiableSet(result); - // } - - // static private boolean containsAnotherArea(ClosedArea area, - // Set all) { - // for (ClosedArea another : all) { - // if (another == area) { - // continue; - // } - // if (area.contains(another)) { - // return true; - // } - // } - // return false; - // } - - @Override - public boolean arePointsConnectable(Point2DInt p1, Point2DInt p2) { - for (ClosedArea area : getAllClosedArea()) { - if (area.arePointsConnectable(p1, p2) == false) { - return false; - } - } - return true; - } - -} diff --git a/src/net/sourceforge/plantuml/geom/LineSegmentInt.java b/src/net/sourceforge/plantuml/geom/LineSegmentInt.java deleted file mode 100644 index 2631315..0000000 --- a/src/net/sourceforge/plantuml/geom/LineSegmentInt.java +++ /dev/null @@ -1,268 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.awt.geom.Point2D; -import java.util.Locale; - -public class LineSegmentInt extends AbstractLineSegment { - - private final Point2DInt p1; - private final Point2DInt p2; - - @Override - public String toString() { - return String.format(Locale.US, "( %d,%d - %d,%d )", p1.getXint(), p1.getYint(), p2.getXint(), p2.getYint()); - } - - public LineSegmentInt(int x1, int y1, int x2, int y2) { - this(new Point2DInt(x1, y1), new Point2DInt(x2, y2)); - } - - public LineSegmentInt(Point2DInt p1, Point2DInt p2) { - this.p1 = p1; - this.p2 = p2; - if (p1.equals(p2)) { - throw new IllegalArgumentException(); - } - assert p1 != null && p2 != null; - assert getLength() > 0; - assert this.getDistance(this) == 0; - } - - public boolean containsPoint(Point2D point) { - return side(point) == 0 && isBetween(point, p1, p2); - } - - public double side(Box box) { - final Point2DInt corners[] = box.getCorners(); - final double s0 = side(corners[0]); - final double s1 = side(corners[1]); - final double s2 = side(corners[2]); - final double s3 = side(corners[3]); - if (s0 > 0 && s1 > 0 && s2 > 0 && s3 > 0) { - return 1; - } - if (s0 < 0 && s1 < 0 && s2 < 0 && s3 < 0) { - return -1; - } - return 0; - } - - public boolean doesIntersectButNotSameExtremity(LineSegmentInt other) { - // assert sameExtremities(other) == false; - if (doesIntersect(other) == false) { - return false; - } - if (atLeastOneCommonExtremities(other)) { - return false; - } - return true; - } - - public boolean sameExtremities(LineSegmentInt other) { - if (p1.equals(other.p1) && p2.equals(other.p2)) { - return true; - } - if (p1.equals(other.p2) && p2.equals(other.p1)) { - return true; - } - return false; - } - - public boolean atLeastOneCommonExtremities(LineSegmentInt other) { - if (p1.equals(other.p1)) { - return true; - } - if (p1.equals(other.p2)) { - return true; - } - if (p2.equals(other.p1)) { - return true; - } - if (p2.equals(other.p2)) { - return true; - } - return false; - } - - public Point2DInt getCommonExtremities(LineSegmentInt other) { - if (p1.equals(other.p1)) { - return p1; - } - if (p1.equals(other.p2)) { - return p1; - } - if (p2.equals(other.p1)) { - return p2; - } - if (p2.equals(other.p2)) { - return p2; - } - return null; - } - - public Point2DInt getOtherExtremity(Point2DInt extremity1) { - if (extremity1 == null) { - throw new IllegalArgumentException(); - } - if (extremity1.equals(p1)) { - return p2; - } - if (extremity1.equals(p2)) { - return p1; - } - throw new IllegalArgumentException(); - } - - // Line2D - - @Override - public Point2DInt getP1() { - return p1; - } - - @Override - public Point2DInt getP2() { - return p2; - } - - @Override - public double getX1() { - return p1.getXint(); - } - - @Override - public double getX2() { - return p2.getXint(); - } - - @Override - public double getY1() { - return p1.getYint(); - } - - @Override - public double getY2() { - return p2.getYint(); - } - - public Point2DInt getTranslatedPoint(Point2DInt pointToBeTranslated) { - final int x = p2.getXint() - p1.getXint(); - final int y = p2.getYint() - p1.getYint(); - return new Point2DInt(pointToBeTranslated.getXint() + x, pointToBeTranslated.getYint() + y); - } - - public Point2DInt getCenter() { - return new Point2DInt((p1.getXint() + p2.getXint()) / 2, (p1.getYint() + p2.getYint()) / 2); - } - - public int getMinX() { - return Math.min(p1.getXint(), p2.getXint()); - } - - public int getMaxX() { - return Math.max(p1.getXint(), p2.getXint()); - } - - public int getMinY() { - return Math.min(p1.getYint(), p2.getYint()); - } - - public int getMaxY() { - return Math.max(p1.getYint(), p2.getYint()); - } - - public Point2DInt ortho(Point2D.Double orig, double d) { - final double vectX = p2.getY() - p1.getY(); - final double vectY = -(p2.getX() - p1.getX()); - final double pour = 1.0 * d / 100.0; - final double x = orig.x + vectX * pour; - final double y = orig.y + vectY * pour; - return new Point2DInt((int) Math.round(x), (int) Math.round(y)); - } - - public LineSegmentInt translate(int deltaX, int deltaY) { - return new LineSegmentInt(p1.translate(deltaX, deltaY), p2.translate(deltaX, deltaY)); - } - - public LineSegmentInt inflateXAlpha(InflateData inflateData) { - - final int xpos = inflateData.getPos(); - final int inflation = inflateData.getInflation(); - if (isHorizontal()) { - return new LineSegmentInt(p1.inflateX(inflateData), p2.inflateX(inflateData)); - } - if (getP1().getXint() == xpos && getP2().getXint() == xpos) { - return this.translate(inflation / 2, 0); - } - if (getP1().getXint() <= xpos && getP2().getXint() <= xpos) { - return this; - } - if (getP1().getXint() >= xpos && getP2().getXint() >= xpos) { - return this.translate(inflation, 0); - } - throw new UnsupportedOperationException(toString() + " " + inflateData); - } - - public LineSegmentInt inflateYAlpha(InflateData inflateData) { - final int ypos = inflateData.getPos(); - final int inflation = inflateData.getInflation(); - if (isVertical()) { - return new LineSegmentInt(p1.inflateY(inflateData), p2.inflateY(inflateData)); - } - if (getP1().getYint() == ypos && getP2().getYint() == ypos) { - return this.translate(0, inflation / 2); - } - if (getP1().getYint() <= ypos && getP2().getYint() <= ypos) { - return this; - } - if (getP1().getYint() >= ypos && getP2().getYint() >= ypos) { - return this.translate(0, inflation); - } - throw new UnsupportedOperationException(); - } - - @Override - public Point2DInt getSegIntersection(AbstractLineSegment other) { - final Point2D result = super.getSegIntersection(other); - if (result == null) { - return null; - } - return new Point2DInt((int) Math.round(result.getX()), (int) Math.round(result.getY())); - } - -} diff --git a/src/net/sourceforge/plantuml/geom/Neighborhood.java b/src/net/sourceforge/plantuml/geom/Neighborhood.java deleted file mode 100644 index 9680c2d..0000000 --- a/src/net/sourceforge/plantuml/geom/Neighborhood.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -public class Neighborhood { - - final private double angle1; - final private double angle2; - final private Point2DInt center; - - public Neighborhood(Point2DInt center) { - this(center, 0, 0); - } - - public boolean is360() { - return angle1 == angle2; - } - - public Neighborhood(Point2DInt center, double angle1, double angle2) { - this.center = center; - this.angle1 = angle1; - this.angle2 = angle2; - } - - @Override - public String toString() { - final int a1 = (int) (angle1 * 180 / Math.PI); - final int a2 = (int) (angle2 * 180 / Math.PI); - return center + " " + a1 + " " + a2; - } - - public final Point2DInt getCenter() { - return center; - } - - public final double getMiddle() { - if (is360()) { - return angle1 + Math.PI; - } - double result = (angle1 + angle2) / 2; - if (angle2 < angle1) { - result += Math.PI; - } - return result; - } - - public boolean isInAngleStrict(double angle) { - if (angle < 0) { - throw new IllegalArgumentException(); - } - if (angle2 > angle1) { - return angle > angle1 && angle < angle2; - } - return angle > angle1 || angle < angle2; - } - - public boolean isInAngleLarge(double angle) { - if (angle < 0) { - throw new IllegalArgumentException(); - } - if (angle2 > angle1) { - return angle >= angle1 && angle <= angle2; - } - return angle >= angle1 || angle <= angle2; - } - - public boolean isAngleLimit(double angle) { - return angle == angle1 || angle == angle2; - } - - public Orientation getOrientationFrom(double angle) { - if (angle1 == angle2) { - throw new IllegalStateException(); - } - if (angle != angle1 && angle != angle2) { - throw new IllegalArgumentException("this=" + this + " angle=" + (int) (angle * 180 / Math.PI)); - } - assert angle == angle1 || angle == angle2; - - if (angle == angle1) { - return Orientation.MATH; - } - return Orientation.CLOCK; - - } -} diff --git a/src/net/sourceforge/plantuml/geom/Orientation.java b/src/net/sourceforge/plantuml/geom/Orientation.java deleted file mode 100644 index b45a7ca..0000000 --- a/src/net/sourceforge/plantuml/geom/Orientation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -public enum Orientation { - - CLOCK, MATH - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/geom/Point2DInt.java b/src/net/sourceforge/plantuml/geom/Point2DInt.java deleted file mode 100644 index 895167d..0000000 --- a/src/net/sourceforge/plantuml/geom/Point2DInt.java +++ /dev/null @@ -1,122 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.awt.geom.Point2D; - -public class Point2DInt extends Point2D implements Pointable { - - private final int x; - private final int y; - - @Override - public String toString() { - return "(" + x + "," + y + ")"; - } - - public Point2DInt(int x, int y) { - this.x = x; - this.y = y; - } - - public int getXint() { - return x; - } - - public int getYint() { - return y; - } - - @Override - public double getX() { - return x; - } - - @Override - public double getY() { - return y; - } - - @Override - public void setLocation(double x, double y) { - throw new UnsupportedOperationException(); - } - - public Point2DInt getPosition() { - return this; - } - - public Point2DInt translate(int deltaX, int deltaY) { - return new Point2DInt(x + deltaX, y + deltaY); - } - - public Point2DInt inflateX(int xpos, int inflation) { - if (inflation % 2 != 0) { - throw new IllegalArgumentException(); - } - if (x < xpos) { - return this; - } - if (x == xpos) { - // throw new IllegalArgumentException(); - return translate(inflation / 2, 0); - } - return translate(inflation, 0); - } - - public Point2DInt inflateX(InflateData inflateData) { - return inflateX(inflateData.getPos(), inflateData.getInflation()); - } - - public Point2DInt inflateY(InflateData inflateData) { - return inflateY(inflateData.getPos(), inflateData.getInflation()); - } - - public Point2DInt inflateY(int ypos, int inflation) { - if (inflation % 2 != 0) { - throw new IllegalArgumentException(); - } - if (y < ypos) { - return this; - } - if (y == ypos) { - // throw new IllegalArgumentException(); - return translate(0, inflation / 2); - } - return translate(0, inflation); - } - -} diff --git a/src/net/sourceforge/plantuml/geom/Pointable.java b/src/net/sourceforge/plantuml/geom/Pointable.java deleted file mode 100644 index a55c6b3..0000000 --- a/src/net/sourceforge/plantuml/geom/Pointable.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -public interface Pointable { - Point2DInt getPosition(); -} diff --git a/src/net/sourceforge/plantuml/geom/Polyline.java b/src/net/sourceforge/plantuml/geom/Polyline.java deleted file mode 100644 index 78bc9f6..0000000 --- a/src/net/sourceforge/plantuml/geom/Polyline.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.List; - -public interface Polyline { - - List segments(); - - int nbSegments(); - - boolean doesTouch(Polyline other); - - double getLength(); - -} diff --git a/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java b/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java deleted file mode 100644 index 04f912e..0000000 --- a/src/net/sourceforge/plantuml/geom/PolylineBreakeable.java +++ /dev/null @@ -1,154 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class PolylineBreakeable extends AbstractPolyline implements Polyline { - - static class Breakure { - private int d; - private int u; - - public Breakure(int u, int d) { - this.u = u; - this.d = d; - } - } - - private final List breakures = new ArrayList(); - - public PolylineBreakeable copy(Pointable newStart, Pointable newEnd) { - final PolylineBreakeable result = new PolylineBreakeable(newStart, newEnd); - result.breakures.addAll(this.breakures); - return result; - } - - public PolylineBreakeable(Pointable start, Pointable end) { - super(start, end); - } - - public List segments() { - if (breakures.size() == 0) { - return Collections.singletonList(new LineSegmentInt(getStart().getPosition(), getEnd().getPosition())); - } - final List result = new ArrayList(); - Point2DInt cur = getStart().getPosition(); - for (Breakure breakure : breakures) { - final Point2DInt next = getBreakurePoint(breakure); - result.add(new LineSegmentInt(cur, next)); - cur = next; - } - result.add(new LineSegmentInt(cur, getEnd().getPosition())); - assert nbSegments() == result.size(); - return Collections.unmodifiableList(result); - } - - private Point2DInt getBreakurePoint(Breakure breakure) { - final LineSegmentInt seg = new LineSegmentInt(getStart().getPosition(), getEnd().getPosition()); - return seg.ortho(seg.startTranslatedAsVector(breakure.u), breakure.d); - } - - public int nbSegments() { - return breakures.size() + 1; - } - - public List getFreedoms() { - final List allFreedom = new ArrayList(); - - for (final Breakure breakure : breakures) { - allFreedom.add(new XMoveable() { - @Override - public String toString() { - return super.toString() + " " + PolylineBreakeable.this.toString() + "(d)"; - } - - public void moveX(int delta) { - breakure.d += delta; - } - }); - allFreedom.add(new XMoveable() { - @Override - public String toString() { - return super.toString() + " " + PolylineBreakeable.this.toString() + "(u)"; - } - - public void moveX(int delta) { - breakure.u += delta; - } - }); - allFreedom.add(new XMoveable() { - @Override - public String toString() { - return super.toString() + " " + PolylineBreakeable.this.toString() + "(ud)"; - } - - public void moveX(int delta) { - breakure.u += delta; - breakure.d += delta; - } - }); - allFreedom.add(new XMoveable() { - @Override - public String toString() { - return super.toString() + " " + PolylineBreakeable.this.toString() + "(dud)"; - } - - public void moveX(int delta) { - breakure.u += delta; - breakure.d -= delta; - } - }); - } - - return Collections.unmodifiableList(allFreedom); - } - - public void insertBetweenPoint(int u, int d) { - breakures.add(new Breakure(u, d)); - } - - private void breakMore() { - if (breakures.size() == 1) { - final Breakure b = breakures.get(0); - insertBetweenPoint(b.u / 2, 0); - } - - } - -} diff --git a/src/net/sourceforge/plantuml/geom/PolylineImpl.java b/src/net/sourceforge/plantuml/geom/PolylineImpl.java deleted file mode 100644 index 1824f43..0000000 --- a/src/net/sourceforge/plantuml/geom/PolylineImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -public class PolylineImpl extends AbstractPolyline implements Polyline { - - final private List intermediates = new ArrayList(); - - public PolylineImpl(Pointable start, Pointable end) { - super(start, end); - } - - public int nbSegments() { - return intermediates.size() + 1; - } - - public List segments() { - final List result = new ArrayList(); - Point2DInt cur = getStart().getPosition(); - for (Point2DInt intermediate : intermediates) { - result.add(new LineSegmentInt(cur, intermediate)); - cur = intermediate; - } - result.add(new LineSegmentInt(cur, getEnd().getPosition())); - return Collections.unmodifiableList(result); - } - - public void addIntermediate(Point2DInt intermediate) { - assert intermediates.contains(intermediate) == false; - intermediates.add(intermediate); - } - - public void inflate(InflationTransform transform) { - // final List segments = segments(); - // if (segments.size() == 1) { - // return; - // } - // intermediates.clear(); - // if (segments.size() == 2) { - // final Point2DInt p = segments.get(0).getP2(); - // intermediates.add(transform.inflatePoint2DInt(p)); - // } else { - // final List segmentsT = transform.inflate(segments); - // for (int i = 0; i < segmentsT.size() - 2; i++) { - // intermediates.add(segmentsT.get(i).getP2()); - // } - // - // } - - final List segments = transform.inflate(this.segments()); - // Log.println("segments="+segments); - intermediates.clear(); - for (int i = 1; i < segments.size() - 1; i++) { - addIntermediate(segments.get(i).getP1()); - } - } - - public final Collection getIntermediates() { - return Collections.unmodifiableCollection(intermediates); - } - -} diff --git a/src/net/sourceforge/plantuml/geom/Singularity.java b/src/net/sourceforge/plantuml/geom/Singularity.java deleted file mode 100644 index e3c54e7..0000000 --- a/src/net/sourceforge/plantuml/geom/Singularity.java +++ /dev/null @@ -1,154 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.TreeSet; - -public class Singularity { - - private final TreeSet angles = new TreeSet(); - - final private Point2DInt center; - - public Singularity(Point2DInt center) { - this.center = center; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(center.toString()); - for (Double a : angles) { - final int degree = (int) (a * 180 / Math.PI); - sb.append(' '); - sb.append(degree); - } - return sb.toString(); - } - - public void addLineSegment(LineSegmentInt seg) { - if (seg.getP1().equals(center)) { - angles.add(convertAngle(seg.getAngle())); - } else if (seg.getP2().equals(center)) { - angles.add(convertAngle(seg.getOppositeAngle())); - } else { - assert seg.side(center) == 0 : "side=" + seg.side(center) + " center=" + center + " seg=" + seg; - assert LineSegmentInt.isBetween(center, seg.getP1(), seg.getP2()); - addLineSegment(new LineSegmentInt(center, seg.getP1())); - addLineSegment(new LineSegmentInt(center, seg.getP2())); - } - assert betweenZeroAndTwoPi(); - - } - - static double convertAngle(double a) { - if (a < 0) { - return a + 2 * Math.PI; - } - return a; - } - - private boolean betweenZeroAndTwoPi() { - for (Double d : angles) { - assert d >= 0; - assert d < 2 * Math.PI; - } - return true; - } - - List getAngles() { - return new ArrayList(angles); - } - - public boolean crossing(Point2DInt direction1, Point2DInt direction2) { - final boolean result = crossingInternal(direction1, direction2); - assert result == crossingInternal(direction2, direction1); - return result; - } - - private boolean crossingInternal(Point2DInt direction1, Point2DInt direction2) { - if (angles.size() < 2) { - return false; - } - final double angle1 = convertAngle(new LineSegmentInt(center, direction1).getAngle()); - final double angle2 = convertAngle(new LineSegmentInt(center, direction2).getAngle()); - - Double last = null; - for (Double current : angles) { - if (last != null) { - assert last < current; - if (isBetween(angle1, last, current) && isBetween(angle2, last, current)) { - return false; - } - } - last = current; - } - final double first = angles.first(); - if ((angle1 <= first || angle1 >= last) && (angle2 <= first || angle2 >= last)) { - return false; - } - return true; - } - - private boolean isBetween(double test, double v1, double v2) { - assert v1 < v2; - return test >= v1 && test <= v2; - } - - protected final Point2DInt getCenter() { - return center; - } - - public void merge(Singularity other) { - this.angles.addAll(other.angles); - } - - public List getNeighborhoods() { - if (angles.size() == 0) { - return Collections.singletonList(new Neighborhood(center)); - } - final List result = new ArrayList(); - double last = angles.last(); - for (Double currentAngle : angles) { - result.add(new Neighborhood(center, last, currentAngle)); - last = currentAngle; - } - return Collections.unmodifiableList(result); - } - -} diff --git a/src/net/sourceforge/plantuml/geom/SpiderWeb.java b/src/net/sourceforge/plantuml/geom/SpiderWeb.java deleted file mode 100644 index 23776e6..0000000 --- a/src/net/sourceforge/plantuml/geom/SpiderWeb.java +++ /dev/null @@ -1,183 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.sourceforge.plantuml.Log; - -public class SpiderWeb { - - private final int pointsInCircle = 16; - private int nbRow; - private int nbCol; - - final private int widthCell; - final private int heightCell; - - final private int xMargin = 50; - final private int yMargin = 50; - - private final List lines = new ArrayList(); - - public SpiderWeb(int widthCell, int heightCell) { - Log.info("widthCell=" + widthCell + " heightCell=" + heightCell); - this.widthCell = widthCell; - this.heightCell = heightCell; - } - - public Point2DInt getMainPoint(int row, int col) { - return new Point2DInt(col * (widthCell + xMargin), row * (heightCell + yMargin)); - } - - public Collection getHangPoints(int row, int col) { - // final double dist = Math.pow(1.6, -row - 10) + Math.pow(1.5, -col - - // 10); - assert pointsInCircle % 4 == 0; - final List result = new ArrayList(); - final int dist = (int) Math.round(Math.sqrt(widthCell * widthCell + heightCell * heightCell) / 10); - for (int i = 0; i < pointsInCircle; i++) { - final Point2DInt main = getMainPoint(row, col); - final int x = main.getXint(); - final int y = main.getYint(); - if (i == 0) { - result.add(new Point2DInt(x + dist, y)); - } else if (i == pointsInCircle / 4) { - result.add(new Point2DInt(x, y + dist)); - } else if (i == 2 * pointsInCircle / 4) { - result.add(new Point2DInt(x - dist, y)); - } else if (i == 3 * pointsInCircle / 4) { - result.add(new Point2DInt(x, y - dist)); - } else { - final double angle = Math.PI * 2.0 * i / pointsInCircle; - final double x1 = x + dist * Math.cos(angle); - final double y1 = y + dist * Math.sin(angle); - result.add(new Point2DInt((int) Math.round(x1), (int) Math.round(y1))); - } - } - // Log.println("getHangPoints="+result); - return result; - } - - public PolylineBreakeable addPolyline(int row1, int col1, int row2, int col2) { - // Log.println("SpiderWeb : adding " + row1 + "," + col1 + " - " - // + row2 + "," + col2); - final PolylineBreakeable result = computePolyline(row1, col1, row2, col2); - // Log.println("SpiderWeb : adding " + result); - if (result != null) { - lines.add(result); - } - return result; - } - - private PolylineBreakeable computePolyline(int row1, int col1, int row2, int col2) { - if (row1 > nbRow) { - nbRow = row1; - } - if (row2 > nbRow) { - nbRow = row2; - } - if (col1 > nbCol) { - nbCol = col1; - } - if (col2 > nbCol) { - nbCol = col2; - } - if (directLinkPossibleForGeometry(row1, col1, row2, col2)) { - // Log.println("Geom OK"); - final PolylineBreakeable direct = new PolylineBreakeable(getMainPoint(row1, col1), getMainPoint(row2, col2)); - if (isCompatible(direct)) { - // Log.println("Direct OK"); - return direct; - } - } - return bestLevel1Line(row1, col1, row2, col2); - } - - private boolean isCompatible(PolylineBreakeable toTest) { - for (PolylineBreakeable p : lines) { - if (p.doesTouch(toTest)) { - return false; - } - } - return true; - } - - private PolylineBreakeable bestLevel1Line(int row1, int col1, int row2, int col2) { - PolylineBreakeable result = null; - for (int u = 5; u <= 95; u += 5) { - for (int d = -200; d <= 200; d += 5) { - final PolylineBreakeable cur = new PolylineBreakeable(getMainPoint(row1, col1), - getMainPoint(row2, col2)); - cur.insertBetweenPoint(u, d); - if ((result == null || cur.getLength() < result.getLength()) && isCompatible(cur)) { - result = cur; - } - - } - } - return result; - } - - boolean directLinkPossibleForGeometry(int row1, int col1, int row2, int col2) { - final int rowMin = Math.min(row1, row2); - final int rowMax = Math.max(row1, row2); - final int colMin = Math.min(col1, col2); - final int colMax = Math.max(col1, col2); - final LineSegmentInt seg = new LineSegmentInt(col1, row1, col2, row2); - for (int r = rowMin; r <= rowMax; r++) { - for (int c = colMin; c <= colMax; c++) { - if (r == row1 && c == col1) { - continue; - } - if (r == row2 && c == col2) { - continue; - } - if (seg.containsPoint(new Point2DInt(c, r))) { - return false; - } - } - } - return true; - } - - final int getPointsInCircle() { - return pointsInCircle; - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/geom/XMoveable.java b/src/net/sourceforge/plantuml/geom/XMoveable.java deleted file mode 100644 index 18440da..0000000 --- a/src/net/sourceforge/plantuml/geom/XMoveable.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom; - -public interface XMoveable { - - void moveX(int delta); - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java b/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java deleted file mode 100644 index 7436dc6..0000000 --- a/src/net/sourceforge/plantuml/geom/kinetic/Quadrant.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom.kinetic; - -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; - -public class Quadrant { - - static final private int SIZE = 100; - - private final int x; - private final int y; - - public Quadrant(int x, int y) { - this.x = x; - this.y = y; - } - - public Quadrant(Point2DCharge pt) { - this((int) pt.getX() / SIZE, (int) pt.getY() / SIZE); - } - - @Override - public boolean equals(Object obj) { - final Quadrant other = (Quadrant) obj; - return x == other.x && y == other.y; - } - - @Override - public int hashCode() { - return x * 3571 + y; - } - - @Override - public String toString() { - return "" + x + "-" + y; - } - - public Collection neighbourhood() { - final Collection result = Arrays.asList(new Quadrant(x - 1, y - 1), new Quadrant(x, y - 1), - new Quadrant(x + 1, y - 1), new Quadrant(x - 1, y), this, new Quadrant(x + 1, y), new Quadrant(x - 1, - y + 1), new Quadrant(x, y + 1), new Quadrant(x + 1, y + 1)); - assert new HashSet(result).size() == 9; - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java b/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java deleted file mode 100644 index 38b85a2..0000000 --- a/src/net/sourceforge/plantuml/geom/kinetic/QuadrantMapper.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom.kinetic; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -public class QuadrantMapper { - - private final Map quadrants = new HashMap(); - private final Map> setOfPoints = new HashMap>(); - - public void addPoint(Point2DCharge pt) { - if (quadrants.containsKey(pt)) { - throw new IllegalArgumentException(); - } - final Quadrant q = new Quadrant(pt); - quadrants.put(pt, q); - getSetOfPoints(q).add(pt); - assert getSetOfPoints(q).contains(pt); - assert getSetOfPoints(new Quadrant(pt)).contains(pt); - } - - public Set getAllPoints(Quadrant qt) { - return Collections.unmodifiableSet(getSetOfPoints(qt)); - } - - public Set getAllPoints() { - assert quadrants.keySet().equals(mergeOfSetOfPoints()); - return Collections.unmodifiableSet(quadrants.keySet()); - } - - private Set mergeOfSetOfPoints() { - final Set result = new HashSet(); - for (Set set : setOfPoints.values()) { - assert Collections.disjoint(set, result); - result.addAll(set); - } - return result; - } - - public void updatePoint(Point2DCharge pt) { - final Quadrant newQ = new Quadrant(pt); - final Quadrant old = quadrants.get(pt); - assert getSetOfPoints(old).contains(pt); - if (old.equals(newQ) == false) { - assert getSetOfPoints(newQ).contains(pt) == false; - assert getSetOfPoints(old).contains(pt); - final boolean remove = getSetOfPoints(old).remove(pt); - assert remove; - final boolean add = getSetOfPoints(newQ).add(pt); - assert add; - assert getSetOfPoints(newQ).contains(pt); - assert getSetOfPoints(old).contains(pt) == false; - quadrants.put(pt, newQ); - } - assert getSetOfPoints(new Quadrant(pt)).contains(pt); - } - - private HashSet getSetOfPoints(Quadrant q) { - HashSet result = setOfPoints.get(q); - if (result == null) { - result = new HashSet(); - setOfPoints.put(q, result); - } - return result; - - } - -} diff --git a/src/net/sourceforge/plantuml/geom/kinetic/World.java b/src/net/sourceforge/plantuml/geom/kinetic/World.java deleted file mode 100644 index c0daadb..0000000 --- a/src/net/sourceforge/plantuml/geom/kinetic/World.java +++ /dev/null @@ -1,173 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.geom.kinetic; - -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -public class World implements MoveObserver { - - private final List paths = new ArrayList(); - private final Map pathOfPoints = new HashMap(); - private final List frames = new ArrayList(); - - public void addFrame(Frame frame) { - this.frames.add(frame); - } - - public void addPath(Path path) { - this.paths.add(path); - } - - public VectorForce getElectricForce(Point2DCharge point) { - VectorForce result = new VectorForce(0, 0); - - final Quadrant quadrant = new Quadrant(point); - - for (Quadrant q : quadrant.neighbourhood()) { - for (Point2DCharge pc2 : quadrantMapper.getAllPoints(q)) { - final Path path = pathOfPoints.get(pc2); - if (path.containsPoint2DCharge(point)) { - continue; - } - result = result.plus(getElectricForce(point, pc2)); - } - } - return result; - } - - private VectorForce getElectricForceSlow(Point2DCharge point) { - VectorForce result = new VectorForce(0, 0); - - for (Path path : paths) { - if (path.containsPoint2DCharge(point)) { - continue; - } - for (Point2DCharge pc2 : path.getPoints()) { - result = result.plus(getElectricForce(point, pc2)); - } - } - return result; - } - - static private VectorForce getElectricForce(Point2DCharge onThis, Point2DCharge byThis) { - final double dist = onThis.distance(byThis); - if (dist == 0) { - return new VectorForce(0, 0); - } - final VectorForce result = new VectorForce(byThis.getX() - onThis.getX(), byThis.getY() - onThis.getY()); - final double v = 100.0 * onThis.getCharge() * byThis.getCharge() / dist / dist; - return result.normaliseTo(v); - } - - static private VectorForce getAtomicForce(Point2DCharge onThis, Point2DCharge byThis) { - final double dist = onThis.distance(byThis); - if (dist == 0) { - return new VectorForce(0, 0); - } - final VectorForce result = new VectorForce(byThis.getX() - onThis.getX(), byThis.getY() - onThis.getY()); - double v = 1000 / dist / dist / dist; - if (v > 5) { - v = 5; - } - return result.normaliseTo(v); - } - - Map getForces() { - final Map result = new LinkedHashMap(); - for (Path path : paths) { - for (Point2DCharge pt : path.getPoints()) { - // final VectorForce elastic = new VectorForce(0, 0); - // final VectorForce elect = new VectorForce(0, 0); - final VectorForce elastic = path.getElasticForce(pt); - final VectorForce elect = getElectricForce(pt); - VectorForce force = elastic.plus(elect); - for (Frame f : frames) { - final Point2D inter = f.getFrontierPointViewBy(pt); - if (inter != null) { - final Point2DCharge pchar = new Point2DCharge(inter, 1); - force = force.plus(getAtomicForce(pt, pchar)); - } - } - result.put(pt, force); - } - } - - return result; - } - - public double onePass() { - double result = 0; - final Map forces = getForces(); - for (Map.Entry ent : forces.entrySet()) { - final VectorForce force = ent.getValue(); - result += force.getLength(); - ent.getKey().apply(force); - } - return result; - } - - public final Collection getPaths() { - return Collections.unmodifiableCollection(paths); - } - - private QuadrantMapper quadrantMapper; - - public void renderContinue() { - quadrantMapper = new QuadrantMapper(); - pathOfPoints.clear(); - for (Path path : paths) { - path.renderContinue(); - } - for (Path path : paths) { - for (Point2DCharge pt : path.getPoints()) { - pt.setMoveObserver(this); - quadrantMapper.addPoint(pt); - pathOfPoints.put(pt, path); - } - } - } - - public void pointMoved(Point2DCharge point) { - quadrantMapper.updatePoint(point); - } -} diff --git a/src/net/sourceforge/plantuml/golem/Magnet.java b/src/net/sourceforge/plantuml/golem/Magnet.java deleted file mode 100644 index 4e685c6..0000000 --- a/src/net/sourceforge/plantuml/golem/Magnet.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.golem; - -public class Magnet { -} diff --git a/src/net/sourceforge/plantuml/golem/Square.java b/src/net/sourceforge/plantuml/golem/Square.java deleted file mode 100644 index 1e889b3..0000000 --- a/src/net/sourceforge/plantuml/golem/Square.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.golem; - -public class Square { -} diff --git a/src/net/sourceforge/plantuml/graph/ALink.java b/src/net/sourceforge/plantuml/graph/ALink.java deleted file mode 100644 index da4d66d..0000000 --- a/src/net/sourceforge/plantuml/graph/ALink.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public interface ALink { - - int getDiffHeight(); - - ANode getNode1(); - - ANode getNode2(); - - public Object getUserData(); - -} diff --git a/src/net/sourceforge/plantuml/graph/ALinkImpl.java b/src/net/sourceforge/plantuml/graph/ALinkImpl.java deleted file mode 100644 index cafc084..0000000 --- a/src/net/sourceforge/plantuml/graph/ALinkImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public class ALinkImpl implements ALink { - - private final ANode node1; - private final ANode node2; - private final Object userData; - private final int diffHeight; - - @Override - public String toString() { - return "" + node1 + " -> " + node2; - } - - public ALinkImpl(ANode n1, ANode n2, int diffHeight, Object userData) { - this.node1 = n1; - this.node2 = n2; - this.userData = userData; - this.diffHeight = diffHeight; - } - - public int getDiffHeight() { - return diffHeight; - } - - public ANode getNode1() { - return node1; - } - - public ANode getNode2() { - return node2; - } - - public final Object getUserData() { - return userData; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/ANode.java b/src/net/sourceforge/plantuml/graph/ANode.java deleted file mode 100644 index 6dd60c3..0000000 --- a/src/net/sourceforge/plantuml/graph/ANode.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public interface ANode { - - void setRow(int row); - - int getRow(); - - String getCode(); - - public Object getUserData(); - -} diff --git a/src/net/sourceforge/plantuml/graph/ANodeImpl.java b/src/net/sourceforge/plantuml/graph/ANodeImpl.java deleted file mode 100644 index 4592167..0000000 --- a/src/net/sourceforge/plantuml/graph/ANodeImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public class ANodeImpl implements ANode { - - private int row = Integer.MIN_VALUE; - private final String code; - private Object userData; - - public ANodeImpl(String code) { - this.code = code; - } - - @Override - public int hashCode() { - return code.hashCode(); - } - - public int getRow() { - return row; - } - - public void setRow(int row) { - this.row = row; - } - - public final String getCode() { - return code; - } - - @Override - public String toString() { - return code + " " + getRow(); - } - - public Object getUserData() { - return userData; - } - - public void setUserData(Object userData) { - this.userData = userData; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java b/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java deleted file mode 100644 index 073639d..0000000 --- a/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java +++ /dev/null @@ -1,115 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Font; -import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.ugraphic.ColorMapper; -import net.sourceforge.plantuml.ugraphic.UFont; - -abstract class AbstractEntityImage { - - private final IEntity entity; - - final private HtmlColor red = HtmlColorUtils.MY_RED; - - final private HtmlColor yellow = HtmlColorUtils.MY_YELLOW; - private final HtmlColor yellowNote = HtmlColorUtils.COL_FBFB77; - - final private UFont font14 = UFont.sansSerif(14); - final private UFont font17 = UFont.courier(17).bold(); - final private HtmlColor green = HtmlColorUtils.COL_ADD1B2; - final private HtmlColor violet = HtmlColorUtils.COL_B4A7E5; - final private HtmlColor blue = HtmlColorUtils.COL_A9DCDF; - final private HtmlColor rose = HtmlColorUtils.COL_EB937F; - - public AbstractEntityImage(IEntity entity) { - if (entity == null) { - throw new IllegalArgumentException("entity null"); - } - this.entity = entity; - } - - public abstract Dimension2D getDimension(StringBounder stringBounder); - - public abstract void draw(ColorMapper colorMapper, Graphics2D g2d); - - protected final IEntity getEntity() { - return entity; - } - - protected final HtmlColor getRed() { - return red; - } - - protected final HtmlColor getYellow() { - return yellow; - } - - protected final UFont getFont17() { - return font17; - } - - protected final UFont getFont14() { - return font14; - } - - protected final HtmlColor getGreen() { - return green; - } - - protected final HtmlColor getViolet() { - return violet; - } - - protected final HtmlColor getBlue() { - return blue; - } - - protected final HtmlColor getRose() { - return rose; - } - - protected final HtmlColor getYellowNote() { - return yellowNote; - } -} diff --git a/src/net/sourceforge/plantuml/graph/Board.java b/src/net/sourceforge/plantuml/graph/Board.java deleted file mode 100644 index 24cbcca..0000000 --- a/src/net/sourceforge/plantuml/graph/Board.java +++ /dev/null @@ -1,267 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class Board { - - private final List links; - private final Map initialDirection; - - private final Map nodesCols = new LinkedHashMap(); - - private int hashcodeValue; - private boolean hashcodeComputed = false; - - private Board(Board old) { - this.links = old.links; - this.initialDirection = old.initialDirection; - this.nodesCols.putAll(old.nodesCols); - } - - public Comparator getLinkComparator() { - return new LenghtLinkComparator(nodesCols); - } - - public boolean equals(Object o) { - final Board other = (Board) o; - if (this.links != other.links) { - return false; - } - final Iterator it1 = this.nodesCols.values().iterator(); - final Iterator it2 = other.nodesCols.values().iterator(); - assert this.nodesCols.size() == other.nodesCols.size(); - while (it1.hasNext()) { - if (it1.next().equals(it2.next()) == false) { - return false; - } - } - return true; - } - - @Override - public int hashCode() { - if (this.hashcodeComputed) { - return this.hashcodeValue; - } - this.hashcodeValue = 13; - for (Integer i : nodesCols.values()) { - this.hashcodeValue = this.hashcodeValue * 17 + i; - } - this.hashcodeComputed = true; - return this.hashcodeValue; - } - - public void normalize() { - int minRow = Integer.MAX_VALUE; - int minCol = Integer.MAX_VALUE; - int maxRow = Integer.MIN_VALUE; - int maxCol = Integer.MIN_VALUE; - for (Map.Entry ent : nodesCols.entrySet()) { - minRow = Math.min(minRow, ent.getKey().getRow()); - maxRow = Math.max(maxRow, ent.getKey().getRow()); - minCol = Math.min(minCol, ent.getValue()); - maxCol = Math.max(maxCol, ent.getValue()); - } - for (Map.Entry ent : nodesCols.entrySet()) { - if (minRow != 0) { - ent.getKey().setRow(ent.getKey().getRow() - minRow); - } - if (minCol != 0) { - ent.setValue(ent.getValue() - minCol); - } - } - } - - private void normalizeCol() { - final int minCol = Collections.min(nodesCols.values()); - - if (minCol != 0) { - for (Map.Entry ent : nodesCols.entrySet()) { - ent.setValue(ent.getValue() - minCol); - } - } - } - - void internalMove(String code, int newCol) { - hashcodeComputed = false; - for (ANode n : nodesCols.keySet()) { - if (n.getCode().equals(code)) { - nodesCols.put(n, newCol); - return; - } - } - } - - public Board copy() { - return new Board(this); - } - - public Board(List nodes, List links) { - for (ANode n : nodes) { - addInRow(n); - } - this.links = Collections.unmodifiableList(new ArrayList(links)); - this.initialDirection = new HashMap(); - for (ALink link : links) { - this.initialDirection.put(link, getDirection(link)); - } - } - - public int getInitialDirection(ALink link) { - return initialDirection.get(link); - } - - public int getDirection(ALink link) { - return getCol(link.getNode2()) - getCol(link.getNode1()); - } - - private void addInRow(ANode n) { - hashcodeComputed = false; - int col = 0; - while (true) { - if (getNodeAt(n.getRow(), col) == null) { - nodesCols.put(n, col); - assert getNodeAt(n.getRow(), col) == n; - return; - } - col++; - } - } - - public Collection getNodes() { - return Collections.unmodifiableCollection(nodesCols.keySet()); - } - - public Collection getNodesInRow(int row) { - final List result = new ArrayList(); - for (ANode n : nodesCols.keySet()) { - if (n.getRow() == row) { - result.add(n); - } - } - return Collections.unmodifiableCollection(result); - } - - public final List getLinks() { - return Collections.unmodifiableList(links); - } - - public int getCol(ANode n) { - return nodesCols.get(n); - } - - public void applyMove(Move move) { - final ANode piece = getNodeAt(move.getRow(), move.getCol()); - if (piece == null) { - throw new IllegalArgumentException(); - } - final ANode piece2 = getNodeAt(move.getRow(), move.getNewCol()); - nodesCols.put(piece, move.getNewCol()); - if (piece2 != null) { - nodesCols.put(piece2, move.getCol()); - } - normalizeCol(); - hashcodeComputed = false; - } - - public Collection getAllPossibleMoves() { - final List result = new ArrayList(); - for (Map.Entry ent : nodesCols.entrySet()) { - final int row = ent.getKey().getRow(); - final int col = ent.getValue(); - result.add(new Move(row, col, -1)); - result.add(new Move(row, col, 1)); - } - return result; - } - - public ANode getNodeAt(int row, int col) { - for (Map.Entry ent : nodesCols.entrySet()) { - if (ent.getKey().getRow() == row && ent.getValue().intValue() == col) { - return ent.getKey(); - } - } - return null; - } - - public Set getConnectedNodes(ANode root, int level) { - if (level < 0) { - throw new IllegalArgumentException(); - } - if (level == 0) { - return Collections.singleton(root); - } - final Set result = new HashSet(); - if (level == 1) { - for (ALink link : links) { - if (link.getNode1() == root) { - result.add(link.getNode2()); - } else if (link.getNode2() == root) { - result.add(link.getNode1()); - } - - } - } else { - for (ANode n : getConnectedNodes(root, level - 1)) { - result.addAll(getConnectedNodes(n, 1)); - } - } - return Collections.unmodifiableSet(result); - } - - public Set getAllLinks(Set nodes) { - final Set result = new HashSet(); - for (ALink link : links) { - if (nodes.contains(link.getNode1()) || nodes.contains(link.getNode2())) { - result.add(link); - } - } - return Collections.unmodifiableSet(result); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/BoardCollection.java b/src/net/sourceforge/plantuml/graph/BoardCollection.java deleted file mode 100644 index 98855f9..0000000 --- a/src/net/sourceforge/plantuml/graph/BoardCollection.java +++ /dev/null @@ -1,128 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.List; - -public class BoardCollection { - - static class Entry implements Comparable { - final private Board board; - final private double cost; - private boolean explored; - - public Entry(Board b, CostComputer costComputer) { - this.board = b; - if (costComputer == null) { - this.cost = 0; - } else { - this.cost = costComputer.getCost(b); - } - } - - public int compareTo(Entry other) { - return (int) Math.signum(this.cost - other.cost); - } - - @Override - public boolean equals(Object obj) { - final Entry other = (Entry) obj; - return board.equals(other.board); - } - - @Override - public int hashCode() { - return board.hashCode(); - } - - } - - private final SortedCollection all = new SortedCollectionArrayList(); - - private final CostComputer costComputer; - - public BoardCollection(CostComputer costComputer) { - this.costComputer = costComputer; - } - - public int size() { - return all.size(); - } - - public Board getAndSetExploredSmallest() { - for (Entry ent : all) { - if (ent.explored == false) { - ent.explored = true; - assert costComputer.getCost(ent.board) == ent.cost; - // Log.println("Peeking " + ent.cost); - return ent.board; - } - } - return null; - } - - public double getBestCost() { - for (Entry ent : all) { - return ent.cost; - } - return 0; - } - - public Board getBestBoard() { - for (Entry ent : all) { - return ent.board; - } - return null; - } - - public List getCosts() { - final List result = new ArrayList(); - for (Entry ent : all) { - result.add(costComputer.getCost(ent.board)); - } - return result; - } - - public void add(Board b) { - all.add(new Entry(b, costComputer)); - } - - public boolean contains(Board b) { - return all.contains(new Entry(b, null)); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/BoardExplorer.java b/src/net/sourceforge/plantuml/graph/BoardExplorer.java deleted file mode 100644 index c99e804..0000000 --- a/src/net/sourceforge/plantuml/graph/BoardExplorer.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.HashSet; -import java.util.Set; - -public class BoardExplorer { - - private final BoardCollection all = new BoardCollection(new KenavoCostComputer()); - - public BoardExplorer(Board init) { - all.add(init); - } - - public double getBestCost() { - return all.getBestCost(); - } - - public Board getBestBoard() { - return all.getBestBoard(); - } - - public int collectionSize() { - return all.size(); - } - - public boolean onePass() { - final Board smallest = all.getAndSetExploredSmallest(); - if (smallest == null) { - return true; - } - final Set moves = nextBoards(smallest); - for (Board newBoard : moves) { - if (all.contains(newBoard)) { - continue; - } - all.add(newBoard); - } - return false; - } - - public Set nextBoards(Board board) { - final Set result = new HashSet(); - for (Move m : board.getAllPossibleMoves()) { - final Board copy = board.copy(); - copy.applyMove(m); - result.add(copy); - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/CostComputer.java b/src/net/sourceforge/plantuml/graph/CostComputer.java deleted file mode 100644 index b29bcf1..0000000 --- a/src/net/sourceforge/plantuml/graph/CostComputer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public interface CostComputer { - - double getCost(Board board); - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/graph/ElectricCharge.java b/src/net/sourceforge/plantuml/graph/ElectricCharge.java deleted file mode 100644 index 41508d1..0000000 --- a/src/net/sourceforge/plantuml/graph/ElectricCharge.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.geom.Point2D; - -public class ElectricCharge { - - private boolean moveable; - private final Point2D position; - private final double charge; - - public ElectricCharge(double x, double y, double charge) { - this.position = new Point2D.Double(x, y); - this.charge = charge; - } - - public Point2D getPosition() { - return position; - } - - public double getCharge() { - return charge; - } - - public final boolean isMoveable() { - return moveable; - } - - public final void setMoveable(boolean moveable) { - this.moveable = moveable; - } - - public void move(double deltax, double deltay) { - position.setLocation(position.getX() + deltax, position.getY() + deltay); - } -} diff --git a/src/net/sourceforge/plantuml/graph/ElectricWord.java b/src/net/sourceforge/plantuml/graph/ElectricWord.java deleted file mode 100644 index 7181000..0000000 --- a/src/net/sourceforge/plantuml/graph/ElectricWord.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class ElectricWord { - - private List charges = new ArrayList(); - - public ElectricWord(Rectangle2D playingZone) { - - } - - public void addGlueArea(Rectangle2D glue) { - - } - - public void addCharge(ElectricCharge charge) { - - } - - public void addCharges(Collection charges) { - - } - - public Point2D getForceAt(Point2D position, double charge, Collection ignoredCharges) { - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java deleted file mode 100644 index e1da35f..0000000 --- a/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.ugraphic.ColorMapper; - -class EntityImageActivityBar extends AbstractEntityImage { - - private final int width = 100; - private final int height = 8; - - public EntityImageActivityBar(IEntity entity) { - super(entity); - } - - @Override - public Dimension2D getDimension(StringBounder stringBounder) { - return new Dimension2DDouble(width, height); - } - - @Override - public void draw(ColorMapper colorMapper, Graphics2D g2d) { - g2d.setColor(Color.BLACK); - g2d.fillRect(0, 0, width, height); - } -} diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java deleted file mode 100644 index ebb544d..0000000 --- a/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Graphics2D; -import java.awt.Polygon; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.ugraphic.ColorMapper; - -class EntityImageActivityBranch extends AbstractEntityImage { - - private final int size = 10; - - public EntityImageActivityBranch(IEntity entity) { - super(entity); - } - - @Override - public Dimension2D getDimension(StringBounder stringBounder) { - return new Dimension2DDouble(size * 2, size * 2); - } - - @Override - public void draw(ColorMapper colorMapper, Graphics2D g2d) { - final Polygon p = new Polygon(); - p.addPoint(size, 0); - p.addPoint(size * 2, size); - p.addPoint(size, size * 2); - p.addPoint(0, size); - - g2d.setColor(colorMapper.getMappedColor(getYellow())); - g2d.fill(p); - g2d.setColor(colorMapper.getMappedColor(getRed())); - g2d.draw(p); - } -} diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java deleted file mode 100644 index e5f01cc..0000000 --- a/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.ugraphic.ColorMapper; - -class EntityImageActivityCircle extends AbstractEntityImage { - - private final int diameterExternal; - private final int diameterInternal; - - public EntityImageActivityCircle(IEntity entity, int diameterExternal, int diameterInternal) { - super(entity); - this.diameterExternal = diameterExternal; - this.diameterInternal = diameterInternal; - } - - @Override - public Dimension2D getDimension(StringBounder stringBounder) { - return new Dimension2DDouble(diameterExternal, diameterExternal); - } - - @Override - public void draw(ColorMapper colorMapper, Graphics2D g2d) { - g2d.setColor(Color.BLACK); - final int delta = diameterExternal - diameterInternal + 1; - g2d.drawOval(0, 0, diameterExternal, diameterExternal); - g2d.fillOval(delta / 2, delta / 2, diameterInternal, diameterInternal); - } -} diff --git a/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java b/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java deleted file mode 100644 index 752f215..0000000 --- a/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; - -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.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.skin.CircleInterface; -import net.sourceforge.plantuml.ugraphic.ColorMapper; - -class EntityImageCircleInterface extends AbstractEntityImage { - - final private TextBlock name; - final private CircleInterface circleInterface; - - public EntityImageCircleInterface(IEntity entity) { - super(entity); - this.name = entity.getDisplay().create(FontConfiguration.blackBlueTrue(getFont14()), - HorizontalAlignment.CENTER, new SpriteContainerEmpty()); - this.circleInterface = new CircleInterface(getYellow(), getRed()); - } - - @Override - public Dimension2D getDimension(StringBounder stringBounder) { - final Dimension2D nameDim = name.calculateDimension(stringBounder); - final double manWidth = circleInterface.getPreferredWidth(stringBounder); - final double manHeight = circleInterface.getPreferredHeight(stringBounder); - return new Dimension2DDouble(Math.max(manWidth, nameDim.getWidth()), manHeight + nameDim.getHeight()); - } - - @Override - public void draw(ColorMapper colorMapper, Graphics2D g2d) { - throw new UnsupportedOperationException(); - // final Dimension2D dimTotal = getDimension(StringBounderUtils.asStringBounder(g2d)); - // final Dimension2D nameDim = name.calculateDimension(StringBounderUtils.asStringBounder(g2d)); - // - // final double manWidth = circleInterface.getPreferredWidth(StringBounderUtils.asStringBounder(g2d)); - // final double manHeight = circleInterface.getPreferredHeight(StringBounderUtils.asStringBounder(g2d)); - // - // final double manX = (dimTotal.getWidth() - manWidth) / 2; - // - // g2d.setColor(Color.WHITE); - // g2d.fill(new Rectangle2D.Double(0, 0, dimTotal.getWidth(), dimTotal.getHeight())); - // - // g2d.translate(manX, 0); - // circleInterface.draw(g2d); - // g2d.translate(-manX, 0); - // - // g2d.setColor(Color.BLACK); - // name.drawTOBEREMOVED(g2d, (dimTotal.getWidth() - nameDim.getWidth()) / 2, manHeight); - } -} diff --git a/src/net/sourceforge/plantuml/graph/Galaxy4.java b/src/net/sourceforge/plantuml/graph/Galaxy4.java deleted file mode 100644 index c44a3c1..0000000 --- a/src/net/sourceforge/plantuml/graph/Galaxy4.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.geom.Point2DInt; -import net.sourceforge.plantuml.geom.PolylineBreakeable; -import net.sourceforge.plantuml.geom.SpiderWeb; - -public class Galaxy4 { - - final private Board board; - - final private Map lines = new LinkedHashMap(); - final private SpiderWeb spiderWeb; - - public Galaxy4(Board board, int widthCell, int heightCell) { - this.spiderWeb = new SpiderWeb(widthCell, heightCell); - this.board = board; - } - - public Point2DInt getMainPoint(int row, int col) { - return spiderWeb.getMainPoint(row, col); - } - - public PolylineBreakeable getPolyline(ALink link) { - return lines.get(link); - - } - - public void addLink(ALink link) { - final int rowStart = link.getNode1().getRow(); - final int rowEnd = link.getNode2().getRow(); - final int colStart = board.getCol(link.getNode1()); - final int colEnd = board.getCol(link.getNode2()); - - final PolylineBreakeable polyline = spiderWeb.addPolyline(rowStart, colStart, rowEnd, colEnd); - - Log.info("link=" + link + " polyline=" + polyline); - - if (polyline == null) { - Log.info("PENDING " + link + " " + polyline); - } else { - lines.put(link, polyline); - } - - } - - public final Board getBoard() { - return board; - } - - public final Map getLines() { - return Collections.unmodifiableMap(lines); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java b/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java deleted file mode 100644 index 7fd54c2..0000000 --- a/src/net/sourceforge/plantuml/graph/GeneralPathFactory.java +++ /dev/null @@ -1,158 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Polygon; -import java.awt.Shape; -import java.awt.geom.AffineTransform; -import java.awt.geom.GeneralPath; -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.cucadiagram.LinkType; -import net.sourceforge.plantuml.geom.Box; -import net.sourceforge.plantuml.geom.LineSegmentInt; -import net.sourceforge.plantuml.geom.PolylineBreakeable; - -public class GeneralPathFactory { - - private final LinkType linkType; - - public GeneralPathFactory(LinkType linkType) { - this.linkType = linkType; - } - - public Shape getLink(PolylineBreakeable polyline, Box b1, Box b2) { - final LineSegmentInt directSegment = new LineSegmentInt(b1.getCenterX(), b1.getCenterY(), b2.getCenterX(), b2 - .getCenterY()); - assert b1.intersect(directSegment).length == 1; - assert b2.intersect(directSegment).length == 1; - - // final Point2D.Double start = polyline.clipStart(b1); - // final Point2D.Double end = polyline.clipEnd(b2); - final GeneralPath generalPath = polyline.asGeneralPath(); - // addSymbol(generalPath, start, polyline.getFirst(), end, - // polyline.getLast()); - return generalPath; - - } - - private void addSymbol(GeneralPath generalPath, Point2D.Double firstPoint, LineSegmentInt firstSeg, - Point2D.Double lastPoint, LineSegmentInt lastSeg) { -// if (linkType.equals(LinkType.AGREGATION) || linkType.equals(LinkType.COMPOSITION)) { -// addSymbolDiamond(generalPath, lastPoint, lastSeg); -// } else if (linkType.equals(LinkType.AGREGATION_INV) || linkType.equals(LinkType.COMPOSITION_INV)) { -// addSymbolDiamondInv(generalPath, firstPoint, firstSeg); -// } else if (linkType.equals(LinkType.NAVASSOC) || linkType.equals(LinkType.NAVASSOC_DASHED)) { -// addSymbolNavasoc(generalPath, lastPoint, lastSeg); -// } else if (linkType.equals(LinkType.NAVASSOC_INV) || linkType.equals(LinkType.NAVASSOC_DASHED_INV)) { -// addSymbolNavasocInv(generalPath, firstPoint, firstSeg); -// } else if (linkType.equals(LinkType.EXTENDS_INV) || linkType.equals(LinkType.IMPLEMENTS_INV)) { -// addSymbolExtends(generalPath, firstPoint, firstSeg); -// } else if (linkType.equals(LinkType.EXTENDS) || linkType.equals(LinkType.IMPLEMENTS)) { -// addSymbolExtendsInv(generalPath, lastPoint, lastSeg); -// } else { -// assert linkType.equals(LinkType.ASSOCIED) || linkType.equals(LinkType.ASSOCIED_DASHED); -// } - } - - private void addSymbolDiamond(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg) { - final Polygon arrow = new Polygon(); - arrow.addPoint(0, 0); - arrow.addPoint(-10, 6); - arrow.addPoint(-20, 0); - arrow.addPoint(-10, -6); - - appendAndRotate(generalPath, point, seg, arrow); - } - - private void addSymbolDiamondInv(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg) { - final Polygon arrow = new Polygon(); - arrow.addPoint(0, 0); - arrow.addPoint(10, 6); - arrow.addPoint(20, 0); - arrow.addPoint(10, -6); - - appendAndRotate(generalPath, point, seg, arrow); - } - - private void addSymbolNavasocInv(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg) { - final Polygon arrow = new Polygon(); - arrow.addPoint(0, 0); - arrow.addPoint(13, -8); - arrow.addPoint(6, 0); - arrow.addPoint(13, 8); - - appendAndRotate(generalPath, point, seg, arrow); - } - - private void addSymbolNavasoc(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg) { - final Polygon arrow = new Polygon(); - arrow.addPoint(0, 0); - arrow.addPoint(-13, -8); - arrow.addPoint(-6, 0); - arrow.addPoint(-13, 8); - - appendAndRotate(generalPath, point, seg, arrow); - } - - private void addSymbolExtends(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg) { - final Polygon arrow = new Polygon(); - arrow.addPoint(0, 0); - arrow.addPoint(25, 7); - arrow.addPoint(25, -7); - - appendAndRotate(generalPath, point, seg, arrow); - } - - private void addSymbolExtendsInv(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg) { - final Polygon arrow = new Polygon(); - arrow.addPoint(0, 0); - arrow.addPoint(-25, 7); - arrow.addPoint(-25, -7); - - appendAndRotate(generalPath, point, seg, arrow); - } - - private void appendAndRotate(GeneralPath generalPath, Point2D.Double point, LineSegmentInt seg, final Shape shape) { - final AffineTransform at = AffineTransform.getTranslateInstance(point.x, point.y); - final double theta = seg.getAngle(); - at.rotate(theta); - - final Shape r = at.createTransformedShape(shape); - generalPath.append(r, false); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/Graph1.java b/src/net/sourceforge/plantuml/graph/Graph1.java deleted file mode 100644 index 44ef13e..0000000 --- a/src/net/sourceforge/plantuml/graph/Graph1.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; - -public class Graph1 { - - private final Board board; - private final int widthCell = 40; - private final int heightCell = 40; - - public Graph1(Board board) { - this.board = board; - } - - public BufferedImage createBufferedImage() { - final BufferedImage im = new BufferedImage(widthCell * 15, heightCell * 15, BufferedImage.TYPE_INT_RGB); - final Graphics2D g2d = im.createGraphics(); - g2d.setColor(Color.WHITE); - g2d.fillRect(0, 0, im.getWidth(), im.getHeight()); - - g2d.setColor(Color.BLACK); - for (ANode n : board.getNodes()) { - final int x = board.getCol(n) * widthCell; - final int y = n.getRow() * heightCell; - g2d.drawString(n.getCode(), x + 5, y + heightCell / 2 - 5); - g2d.drawOval(x, y, widthCell / 2, heightCell / 2); - } - - for (ALink link : board.getLinks()) { - final ANode n1 = link.getNode1(); - final ANode n2 = link.getNode2(); - final int x1 = 10 + board.getCol(n1) * widthCell; - final int y1 = 10 + n1.getRow() * heightCell; - final int x2 = 10 + board.getCol(n2) * widthCell; - final int y2 = 10 + n2.getRow() * heightCell; - g2d.drawLine(x1, y1, x2, y2); - - } - - return im; - - } - -} diff --git a/src/net/sourceforge/plantuml/graph/Heap.java b/src/net/sourceforge/plantuml/graph/Heap.java deleted file mode 100644 index fec054f..0000000 --- a/src/net/sourceforge/plantuml/graph/Heap.java +++ /dev/null @@ -1,242 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -public class Heap { - - private final Map nodes = new LinkedHashMap(); - private final Map> directChildren = new LinkedHashMap>(); - private final List links = new ArrayList(); - - public boolean isEmpty() { - if (links.isEmpty()) { - assert nodes.isEmpty(); - assert directChildren.isEmpty(); - return true; - } - return false; - } - - public void importing(ANode under, ANode otherRoot, Heap otherHeap, int diffHeight, Object userData) { - assert this.directChildren.keySet().contains(under); - assert this.nodes.values().contains(under); - assert otherHeap.nodes.values().contains(otherRoot); - assert otherHeap.directChildren.keySet().contains(otherRoot); - assert this.nodes.values().contains(otherRoot) == false; - assert this.directChildren.keySet().contains(otherRoot) == false; - assert otherHeap.directChildren.keySet().contains(under) == false; - final int oldSize = this.nodes.size(); - assert oldSize == this.directChildren.size(); - this.nodes.putAll(otherHeap.nodes); - this.directChildren.putAll(otherHeap.directChildren); - final ALinkImpl link = new ALinkImpl(under, otherRoot, diffHeight, userData); - this.links.add(link); - this.links.addAll(otherHeap.links); - assert oldSize + otherHeap.nodes.size() == this.nodes.size(); - assert oldSize + otherHeap.directChildren.size() == this.directChildren.size(); - - addUnderMe(under, otherRoot, link); - } - - public void computeRows() { - for (ANode n : nodes.values()) { - n.setRow(Integer.MIN_VALUE); - } - nodes.values().iterator().next().setRow(0); - boolean changed; - do { - onePass(); - changed = false; - for (ANode n : nodes.values()) { - if (n.getRow() != Integer.MIN_VALUE) { - continue; - } - final Map.Entry smallestRowOfChildren = getSmallestRowOfChildren(n); - if (smallestRowOfChildren != null) { - n.setRow(getStartingRow(smallestRowOfChildren)); - } - changed = true; - } - } while (changed); - - minToZero(); - } - - private int getStartingRow(Map.Entry ent) { - assert ent.getValue().getNode2() == ent.getKey(); - return ent.getValue().getNode2().getRow() - ent.getValue().getDiffHeight(); - } - - private void minToZero() { - int min = Integer.MAX_VALUE; - for (ANode n : nodes.values()) { - min = Math.min(min, n.getRow()); - } - if (min == Integer.MIN_VALUE) { - throw new IllegalStateException(); - } - if (min != 0) { - for (ANode n : nodes.values()) { - n.setRow(n.getRow() - min); - } - } - - } - - private Map.Entry getSmallestRowOfChildren(ANode n) { - assert n.getRow() == Integer.MIN_VALUE; - Map.Entry result = null; - for (Map.Entry ent : directChildren.get(n).entrySet()) { - final ANode child = ent.getKey(); - if (child.getRow() == Integer.MIN_VALUE) { - continue; - } - if (result == null || getStartingRow(ent) < getStartingRow(result)) { - result = ent; - } - } - // assert result != null; - return result; - } - - private void onePass() { - boolean changed; - do { - changed = false; - for (ANode n : nodes.values()) { - final int row = n.getRow(); - if (row == Integer.MIN_VALUE) { - continue; - } - for (Map.Entry ent : directChildren.get(n).entrySet()) { - final ANode child = ent.getKey(); - final int diffHeight = ent.getValue().getDiffHeight(); - if (child.getRow() == Integer.MIN_VALUE || child.getRow() < row + diffHeight) { - child.setRow(row + diffHeight); - changed = true; - } - } - } - } while (changed); - } - - private ANode getNode(String code) { - ANode result = nodes.get(code); - if (result == null) { - result = createNewNode(code); - } - return result; - } - - private ANode createNewNode(String code) { - final ANode result = new ANodeImpl(code); - directChildren.put(result, new LinkedHashMap()); - nodes.put(code, result); - assert directChildren.size() == nodes.size(); - return result; - } - - public ANode getExistingNode(String code) { - return nodes.get(code); - } - - public List getLinks() { - return Collections.unmodifiableList(links); - } - - public List getNodes() { - return Collections.unmodifiableList(new ArrayList(nodes.values())); - } - - HashSet getAllChildren(ANode n) { - final HashSet result = new HashSet(directChildren.get(n).keySet()); - int size = 0; - do { - size = result.size(); - for (ANode other : new HashSet(result)) { - result.addAll(getAllChildren(other)); - } - } while (result.size() != size); - return result; - } - - public void addLink(String stringLink, int diffHeight, Object userData) { - final LinkString l = new LinkString(stringLink); - final ANode n1 = getNode(l.getNode1()); - final ANode n2 = getNode(l.getNode2()); - if (n1 == n2) { - return; - } - final ALinkImpl link = new ALinkImpl(n1, n2, diffHeight, userData); - links.add(link); - - if (getAllChildren(n2).contains(n1)) { - addUnderMe(n2, n1, link); - } else { - addUnderMe(n1, n2, link); - } - } - - public ANode addNode(String code) { - if (nodes.containsKey(code)) { - throw new IllegalArgumentException(); - } - return createNewNode(code); - } - - private void addUnderMe(final ANode n1, final ANode n2, final ALinkImpl link) { - assert getAllChildren(n2).contains(n1) == false; - directChildren.get(n1).put(n2, link); - assert getAllChildren(n1).contains(n2); - assert getAllChildren(n2).contains(n1) == false; - } - - public int getRowMax() { - int max = Integer.MIN_VALUE; - for (ANode n : nodes.values()) { - max = Math.max(max, n.getRow()); - } - return max; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java b/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java deleted file mode 100644 index 97c2b2f..0000000 --- a/src/net/sourceforge/plantuml/graph/KenavoCostComputer.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import net.sourceforge.plantuml.geom.LineSegmentInt; - -public class KenavoCostComputer implements CostComputer { - - public double getCost(Board board) { - double result = 0; - for (ALink link1 : board.getLinks()) { - for (ALink link2 : board.getLinks()) { - result += getCost(board, link1, link2); - } - } - return result; - } - - LineSegmentInt getLineSegment(Board board, ALink link) { - final ANode n1 = link.getNode1(); - final ANode n2 = link.getNode2(); - return new LineSegmentInt(board.getCol(n1), n1.getRow(), board.getCol(n2), n2.getRow()); - } - - private double getCost(Board board, ALink link1, ALink link2) { - final LineSegmentInt seg1 = getLineSegment(board, link1); - final LineSegmentInt seg2 = getLineSegment(board, link2); - - final double len1 = getLength(link1, seg1, board); - final double len2 = getLength(link2, seg2, board); - - return len1 * len2 * Math.exp(-seg1.getDistance(seg2)); - } - - private double getLength(ALink link, final LineSegmentInt seg, Board board) { - double coef = 1; - if (link.getNode1().getRow() == link.getNode2().getRow() - && board.getDirection(link) != board.getInitialDirection(link)) { - coef = 1.1; - } - - return seg.getLength() * coef; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java b/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java deleted file mode 100644 index b316e64..0000000 --- a/src/net/sourceforge/plantuml/graph/LenghtLinkComparator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.Comparator; -import java.util.Map; - -public class LenghtLinkComparator implements Comparator { - - private final Map cols; - - public LenghtLinkComparator(Map cols) { - this.cols = cols; - } - - public int compare(ALink link1, ALink link2) { - return (int) Math.signum(getLenght(link1) - getLenght(link2)); - } - - private double getLenght(ALink link) { - final ANode n1 = link.getNode1(); - final ANode n2 = link.getNode2(); - final int deltaRow = n2.getRow() - n1.getRow(); - final int deltaCol = cols.get(n2) - cols.get(n1); - return deltaRow * deltaRow + deltaCol * deltaCol; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/LinkString.java b/src/net/sourceforge/plantuml/graph/LinkString.java deleted file mode 100644 index c69ec79..0000000 --- a/src/net/sourceforge/plantuml/graph/LinkString.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; - -public class LinkString { - - final private static Pattern2 p = MyPattern.cmpile("(.*)->(.*)"); - - final private String node1; - final private String node2; - - public LinkString(String desc) { - final Matcher2 m = p.matcher(desc); - if (m.find() == false) { - throw new IllegalArgumentException(); - } - node1 = m.group(1); - node2 = m.group(2); - - } - - public final String getNode1() { - return node1; - } - - public final String getNode2() { - return node2; - } -} diff --git a/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java deleted file mode 100644 index 0d56eaa..0000000 --- a/src/net/sourceforge/plantuml/graph/MethodsOrFieldsArea.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.awt.geom.Dimension2D; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.SpriteContainerEmpty; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.cucadiagram.Member; -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.skin.VisibilityModifier; -import net.sourceforge.plantuml.ugraphic.UFont; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class MethodsOrFieldsArea { - - private final UFont font; - private final List strings = new ArrayList(); - - public MethodsOrFieldsArea(List attributes, UFont font) { - this.font = font; - for (Member att : attributes) { - this.strings.add(att.getDisplay(false)); - } - } - - public VisibilityModifier getVisibilityModifier() { - throw new UnsupportedOperationException(); - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - double x = 0; - double y = 0; - for (String s : strings) { - final TextBlock bloc = createTextBlock(s); - final Dimension2D dim = bloc.calculateDimension(stringBounder); - y += dim.getHeight(); - x = Math.max(dim.getWidth(), x); - } - return new Dimension2DDouble(x, y); - } - - private TextBlock createTextBlock(String s) { - return Display.create(s).create(FontConfiguration.blackBlueTrue(font), HorizontalAlignment.LEFT, - new SpriteContainerEmpty()); - } - - public void draw(UGraphic ug, double x, double y) { - for (String s : strings) { - final TextBlock bloc = createTextBlock(s); - bloc.drawU(ug.apply(new UTranslate(x, y))); - y += bloc.calculateDimension(ug.getStringBounder()).getHeight(); - } - } - -} diff --git a/src/net/sourceforge/plantuml/graph/Move.java b/src/net/sourceforge/plantuml/graph/Move.java deleted file mode 100644 index d671757..0000000 --- a/src/net/sourceforge/plantuml/graph/Move.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public class Move { - - private final int row; - private final int col; - private final int delta; - - @Override - public String toString() { - return row + "." + col + "->" + row + "." + (col + delta); - } - - public Move(int row, int col, int delta) { - if (delta != 1 && delta != -1) { - throw new IllegalArgumentException(); - } - this.row = row; - this.col = col; - this.delta = delta; - } - - public int getRow() { - return row; - } - - public int getCol() { - return col; - } - - public int getNewCol() { - return col + delta; - } - - public int getDelta() { - return delta; - } - - public Move getBackMove() { - return new Move(row, col + delta, -delta); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/Oven.java b/src/net/sourceforge/plantuml/graph/Oven.java deleted file mode 100644 index e533c12..0000000 --- a/src/net/sourceforge/plantuml/graph/Oven.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.Random; - -public class Oven { - - final private double temp; - final private CostComputer costComputer; - - public Oven(double temp, CostComputer costComputer) { - this.temp = temp; - this.costComputer = costComputer; - } - - public Board longTic(int nbTic, Board board, Random rnd) { - double best = costComputer.getCost(board); - Board bestBoard = board.copy(); - for (int i = 0; i < nbTic; i++) { - final double current = tic(board, rnd); - // Log.println("current=" + current + " best=" + best); - if (current < best) { - best = current; - bestBoard = board.copy(); - } - - } - return bestBoard; - } - - public double tic(Board board, Random rnd) { - // Log.println("Oven::tic"); - final double costBefore = costComputer.getCost(board); - final Move move = null; // board.getRandomMove(rnd); - board.applyMove(move); - final double costAfter = costComputer.getCost(board); - final double delta = costAfter - costBefore; - // Log.println("delta=" + delta); - if (delta <= 0) { - return costAfter; - } - assert delta > 0; - assert costAfter > costBefore; - // Log.println("temp=" + temp); - if (temp > 0) { - final double probability = Math.exp(-delta / temp); - final double dice = rnd.nextDouble(); - // Log.println("probability=" + probability + " dice=" + - // dice); - if (dice < probability) { - // Log.println("We keep it"); - return costAfter; - } - } - // Log.println("Roolback"); - board.applyMove(move.getBackMove()); - assert costBefore == costComputer.getCost(board); - return costBefore; - - } -} diff --git a/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java b/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java deleted file mode 100644 index d83f2a2..0000000 --- a/src/net/sourceforge/plantuml/graph/SimpleCostComputer.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public class SimpleCostComputer implements CostComputer { - - /* - * (non-Javadoc) - * - * @see net.sourceforge.plantuml.graph.CostComputer#getCost(net.sourceforge.plantuml.graph.Board) - */ - public double getCost(Board board) { - double result = 0; - for (ALink link : board.getLinks()) { - final ANode n1 = link.getNode1(); - final ANode n2 = link.getNode2(); - final int x1 = board.getCol(n1); - final int y1 = n1.getRow(); - final int x2 = board.getCol(n2); - final int y2 = n2.getRow(); - result += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/graph/SortedCollection.java b/src/net/sourceforge/plantuml/graph/SortedCollection.java deleted file mode 100644 index f9c52d4..0000000 --- a/src/net/sourceforge/plantuml/graph/SortedCollection.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -public interface SortedCollection> extends Iterable { - - int size(); - - void add(S entry); - - boolean contains(S entry); - -} diff --git a/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java b/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java deleted file mode 100644 index 7b449ea..0000000 --- a/src/net/sourceforge/plantuml/graph/SortedCollectionArrayList.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -public class SortedCollectionArrayList> implements SortedCollection { - - private final List allAsList = new ArrayList(); - private final Set allAsSet = new HashSet(); - - public Iterator iterator() { - return allAsList.iterator(); - } - - public void add(S newEntry) { - final int r = Collections.binarySearch(allAsList, newEntry); - if (r >= 0) { - allAsList.add(r, newEntry); - } else { - allAsList.add(-1 - r, newEntry); - } - allAsSet.add(newEntry); - assert isSorted(); - } - - public int size() { - assert allAsSet.size() == allAsList.size(); - return allAsList.size(); - } - - List toList() { - return new ArrayList(allAsList); - } - - boolean isSorted() { - S before = null; - for (S ent : allAsList) { - if (before != null && ent.compareTo(before) < 0) { - return false; - } - before = ent; - } - return true; - } - - public boolean contains(S entry) { - return allAsSet.contains(entry); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java b/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java deleted file mode 100644 index 023befa..0000000 --- a/src/net/sourceforge/plantuml/graph/SortedCollectionLinked.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; - -public class SortedCollectionLinked> implements SortedCollection { - - private final List all = new LinkedList(); - - public Iterator iterator() { - return all.iterator(); - } - - public void add(S newEntry) { - for (final ListIterator it = all.listIterator(); it.hasNext();) { - final S cur = it.next(); - if (cur.compareTo(newEntry) >= 0) { - it.previous(); - it.add(newEntry); - assert isSorted(); - return; - } - } - all.add(newEntry); - assert isSorted(); - } - - public int size() { - return all.size(); - } - - List toList() { - return new ArrayList(all); - } - - boolean isSorted() { - S before = null; - for (S ent : all) { - if (before != null && ent.compareTo(before) < 0) { - return false; - } - before = ent; - } - return true; - } - - public boolean contains(S entry) { - return all.contains(entry); - } - -} diff --git a/src/net/sourceforge/plantuml/graph/Zoda1.java b/src/net/sourceforge/plantuml/graph/Zoda1.java deleted file mode 100644 index d7edb60..0000000 --- a/src/net/sourceforge/plantuml/graph/Zoda1.java +++ /dev/null @@ -1,168 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * @deprecated - * - */ -public class Zoda1 { - - private final Map nodes = new LinkedHashMap(); - private final List links = new ArrayList(); - - public ANodeImpl getNode(String code) { - ANodeImpl result = nodes.get(code); - if (result == null) { - result = new ANodeImpl(code); - nodes.put(code, result); - } - return result; - } - - public ANodeImpl getExistingNode(String code) { - return nodes.get(code); - } - - public List getLinks() { - return Collections.unmodifiableList(links); - } - - public List getNodes() { - return Collections.unmodifiableList(new ArrayList(nodes.values())); - } - - public void addLink(String link) { - final LinkString l = new LinkString(link); - final ANodeImpl n1 = getNode(l.getNode1()); - final ANodeImpl n2 = getNode(l.getNode2()); - links.add(new ALinkImpl(n1, n2, 1, null)); - } - - public void computeRows() { - getNodes().get(0).setRow(0); - - for (int i = 0; i < links.size(); i++) { - oneStep1(); - oneStep2(); - } - - removeUnplacedNodes(); - } - - private void removeUnplacedNodes() { - for (final Iterator it = nodes.values().iterator(); it.hasNext();) { - final ANodeImpl n = it.next(); - if (n.getRow() == Integer.MIN_VALUE) { - removeLinksOf(n); - it.remove(); - } - } - - } - - private void removeLinksOf(ANodeImpl n) { - for (final Iterator it = links.iterator(); it.hasNext();) { - final ALink link = it.next(); - if (link.getNode1() == n || link.getNode2() == n) { - it.remove(); - } - } - - } - - public int getRowMax() { - int max = 0; - for (ANode n : getNodes()) { - if (n.getRow() == Integer.MIN_VALUE) { - return Integer.MIN_VALUE; - } - if (n.getRow() > max) { - max = n.getRow(); - } - } - return max; - } - - private void oneStep1() { - for (ALink link : links) { - final ANode n1 = link.getNode1(); - if (n1.getRow() == Integer.MIN_VALUE) { - continue; - } - final ANode n2 = link.getNode2(); - if (n2.getRow() == Integer.MIN_VALUE) { - n2.setRow(n1.getRow() + 1); - } else if (n2.getRow() < n1.getRow() + 1) { - n2.setRow(n1.getRow() + 1); - } - } - } - - private void oneStep2() { - for (ALink link : links) { - final ANode n1 = link.getNode1(); - final ANode n2 = link.getNode2(); - if (n1.getRow() == Integer.MIN_VALUE && n2.getRow() != Integer.MIN_VALUE) { - if (n2.getRow() == 0) { - allDown(); - } - final int row = n2.getRow() - 1; - if (row == -1) { - throw new UnsupportedOperationException(); - } - n1.setRow(row); - } - } - } - - private void allDown() { - for (ANodeImpl n : nodes.values()) { - if (n.getRow() != Integer.MIN_VALUE) { - n.setRow(n.getRow() + 1); - } - } - - } - -} diff --git a/src/net/sourceforge/plantuml/graph/Zoda2.java b/src/net/sourceforge/plantuml/graph/Zoda2.java deleted file mode 100644 index d02fef7..0000000 --- a/src/net/sourceforge/plantuml/graph/Zoda2.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class Zoda2 { - - private final Map heaps = new LinkedHashMap(); - - public ANode getNode(String code) { - for (ANode n : heaps.keySet()) { - if (n.getCode().equals(code)) { - return n; - } - } - return null; - } - - public ANode createAloneNode(String code) { - if (getNode(code) != null) { - throw new IllegalArgumentException(); - } - final Heap h = new Heap(); - final ANode n = h.addNode(code); - heaps.put(n, h); - return n; - } - - public List getNodes() { - return Collections.unmodifiableList(new ArrayList(heaps.keySet())); - } - - public Set getHeaps() { - return new HashSet(heaps.values()); - } - - public void addLink(String link, int diffHeight, Object userData) { - final LinkString l; - try { - l = new LinkString(link); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - return; - } - final ANode n1 = getNode(l.getNode1()); - final ANode n2 = getNode(l.getNode2()); - final Heap h1 = n1 == null ? null : heaps.get(n1); - final Heap h2 = n2 == null ? null : heaps.get(n2); - assert h1 == null || h1.isEmpty() == false; - assert h2 == null || h2.isEmpty() == false; - if (h1 == null && h2 == null) { - final Heap h = new Heap(); - h.addLink(link, diffHeight, userData); - recordHeap(h); - } else if (h1 == h2) { - assert h1 != null && h2 != null; - h1.addLink(link, diffHeight, userData); - } else if (h1 == null) { - h2.addLink(link, diffHeight, userData); - recordHeap(h2); - } else if (h2 == null) { - h1.addLink(link, diffHeight, userData); - recordHeap(h1); - } else { - assert h1 != null && h2 != null; - assert h1.getNodes().contains(n1); - h1.importing(n1, n2, h2, diffHeight, userData); - recordHeap(h1); - assert heapMerged(h1, h2); - } - } - - private boolean heapMerged(final Heap destination, final Heap source) { - for (ANode n : source.getNodes()) { - assert heaps.get(n) == destination; - } - return true; - } - - private void recordHeap(final Heap h) { - for (ANode n : h.getNodes()) { - heaps.put((ANodeImpl) n, h); - } - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java b/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java deleted file mode 100644 index 59cdd47..0000000 --- a/src/net/sourceforge/plantuml/graph2/CubicCurveFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -public class CubicCurveFactory { - - private final Point2D.Double start; - private final Point2D.Double end; - private final RectanglesCollection forbiddenRect = new RectanglesCollection(); - private final List forbiddenCurves = new ArrayList(); - - public CubicCurveFactory(Point2D start, Point2D end) { - this.start = new Point2D.Double(start.getX(), start.getY()); - this.end = new Point2D.Double(end.getX(), end.getY()); - } - - public void addForbidden(Rectangle2D.Double rect) { - forbiddenRect.add(rect); - } - - public void addForbidden(MyCurve curve) { - forbiddenCurves.add(curve); - } - - public MyCurve getCubicCurve2D() { - MyCurve result = new MyCurve(new CubicCurve2D.Double(start.getX(), start.getY(), start.getX(), start.getY(), - end.getX(), end.getY(), end.getX(), end.getY())); - if (result.intersects(forbiddenRect) || result.intersects(forbiddenCurves)) { - final Set all = new HashSet(); - all.addAll(MagicPointsFactory.get(start, end)); - for (Rectangle2D.Double rect : forbiddenRect) { - all.addAll(MagicPointsFactory.get(rect)); - } -// Log.println("s1 " + all.size()); -// final long t1 = System.currentTimeMillis(); - double min = Double.MAX_VALUE; - for (Point2D.Double p1 : all) { - for (Point2D.Double p2 : all) { - final MyCurve me = new MyCurve(new CubicCurve2D.Double(start.getX(), start.getY(), p1.getX(), p1 - .getY(), p2.getX(), p2.getY(), end.getX(), end.getY())); - if (me.getLenght() < min && me.intersects(forbiddenRect) == false - && me.intersects(forbiddenCurves) == false) { - result = me; - min = me.getLenght(); - } - } - } -// final long t2 = System.currentTimeMillis() - t1; -// Log.println("s2 = " + t2); -// Log.println("TPS1 = " + RectanglesCollection.TPS1); -// Log.println("TPS2 = " + RectanglesCollection.TPS2); - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/Dijkstra.java b/src/net/sourceforge/plantuml/graph2/Dijkstra.java deleted file mode 100644 index d9f0430..0000000 --- a/src/net/sourceforge/plantuml/graph2/Dijkstra.java +++ /dev/null @@ -1,156 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -/* - * Copyright (c) 2009 the authors listed at the following URL, and/or the - * authors of referenced articles or incorporated external code: - * http://en.literateprograms.org/Dijkstra's_algorithm_(Java)?action=history&offset=20081113161332 - * - * 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. - * - * Retrieved from: - * http://en.literateprograms.org/Dijkstra's_algorithm_(Java)?oldid=15444 - */ - -// http://www.google.fr/search?hl=fr&source=hp&q=A+star+java&btnG=Recherche+Google&meta=&aq=f&oq= -// http://www.edenwaith.com/products/pige/tutorials/a-star.php -import java.util.ArrayList; -import java.util.List; -import java.util.PriorityQueue; - -public class Dijkstra { - - static class Vertex implements Comparable { - private final Object data; - private final List adjacencies = new ArrayList(); - private double minDistance = Double.POSITIVE_INFINITY; - private Vertex previous; - - Vertex(Object data) { - this.data = data; - } - - public void addAdjacencies(Vertex target, double dist) { - if (target == null) { - throw new IllegalArgumentException(); - } - adjacencies.add(new Edge(target, dist)); - } - - public String toString() { - return "[ " + data.toString() + " (" + minDistance + ") ] "; - } - - public int compareTo(Vertex other) { - return Double.compare(minDistance, other.minDistance); - } - - public final Object getData() { - return data; - } - - } - - static class Edge { - private final Vertex target; - private final double weight; - - Edge(Vertex argTarget, double argWeight) { - target = argTarget; - weight = argWeight; - } - } - - private final List vertices = new ArrayList(); - - public Vertex addVertex(Object data) { - final Vertex v = new Vertex(data); - vertices.add(v); - return v; - } - - private void computePaths(Vertex source) { - source.minDistance = 0.; - final PriorityQueue vertexQueue = new PriorityQueue(); - vertexQueue.add(source); - - while (vertexQueue.isEmpty() == false) { - final Vertex u = vertexQueue.poll(); - - // Visit each edge exiting u - for (Edge e : u.adjacencies) { - final Vertex v = e.target; - final double weight = e.weight; - final double distanceThroughU = u.minDistance + weight; - if (distanceThroughU < v.minDistance) { - vertexQueue.remove(v); - - v.minDistance = distanceThroughU; - v.previous = u; - vertexQueue.add(v); - } - } - } - } - - public List getShortestPathTo(Vertex source, Vertex target) { - computePaths(source); - final List path = new ArrayList(); - for (Vertex vertex = target; vertex != null; vertex = vertex.previous) { - path.add(0, vertex); - } - - return path; - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/IInflationTransform.java b/src/net/sourceforge/plantuml/graph2/IInflationTransform.java deleted file mode 100644 index c747af3..0000000 --- a/src/net/sourceforge/plantuml/graph2/IInflationTransform.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.util.Collection; -import java.util.List; - -public interface IInflationTransform { - - void addInflationX(double xpos, double inflation); - - void addInflationY(double ypos, double inflation); - - double getTotalInflationX(); - - double getTotalInflationY(); - - Point2D inflatePoint2D(Point2D point); - - List inflate(Collection segments); - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java b/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java deleted file mode 100644 index baecf7c..0000000 --- a/src/net/sourceforge/plantuml/graph2/IdentityInflationTransform.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class IdentityInflationTransform implements IInflationTransform { - - public void addInflationX(double xpos, double inflation) { - - } - - public void addInflationY(double ypos, double inflation) { - - } - - public double getTotalInflationX() { - return 0; - } - - public double getTotalInflationY() { - return 0; - } - - public Point2D inflatePoint2D(Point2D point) { - return point; - } - - public List inflate(Collection segments) { - return new ArrayList(segments); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/graph2/InflateData2.java b/src/net/sourceforge/plantuml/graph2/InflateData2.java deleted file mode 100644 index c1b6846..0000000 --- a/src/net/sourceforge/plantuml/graph2/InflateData2.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -public class InflateData2 implements Comparable { - - private final double pos; - private final double inflation; - - public InflateData2(double pos, double inflation) { - this.pos = pos; - this.inflation = inflation; - } - - public final double getPos() { - return pos; - } - - public final double getInflation() { - return inflation; - } - - public int compareTo(InflateData2 other) { - return -Double.compare(this.pos, other.pos); - } - - // public Point2D inflateX(Point2D pt) { - // if (pt.getX() < pos) { - // return pt; - // } - // if (pt.getX() == pos) { - // return GeomUtils.translate(pt, inflation / 2, 0); - // } - // return GeomUtils.translate(pt, inflation, 0); - // } - // - public double inflateAt(double v) { - if (v == pos) { - return inflation / 2; - } - - if (v < pos) { - return 0; - } - return inflation; - } - - // public Line2D.Double inflateXAlpha(Line2D.Double line) { - // - // if (GeomUtils.isHorizontal(line)) { - // return new Line2D.Double(inflateX(line.getP1()), inflateX(line.getP2())); - // } - // if (line.x1 == pos && line.x2 == pos) { - // return new Line2D.Double(GeomUtils.translate(line.getP1(), inflation / 2, - // 0), GeomUtils.translate(line - // .getP2(), inflation / 2, 0)); - // } - // if (line.x1 <= pos && line.x2 <= pos) { - // return line; - // } - // if (line.x1 >= pos && line.x2 >= pos) { - // return new Line2D.Double(GeomUtils.translate(line.getP1(), inflation, 0), - // GeomUtils.translate(line.getP2(), - // inflation, 0)); - // } - // throw new UnsupportedOperationException(); - // } - // - // public Line2D.Double inflateYAlpha(Line2D.Double line) { - // if (GeomUtils.isVertical(line)) { - // return new Line2D.Double(inflateY(line.getP1()), inflateY(line.getP2())); - // } - // if (line.y1 == pos && line.y2 == pos) { - // return new Line2D.Double(GeomUtils.translate(line.getP1(), 0, inflation / - // 2), GeomUtils.translate(line - // .getP2(), 0, inflation / 2)); - // } - // if (line.y1 <= pos && line.y2 <= pos) { - // return line; - // } - // if (line.y1 >= pos && line.y2 >= pos) { - // return new Line2D.Double(GeomUtils.translate(line.getP1(), 0, inflation), - // GeomUtils.translate(line.getP2(), - // 0, inflation)); - // } - // throw new UnsupportedOperationException(); - // } - - @Override - public String toString() { - return "" + pos + " (" + inflation + ")"; - } -} diff --git a/src/net/sourceforge/plantuml/graph2/InflationTransform2.java b/src/net/sourceforge/plantuml/graph2/InflationTransform2.java deleted file mode 100644 index 97bda85..0000000 --- a/src/net/sourceforge/plantuml/graph2/InflationTransform2.java +++ /dev/null @@ -1,240 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.AffineTransform; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.ListIterator; -import java.util.SortedSet; -import java.util.TreeSet; - -class Point2DComparatorDistance implements Comparator { - - private final Point2D center; - - public Point2DComparatorDistance(Point2D center) { - this.center = center; - } - - public int compare(Point2D p1, Point2D p2) { - return Double.compare(p1.distance(center), p2.distance(center)); - } - -} - -public class InflationTransform2 implements IInflationTransform { - - private final List inflateX = new ArrayList(); - private final List inflateY = new ArrayList(); - - public void addInflationX(double xpos, double inflation) { - add(inflateX, xpos, inflation); - } - - @Override - public String toString() { - return "inflateX = " + inflateX + " inflateY = " + inflateY; - } - - public void addInflationY(double ypos, double inflation) { - add(inflateY, ypos, inflation); - } - - public double getTotalInflationX() { - return sumInflation(inflateX); - } - - public double getTotalInflationY() { - return sumInflation(inflateY); - } - - static private double sumInflation(List list) { - double result = 0; - for (InflateData2 data : list) { - result += data.getInflation(); - } - return result; - } - - static private void add(List list, double ypos, double inflation) { - for (final ListIterator it = list.listIterator(); it.hasNext();) { - final InflateData2 cur = it.next(); - if (cur.getPos() == ypos) { - it.set(new InflateData2(ypos, Math.max(inflation, cur.getInflation()))); - return; - } - } - list.add(new InflateData2(ypos, inflation)); - Collections.sort(list); - } - - Collection cutPoints(Line2D.Double original) { - - final SortedSet result = new TreeSet(new Point2DComparatorDistance(original - .getP1())); - - if (GeomUtils.isHorizontal(original) == false) { - for (InflateData2 x : inflateX) { - final Line2D.Double vertical = new Line2D.Double(x.getPos(), GeomUtils.getMinY(original), x.getPos(), - GeomUtils.getMaxY(original)); - final Point2D.Double inter = GeomUtils.getSegIntersection(original, vertical); - if (inter != null) { - result.add(inter); - } - } - } - if (GeomUtils.isVertical(original) == false) { - for (InflateData2 y : inflateY) { - final Line2D.Double horizontal = new Line2D.Double(GeomUtils.getMinX(original), y.getPos(), GeomUtils - .getMaxX(original), y.getPos()); - final Point2D.Double inter = GeomUtils.getSegIntersection(original, horizontal); - if (inter != null) { - result.add(inter); - } - } - } - return result; - } - - Collection cutSegments(Line2D.Double original) { - final List result = new ArrayList(); - Point2D.Double cur = (Point2D.Double) original.getP1(); - final Collection cutPoints = cutPoints(original); - for (Point2D.Double inter : cutPoints) { - if (cur.equals(inter)) { - continue; - } - result.add(new Line2D.Double(cur, inter)); - cur = inter; - } - if (cur.equals(original.getP2()) == false) { - result.add(new Line2D.Double(cur, original.getP2())); - } - return result; - } - - Collection cutSegments(Collection segments) { - final List result = new ArrayList(); - for (Line2D.Double seg : segments) { - result.addAll(cutSegments(seg)); - } - return result; - } - - // private Line2D.Double inflateSegment(Line2D.Double seg) { - // // if (isOnGrid(seg.getP1()) && isOnGrid(seg.getP2())) { - // // return new Line2D.Double(inflatePoint2D(seg.getP1()), - // inflatePoint2D(seg.getP2())); - // // } - // // for (InflateData2 x : inflateX) { - // // seg = x.inflateXAlpha(seg); - // // } - // // for (InflateData2 y : inflateY) { - // // seg = y.inflateYAlpha(seg); - // // } - // // return seg; - // return new Line2D.Double(inflatePoint2D(seg.getP1()), - // inflatePoint2D(seg.getP2())); - // } - - // private boolean isOnGrid(Point2D point) { - // boolean onGrid = false; - // for (InflateData2 x : inflateX) { - // if (point.getX() == x.getPos()) { - // onGrid = true; - // } - // } - // if (onGrid == false) { - // return false; - // } - // for (InflateData2 y : inflateY) { - // if (point.getY() == y.getPos()) { - // return true; - // } - // } - // return false; - // - // } - - public Point2D inflatePoint2D(Point2D point) { - return getAffineTransformAt(point).transform(point, null); - } - - AffineTransform getAffineTransformAt(Point2D point) { - double deltaX = 0; - for (InflateData2 x : inflateX) { - deltaX += x.inflateAt(point.getX()); - } - double deltaY = 0; - for (InflateData2 y : inflateY) { - deltaY += y.inflateAt(point.getY()); - } - return AffineTransform.getTranslateInstance(deltaX, deltaY); - } - - List inflateSegmentCollection(Collection segments) { - final List result = new ArrayList(); - for (Line2D.Double seg : segments) { - final AffineTransform at = getAffineTransformAt(new Point2D.Double((seg.x1 + seg.x2) / 2, - (seg.y1 + seg.y2) / 2)); - result.add(new Line2D.Double(at.transform(seg.getP1(), null), at.transform(seg.getP2(), null))); - } - return result; - } - - public List inflate(Collection segments) { - final Collection cutSegments = cutSegments(segments); - Line2D.Double last = null; - final List inflated = inflateSegmentCollection(cutSegments); - final List result = new ArrayList(); - for (Line2D.Double seg : inflated) { - if (last != null && last.getP2().equals(seg.getP1()) == false) { - result.add(new Line2D.Double(last.getP2(), seg.getP1())); - } - result.add(seg); - last = seg; - - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java b/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java deleted file mode 100644 index eb667e1..0000000 --- a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.List; - -public class MagicPointsFactory { - - private MagicPointsFactory() { - - } - - public static List get(Rectangle2D.Double rect) { - final List result = new ArrayList(); - result.add(new Point2D.Double(rect.x - rect.width, rect.y - rect.height)); - result.add(new Point2D.Double(rect.x, rect.y - rect.height)); - result.add(new Point2D.Double(rect.x + rect.width, rect.y - rect.height)); - result.add(new Point2D.Double(rect.x + 2 * rect.width, rect.y - rect.height)); - - result.add(new Point2D.Double(rect.x - rect.width, rect.y)); - result.add(new Point2D.Double(rect.x + 2 * rect.width, rect.y)); - - result.add(new Point2D.Double(rect.x - rect.width, rect.y + rect.height)); - result.add(new Point2D.Double(rect.x + 2 * rect.width, rect.y + rect.height)); - - result.add(new Point2D.Double(rect.x - rect.width, rect.y + 2 * rect.height)); - result.add(new Point2D.Double(rect.x, rect.y + 2 * rect.height)); - result.add(new Point2D.Double(rect.x + rect.width, rect.y + 2 * rect.height)); - result.add(new Point2D.Double(rect.x + 2 * rect.width, rect.y + 2 * rect.height)); - return result; - } - - public static List get(Point2D.Double p1, Point2D.Double p2) { - final List result = new ArrayList(); - result.add(new Point2D.Double(p1.x, p2.y)); - result.add(new Point2D.Double(p2.x, p1.y)); - return result; - } -} diff --git a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java b/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java deleted file mode 100644 index 8b897cc..0000000 --- a/src/net/sourceforge/plantuml/graph2/MagicPointsFactory2.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.AffineTransform; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; - -public class MagicPointsFactory2 { - - private final Point2D.Double p1; - private final Point2D.Double p2; - - private final List result = new ArrayList(); - - public MagicPointsFactory2(Point2D.Double p1, Point2D.Double p2) { - this.p1 = p1; - this.p2 = p2; - final double dx = p2.x - p1.x; - final double dy = p2.y - p1.y; - - final int interv = 5; - final int intervAngle = 10; - final double theta = Math.PI * 2 / intervAngle; - for (int a = 0; a < 10; a++) { - final AffineTransform at = AffineTransform.getRotateInstance(theta * a, p1.x, p1.y); - for (int i = 0; i < interv * 2; i++) { - final Point2D.Double p = new Point2D.Double(p1.x + dx * i / interv, p1.y + dy * i / interv); - result.add((Point2D.Double) at.transform(p, null)); - } - } - - } - - public List get() { - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/Measurer.java b/src/net/sourceforge/plantuml/graph2/Measurer.java deleted file mode 100644 index 1addeed..0000000 --- a/src/net/sourceforge/plantuml/graph2/Measurer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -public interface Measurer { - int getMeasure(V data); -} diff --git a/src/net/sourceforge/plantuml/graph2/MyCurve.java b/src/net/sourceforge/plantuml/graph2/MyCurve.java deleted file mode 100644 index 527a04a..0000000 --- a/src/net/sourceforge/plantuml/graph2/MyCurve.java +++ /dev/null @@ -1,173 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.List; - -public class MyCurve { - - private final CubicCurve2D.Double curve; - private final List lines = new ArrayList(); - private final List linesForInters = new ArrayList(); - private Color color = Color.GREEN; - private double lenght = 0; - - public MyCurve(CubicCurve2D.Double curve) { - this.curve = curve; - addCurve(curve); - if (lenght <= 0) { - throw new IllegalStateException(); - } - for (Line2D.Double line : lines) { - linesForInters.add(change(line, curve.getP1(), curve.getP2())); - } - } - - private Line2D.Double change(Line2D.Double line, Point2D p1, Point2D p2) { - if (line.getP1().equals(p1) == false && line.getP2().equals(p2) == false) { - return line; - } - final double dx = line.x2 - line.x1; - final double dy = line.y2 - line.y1; - if (line.getP1().equals(p1)) { - p1 = new Point2D.Double(line.x1 + dx / 10, line.y1 + dy / 10); - } else { - p1 = line.getP1(); - } - if (line.getP2().equals(p2)) { - p2 = new Point2D.Double(line.x2 - dx / 10, line.y2 - dy / 10); - } else { - p2 = line.getP2(); - } - return new Line2D.Double(p1, p2); - } - - public final double getLenght() { - return lenght; - } - - private void addCurve(CubicCurve2D.Double peace) { - final Rectangle2D bounds = peace.getBounds2D(); - final double flat = peace.getFlatness(); - if (flat < 10) { - lines.add(new Line2D.Double(peace.getP1(), peace.getP2())); - lenght += Math.sqrt(bounds.getWidth() * bounds.getWidth() + bounds.getHeight() * bounds.getHeight()); - return; - } - final CubicCurve2D.Double left = new CubicCurve2D.Double(); - final CubicCurve2D.Double right = new CubicCurve2D.Double(); - peace.subdivide(left, right); - addCurve(left); - addCurve(right); - } - - public void drawDebug(Graphics2D g2d) { - for (Line2D r : linesForInters) { - g2d.setColor(color); - g2d.draw(r); - } - g2d.setColor(Color.BLACK); - // g2d.draw(curve); - } - - public void draw(Graphics2D g2d) { - g2d.setStroke(new BasicStroke((float) 1.5)); - g2d.draw(curve); - g2d.setStroke(new BasicStroke()); - } - - public final void setColor(Color color) { - this.color = color; - } - - public boolean intersects(List others) { - for (MyCurve other : others) { - if (this.intersects(other)) { - return true; - } - } - return false; - } - - private boolean intersects(MyCurve other) { - for (Line2D.Double l1 : this.linesForInters) { - for (Line2D.Double l2 : other.linesForInters) { - if (l1.intersectsLine(l2)) { - return true; - } - } - } - return false; - } - - public boolean intersects(RectanglesCollection forbidden) { - for (Rectangle2D.Double r : forbidden) { - for (Line2D.Double line : lines) { - if (r.intersectsLine(line)) { - return true; - } - } - } - return false; - } - // public static long TPS6; - // - // public RectanglesCollection unrecoveredBy(RectanglesCollection allFrames) - // { - // final long start = System.currentTimeMillis(); - // try { - // final RectanglesCollection result = new RectanglesCollection(); - // for (Rectangle2D.Double r : areas) { - // if (allFrames.intersect(new RectanglesCollection(r)) == false) { - // result.add(r); - // } - // } - // return result; - // } finally { - // TPS6 += System.currentTimeMillis() - start; - // } - // } - // - -} diff --git a/src/net/sourceforge/plantuml/graph2/Neighborhood2.java b/src/net/sourceforge/plantuml/graph2/Neighborhood2.java deleted file mode 100644 index 51cb50d..0000000 --- a/src/net/sourceforge/plantuml/graph2/Neighborhood2.java +++ /dev/null @@ -1,190 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.geom.Orientation; - -public class Neighborhood2 { - - final private double angle1; - final private double angle2; - final private Point2D.Double center; - - public Neighborhood2(Point2D.Double center) { - this(center, 0, 0); - } - - public boolean is360() { - return angle1 == angle2; - } - - public Neighborhood2(Point2D.Double center, double angle1, double angle2) { - this.center = center; - this.angle1 = angle1; - this.angle2 = angle2; - } - - @Override - public boolean equals(Object obj) { - final Neighborhood2 other = (Neighborhood2) obj; - return angle1 == other.angle1 && angle2 == other.angle2 && center.equals(other.center); - } - - @Override - public int hashCode() { - return center.hashCode() * 17 + new Point2D.Double(angle1, angle2).hashCode(); - } - - @Override - public String toString() { - final int a1 = (int) (angle1 * 180 / Math.PI); - final int a2 = (int) (angle2 * 180 / Math.PI); - return center + " " + a1 + " " + a2; - } - - public final Point2D.Double getCenter() { - return center; - } - - // private double getMiddle() { - // if (is360()) { - // return angle1 + 2 * Math.PI / 3; - // } - // double result = (angle1 + angle2) / 2; - // if (angle2 < angle1) { - // result += Math.PI; - // } - // return result; - // } - // - public Point2D.Double getPointInNeighborhood(double dist, Point2D p1, Point2D p2) { - if (p1 == null || p2 == null) { - throw new IllegalArgumentException(); - } - if (dist <= 0) { - throw new IllegalArgumentException(); - } - final double v1 = Singularity2.convertAngle(Singularity2.getAngle(new Line2D.Double(center, p1)) - angle1); - final double v2 = Singularity2.convertAngle(Singularity2.getAngle(new Line2D.Double(center, p2)) - angle1); - if (v1 < 0) { - throw new IllegalStateException(); - } - if (v2 < 0) { - throw new IllegalStateException(); - } - final double middle = (v1 + v2) / 2 + angle1; - return new Point2D.Double(center.x + dist * Math.cos(middle), center.y + dist * Math.sin(middle)); - } - - public boolean isInAngleStrict(double angle) { - if (angle < 0) { - throw new IllegalArgumentException(); - } - if (angle2 > angle1) { - return angle > angle1 && angle < angle2; - } - return angle > angle1 || angle < angle2; - } - - public boolean isInAngleLarge(double angle) { - if (angle < 0) { - throw new IllegalArgumentException(); - } - if (angle2 > angle1) { - return angle >= angle1 && angle <= angle2; - } - return angle >= angle1 || angle <= angle2; - } - - public boolean isAngleLimit(double angle) { - return angle == angle1 || angle == angle2; - } - - public Orientation getOrientationFrom(double angle) { - if (angle1 == angle2) { - throw new IllegalStateException(); - } - if (angle != angle1 && angle != angle2) { - throw new IllegalArgumentException("this=" + this + " angle=" + (int) (angle * 180 / Math.PI)); - } - assert angle == angle1 || angle == angle2; - - if (angle == angle1) { - return Orientation.MATH; - } - return Orientation.CLOCK; - } - - public boolean isConnectable(Neighborhood2 other) { - assert isConnectableInternal(other) == other.isConnectableInternal(this); - return isConnectableInternal(other); - - } - - private boolean isConnectableInternal(Neighborhood2 other) { - if (getCenter().equals(other.getCenter())) { - throw new IllegalArgumentException("Same center"); - } - final Line2D.Double seg1 = new Line2D.Double(getCenter(), other.getCenter()); - - final double angle1 = Singularity2.convertAngle(Singularity2.getAngle(seg1)); - final double angle2 = Singularity2.convertAngle(Singularity2.getOppositeAngle(seg1)); - assert angle2 == Singularity2.convertAngle(Singularity2.getAngle(new Line2D.Double(other.getCenter(), - getCenter()))); - if (isInAngleStrict(angle1) && other.isInAngleStrict(angle2)) { - return true; - } - if (isInAngleStrict(angle1) && other.isInAngleLarge(angle2)) { - return true; - } - if (isInAngleLarge(angle1) && other.isInAngleStrict(angle2)) { - return true; - } - if (isAngleLimit(angle1) && other.isAngleLimit(angle2)) { - if (is360() || other.is360()) { - return true; - } - final Orientation o1 = getOrientationFrom(angle1); - final Orientation o2 = other.getOrientationFrom(angle2); - return o1 != o2; - } - return false; - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/Plan.java b/src/net/sourceforge/plantuml/graph2/Plan.java deleted file mode 100644 index 459f7ae..0000000 --- a/src/net/sourceforge/plantuml/graph2/Plan.java +++ /dev/null @@ -1,255 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.graph2.Dijkstra.Vertex; - -public class Plan { - - private final Map points = new LinkedHashMap(); - private final Collection lines = new ArrayList(); - - public void addPoint2D(Point2D.Double point) { - if (points.containsKey(point)) { - throw new IllegalArgumentException(); - } - points.put(point, new Singularity2(point)); - } - - public void debugPrint() { - Log.println("PLAN PRINT"); - for (Singularity2 s : points.values()) { - Log.println("s="+s); - } - for (Line2D.Double l : lines) { - Log.println(GeomUtils.toString(l)); - } - } - - public void createLink(Point2D p1, Point2D p2) { - final Singularity2 s1 = points.get(p1); - final Singularity2 s2 = points.get(p2); - if (s1 == null || s2 == null) { - throw new IllegalArgumentException(); - } - final Line2D.Double line = new Line2D.Double(p1, p2); - - s1.addLineSegment(line); - s2.addLineSegment(line); - lines.add(line); - } - - Singularity2 getSingularity(Point2D pt) { - final Singularity2 result = points.get(pt); - if (result == null) { - throw new IllegalArgumentException(); - } - return result; - } - - List getShortestPathToInternal(Point2D start, Point2D end) { - final Dijkstra dijkstra = new Dijkstra(); - if (points.containsKey(start) == false || points.containsKey(end) == false) { - throw new IllegalArgumentException(); - } - final Vertex vStart = dijkstra.addVertex(start); - final Vertex vEnd = dijkstra.addVertex(end); - final Map vertexes = new LinkedHashMap(); - for (Singularity2 s : points.values()) { - for (Neighborhood2 n : s.getNeighborhoods()) { - final Vertex v = dijkstra.addVertex(n); - vertexes.put(n, v); - if (n.getCenter().equals(start)) { - vStart.addAdjacencies(v, 0.01); - } - if (n.getCenter().equals(end)) { - v.addAdjacencies(vEnd, 0.01); - } - } - } - - for (Vertex v1 : vertexes.values()) { - for (Vertex v2 : vertexes.values()) { - final Neighborhood2 n1 = (Neighborhood2) v1.getData(); - final Neighborhood2 n2 = (Neighborhood2) v2.getData(); - if (n1.getCenter().equals(n2.getCenter())) { - continue; - } - final Line2D.Double line = new Line2D.Double(n1.getCenter(), n2.getCenter()); - if (isStrictCrossing(line)) { - continue; - } - if (n1.isConnectable(n2) == false) { - continue; - } - final double dist = n1.getCenter().distance(n2.getCenter()); - v1.addAdjacencies(v2, dist); - v2.addAdjacencies(v1, dist); - // Log.println("=(" + n1 + ") (" + n2 + ") " + dist); - } - } - - final List list = dijkstra.getShortestPathTo(vStart, vEnd); - if (list.size() < 2) { - throw new IllegalStateException("list=" + list); - } - final List result = new ArrayList(); - for (Vertex v : list.subList(1, list.size() - 1)) { - result.add((Neighborhood2) v.getData()); - } - return result; - } - - public List getIntermediatePoints(Point2D start, Point2D end) { - // Log.println("start=" + start + " end=" + end); - final List result = new ArrayList(); - final List list = getShortestPathToInternal(start, end); - // Log.println("Neighborhood2 = " + list); - for (int i = 1; i < list.size() - 1; i++) { - final Neighborhood2 n = list.get(i); - final Point2D.Double before = list.get(i - 1).getCenter(); - final Point2D.Double after = list.get(i + 1).getCenter(); - // Log.println("before="+before); - // Log.println("after="+after); - // Log.println("n.getCenter()="+n.getCenter()); - // Log.println("getMindist(n.getCenter())="+getMindist(n.getCenter())); - final Point2D.Double pointInNeighborhood = n.getPointInNeighborhood(getMindist(n.getCenter()) / 2, before, - after); - // Log.println("pointInNeighborhood="+pointInNeighborhood); - result.add(pointInNeighborhood); - } - return result; - - } - - private boolean isStrictCrossing(Line2D.Double line) { - for (Line2D.Double l : lines) { - if (intersectsLineStrict(l, line)) { - return true; - } - } - return false; - } - - public static boolean intersectsLineStrict(Line2D.Double l1, Line2D.Double l2) { - assert intersectsLineStrictInternal(l1, l2) == intersectsLineStrictInternal(l2, l1); - assert intersectsLineStrictInternal(l1, l2) == intersectsLineStrictInternal(inverse(l1), l2); - assert intersectsLineStrictInternal(l1, l2) == intersectsLineStrictInternal(l1, inverse(l2)); - assert intersectsLineStrictInternal(l1, l2) == intersectsLineStrictInternal(inverse(l1), inverse(l2)); - return intersectsLineStrictInternal(l1, l2); - } - - private static Line2D.Double inverse(Line2D.Double line) { - return new Line2D.Double(line.getP2(), line.getP1()); - } - - private static boolean intersectsLineStrictInternal(Line2D.Double l1, Line2D.Double l2) { - if (l1.intersectsLine(l2) == false) { - return false; - } - assert l1.intersectsLine(l2); - - Point2D.Double l1a = (Point2D.Double) l1.getP1(); - Point2D.Double l1b = (Point2D.Double) l1.getP2(); - Point2D.Double l2a = (Point2D.Double) l2.getP1(); - Point2D.Double l2b = (Point2D.Double) l2.getP2(); - - if (l1a.equals(l2a) == false && l1a.equals(l2b) == false && l1b.equals(l2a) == false - && l1b.equals(l2b) == false) { - return true; - } - - if (l1a.equals(l2b)) { - final Point2D.Double tmp = l2a; - l2a = l2b; - l2b = tmp; - } else if (l2a.equals(l1b)) { - final Point2D.Double tmp = l1a; - l1a = l1b; - l1b = tmp; - } else if (l1b.equals(l2b)) { - Point2D.Double tmp = l2a; - l2a = l2b; - l2b = tmp; - tmp = l1a; - l1a = l1b; - l1b = tmp; - } - - assert l1a.equals(l2a); - - return false; - - } - - final double getMindist(Point2D.Double pt) { - double result = Double.MAX_VALUE; - for (Point2D p : points.keySet()) { - if (pt.equals(p)) { - continue; - } - final double v = p.distance(pt); - if (v < 1E-4) { - throw new IllegalStateException(); - } - result = Math.min(result, v); - } - for (Line2D line : lines) { - if (line.getP1().equals(pt) || line.getP2().equals(pt)) { - continue; - } - final double v = line.ptSegDist(pt); - if (result < 1E-4) { - throw new IllegalStateException("pt=" + pt + " line=" + GeomUtils.toString(line)); - } - result = Math.min(result, v); - } - if (result == 0) { - throw new IllegalStateException(); - } - // Log.println("getMindist=" + result); - return result; - } -} diff --git a/src/net/sourceforge/plantuml/graph2/Polyline2.java b/src/net/sourceforge/plantuml/graph2/Polyline2.java deleted file mode 100644 index 9123681..0000000 --- a/src/net/sourceforge/plantuml/graph2/Polyline2.java +++ /dev/null @@ -1,111 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.QuadCurve2D; -import java.util.ArrayList; -import java.util.List; - -public class Polyline2 { - - private final List lines = new ArrayList(); - private Point2D lastCurrent; - private final Point2D end; - - public Polyline2(Point2D start, Point2D end) { - lastCurrent = start; - this.end = end; - } - - public void addLine(Line2D.Double newLine) { - // Log.println("# Polyline2::addLine " + - // GeomUtils.toString(newLine)); - if (lastCurrent.equals(newLine.getP1()) == false) { - lines.add(new Line2D.Double(lastCurrent, newLine.getP1())); - } - lines.add(newLine); - lastCurrent = newLine.getP2(); - } - - private boolean debug = false; - - public void draw(Graphics2D g2d) { - close(); - if (debug) { - g2d.setColor(Color.GREEN); - drawDebug(g2d); - } - g2d.setColor(Color.BLUE); - final List centers = new ArrayList(); - for (Line2D.Double l : lines) { - centers.add(GeomUtils.getCenter(l)); - } - g2d.draw(new Line2D.Double(lines.get(0).getP1(), centers.get(0))); - g2d.draw(new Line2D.Double(centers.get(centers.size() - 1), end)); - for (int i = 0; i < lines.size() - 1; i++) { - final Point2D c1 = centers.get(i); - final Point2D c2 = centers.get(i + 1); - final Point2D ctrl = lines.get(i).getP2(); - assert ctrl.equals(lines.get(i + 1).getP1()); - final QuadCurve2D.Double quad = new QuadCurve2D.Double(c1.getX(), c1.getY(), ctrl.getX(), ctrl.getY(), c2 - .getX(), c2.getY()); - g2d.draw(quad); - } - if (debug) { - for (Point2D.Double c : centers) { - GeomUtils.fillPoint2D(g2d, c); - } - } - } - - private void drawDebug(Graphics2D g2d) { - for (Line2D.Double l : lines) { - g2d.draw(l); - GeomUtils.fillPoint2D(g2d, l.getP1()); - GeomUtils.fillPoint2D(g2d, l.getP2()); - } - } - - private void close() { - if (lastCurrent.equals(end) == false) { - lines.add(new Line2D.Double(lastCurrent, end)); - } - } -} diff --git a/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java b/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java deleted file mode 100644 index c0ac2ad..0000000 --- a/src/net/sourceforge/plantuml/graph2/RectanglesCollection.java +++ /dev/null @@ -1,200 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public class RectanglesCollection implements Iterable { - - private final List areas = new ArrayList(); - private final SortedListImpl sortedX1; - private final SortedListImpl sortedX2; - private final SortedListImpl sortedY1; - private final SortedListImpl sortedY2; - - private Rectangle2D.Double max = null; - - public RectanglesCollection() { - sortedX1 = new SortedListImpl(new Measurer() { - public int getMeasure(Rectangle2D.Double data) { - return (int) data.x; - } - }); - sortedX2 = new SortedListImpl(new Measurer() { - public int getMeasure(Rectangle2D.Double data) { - return (int) (data.x + data.width); - } - }); - sortedY1 = new SortedListImpl(new Measurer() { - public int getMeasure(Rectangle2D.Double data) { - return (int) data.y; - } - }); - sortedY2 = new SortedListImpl(new Measurer() { - public int getMeasure(Rectangle2D.Double data) { - return (int) (data.y + data.height); - } - }); - } - - public RectanglesCollection(Rectangle2D.Double rect) { - this(); - add(rect); - } - - public double getSurf() { - if (max == null) { - return 0; - } - return max.getWidth() * max.getHeight(); - } - - public void add(Rectangle2D.Double rect) { - areas.add(rect); - // sortedX1.add(rect); - // sortedX2.add(rect); - // sortedY1.add(rect); - // sortedY2.add(rect); - if (max == null) { - max = rect; - } else { - max = (Rectangle2D.Double) max.createUnion(rect); - } - } - - public Iterator iterator() { - return areas.iterator(); - } - - public boolean intersect(RectanglesCollection other) { - if (this.size() > other.size()) { - return intersectSeveral(this, other); - } - return intersectSeveral(other, this); - } - - static private long TPS1; - static private long TPS2; - - private static boolean intersectSeveral(RectanglesCollection large, RectanglesCollection compact) { - assert large.size() >= compact.size(); - final long start = System.currentTimeMillis(); - try { - for (Rectangle2D.Double r : compact) { - if (large.intersectSimple(r)) { - return true; - } - } - return false; - } finally { - TPS2 += System.currentTimeMillis() - start; - } - } - - private boolean intersectSimple(Rectangle2D.Double rect) { - final long start = System.currentTimeMillis(); - try { - if (max == null || max.intersects(rect) == false) { - return false; - } - for (Rectangle2D.Double r : areas) { - if (rect.intersects(r)) { - return true; - } - } - return false; - } finally { - TPS1 += System.currentTimeMillis() - start; - } - } - - private boolean intersectSimpleOld(Rectangle2D.Double rect) { - final long start = System.currentTimeMillis(); - try { - if (max == null || max.intersects(rect) == false) { - return false; - } - final List lX1 = sortedX1.lesserOrEquals((int) (rect.x + rect.width)); - List lmin = lX1; - if (lX1.size() == 0) { - return false; - } - final List lX2 = sortedX2.biggerOrEquals((int) rect.x); - if (lX2.size() == 0) { - return false; - } - if (lX2.size() < lmin.size()) { - lmin = lX2; - } - final List lY1 = sortedY1.lesserOrEquals((int) (rect.y + rect.height)); - if (lY1.size() == 0) { - return false; - } - if (lY1.size() < lmin.size()) { - lmin = lY1; - } - final List lY2 = sortedY2.biggerOrEquals((int) rect.y); - if (lY2.size() == 0) { - return false; - } - if (lY2.size() < lmin.size()) { - lmin = lY2; - } - for (Rectangle2D.Double r : lmin) { - if (rect.intersects(r)) { - return true; - } - } - return false; - } finally { - TPS1 += System.currentTimeMillis() - start; - } - } - - public int size() { - return areas.size(); - } - - public void addAll(RectanglesCollection other) { - for (Rectangle2D.Double r : other.areas) { - this.add(r); - } - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/Singularity2.java b/src/net/sourceforge/plantuml/graph2/Singularity2.java deleted file mode 100644 index 3edafcc..0000000 --- a/src/net/sourceforge/plantuml/graph2/Singularity2.java +++ /dev/null @@ -1,164 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.TreeSet; - -public class Singularity2 { - - private final TreeSet angles = new TreeSet(); - - final private Point2D.Double center; - - public Singularity2(Point2D.Double center) { - this.center = center; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(center.toString()); - for (Double a : angles) { - final int degree = (int) (a * 180 / Math.PI); - sb.append(' '); - sb.append(degree); - } - return sb.toString(); - } - - public void addLineSegment(Line2D.Double seg) { - if (seg.getP1().equals(center)) { - angles.add(convertAngle(getAngle(seg))); - } else if (seg.getP2().equals(center)) { - angles.add(convertAngle(getOppositeAngle(seg))); - } else { - throw new IllegalArgumentException(); - } - assert betweenZeroAndTwoPi(); - - } - - static final double getAngle(Line2D.Double line) { - if (line.getP1().equals(line.getP2())) { - throw new IllegalArgumentException(); - } - return Math.atan2(line.getP2().getY() - line.getP1().getY(), line.getP2().getX() - line.getP1().getX()); - } - - static final double getOppositeAngle(Line2D.Double line) { - return Math.atan2(line.getP1().getY() - line.getP2().getY(), line.getP1().getX() - line.getP2().getX()); - } - - static double convertAngle(double a) { - while (a < 0) { - a += 2 * Math.PI; - } - return a; - } - - private boolean betweenZeroAndTwoPi() { - for (Double d : angles) { - assert d >= 0; - assert d < 2 * Math.PI; - } - return true; - } - - List getAngles() { - return new ArrayList(angles); - } - - public boolean crossing(Point2D.Double direction1, Point2D.Double direction2) { - final boolean result = crossingInternal(direction1, direction2); - assert result == crossingInternal(direction2, direction1); - return result; - } - - private boolean crossingInternal(Point2D.Double direction1, Point2D.Double direction2) { - if (angles.size() < 2) { - return false; - } - final double angle1 = convertAngle(getAngle(new Line2D.Double(center, direction1))); - final double angle2 = convertAngle(getAngle(new Line2D.Double(center, direction2))); - - Double last = null; - for (Double current : angles) { - if (last != null) { - assert last < current; - if (isBetween(angle1, last, current) && isBetween(angle2, last, current)) { - return false; - } - } - last = current; - } - final double first = angles.first(); - if ((angle1 <= first || angle1 >= last) && (angle2 <= first || angle2 >= last)) { - return false; - } - return true; - } - - private boolean isBetween(double test, double v1, double v2) { - assert v1 < v2; - return test >= v1 && test <= v2; - } - - protected final Point2D.Double getCenter() { - return center; - } - - public void merge(Singularity2 other) { - this.angles.addAll(other.angles); - } - - public List getNeighborhoods() { - if (angles.size() == 0) { - return Collections.singletonList(new Neighborhood2(center)); - } - final List result = new ArrayList(); - double last = angles.last(); - for (Double currentAngle : angles) { - result.add(new Neighborhood2(center, last, currentAngle)); - last = currentAngle; - } - return Collections.unmodifiableList(result); - } - -} diff --git a/src/net/sourceforge/plantuml/graph2/SortedList.java b/src/net/sourceforge/plantuml/graph2/SortedList.java deleted file mode 100644 index 51d61af..0000000 --- a/src/net/sourceforge/plantuml/graph2/SortedList.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.util.List; - -public interface SortedList extends Iterable { - public void add(V data); - - public List lesserOrEquals(int v); - - public List biggerOrEquals(int v); -} diff --git a/src/net/sourceforge/plantuml/graph2/SortedListImpl.java b/src/net/sourceforge/plantuml/graph2/SortedListImpl.java deleted file mode 100644 index 0fd3ba8..0000000 --- a/src/net/sourceforge/plantuml/graph2/SortedListImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.graph2; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -public class SortedListImpl implements SortedList { - - static class NullableAndEvenMeasurer implements Measurer { - private final Measurer wrapped; - private final int valueForNull; - - NullableAndEvenMeasurer(Measurer wrapped, int valueForNull, boolean plus) { - this.wrapped = wrapped; - if (plus) { - this.valueForNull = valueForNull * 2 + 1; - } else { - this.valueForNull = valueForNull * 2 - 1; - } - } - - public int getMeasure(V data) { - if (data == null) { - return valueForNull; - } - return wrapped.getMeasure(data) * 2; - } - } - - private final Measurer measurer; - private final List all = new ArrayList(); - private final Comparator comparator; - - public SortedListImpl(Measurer m) { - this.measurer = m; - this.comparator = new Comparator() { - public int compare(V o1, V o2) { - final int v1 = measurer.getMeasure(o1); - final int v2 = measurer.getMeasure(o2); - return v1 - v2; - } - }; - } - - public void add(V data) { - final int pos = Collections.binarySearch(all, data, comparator); - if (pos >= 0) { - all.add(pos, data); - } else { - all.add(-pos - 1, data); - } - assert isSorted(); - } - - private int getPos(int v, boolean plus) { - final Measurer m = new NullableAndEvenMeasurer(measurer, v, plus); - final Comparator myComp = new Comparator() { - public int compare(V o1, V o2) { - final int v1 = m.getMeasure(o1); - final int v2 = m.getMeasure(o2); - return v1 - v2; - } - }; - final int pos = Collections.binarySearch(all, null, myComp); - assert pos < 0; - return -pos - 1; - } - - public List lesserOrEquals(int v) { - return all.subList(0, getPos(v, true)); - } - - public List biggerOrEquals(int v) { - return all.subList(getPos(v, false), all.size()); - } - - private boolean isSorted() { - for (int i = 0; i < all.size() - 1; i++) { - final int v1 = measurer.getMeasure(all.get(i)); - final int v2 = measurer.getMeasure(all.get(i + 1)); - if (v1 > v2) { - return false; - } - } - return true; - } - - public Iterator iterator() { - return all.iterator(); - } - -} diff --git a/src/net/sourceforge/plantuml/hector/Box2D.java b/src/net/sourceforge/plantuml/hector/Box2D.java deleted file mode 100644 index a93117b..0000000 --- a/src/net/sourceforge/plantuml/hector/Box2D.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.geom.LineSegmentDouble; - -public class Box2D { - - final private double x1; - final private double y1; - final private double x2; - final private double y2; - - private Box2D(double x1, double y1, double x2, double y2) { - this.x1 = x1; - this.y1 = y1; - this.x2 = x2; - this.y2 = y2; - } - - public static Box2D create(double x, double y, Dimension2D dim) { - return new Box2D(x, y, x + dim.getWidth(), y + dim.getHeight()); - } - - @Override - public String toString() { - return "Box [" + x1 + "," + y1 + "] [" + x2 + "," + y2 + "]"; - } - - public boolean doesIntersect(LineSegmentDouble seg) { - if (seg.doesIntersect(new LineSegmentDouble(x1, y1, x2, y1))) { - return true; - } - if (seg.doesIntersect(new LineSegmentDouble(x2, y1, x2, y2))) { - return true; - } - if (seg.doesIntersect(new LineSegmentDouble(x2, y2, x1, y2))) { - return true; - } - if (seg.doesIntersect(new LineSegmentDouble(x1, y2, x1, y1))) { - return true; - } - return false; - } - -} diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java deleted file mode 100644 index 0588f9e..0000000 --- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java +++ /dev/null @@ -1,169 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.awt.geom.Dimension2D; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.cucadiagram.CucaDiagram; -import net.sourceforge.plantuml.cucadiagram.ILeaf; -import net.sourceforge.plantuml.cucadiagram.Link; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.svek.CucaDiagramFileMaker; -import net.sourceforge.plantuml.svek.GeneralImageBuilder; -import net.sourceforge.plantuml.svek.IEntityImage; -import net.sourceforge.plantuml.ugraphic.MinMax; -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.UGraphic2; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class CucaDiagramFileMakerHectorB1 implements CucaDiagramFileMaker { - - private final CucaDiagram diagram; - private SkeletonConfiguration configuration; - - // private double singleWidth; - // private double singleHeight; - private double nodeMargin = 40; - - public CucaDiagramFileMakerHectorB1(CucaDiagram diagram) { - this.diagram = diagram; - } - - // final private Map images = new LinkedHashMap(); - // final private Map boxes = new LinkedHashMap(); - - final private Map links = new LinkedHashMap(); - - // final private List forbidden = new ArrayList(); - - private double getX(Pin pin) { - return nodeMargin * configuration.getCol(pin); - } - - private double getY(Pin pin) { - return nodeMargin * pin.getRow(); - } - - // private double getCenterX(Pin pin) { - // return singleWidth * configuration.getCol(pin) + singleWidth / 2.0; - // } - // - // private double getCenterY(Pin pin) { - // return singleHeight * pin.getRow() + singleHeight / 2.0; - // } - - public ImageData createFile(OutputStream os, List dotStrings, FileFormatOption fileFormatOption) - throws IOException { - final PinFactory pinFactory = new PinFactory(); - final SkeletonBuilder skeletonBuilder = new SkeletonBuilder(); - links.clear(); - for (Link link : diagram.getLinks()) { - final PinLink pinLink = pinFactory.createPinLink(link); - links.put(link, pinLink); - skeletonBuilder.add(pinLink); - } - - final Skeleton skeleton = skeletonBuilder.createSkeletons().get(0); - this.configuration = SkeletonConfigurationUtils.getBest(skeleton); - - MinMax minMax = MinMax.getEmpty(false); - for (Pin pin : skeleton.getPins()) { - minMax = minMax.addPoint(getX(pin), getY(pin)); - } - - final double borderMargin = 10; - - final Dimension2D dimTotal = new Dimension2DDouble(2 * borderMargin + minMax.getMaxX(), 2 * borderMargin - + minMax.getMaxY()); - UGraphic2 ug = null;// fileFormatOption.createUGraphic(diagram.getColorMapper(), diagram.getDpiFactor(fileFormatOption), - // dimTotal, null, false); - ug = (UGraphic2) ug.apply(new UTranslate(borderMargin, borderMargin)); - - for (PinLink pinLink : skeleton.getPinLinks()) { - drawPinLink(ug, pinLink); - } - - for (Pin pin : skeleton.getPins()) { - drawPin(ug, pin); - } - -// ug.writeImageTOBEMOVED(os, null, diagram.getDpi(fileFormatOption)); -// return new ImageDataSimple(dimTotal); - throw new UnsupportedOperationException(); - } - - private void drawPin(UGraphic ug, Pin pin) { - final double x = getX(pin); - final double y = getY(pin); - final UEllipse circle = new UEllipse(6, 6); - ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)) - .apply(new UTranslate(x - 3, y - 3)).draw(circle); - } - - private void drawPinLink(UGraphic ug, PinLink pinLink) { - final double x1 = getX(pinLink.getPin1()); - final double y1 = getY(pinLink.getPin1()); - final double x2 = getX(pinLink.getPin2()); - final double y2 = getY(pinLink.getPin2()); - - final Rose rose = new Rose(); - final HtmlColor color = rose.getHtmlColor(diagram.getSkinParam(), ColorParam.arrow); - final List b = new ArrayList(); - final SmartConnection connection = new SmartConnection(x1, y1, x2, y2, b); - connection.draw(ug, color); - } - - private IEntityImage computeImage(final ILeaf leaf) { - final IEntityImage image = GeneralImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(), - false, diagram, null, null, null, diagram.getLinks()); - return image; - } -} diff --git a/src/net/sourceforge/plantuml/hector/GrowingTree.java b/src/net/sourceforge/plantuml/hector/GrowingTree.java deleted file mode 100644 index 9b5bdf3..0000000 --- a/src/net/sourceforge/plantuml/hector/GrowingTree.java +++ /dev/null @@ -1,175 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class GrowingTree { - - private final List all = new ArrayList(); - private final Map> directlyAfter = new HashMap>(); - - public Skeleton createSkeleton() { - final Set pins = new LinkedHashSet(); - for (PinLink link : all) { - pins.add(link.getPin1()); - pins.add(link.getPin2()); - } - normalizeRowToZero(pins); - return new Skeleton(new ArrayList(pins), new ArrayList(all)); - } - - private void normalizeRowToZero(Collection pins) { - int minRow = Integer.MAX_VALUE; - for (Pin p : pins) { - final int r = p.getRow(); - if (r == Integer.MAX_VALUE) { - throw new IllegalStateException(); - } - if (r < minRow) { - minRow = r; - } - } - for (Pin p : pins) { - p.push(-minRow); - } - } - - public boolean canBeAdded(PinLink candidat) { - if (all.size() == 0) { - return true; - } - final Pin p1 = candidat.getPin1(); - final Pin p2 = candidat.getPin2(); - if (p1.getRow() == Integer.MAX_VALUE && p2.getRow() == Integer.MAX_VALUE) { - return false; - } - return true; - } - - public void add(PinLink newPinLink) { - final Pin p1 = newPinLink.getPin1(); - final Pin p2 = newPinLink.getPin2(); - if (all.size() == 0) { - newPinLink.getPin1().setRow(0); - simpleRowComputation(newPinLink); - } else if (isPartiallyNew(newPinLink)) { - simpleRowComputation(newPinLink); - } else if (p1.getRow() != Integer.MAX_VALUE && p2.getRow() != Integer.MAX_VALUE) { - final int actualRowDiff = p2.getRow() - p1.getRow(); - final int neededPushForP2 = newPinLink.getLengthStandard() - actualRowDiff; - push(p2, neededPushForP2); - } else { - throw new IllegalArgumentException(); - } - all.add(newPinLink); - getDirectlyAfter(p1).add(p2); - } - - private List getDirectlyAfter(Pin p) { - ArrayList result = directlyAfter.get(p); - if (result == null) { - result = new ArrayList(); - directlyAfter.put(p, result); - } - return result; - } - - private Collection getIndirectlyAfter(Pin pin) { - final Set result = new HashSet(getDirectlyAfter(pin)); - int lastSize = result.size(); - while (true) { - for (Pin p : new ArrayList(result)) { - result.addAll(getDirectlyAfter(p)); - } - if (result.size() == lastSize) { - return result; - } - lastSize = result.size(); - } - } - - private void push(Pin p, int push) { - if (push <= 0) { - return; - } - final Collection after = getIndirectlyAfter(p); - if (after.contains(p)) { - throw new IllegalStateException(); - } - p.push(push); - for (Pin pp : after) { - pp.push(push); - } - } - - private void simpleRowComputation(PinLink link) { - final Pin p1 = link.getPin1(); - final Pin p2 = link.getPin2(); - if (p1.getRow() == Integer.MAX_VALUE && p2.getRow() != Integer.MAX_VALUE) { - p1.setRow(p2.getRow() - link.getLengthStandard()); - } else if (p1.getRow() != Integer.MAX_VALUE && p2.getRow() == Integer.MAX_VALUE) { - p2.setRow(p1.getRow() + link.getLengthStandard()); - } else { - throw new IllegalArgumentException(); - } - } - - private boolean isPartiallyNew(PinLink link) { - final Pin p1 = link.getPin1(); - final Pin p2 = link.getPin2(); - if (p1.getRow() == Integer.MAX_VALUE && p2.getRow() != Integer.MAX_VALUE) { - return true; - } else if (p1.getRow() != Integer.MAX_VALUE && p2.getRow() == Integer.MAX_VALUE) { - return true; - } else { - return false; - } - } - - public void normalizeRowToZero() { - // TODO Auto-generated method stub - - } - -} diff --git a/src/net/sourceforge/plantuml/hector/HectorPath.java b/src/net/sourceforge/plantuml/hector/HectorPath.java deleted file mode 100644 index 3a7f92c..0000000 --- a/src/net/sourceforge/plantuml/hector/HectorPath.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.geom.LineSegmentDouble; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UStroke; - -public class HectorPath { - - private final List segments = new ArrayList(); - - public void add(LineSegmentDouble seg) { - this.segments.add(seg); - } - - public void add(Point2D p1, Point2D p2) { - add(new LineSegmentDouble(p1, p2)); - } - - @Override - public String toString() { - return segments.toString(); - } - - public void draw(UGraphic ug, HtmlColor color) { - ug = ug.apply(new UChangeColor(color)).apply(new UStroke(1.5)); - for (LineSegmentDouble seg : segments) { - seg.draw(ug); - } - } - -} diff --git a/src/net/sourceforge/plantuml/hector/Pin.java b/src/net/sourceforge/plantuml/hector/Pin.java deleted file mode 100644 index ead918a..0000000 --- a/src/net/sourceforge/plantuml/hector/Pin.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - - -public class Pin { - - private int row; - private int uid = -1; - - private final Object userData; - - public Pin(int row, Object userData) { - this.row = row; - this.userData = userData; - } - - public void setUid(int uid) { - if (this.uid != -1) { - throw new IllegalStateException(); - } - this.uid = uid; - } - - public int getRow() { - return row; - } - - public int getUid() { - return uid; - } - - public Object getUserData() { - return userData; - } - - public void setRow(int row) { - this.row = row; - } - - public void push(int push) { - setRow(getRow() + push); - } - -} diff --git a/src/net/sourceforge/plantuml/hector/PinFactory.java b/src/net/sourceforge/plantuml/hector/PinFactory.java deleted file mode 100644 index e6146ee..0000000 --- a/src/net/sourceforge/plantuml/hector/PinFactory.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.HashMap; -import java.util.Map; - -import net.sourceforge.plantuml.cucadiagram.Link; - -public class PinFactory { - - private final Map pins = new HashMap(); - - Pin create(Object userData) { - return create(Integer.MAX_VALUE, userData); - } - - public Pin create(int row, Object userData) { - if (userData == null) { - return new Pin(row, userData); - } - Pin result = pins.get(userData); - if (result == null) { - result = new Pin(row, userData); - pins.put(userData, result); - } - return result; - } - - public PinLink createPinLink(Link link) { - final PinLink result = new PinLink(create(link.getEntity1()), create(link.getEntity2()), link.getLength(), link); - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/hector/PinLink.java b/src/net/sourceforge/plantuml/hector/PinLink.java deleted file mode 100644 index 231dac5..0000000 --- a/src/net/sourceforge/plantuml/hector/PinLink.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -public class PinLink { - - private final Pin pin1; - private final Pin pin2; - private final Object userData; - private final int length; - - public PinLink(Pin pin1, Pin pin2, int length, Object userData) { - if (length < 1) { - throw new IllegalArgumentException(); - } - this.pin1 = pin1; - this.pin2 = pin2; - this.userData = userData; - this.length = length; - } - - public boolean contains(Pin pin) { - return pin == pin1 || pin == pin2; - } - - public boolean doesTouch(PinLink other) { - return other.contains(pin1) || other.contains(pin2); - } - - public Pin getPin1() { - return pin1; - } - - public Pin getPin2() { - return pin2; - } - - public int getLengthDot() { - return length; - } - - public int getLengthStandard() { - return length - 1; - } -} diff --git a/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java b/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java deleted file mode 100644 index 49fc3e7..0000000 --- a/src/net/sourceforge/plantuml/hector/PinLinksContinuousSet.java +++ /dev/null @@ -1,104 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -public class PinLinksContinuousSet { - - private final Collection all = new ArrayList(); - - public Skeleton createSkeleton() { - final GrowingTree tree = new GrowingTree(); - final Collection pendings = new ArrayList(all); - while (pendings.size() > 0) { - for (Iterator it = pendings.iterator(); it.hasNext();) { - final PinLink candidat = it.next(); - if (tree.canBeAdded(candidat)) { - tree.add(candidat); - it.remove(); - } - } - } - return tree.createSkeleton(); - - } - - public void add(PinLink newPinLink) { - if (all.size() == 0) { - all.add(newPinLink); - return; - } - if (all.contains(newPinLink)) { - throw new IllegalArgumentException("already"); - } - for (PinLink aLink : all) { - if (newPinLink.doesTouch(aLink)) { - all.add(newPinLink); - return; - } - } - throw new IllegalArgumentException("not connex"); - } - - public void addAll(PinLinksContinuousSet other) { - if (doesTouch(other) == false) { - throw new IllegalArgumentException(); - } - this.all.addAll(other.all); - } - - public boolean doesTouch(PinLink other) { - for (PinLink aLink : all) { - if (other.doesTouch(aLink)) { - return true; - } - } - return false; - } - - public boolean doesTouch(PinLinksContinuousSet otherSet) { - for (PinLink otherLink : otherSet.all) { - if (doesTouch(otherLink)) { - return true; - } - } - return false; - } - -} diff --git a/src/net/sourceforge/plantuml/hector/Skeleton.java b/src/net/sourceforge/plantuml/hector/Skeleton.java deleted file mode 100644 index d02cf7b..0000000 --- a/src/net/sourceforge/plantuml/hector/Skeleton.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -public class Skeleton { - - private final List pins; - private final List pinLinks; - private final SortedSet rows = new TreeSet(); - - public Skeleton(List pins, List pinLinks) { - this.pins = pins; - this.pinLinks = pinLinks; - int uid = 0; - for (Pin pin : pins) { - pin.setUid(uid++); - rows.add(pin.getRow()); - } - } - - public SortedSet getRows() { - return rows; - } - - public List getPins() { - return pins; - } - - public Collection getPinsOfRow(int row) { - final Set result = new LinkedHashSet(); - for (Pin pin : pins) { - if (pin.getRow() == row) { - result.add(pin); - } - } - return result; - } - - public List getPinLinks() { - return pinLinks; - } - - - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java b/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java deleted file mode 100644 index 7519b11..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class SkeletonBuilder { - - private List sets = new ArrayList(); - - public void add(PinLink pinLink) { - addInternal(pinLink); - merge(); - - } - - private void merge() { - for (int i = 0; i < sets.size() - 1; i++) { - for (int j = i + 1; j < sets.size(); j++) { - if (sets.get(i).doesTouch(sets.get(j))) { - sets.get(i).addAll(sets.get(j)); - sets.remove(j); - return; - } - } - } - } - - private void addInternal(PinLink pinLink) { - for (PinLinksContinuousSet set : sets) { - if (set.doesTouch(pinLink)) { - set.add(pinLink); - return; - } - } - final PinLinksContinuousSet newSet = new PinLinksContinuousSet(); - newSet.add(pinLink); - sets.add(newSet); - } - - public List createSkeletons() { - final List result = new ArrayList(); - - for (PinLinksContinuousSet set : sets) { - result.add(set.createSkeleton()); - } - - return Collections.unmodifiableList(result); - } -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java b/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java deleted file mode 100644 index 125eecb..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfiguration.java +++ /dev/null @@ -1,256 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class SkeletonConfiguration { - - private final int position[]; - private final Skeleton skeleton; - - public static SkeletonConfiguration getDefault(Skeleton skeleton) { - final Collection rows = skeleton.getRows(); - final Map free = new HashMap(); - for (Integer i : rows) { - free.put(i, 0); - } - final Collection pins = skeleton.getPins(); - final int position[] = new int[pins.size()]; - for (Pin pin : pins) { - final int f = free.get(pin.getRow()); - position[pin.getUid()] = f; - free.put(pin.getRow(), f + 1); - } - return new SkeletonConfiguration(skeleton, position); - } - - @Override - public int hashCode() { - int result = 0; - for (int v : position) { - result = result * 37 + v; - } - return result; - } - - @Override - public boolean equals(Object other) { - final SkeletonConfiguration this2 = (SkeletonConfiguration) other; - if (this.skeleton != this2.skeleton) { - throw new IllegalArgumentException(); - } - if (this.position.length != this2.position.length) { - throw new IllegalArgumentException(); - } - for (int i = 0; i < position.length; i++) { - if (this.position[i] != this2.position[i]) { - return false; - } - } - return true; - } - - @Override - public String toString() { - final int minRow = skeleton.getRows().first(); - final int maxRow = skeleton.getRows().last(); - int minCol = Integer.MAX_VALUE; - int maxCol = Integer.MIN_VALUE; - for (int c : position) { - if (c > maxCol) { - maxCol = c; - } - if (c < minCol) { - minCol = c; - } - } - final StringBuilder result = new StringBuilder(); - for (int r = minRow; r <= maxRow; r++) { - appendRow(result, r, minCol, maxCol); - if (r < maxRow) { - result.append(" "); - } - } - return result.toString(); - } - - private void appendRow(StringBuilder result, int row, int minCol, int maxCol) { - result.append("("); - boolean first = true; - for (int c = minCol; c <= maxCol; c++) { - if (first == false) { - result.append("-"); - } - final Pin pin = getPin(row, c); - if (pin == null) { - result.append("."); - } else { - result.append(pin.getUid()); - } - first = false; - } - result.append(")"); - - } - - private Pin getPin(int row, int col) { - for (Pin p : skeleton.getPinsOfRow(row)) { - if (getCol(p) == col) { - return p; - } - } - return null; - } - - public int getCol(Pin pin) { - return position[pin.getUid()]; - } - - private SkeletonConfiguration(Skeleton skeleton, int position[]) { - this.position = position; - this.skeleton = skeleton; - } - - class Switch implements SkeletonMutation { - private final SkeletonConfiguration newConfiguration; - - public Switch(Pin pin1, Pin pin2) { - if (pin1 == pin2) { - throw new IllegalArgumentException(); - } - final int copy[] = new int[position.length]; - for (int i = 0; i < position.length; i++) { - if (i == pin1.getUid()) { - copy[i] = position[pin2.getUid()]; - } else if (i == pin2.getUid()) { - copy[i] = position[pin1.getUid()]; - } else { - copy[i] = position[i]; - } - } - this.newConfiguration = new SkeletonConfiguration(skeleton, copy); - } - - public SkeletonConfiguration mutate() { - return newConfiguration; - } - } - - class Move implements SkeletonMutation { - private final SkeletonConfiguration newConfiguration; - - public Move(Pin pin, int deltaX) { - final int copy[] = new int[position.length]; - for (int i = 0; i < position.length; i++) { - if (i == pin.getUid()) { - copy[i] = position[i] + deltaX; - } else { - copy[i] = position[i]; - } - } - this.newConfiguration = new SkeletonConfiguration(skeleton, copy); - } - - public SkeletonConfiguration mutate() { - return newConfiguration; - } - } - - private Collection getMutationForRow(int row) { - final Collection pins = skeleton.getPinsOfRow(row); - final Collection usedCols = new HashSet(); - for (Pin pin : pins) { - usedCols.add(getCol(pin)); - } - final Collection result = new ArrayList(); - for (Pin pin1 : pins) { - final int c = getCol(pin1); - if (usedCols.contains(c + 1) == false) { - result.add(new Move(pin1, 1)); - } - if (usedCols.contains(c - 1) == false) { - result.add(new Move(pin1, -1)); - } - for (Pin pin2 : pins) { - if (pin1 == pin2) { - continue; - } - if (getCol(pin1) > getCol(pin2)) { - continue; - } - if (getCol(pin1) == getCol(pin2)) { - throw new IllegalStateException(); - } - result.add(new Switch(pin1, pin2)); - } - } - return result; - } - - public Set getSomeMuteds() { - final Set result = new HashSet(); - for (Integer row : skeleton.getRows()) { - for (SkeletonMutation mutation : getMutationForRow(row)) { - result.add(mutation.mutate()); - } - - } - return result; - } - - public List getPinLinks() { - return skeleton.getPinLinks(); - } - - public double getLength(PinLink link) { - final double x1 = getCol(link.getPin1()); - final double y1 = link.getPin1().getRow(); - final double x2 = getCol(link.getPin2()); - final double y2 = link.getPin2().getRow(); - final double dx = x2 - x1; - final double dy = y2 - y1; - return Math.sqrt(dx * dx + dy * dy); - } - - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java deleted file mode 100644 index 627702a..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationComparator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.Comparator; - -public class SkeletonConfigurationComparator implements Comparator { - - private final SkeletonConfigurationEvaluator evaluator; - - public SkeletonConfigurationComparator(SkeletonConfigurationEvaluator evaluator) { - this.evaluator = evaluator; - } - - public int compare(SkeletonConfiguration sc1, SkeletonConfiguration sc2) { - final double price1 = evaluator.getPrice(sc1); - final double price2 = evaluator.getPrice(sc2); - if (price1 > price2) { - return 1; - } - if (price1 < price2) { - return -1; - } - return 0; - } - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java deleted file mode 100644 index 9742a5f..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluator.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -public interface SkeletonConfigurationEvaluator { - - public double getPrice(SkeletonConfiguration configuration); - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java deleted file mode 100644 index a6e2f78..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationEvaluatorLineLenght.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -public class SkeletonConfigurationEvaluatorLineLenght implements SkeletonConfigurationEvaluator { - - public double getPrice(SkeletonConfiguration configuration) { - double result = 0; - for (PinLink link : configuration.getPinLinks()) { - result += configuration.getLength(link); - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java deleted file mode 100644 index b6ecccc..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationSet.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -public class SkeletonConfigurationSet implements Iterable { - - private final List all; - private final SkeletonConfigurationComparator comparator; - private final int limitSize; - - public SkeletonConfigurationSet(int limitSize, SkeletonConfigurationEvaluator evaluator) { - this.comparator = new SkeletonConfigurationComparator(evaluator); - this.all = new ArrayList(); - this.limitSize = limitSize; - } - - public void add(SkeletonConfiguration skeletonConfiguration) { - this.all.add(skeletonConfiguration); - sortAndTruncate(); - } - - public void addAll(Collection others) { - all.addAll(others); - sortAndTruncate(); - } - - private void sortAndTruncate() { - Collections.sort(all, comparator); - while (all.size() > limitSize) { - all.remove(all.size() - 1); - } - } - - @Override - public String toString() { - return all.toString(); - } - - public int size() { - return all.size(); - } - - public Iterator iterator() { - return new ArrayList(all).iterator(); - } - - public SkeletonConfiguration first() { - return all.get(0); - } - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java deleted file mode 100644 index 7b2429c..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurationUtils.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -public class SkeletonConfigurationUtils { - - public static SkeletonConfiguration getBest(Skeleton skeleton) { - SkeletonConfiguration config = SkeletonConfiguration.getDefault(skeleton); - - final SkeletonConfigurationSet set = new SkeletonConfigurationSet(200, - new SkeletonConfigurationEvaluatorLineLenght()); - set.add(config); - - for (int i = 0; i < 10; i++) { - System.err.println("before size=" + set.size()); - for (SkeletonConfiguration sk : set) { - set.addAll(sk.getSomeMuteds()); - } - System.err.println("after size=" + set.size()); - } - return set.first(); - } - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java b/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java deleted file mode 100644 index c7d2f0c..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonConfigurations.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -public class SkeletonConfigurations { - -} diff --git a/src/net/sourceforge/plantuml/hector/SkeletonMutation.java b/src/net/sourceforge/plantuml/hector/SkeletonMutation.java deleted file mode 100644 index 593ef96..0000000 --- a/src/net/sourceforge/plantuml/hector/SkeletonMutation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -interface SkeletonMutation { - - public SkeletonConfiguration mutate(); - -} diff --git a/src/net/sourceforge/plantuml/hector/SmartConnection.java b/src/net/sourceforge/plantuml/hector/SmartConnection.java deleted file mode 100644 index 8fa7ccd..0000000 --- a/src/net/sourceforge/plantuml/hector/SmartConnection.java +++ /dev/null @@ -1,111 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.awt.geom.Point2D; -import java.util.List; - -import net.sourceforge.plantuml.geom.LineSegmentDouble; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UPath; -import net.sourceforge.plantuml.ugraphic.UStroke; - -class SmartConnection { - - private final double x1; - private final double y1; - private final double x2; - private final double y2; - private final List forbidden; - - public SmartConnection(double x1, double y1, double x2, double y2, List forbidden) { - this.x1 = x1; - this.y1 = y1; - this.x2 = x2; - this.y2 = y2; - this.forbidden = forbidden; - } - - public SmartConnection(Point2D p1, Point2D p2, List b) { - this(p1.getX(), p1.getY(), p2.getX(), p2.getY(), b); - } - - public void draw(UGraphic ug, HtmlColor color) { - final LineSegmentDouble seg = new LineSegmentDouble(x1, y1, x2, y2); - boolean clash = intersect(seg); - if (clash) { - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UStroke(1.0)); - } else { - ug = ug.apply(new UChangeColor(color)).apply(new UStroke(1.5)); - } - seg.draw(ug); - } - - private boolean intersect(LineSegmentDouble seg) { - for (Box2D box : forbidden) { - if (box.doesIntersect(seg)) { - return true; - } - } - return false; - } - - public void drawEx1(UGraphic ug, HtmlColor color) { - ug = ug.apply(new UChangeColor(color)).apply(new UStroke(1.5)); - final double orthoX = -(y2 - y1); - final double orthoY = x2 - x1; - for (int i = -10; i <= 10; i++) { - for (int j = -10; j <= 10; j++) { - final double d1x = orthoX * i / 10.0; - final double d1y = orthoY * i / 10.0; - final double c1x = (x1 + x2) / 2 + d1x; - final double c1y = (y1 + y2) / 2 + d1y; - final double d2x = orthoX * j / 10.0; - final double d2y = orthoY * j / 10.0; - final double c2x = (x1 + x2) / 2 + d2x; - final double c2y = (y1 + y2) / 2 + d2y; - final UPath path = new UPath(); - path.moveTo(x1, y1); - path.cubicTo(c1x, c1y, c2x, c2y, x2, y2); - ug.draw(path); - } - } - } - -} diff --git a/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java b/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java deleted file mode 100644 index 3b0998c..0000000 --- a/src/net/sourceforge/plantuml/hector/UnlinarCompressedPlan.java +++ /dev/null @@ -1,144 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.geom.LineSegmentDouble; -import net.sourceforge.plantuml.hector.UnlinearCompression.Rounding; - -class UnlinarCompressedPlan { - - private final UnlinearCompression compX; - private final UnlinearCompression compY; - - public UnlinarCompressedPlan(double inner, double outer) { - this(inner, outer, inner, outer); - } - - public UnlinarCompressedPlan(double innerx, double outerx, double innery, double outery) { - this.compX = new UnlinearCompression(innerx, outerx); - this.compY = new UnlinearCompression(innery, outery); - } - - public double getInnerX() { - return compX.innerSize(); - } - - public double getInnerY() { - return compY.innerSize(); - } - - public HectorPath uncompressSegmentSimple(Point2D pp1, Point2D pp2) { - final HectorPath result = new HectorPath(); - result.add(new LineSegmentDouble(uncompress(pp1, UnlinearCompression.Rounding.CENTRAL), uncompress(pp2, - UnlinearCompression.Rounding.CENTRAL))); - return result; - } - - public HectorPath uncompressSegment(Point2D pp1, Point2D pp2) { - double x1 = pp1.getX(); - double y1 = pp1.getY(); - final double x2 = pp2.getX(); - final double y2 = pp2.getY(); - final HectorPath result = new HectorPath(); - final double y[] = compY.encounteredSingularities(y1, y2); - if (y.length == 0 || x1 == x2) { - result.add(new LineSegmentDouble(uncompress(pp1, UnlinearCompression.Rounding.CENTRAL), uncompress(pp2, - UnlinearCompression.Rounding.CENTRAL))); - return result; - } - System.err.println("len=" + y.length); - final LineSegmentDouble segment = new LineSegmentDouble(pp1, pp2); - for (int i = 0; i < y.length; i++) { - final double x = segment.getIntersectionHorizontal(y[i]); - final Rounding r = i == 0 ? UnlinearCompression.Rounding.CENTRAL : UnlinearCompression.Rounding.BORDER_2; - result.add(uncompress(x1, y1, r), uncompress(x, y[i], UnlinearCompression.Rounding.BORDER_1)); - x1 = x; - y1 = y[i]; - } - result.add(uncompress(x1, y1, UnlinearCompression.Rounding.BORDER_2), uncompress(x2, y2, - UnlinearCompression.Rounding.CENTRAL)); - return result; - - } - - public HectorPath uncompress(LineSegmentDouble segment) { - double x1 = segment.getX1(); - double y1 = segment.getY1(); - final double x2 = segment.getX2(); - final double y2 = segment.getY2(); - final HectorPath result = new HectorPath(); - final double x[] = compX.encounteredSingularities(x1, x2); - if (x.length == 0) { - result.add(getUncompressedSegment(x1, y1, x2, y2, UnlinearCompression.Rounding.BORDER_2)); - return result; - } - for (int i = 0; i < x.length; i++) { - final double y = segment.getIntersectionVertical(x[i]); - result.add(getUncompressedSegment(x1, y1, x[i], y, UnlinearCompression.Rounding.BORDER_2)); - x1 = x[i]; - y1 = y; - } - result.add(getUncompressedSegment(x1, y1, x2, y2, UnlinearCompression.Rounding.BORDER_2)); - return result; - } - - public Point2D uncompress(Point2D pt, UnlinearCompression.Rounding rounding) { - return uncompress(pt.getX(), pt.getY(), rounding); - } - - public Point2D uncompress(double x, double y, UnlinearCompression.Rounding rounding) { - return new Point2D.Double(compX.uncompress(x, rounding), compY.uncompress(y, rounding)); - } - - private LineSegmentDouble getUncompressedSegment(final double x1, final double y1, final double x2, - final double y2, UnlinearCompression.Rounding rounding) { - final LineSegmentDouble un1 = new LineSegmentDouble(compX.uncompress(x1, rounding), compY.uncompress(y1, - rounding), compX.uncompress(x2, rounding), compY.uncompress(y2, rounding)); - return un1; - } - - // private LineSegmentDouble getUncompressedSegmentRoundBefore(final double - // x1, final double y1, final double x2, - // final double y2) { - // final LineSegmentDouble un1 = new LineSegmentDouble(compX.uncompress(x1), - // compY.uncompress(y1), - // compX.uncompress(x2) - compX.innerSize(), compY.uncompress(y2)); - // return un1; - // } - -} diff --git a/src/net/sourceforge/plantuml/hector/UnlinearCompression.java b/src/net/sourceforge/plantuml/hector/UnlinearCompression.java deleted file mode 100644 index d79f6d9..0000000 --- a/src/net/sourceforge/plantuml/hector/UnlinearCompression.java +++ /dev/null @@ -1,112 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector; - -class UnlinearCompression { - - static enum Rounding { - BORDER_1, CENTRAL, BORDER_2; - } - - private final double inner; - private final double outer; - - public UnlinearCompression(double inner, double outer) { - this.inner = inner; - this.outer = outer; - } - - public double compress(double x) { - final double pour = x / (inner + outer); - final double pourInter = Math.floor(pour); - x -= pourInter * (inner + outer); - if (x < inner) { - return pourInter * outer; - } - return x - inner + pourInter * outer; - } - - public double uncompress(double x, Rounding rounding) { - final int pourInter = nbOuterBefore(x); - final boolean onBorder = equals(x, pourInter * outer); - if (onBorder && rounding == Rounding.BORDER_1) { - // Nothing - } else if (onBorder && rounding == Rounding.CENTRAL) { - x += inner / 2.0; - } else { - x += inner; - } - x += pourInter * inner; - return x; - } - - private static boolean equals(double d1, double d2) { - return Math.abs(d1 - d2) < .001; - } - - private int nbOuterBefore(double x) { - final double pour = x / outer; - final int pourInter = (int) Math.floor(pour); - return pourInter; - } - - public double[] encounteredSingularities(double from, double to) { - final int outer1 = nbOuterBefore(from) + 1; - int outer2 = nbOuterBefore(to) + 1; - if (equals(to, (outer2 - 1) * outer)) { - outer2--; - } - final double result[]; - if (from <= to) { - result = new double[outer2 - outer1]; - for (int i = 0; i < result.length; i++) { - result[i] = (outer1 + i) * outer; - } - } else { - result = new double[outer1 - outer2]; - for (int i = 0; i < result.length; i++) { - result[i] = (outer1 - 1 - i) * outer; - } - - } - return result; - } - - public double innerSize() { - return inner; - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/MinMax.java b/src/net/sourceforge/plantuml/hector2/MinMax.java deleted file mode 100644 index f783491..0000000 --- a/src/net/sourceforge/plantuml/hector2/MinMax.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2; - -import java.util.Collection; - -public class MinMax { - - private final int min; - private final int max; - - private MinMax(int min, int max) { - if (max < min) { - throw new IllegalArgumentException(); - } - this.min = min; - this.max = max; - } - - private MinMax(int value) { - this(value, value); - } - - public MinMax add(int value) { - final int newMin = Math.min(min, value); - final int newMax = Math.max(max, value); - if (min == newMin && max == newMax) { - return this; - } - return new MinMax(newMin, newMax); - } - - public MinMax add(MinMax other) { - final int newMin = Math.min(min, other.min); - final int newMax = Math.max(max, other.max); - if (min == newMin && max == newMax) { - return this; - } - return new MinMax(newMin, newMax); - } - - public final int getMin() { - return min; - } - - public final int getMax() { - return max; - } - - public static MinMax from(Collection values) { - MinMax result = null; - for (Integer i : values) { - if (result == null) { - result = new MinMax(i); - } else { - result = result.add(i); - } - } - return result; - } - - public int getDiff() { - return max - min; - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java b/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java deleted file mode 100644 index 3686449..0000000 --- a/src/net/sourceforge/plantuml/hector2/continuity/Skeleton.java +++ /dev/null @@ -1,189 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.continuity; - -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.cucadiagram.IEntity; -import net.sourceforge.plantuml.cucadiagram.Link; - -public class Skeleton { - - private final Set entities = new HashSet(); - private final List links = new ArrayList(); - - private Set getDirectChildren(IEntity parent) { - final Set result = new HashSet(); - for (Link link : links) { - if (link.isAutolink()) { - continue; - } - if (link.getEntity1() == parent) { - result.add(link.getEntity2()); - } - } - return Collections.unmodifiableSet(result); - } - - @Override - public String toString() { - return "skeleton " + links; - } - - private Set getIndirectChildren(IEntity parent) { - final Set result = new HashSet(getDirectChildren(parent)); - int currentSize = result.size(); - while (true) { - for (IEntity ent : new HashSet(result)) { - result.addAll(getDirectChildren(ent)); - } - if (result.contains(parent) || result.size() == currentSize) { - return Collections.unmodifiableSet(result); - } - currentSize = result.size(); - } - } - - private boolean hasCycle() { - for (IEntity ent : entities) { - if (getIndirectChildren(ent).contains(ent)) { - return true; - } - } - return false; - } - - public Skeleton removeCycle() { - final Skeleton result = new Skeleton(); - for (Link link : links) { - result.add(link); - if (result.hasCycle()) { - result.links.remove(link); - } - } - return result; - } - - public void add(Link link) { - if (links.contains(link)) { - throw new IllegalArgumentException(); - } - if (link.getEntity1().isGroup()) { - throw new IllegalArgumentException(); - } - if (link.getEntity2().isGroup()) { - throw new IllegalArgumentException(); - } - links.add(link); - entities.add(link.getEntity1()); - entities.add(link.getEntity2()); - } - - public void addAll(Skeleton other) { - for (Link otherLink : other.links) { - this.add(otherLink); - } - - } - - public boolean doesTouch(Link other) { - for (Link link : links) { - if (link.doesTouch(other)) { - return true; - } - } - return false; - } - - public boolean doesTouch(Skeleton other) { - for (Link link : links) { - if (other.doesTouch(link)) { - return true; - } - } - return false; - } - - public void computeLayers() { - if (hasCycle()) { - throw new UnsupportedOperationException(); - } - for (IEntity ent : entities) { - ent.setHectorLayer(0); - } - boolean changed; - do { - changed = false; - for (Link link : links) { - if (ensureLayer(link)) { - changed = true; - } - } - } while (changed); - } - - private boolean ensureLayer(Link link) { - final int lenght = link.getLength(); - final int l1 = link.getEntity1().getHectorLayer(); - final int l2 = link.getEntity2().getHectorLayer(); - if (lenght == 1) { - if (l1 < l2) { - link.getEntity1().setHectorLayer(l2); - return true; - } else if (l2 < l1) { - link.getEntity2().setHectorLayer(l1); - return true; - } - } else { - final int l2theoric = l1 + lenght - 1; - if (l2 < l2theoric) { - link.getEntity2().setHectorLayer(l2theoric); - return true; - } - } - return false; - } - - public Collection entities() { - return Collections.unmodifiableCollection(entities); - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java b/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java deleted file mode 100644 index 677395c..0000000 --- a/src/net/sourceforge/plantuml/hector2/continuity/SkeletonBuilder.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.continuity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.cucadiagram.Link; - -public class SkeletonBuilder { - - private List all = new ArrayList(); - - public void add(Link link) { - addInternal(link); - do { - final boolean changed = merge(); - if (changed == false) { - return; - } - } while (true); - - } - - private boolean merge() { - for (int i = 0; i < all.size() - 1; i++) { - for (int j = i + 1; j < all.size(); j++) { - if (all.get(i).doesTouch(all.get(j))) { - all.get(i).addAll(all.get(j)); - all.remove(j); - return true; - } - } - } - return false; - } - - private void addInternal(Link link) { - for (Skeleton skeleton : all) { - if (skeleton.doesTouch(link)) { - skeleton.add(link); - return; - } - } - final Skeleton newSkeleton = new Skeleton(); - newSkeleton.add(link); - all.add(newSkeleton); - } - - public List getSkeletons() { - return Collections.unmodifiableList(all); - } -} diff --git a/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java b/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java deleted file mode 100644 index e3df59f..0000000 --- a/src/net/sourceforge/plantuml/hector2/graphic/Foo1.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.graphic; - -import java.awt.geom.Dimension2D; - -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.StringBounder; -import net.sourceforge.plantuml.hector2.layering.Layer; -import net.sourceforge.plantuml.svek.GeneralImageBuilder; -import net.sourceforge.plantuml.svek.IEntityImage; - -public class Foo1 { - - public static Dimension2D getMaxCellDimension(StringBounder stringBounder, Layer layer, CucaDiagram diagram) { - Dimension2D result = new Dimension2DDouble(0, 0); - for (IEntity ent : layer.entities()) { - final IEntityImage image = computeImage((ILeaf) ent, diagram); - final Dimension2D dim = image.calculateDimension(stringBounder); - result = Dimension2DDouble.max(result, dim); - } - return result; - } - - private static IEntityImage computeImage(final ILeaf leaf, CucaDiagram diagram) { - final IEntityImage image = GeneralImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(), - false, diagram, null, null, null, diagram.getLinks()); - return image; - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java b/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java deleted file mode 100644 index 92fedb0..0000000 --- a/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.graphic; - -import java.awt.geom.Dimension2D; - -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; -import net.sourceforge.plantuml.hector2.layering.Layer; -import net.sourceforge.plantuml.hector2.mpos.Distribution; -import net.sourceforge.plantuml.svek.GeneralImageBuilder; -import net.sourceforge.plantuml.svek.IEntityImage; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class Foo2 extends AbstractTextBlock implements TextBlock { - - private final Distribution distribution; - private final CucaDiagram diagram; - - public Foo2(Distribution distribution, CucaDiagram diagram) { - this.distribution = distribution; - this.diagram = diagram; - } - - public Dimension2D getMaxCellDimension(StringBounder stringBounder) { - Dimension2D result = new Dimension2DDouble(0, 0); - for (Layer layer : distribution.getLayers()) { - final Dimension2D dim = Foo1.getMaxCellDimension(stringBounder, layer, diagram); - result = Dimension2DDouble.max(result, dim); - } - return result; - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - final Dimension2D cell = getMaxCellDimension(stringBounder); - final MinMax longitudes = distribution.getMinMaxLongitudes(); - final double width = (longitudes.getDiff() + 2) * cell.getWidth() / 2; - final double height = cell.getHeight() * distribution.getNbLayers(); - return new Dimension2DDouble(width, height); - } - - public void drawU(UGraphic ug) { - final StringBounder stringBounder = ug.getStringBounder(); - final Dimension2D cell = getMaxCellDimension(stringBounder); - for (Layer layer : distribution.getLayers()) { - drawLayer(ug, layer, cell.getWidth(), cell.getHeight()); - ug = ug.apply(new UTranslate(0, cell.getHeight())); - } - } - - private void drawLayer(UGraphic ug, Layer layer, double w, double h) { - for (IEntity ent : layer.entities()) { - final IEntityImage image = computeImage((ILeaf) ent); - final int longitude = layer.getLongitude(ent); - final Dimension2D dimImage = image.calculateDimension(ug.getStringBounder()); - final double diffx = w - dimImage.getWidth(); - final double diffy = h - dimImage.getHeight(); - image.drawU(ug.apply(new UTranslate(w * longitude / 2 + diffx / 2, diffy / 2))); - } - } - - private IEntityImage computeImage(final ILeaf leaf) { - final IEntityImage image = GeneralImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(), - false, diagram, null, null, null, diagram.getLinks()); - return image; - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/layering/Layer.java b/src/net/sourceforge/plantuml/hector2/layering/Layer.java deleted file mode 100644 index 3402cce..0000000 --- a/src/net/sourceforge/plantuml/hector2/layering/Layer.java +++ /dev/null @@ -1,117 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.layering; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.hector2.MinMax; -import net.sourceforge.plantuml.hector2.mpos.MutationLayer; -import net.sourceforge.plantuml.hector2.mpos.MutationLayerMove; - -public class Layer { - - private final int id; - private final Map entities = new HashMap(); - - public Layer(int id) { - this.id = id; - } - - public Layer duplicate() { - final Layer result = new Layer(id); - result.entities.putAll(this.entities); - return result; - } - - public List getPossibleMutations() { - final List result = new ArrayList(); - for (Map.Entry ent : entities.entrySet()) { - final IEntity entity = ent.getKey(); - final int longitude = ent.getValue(); - if (isLongitudeFree(longitude + 2)) { - result.add(new MutationLayerMove(this, entity, longitude + 2)); - } - if (isLongitudeFree(longitude - 2)) { - result.add(new MutationLayerMove(this, entity, longitude - 2)); - } - } - return Collections.unmodifiableList(result); - } - - private boolean isLongitudeFree(int longitude) { - return entities.values().contains(longitude) == false; - } - - public void put(IEntity ent, int longitude) { - if (entities.containsKey(ent) == false) { - throw new IllegalArgumentException(); - } - this.entities.put(ent, longitude); - } - - public void add(IEntity ent) { - final int pos = entities.size() * 2; - this.entities.put(ent, pos); - } - - public Collection entities() { - return Collections.unmodifiableCollection(entities.keySet()); - } - - public int getLongitude(IEntity ent) { - return entities.get(ent); - } - - public MinMax getMinMaxLongitudes() { - return MinMax.from(entities.values()); - } - - @Override - public String toString() { - return "layer " + id + " " + entities; - } - - public final int getId() { - return id; - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java b/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java deleted file mode 100644 index 6a00b03..0000000 --- a/src/net/sourceforge/plantuml/hector2/layering/LayerFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.layering; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.hector2.continuity.Skeleton; - -public class LayerFactory { - - public List getLayers(Skeleton skeleton) { - skeleton = skeleton.removeCycle(); - skeleton.computeLayers(); - final List result = new ArrayList(); - for (IEntity ent : skeleton.entities()) { - ensureLayer(result, ent.getHectorLayer()); - } - for (IEntity ent : skeleton.entities()) { - final int layer = ent.getHectorLayer(); - result.get(layer).add(ent); - } - return Collections.unmodifiableList(result); - } - - private void ensureLayer(List result, int layerToAdd) { - while (result.size() <= layerToAdd) { - result.add(new Layer(result.size())); - } - - } -} diff --git a/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java b/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java deleted file mode 100644 index 0a54be1..0000000 --- a/src/net/sourceforge/plantuml/hector2/mpos/Distribution.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.mpos; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.cucadiagram.Link; -import net.sourceforge.plantuml.hector2.MinMax; -import net.sourceforge.plantuml.hector2.layering.Layer; - -public class Distribution { - - private final List layers; - - public Distribution(List layers) { - this.layers = new ArrayList(layers); - } - - public Distribution mute(MutationLayer mutation) { - final Distribution result = new Distribution(this.layers); - final int idx = result.layers.indexOf(mutation.getOriginal()); - if (idx == -1) { - throw new IllegalArgumentException(); - } - result.layers.set(idx, mutation.mute()); - return result; - } - - public double cost(Collection links) { - double result = 0; - for (Link link : links) { - result += getLength(link); - } - return result; - } - - private double getLength(Link link) { - final IEntity ent1 = link.getEntity1(); - final IEntity ent2 = link.getEntity2(); - final int y1 = ent1.getHectorLayer(); - final int x1 = layers.get(y1).getLongitude(ent1); - final int y2 = ent2.getHectorLayer(); - final int x2 = layers.get(y2).getLongitude(ent2); - final int dx = x2 - x1; - final int dy = y2 - y1; - return Math.sqrt(dx * dx + dy * dy); - } - - public List getPossibleMutations() { - final List result = new ArrayList(); - for (Layer layer : layers) { - result.addAll(layer.getPossibleMutations()); - } - return Collections.unmodifiableList(result); - } - - public final List getLayers() { - return Collections.unmodifiableList(layers); - } - - public MinMax getMinMaxLongitudes() { - MinMax result = null; - for (Layer layer : layers) { - if (result == null) { - result = layer.getMinMaxLongitudes(); - } else { - result = result.add(layer.getMinMaxLongitudes()); - } - } - return result; - } - - public double getNbLayers() { - return layers.size(); - } - -} diff --git a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java b/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java deleted file mode 100644 index 611ff57..0000000 --- a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.mpos; - -import net.sourceforge.plantuml.hector2.layering.Layer; - -public interface MutationLayer { - - public Layer getOriginal(); - - public Layer mute(); - -} diff --git a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java b/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java deleted file mode 100644 index 5c469ca..0000000 --- a/src/net/sourceforge/plantuml/hector2/mpos/MutationLayerMove.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.hector2.mpos; - -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.hector2.layering.Layer; - -public class MutationLayerMove implements MutationLayer { - - private final Layer layer; - private final IEntity entity; - private final int newLongitude; - - public MutationLayerMove(Layer layer, IEntity entity, int newLongitude) { - this.layer = layer; - this.entity = entity; - this.newLongitude = newLongitude; - } - - public Layer mute() { - final Layer result = layer.duplicate(); - result.put(entity, newLongitude); - return result; - } - - public Layer getOriginal() { - return layer; - } - - @Override - public String toString() { - return "{" + layer.getId() + "} " + entity + " moveto " + newLongitude; - } -} diff --git a/src/net/sourceforge/plantuml/jungle/GNodeUtils.java b/src/net/sourceforge/plantuml/jungle/GNodeUtils.java deleted file mode 100644 index 819ddbb..0000000 --- a/src/net/sourceforge/plantuml/jungle/GNodeUtils.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.jungle; - -public class GNodeUtils { - -// public static GNode getIndirectChild(GNode root, String id) { -// if (root.getId().equals(id)) { -// return root; -// } -// for (GNode n : root.getChildren()) { -// if (n.getId().equals(id)) { -// return n; -// } -// final GNode result = getIndirectChild(n, id); -// if (result != null) { -// return result; -// } -// } -// return null; -// } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/math/AsciiMathOld.java b/src/net/sourceforge/plantuml/math/AsciiMathOld.java deleted file mode 100644 index 2dc1bfe..0000000 --- a/src/net/sourceforge/plantuml/math/AsciiMathOld.java +++ /dev/null @@ -1,151 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.math; - -import java.awt.geom.Dimension2D; -import java.awt.image.BufferedImage; -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import net.sourceforge.plantuml.BackSlash; -import net.sourceforge.plantuml.Dimension2DDouble; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -public class AsciiMathOld { - - private static final String ASCIIMATH_PARSER_JS_LOCATION = "/net/sourceforge/plantuml/math/"; - - private static String JAVASCRIPT_CODE; - - static { - try { - final BufferedReader br = new BufferedReader(new InputStreamReader( - AsciiMathOld.class.getResourceAsStream(ASCIIMATH_PARSER_JS_LOCATION + "AsciiMathParser.js"), "UTF-8")); - final StringBuilder sb = new StringBuilder(); - String s = null; - while ((s = br.readLine()) != null) { - sb.append(s); - sb.append(BackSlash.NEWLINE); - } - br.close(); - JAVASCRIPT_CODE = sb.toString(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - private final Node mathML; - - public AsciiMathOld(String form) throws IOException, ScriptException, ParserConfigurationException, - NoSuchMethodException { - final ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript"); - engine.eval(JAVASCRIPT_CODE); - final Invocable inv = (Invocable) engine; - final Document dom = createDocument(); - mathML = (Node) inv.invokeFunction("plantuml", dom, form); - } - - private Document createDocument() throws ParserConfigurationException { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - DocumentBuilder db = dbf.newDocumentBuilder(); - Document document = db.newDocument(); - return document; - } - - private Dimension2D dim; - - public String getSvg() throws IOException, ClassNotFoundException, NoSuchMethodException, SecurityException, - IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchFieldException { - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - final Class clConverter = Class.forName("net.sourceforge.jeuclid.converter.Converter"); - final Method getInstance = clConverter.getMethod("getInstance"); - final Object conv = getInstance.invoke(null); - final Method convert = clConverter.getMethod("convert", Node.class, OutputStream.class, String.class, - Class.forName("net.sourceforge.jeuclid.LayoutContext")); - dim = (Dimension2D) convert.invoke(conv, mathML, baos, "image/svg+xml", getLayout()); - return new String(baos.toByteArray()); - } - - public BufferedImage getImage() throws IOException, ClassNotFoundException, NoSuchMethodException, - SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, - NoSuchFieldException { - final Class clConverter = Class.forName("net.sourceforge.jeuclid.converter.Converter"); - final Method getInstance = clConverter.getMethod("getInstance"); - final Object conv = getInstance.invoke(null); - // final LayoutContext layoutContext = LayoutContextImpl.getDefaultLayoutContext(); - - final Method render = clConverter.getMethod("render", Node.class, - Class.forName("net.sourceforge.jeuclid.LayoutContext")); - - final BufferedImage result = (BufferedImage) render.invoke(conv, mathML, getLayout()); - dim = new Dimension2DDouble(result.getWidth(), result.getHeight()); - return result; - } - - private Object getLayout() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, IllegalArgumentException, NoSuchFieldException, SecurityException { - final Class clLayoutContextIml = Class.forName("net.sourceforge.jeuclid.context.LayoutContextImpl"); - final Class clParameter = Class.forName("net.sourceforge.jeuclid.context.Parameter"); - final Method getDefaultLayoutContext = clLayoutContextIml.getMethod("getDefaultLayoutContext"); - final Object layoutContext = getDefaultLayoutContext.invoke(null); - - final Method setParameter = clLayoutContextIml.getMethod("setParameter", clParameter, Object.class); - setParameter.invoke(layoutContext, clParameter.getDeclaredField("SCRIPTSIZEMULTIPLIER").get(null), (float) 2); - return layoutContext; - } - - public Dimension2D getDimension() { - return dim; - } - -} diff --git a/src/net/sourceforge/plantuml/math/AsciiMathParser.js b/src/net/sourceforge/plantuml/math/AsciiMathParser.js deleted file mode 100644 index b44b116..0000000 --- a/src/net/sourceforge/plantuml/math/AsciiMathParser.js +++ /dev/null @@ -1,846 +0,0 @@ -/* - -Copyright (c) 2011-2012, The University of Edinburgh -All Rights Reserved - -This file is part of AsciiMathParser.js - -AsciiMathParser.js is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by the -Free Software Foundation; either version 3 of the License, or (at your -option) any later version. - -AsciiMathParser.js 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 Lesser General Public License (at -http://www.gnu.org/licences/lgpl.html) for more details. - -You should have received a copy of the GNU Lesser General Public License -along with AsciiMathParser.js. If not, see . - -AsciiMathParser.js -================== - -This is a modified and cut-down version of ASCIIMathML.js v2.1 -that allows ASCIIMath to be used solely as a parser for ASCIIMath -input, generating an XML Element Node as a result. - -This may allow you to integrate the ASCIIMath input format with -other software and does not need to be run in a browser. - -The only requirement is that you can provide a DOM Document Object -when creating a parser. (Microsoft's implementation of Document is fine -too.) - -*/ - -/************************************************************************/ - -/* This creates a new Object that you can use to parse ASCIIMath input. - * - * You must pass a DOM Document Object here that will be used to create - * new DOM Nodes. The Doucument itself will not be modified. - * A Microsoft DOM is acceptable. - */ -function AsciiMathParser(document) { - -/* ASCIIMathML.js BEGINS BELOW. - * - * NOTE: I did a global search and replace to make NodeList traversal - * work with the Java DOM, so that childNodes[i] -> childNodes.item(i). - * This was done with the regexp s/(childNodes)\[(.+?)\]/$1.item($2)/g - * - * All other modifications made are shown below on - * lines starting with - * '//MOD: ' - */ - -//------------------------------------------------------------- - -/* -ASCIIMathML.js -============== -This file contains JavaScript functions to convert ASCII math notation -and LaTeX to Presentation MathML. Simple graphics commands are also -translated to SVG images. The conversion is done while the (X)HTML -page loads, and should work with Firefox/Mozilla/Netscape 7+ and Internet -Explorer 6/7 + MathPlayer (http://www.dessci.com/en/products/mathplayer/) + -Adobe SVGview 3.03 (http://www.adobe.com/svg/viewer/install/). - -Just add the next line to your (X)HTML page with this file in the same folder: - - - -(using the graphics in IE also requires the file "d.svg" in the same folder). -This is a convenient and inexpensive solution for authoring MathML and SVG. - -Version 2.1 Oct 8, 2008, (c) Peter Jipsen http://www.chapman.edu/~jipsen -This version extends ASCIIMathML.js with LaTeXMathML.js and ASCIIsvg.js. -Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js -If you use it on a webpage, please send the URL to jipsen@chapman.edu - -The LaTeXMathML modifications were made by Douglas Woodall, June 2006. -(for details see header on the LaTeXMathML part in middle of file) -Extensive clean-up and improvements by Paulo Soares, Oct 2007. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 3 of the License, or (at -your option) any later version. - -This program 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 Lesser General Public License -(at http://www.gnu.org/licences/lgpl.html) for more details. -*/ - -//MOD: Most of the global variables defined next are not required, -//MOD: with the exception of the following: -var decimalsign = "."; // change to "," if you like, beware of `(1,2)`! - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -//MOD: Everything from this point until the character list definitions starting -//MOD: with 'var AMcal' has been removed and replaced with the following: - -// This should be false here, since we're generating an XML DOM, rather than -// something that will be aimed at a specific browser. -var isIE = false; - -// New version of this method to overcome the lack of createElementNS() in MSXML -function createMmlNode(t,frag) { - var node; - if (document.createElementNS) { - node = document.createElementNS("http://www.w3.org/1998/Math/MathML", t); - } - else { - try { - /* MSXML */ - node = document.createNode(1, t, "http://www.w3.org/1998/Math/MathML"); - } - catch (e) { - throw "This DOM Document does not support either createElementNS() or createNS()"; - } - } - if (frag) node.appendChild(frag); - return node; -} - -// character lists for Mozilla/Netscape fonts -var AMcal = [0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46]; -var AMfrk = [0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128]; -var AMbbb = [0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124]; - -var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4, - RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8, - LEFTRIGHT = 9, TEXT = 10, BIG = 11, LONG = 12, STRETCHY = 13, - MATRIX = 14;; // token types - -var AMquote = {input:"\"", tag:"mtext", output:"mbox", tex:null, ttype:TEXT}; - -var AMsymbols = [ -//some greek symbols -{input:"alpha", tag:"mi", output:"\u03B1", tex:null, ttype:CONST}, -{input:"beta", tag:"mi", output:"\u03B2", tex:null, ttype:CONST}, -{input:"chi", tag:"mi", output:"\u03C7", tex:null, ttype:CONST}, -{input:"delta", tag:"mi", output:"\u03B4", tex:null, ttype:CONST}, -{input:"Delta", tag:"mo", output:"\u0394", tex:null, ttype:CONST}, -{input:"epsi", tag:"mi", output:"\u03B5", tex:"epsilon", ttype:CONST}, -{input:"varepsilon", tag:"mi", output:"\u025B", tex:null, ttype:CONST}, -{input:"eta", tag:"mi", output:"\u03B7", tex:null, ttype:CONST}, -{input:"gamma", tag:"mi", output:"\u03B3", tex:null, ttype:CONST}, -{input:"Gamma", tag:"mo", output:"\u0393", tex:null, ttype:CONST}, -{input:"iota", tag:"mi", output:"\u03B9", tex:null, ttype:CONST}, -{input:"kappa", tag:"mi", output:"\u03BA", tex:null, ttype:CONST}, -{input:"lambda", tag:"mi", output:"\u03BB", tex:null, ttype:CONST}, -{input:"Lambda", tag:"mo", output:"\u039B", tex:null, ttype:CONST}, -{input:"mu", tag:"mi", output:"\u03BC", tex:null, ttype:CONST}, -{input:"nu", tag:"mi", output:"\u03BD", tex:null, ttype:CONST}, -{input:"omega", tag:"mi", output:"\u03C9", tex:null, ttype:CONST}, -{input:"Omega", tag:"mo", output:"\u03A9", tex:null, ttype:CONST}, -{input:"phi", tag:"mi", output:"\u03C6", tex:null, ttype:CONST}, -{input:"varphi", tag:"mi", output:"\u03D5", tex:null, ttype:CONST}, -{input:"Phi", tag:"mo", output:"\u03A6", tex:null, ttype:CONST}, -{input:"pi", tag:"mi", output:"\u03C0", tex:null, ttype:CONST}, -{input:"Pi", tag:"mo", output:"\u03A0", tex:null, ttype:CONST}, -{input:"psi", tag:"mi", output:"\u03C8", tex:null, ttype:CONST}, -{input:"Psi", tag:"mi", output:"\u03A8", tex:null, ttype:CONST}, -{input:"rho", tag:"mi", output:"\u03C1", tex:null, ttype:CONST}, -{input:"sigma", tag:"mi", output:"\u03C3", tex:null, ttype:CONST}, -{input:"Sigma", tag:"mo", output:"\u03A3", tex:null, ttype:CONST}, -{input:"tau", tag:"mi", output:"\u03C4", tex:null, ttype:CONST}, -{input:"theta", tag:"mi", output:"\u03B8", tex:null, ttype:CONST}, -{input:"vartheta", tag:"mi", output:"\u03D1", tex:null, ttype:CONST}, -{input:"Theta", tag:"mo", output:"\u0398", tex:null, ttype:CONST}, -{input:"upsilon", tag:"mi", output:"\u03C5", tex:null, ttype:CONST}, -{input:"xi", tag:"mi", output:"\u03BE", tex:null, ttype:CONST}, -{input:"Xi", tag:"mo", output:"\u039E", tex:null, ttype:CONST}, -{input:"zeta", tag:"mi", output:"\u03B6", tex:null, ttype:CONST}, - -//binary operation symbols -//{input:"-", tag:"mo", output:"\u0096", tex:null, ttype:CONST}, -{input:"*", tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST}, -{input:"**", tag:"mo", output:"\u22C6", tex:"star", ttype:CONST}, -{input:"//", tag:"mo", output:"/", tex:null, ttype:CONST}, -{input:"\\\\", tag:"mo", output:"\\", tex:"backslash", ttype:CONST}, -{input:"setminus", tag:"mo", output:"\\", tex:null, ttype:CONST}, -{input:"xx", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST}, -{input:"-:", tag:"mo", output:"\u00F7", tex:"divide", ttype:CONST}, -{input:"@", tag:"mo", output:"\u26AC", tex:"circ", ttype:CONST}, -{input:"o+", tag:"mo", output:"\u2295", tex:"oplus", ttype:CONST}, -{input:"ox", tag:"mo", output:"\u2297", tex:"otimes", ttype:CONST}, -{input:"o.", tag:"mo", output:"\u2299", tex:"odot", ttype:CONST}, -{input:"sum", tag:"mo", output:"\u2211", tex:null, ttype:UNDEROVER}, -{input:"prod", tag:"mo", output:"\u220F", tex:null, ttype:UNDEROVER}, -{input:"^^", tag:"mo", output:"\u2227", tex:"wedge", ttype:CONST}, -{input:"^^^", tag:"mo", output:"\u22C0", tex:"bigwedge", ttype:UNDEROVER}, -{input:"vv", tag:"mo", output:"\u2228", tex:"vee", ttype:CONST}, -{input:"vvv", tag:"mo", output:"\u22C1", tex:"bigvee", ttype:UNDEROVER}, -{input:"nn", tag:"mo", output:"\u2229", tex:"cap", ttype:CONST}, -{input:"nnn", tag:"mo", output:"\u22C2", tex:"bigcap", ttype:UNDEROVER}, -{input:"uu", tag:"mo", output:"\u222A", tex:"cup", ttype:CONST}, -{input:"uuu", tag:"mo", output:"\u22C3", tex:"bigcup", ttype:UNDEROVER}, - -//binary relation symbols -{input:"!=", tag:"mo", output:"\u2260", tex:"ne", ttype:CONST}, -{input:":=", tag:"mo", output:":=", tex:null, ttype:CONST}, -{input:"lt", tag:"mo", output:"<", tex:null, ttype:CONST}, -{input:"<=", tag:"mo", output:"\u2264", tex:"le", ttype:CONST}, -{input:"lt=", tag:"mo", output:"\u2264", tex:"leq", ttype:CONST}, -{input:">=", tag:"mo", output:"\u2265", tex:"ge", ttype:CONST}, -{input:"geq", tag:"mo", output:"\u2265", tex:null, ttype:CONST}, -{input:"-<", tag:"mo", output:"\u227A", tex:"prec", ttype:CONST}, -{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST}, -{input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST}, -{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST}, -{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST}, -{input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST}, -{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST}, -{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST}, -{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST}, -{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST}, -{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST}, -{input:"-=", tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST}, -{input:"~=", tag:"mo", output:"\u2245", tex:"cong", ttype:CONST}, -{input:"~~", tag:"mo", output:"\u2248", tex:"approx", ttype:CONST}, -{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST}, - -//logical symbols -{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE}, -{input:"or", tag:"mtext", output:"or", tex:null, ttype:SPACE}, -{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST}, -{input:"=>", tag:"mo", output:"\u21D2", tex:"implies", ttype:CONST}, -{input:"if", tag:"mo", output:"if", tex:null, ttype:SPACE}, -{input:"<=>", tag:"mo", output:"\u21D4", tex:"iff", ttype:CONST}, -{input:"AA", tag:"mo", output:"\u2200", tex:"forall", ttype:CONST}, -{input:"EE", tag:"mo", output:"\u2203", tex:"exists", ttype:CONST}, -{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST}, -{input:"TT", tag:"mo", output:"\u22A4", tex:"top", ttype:CONST}, -{input:"|--", tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST}, -{input:"|==", tag:"mo", output:"\u22A8", tex:"models", ttype:CONST}, - -//grouping brackets -{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET}, -{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET}, -{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET}, -{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET}, -{input:"{", tag:"mo", output:"{", tex:null, ttype:LEFTBRACKET}, -{input:"}", tag:"mo", output:"}", tex:null, ttype:RIGHTBRACKET}, -{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT}, -//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT}, -{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET}, -{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET}, -{input:"<<", tag:"mo", output:"\u2329", tex:null, ttype:LEFTBRACKET}, -{input:">>", tag:"mo", output:"\u232A", tex:null, ttype:RIGHTBRACKET}, -{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true}, -{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true}, - -//miscellaneous symbols -{input:"int", tag:"mo", output:"\u222B", tex:null, ttype:CONST}, -{input:"dx", tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION}, -{input:"dy", tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION}, -{input:"dz", tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION}, -{input:"dt", tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION}, -{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST}, -{input:"del", tag:"mo", output:"\u2202", tex:"partial", ttype:CONST}, -{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST}, -{input:"+-", tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST}, -{input:"O/", tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST}, -{input:"oo", tag:"mo", output:"\u221E", tex:"infty", ttype:CONST}, -{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST}, -{input:"...", tag:"mo", output:"...", tex:"ldots", ttype:CONST}, -{input:":.", tag:"mo", output:"\u2234", tex:"therefore", ttype:CONST}, -{input:"/_", tag:"mo", output:"\u2220", tex:"angle", ttype:CONST}, -{input:"\\ ", tag:"mo", output:"\u00A0", tex:null, ttype:CONST}, -{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST}, -{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST}, -{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST}, -{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST}, -{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST}, -{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST}, -{input:"square", tag:"mo", output:"\u25A1", tex:null, ttype:CONST}, -{input:"|__", tag:"mo", output:"\u230A", tex:"lfloor", ttype:CONST}, -{input:"__|", tag:"mo", output:"\u230B", tex:"rfloor", ttype:CONST}, -{input:"|~", tag:"mo", output:"\u2308", tex:"lceiling", ttype:CONST}, -{input:"~|", tag:"mo", output:"\u2309", tex:"rceiling", ttype:CONST}, -{input:"CC", tag:"mo", output:"\u2102", tex:null, ttype:CONST}, -{input:"NN", tag:"mo", output:"\u2115", tex:null, ttype:CONST}, -{input:"QQ", tag:"mo", output:"\u211A", tex:null, ttype:CONST}, -{input:"RR", tag:"mo", output:"\u211D", tex:null, ttype:CONST}, -{input:"ZZ", tag:"mo", output:"\u2124", tex:null, ttype:CONST}, -{input:"f", tag:"mi", output:"f", tex:null, ttype:UNARY, func:true}, -{input:"g", tag:"mi", output:"g", tex:null, ttype:UNARY, func:true}, - -//standard functions -{input:"lim", tag:"mo", output:"lim", tex:null, ttype:UNDEROVER}, -{input:"Lim", tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER}, -{input:"sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true}, -{input:"cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true}, -{input:"tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true}, -{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true}, -{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true}, -{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true}, -{input:"cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true}, -{input:"sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true}, -{input:"csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true}, -{input:"log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true}, -{input:"ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true}, -{input:"det", tag:"mo", output:"det", tex:null, ttype:UNARY, func:true}, -{input:"dim", tag:"mo", output:"dim", tex:null, ttype:CONST}, -{input:"mod", tag:"mo", output:"mod", tex:null, ttype:CONST}, -{input:"gcd", tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true}, -{input:"lcm", tag:"mo", output:"lcm", tex:null, ttype:UNARY, func:true}, -{input:"lub", tag:"mo", output:"lub", tex:null, ttype:CONST}, -{input:"glb", tag:"mo", output:"glb", tex:null, ttype:CONST}, -{input:"min", tag:"mo", output:"min", tex:null, ttype:UNDEROVER}, -{input:"max", tag:"mo", output:"max", tex:null, ttype:UNDEROVER}, - -//arrows -{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST}, -{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST}, -{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST}, -{input:"->", tag:"mo", output:"\u2192", tex:"to", ttype:CONST}, -{input:">->", tag:"mo", output:"\u21A3", tex:"rightarrowtail", ttype:CONST}, -{input:"->>", tag:"mo", output:"\u21A0", tex:"twoheadrightarrow", ttype:CONST}, -{input:">->>", tag:"mo", output:"\u2916", tex:"twoheadrightarrowtail", ttype:CONST}, -{input:"|->", tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST}, -{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST}, -{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST}, -{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST}, -{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST}, -{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST}, -//commands with argument -{input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY}, -{input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY}, -{input:"frac", tag:"mfrac", output:"/", tex:null, ttype:BINARY}, -{input:"/", tag:"mfrac", output:"/", tex:null, ttype:INFIX}, -{input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY}, -{input:"_", tag:"msub", output:"_", tex:null, ttype:INFIX}, -{input:"^", tag:"msup", output:"^", tex:null, ttype:INFIX}, -{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true}, -{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true}, -{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true}, -{input:"dot", tag:"mover", output:".", tex:null, ttype:UNARY, acc:true}, -{input:"ddot", tag:"mover", output:"..", tex:null, ttype:UNARY, acc:true}, -{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true}, -{input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT}, -{input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT}, -AMquote, -{input:"bb", tag:"mstyle", atname:"fontweight", atval:"bold", output:"bb", tex:null, ttype:UNARY}, -{input:"mathbf", tag:"mstyle", atname:"fontweight", atval:"bold", output:"mathbf", tex:null, ttype:UNARY}, -{input:"sf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"sf", tex:null, ttype:UNARY}, -{input:"mathsf", tag:"mstyle", atname:"fontfamily", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY}, -{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:null, ttype:UNARY, codes:AMbbb}, -{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY, codes:AMbbb}, -{input:"cc", tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:null, ttype:UNARY, codes:AMcal}, -{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY, codes:AMcal}, -{input:"tt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"tt", tex:null, ttype:UNARY}, -{input:"mathtt", tag:"mstyle", atname:"fontfamily", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY}, -{input:"fr", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:null, ttype:UNARY, codes:AMfrk}, -{input:"mathfrak", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY, codes:AMfrk} -]; - -function compareNames(s1,s2) { - if (s1.input > s2.input) return 1 - else return -1; -} - -var AMnames = []; //list of input symbols - -function initSymbols() { - var texsymbols = [], i; - for (i=0; i=n where str appears or would be inserted -// assumes arr is sorted - if (n==0) { - var h,m; - n = -1; - h = arr.length; - while (n+1> 1; - if (arr[m]=str -} - -function AMgetSymbol(str) { -//return maximal initial substring of str that appears in names -//return null if there is none - var k = 0; //new pos - var j = 0; //old pos - var mk; //match pos - var st; - var tagst; - var match = ""; - var more = true; - for (var i=1; i<=str.length && more; i++) { - st = str.slice(0,i); //initial substring of length i - j = k; - k = position(AMnames, st, j); - if (k=AMnames[k]; - } - AMpreviousSymbol=AMcurrentSymbol; - if (match!=""){ - AMcurrentSymbol=AMsymbols[mk].ttype; - return AMsymbols[mk]; - } -// if str[0] is a digit or - return maxsubstring of digits.digits - AMcurrentSymbol=CONST; - k = 1; - st = str.slice(0,1); - var integ = true; - while ("0"<=st && st<="9" && k<=str.length) { - st = str.slice(k,k+1); - k++; - } - if (st == decimalsign) { - st = str.slice(k,k+1); - if ("0"<=st && st<="9") { - integ = false; - k++; - while ("0"<=st && st<="9" && k<=str.length) { - st = str.slice(k,k+1); - k++; - } - } - } - if ((integ && k>1) || k>2) { - st = str.slice(0,k-1); - tagst = "mn"; - } else { - k = 2; - st = str.slice(0,1); //take 1 character - tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi"); - } - if (st=="-" && AMpreviousSymbol==INFIX) { - AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse - return {input:st, tag:tagst, output:st, ttype:UNARY, func:true}; - } - return {input:st, tag:tagst, output:st, ttype:CONST}; -} - -function AMremoveBrackets(node) { - var st; - if (node.nodeName=="mrow") { - st = node.firstChild.firstChild.nodeValue; - if (st=="(" || st=="[" || st=="{") node.removeChild(node.firstChild); - } - if (node.nodeName=="mrow") { - st = node.lastChild.firstChild.nodeValue; - if (st==")" || st=="]" || st=="}") node.removeChild(node.lastChild); - } -} - -/*Parsing ASCII math expressions with the following grammar -v ::= [A-Za-z] | greek letters | numbers | other constant symbols -u ::= sqrt | text | bb | other unary symbols for font commands -b ::= frac | root | stackrel binary symbols -l ::= ( | [ | { | (: | {: left brackets -r ::= ) | ] | } | :) | :} right brackets -S ::= v | lEr | uS | bSS Simple expression -I ::= S_S | S^S | S_S^S | S Intermediate expression -E ::= IE | I/I Expression -Each terminal symbol is translated into a corresponding mathml node.*/ - -var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol; - -function AMparseSexpr(str) { //parses str and returns [node,tailstr] - var symbol, node, result, i, st,// rightvert = false, - newFrag = document.createDocumentFragment(); - str = AMremoveCharsAndBlanks(str,0); - symbol = AMgetSymbol(str); //either a token or a bracket or empty - if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) { - return [null,str]; - } - if (symbol.ttype == DEFINITION) { - str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length); - symbol = AMgetSymbol(str); - } - switch (symbol.ttype) { case UNDEROVER: - case CONST: - str = AMremoveCharsAndBlanks(str,symbol.input.length); - return [createMmlNode(symbol.tag, //its a constant - document.createTextNode(symbol.output)),str]; - case LEFTBRACKET: //read (expr+) - AMnestingDepth++; - str = AMremoveCharsAndBlanks(str,symbol.input.length); - result = AMparseExpr(str,true); - AMnestingDepth--; - if (typeof symbol.invisible == "boolean" && symbol.invisible) - node = createMmlNode("mrow",result[0]); - else { - node = createMmlNode("mo",document.createTextNode(symbol.output)); - node = createMmlNode("mrow",node); - node.appendChild(result[0]); - } - return [node,result[1]]; - case TEXT: - if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length); - if (str.charAt(0)=="{") i=str.indexOf("}"); - else if (str.charAt(0)=="(") i=str.indexOf(")"); - else if (str.charAt(0)=="[") i=str.indexOf("]"); - else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1; - else i = 0; - if (i==-1) i = str.length; - st = str.slice(1,i); - if (st.charAt(0) == " ") { - node = createMmlNode("mspace"); - node.setAttribute("width","1ex"); - newFrag.appendChild(node); - } - newFrag.appendChild( - createMmlNode(symbol.tag,document.createTextNode(st))); - if (st.charAt(st.length-1) == " ") { - node = createMmlNode("mspace"); - node.setAttribute("width","1ex"); - newFrag.appendChild(node); - } - str = AMremoveCharsAndBlanks(str,i+1); - return [createMmlNode("mrow",newFrag),str]; - case UNARY: - str = AMremoveCharsAndBlanks(str,symbol.input.length); - result = AMparseSexpr(str); - if (result[0]==null) return [createMmlNode(symbol.tag, - document.createTextNode(symbol.output)),str]; - if (typeof symbol.func == "boolean" && symbol.func) { // functions hack - st = str.charAt(0); - if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") { - return [createMmlNode(symbol.tag, - document.createTextNode(symbol.output)),str]; - } else { - node = createMmlNode("mrow", - createMmlNode(symbol.tag,document.createTextNode(symbol.output))); - node.appendChild(result[0]); - return [node,result[1]]; - } - } - AMremoveBrackets(result[0]); - if (symbol.input == "sqrt") { // sqrt - return [createMmlNode(symbol.tag,result[0]),result[1]]; - } else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent - node = createMmlNode(symbol.tag,result[0]); - node.appendChild(createMmlNode("mo",document.createTextNode(symbol.output))); - return [node,result[1]]; - } else { // font change command -// MOD: The following code generates invalid MathML, so is commented out for the time being. -// if (!isIE && typeof symbol.codes != "undefined") { -// for (i=0; i64 && st.charCodeAt(j)<91) newst = newst + -// String.fromCharCode(symbol.codes[st.charCodeAt(j)-65]); -// else newst = newst + st.charAt(j); -// if (result[0].nodeName=="mi") { -// result[0]=createMmlNode("mo"). -// appendChild(document.createTextNode(newst)); -// } -// else result[0].replaceChild(createMmlNode("mo"). -// appendChild(document.createTextNode(newst)), -// result[0].childNodes.item(i)); -// } -// } - node = createMmlNode(symbol.tag,result[0]); - node.setAttribute(symbol.atname,symbol.atval); - return [node,result[1]]; - } - case BINARY: - str = AMremoveCharsAndBlanks(str,symbol.input.length); - result = AMparseSexpr(str); - if (result[0]==null) return [createMmlNode("mo", - document.createTextNode(symbol.input)),str]; - AMremoveBrackets(result[0]); - var result2 = AMparseSexpr(result[1]); - if (result2[0]==null) return [createMmlNode("mo", - document.createTextNode(symbol.input)),str]; - AMremoveBrackets(result2[0]); - if (symbol.input=="root" || symbol.input=="stackrel") - newFrag.appendChild(result2[0]); - newFrag.appendChild(result[0]); - if (symbol.input=="frac") newFrag.appendChild(result2[0]); - return [createMmlNode(symbol.tag,newFrag),result2[1]]; - case INFIX: - str = AMremoveCharsAndBlanks(str,symbol.input.length); - return [createMmlNode("mo",document.createTextNode(symbol.output)),str]; - case SPACE: - str = AMremoveCharsAndBlanks(str,symbol.input.length); - node = createMmlNode("mspace"); - node.setAttribute("width","1ex"); - newFrag.appendChild(node); - newFrag.appendChild( - createMmlNode(symbol.tag,document.createTextNode(symbol.output))); - node = createMmlNode("mspace"); - node.setAttribute("width","1ex"); - newFrag.appendChild(node); - return [createMmlNode("mrow",newFrag),str]; - case LEFTRIGHT: -// if (rightvert) return [null,str]; else rightvert = true; - AMnestingDepth++; - str = AMremoveCharsAndBlanks(str,symbol.input.length); - result = AMparseExpr(str,false); - AMnestingDepth--; - var st = ""; - if (result[0].lastChild!=null) - st = result[0].lastChild.firstChild.nodeValue; - if (st == "|") { // its an absolute value subterm - node = createMmlNode("mo",document.createTextNode(symbol.output)); - node = createMmlNode("mrow",node); - node.appendChild(result[0]); - return [node,result[1]]; - } else { // the "|" is a \mid so use unicode 2223 (divides) for spacing - node = createMmlNode("mo",document.createTextNode("\u2223")); - node = createMmlNode("mrow",node); - return [node,str]; - } - default: -//alert("default"); - str = AMremoveCharsAndBlanks(str,symbol.input.length); - return [createMmlNode(symbol.tag, //its a constant - document.createTextNode(symbol.output)),str]; - } -} - -function AMparseIexpr(str) { - var symbol, sym1, sym2, node, result, underover; - str = AMremoveCharsAndBlanks(str,0); - sym1 = AMgetSymbol(str); - result = AMparseSexpr(str); - node = result[0]; - str = result[1]; - symbol = AMgetSymbol(str); - if (symbol.ttype == INFIX && symbol.input != "/") { - str = AMremoveCharsAndBlanks(str,symbol.input.length); -// if (symbol.input == "/") result = AMparseIexpr(str); else ... - result = AMparseSexpr(str); - if (result[0] == null) // show box in place of missing argument - result[0] = createMmlNode("mo",document.createTextNode("\u25A1")); - else AMremoveBrackets(result[0]); - str = result[1]; -// if (symbol.input == "/") AMremoveBrackets(node); - if (symbol.input == "_") { - sym2 = AMgetSymbol(str); - underover = (sym1.ttype == UNDEROVER); - if (sym2.input == "^") { - str = AMremoveCharsAndBlanks(str,sym2.input.length); - var res2 = AMparseSexpr(str); - AMremoveBrackets(res2[0]); - str = res2[1]; - node = createMmlNode((underover?"munderover":"msubsup"),node); - node.appendChild(result[0]); - node.appendChild(res2[0]); - node = createMmlNode("mrow",node); // so sum does not stretch - } else { - node = createMmlNode((underover?"munder":"msub"),node); - node.appendChild(result[0]); - } - } else { - node = createMmlNode(symbol.tag,node); - node.appendChild(result[0]); - } - } - return [node,str]; -} - -function AMparseExpr(str,rightbracket) { - var symbol, node, result, i, nodeList = [], - newFrag = document.createDocumentFragment(); - do { - str = AMremoveCharsAndBlanks(str,0); - result = AMparseIexpr(str); - node = result[0]; - str = result[1]; - symbol = AMgetSymbol(str); - if (symbol.ttype == INFIX && symbol.input == "/") { - str = AMremoveCharsAndBlanks(str,symbol.input.length); - result = AMparseIexpr(str); - if (result[0] == null) // show box in place of missing argument - result[0] = createMmlNode("mo",document.createTextNode("\u25A1")); - else AMremoveBrackets(result[0]); - str = result[1]; - AMremoveBrackets(node); - node = createMmlNode(symbol.tag,node); - node.appendChild(result[0]); - newFrag.appendChild(node); - symbol = AMgetSymbol(str); - } - else if (node!=undefined) newFrag.appendChild(node); - } while ((symbol.ttype != RIGHTBRACKET && - (symbol.ttype != LEFTRIGHT || rightbracket) - || AMnestingDepth == 0) && symbol!=null && symbol.output!=""); - if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) { -// if (AMnestingDepth > 0) AMnestingDepth--; - var len = newFrag.childNodes.length; - if (len>0 && newFrag.childNodes.item(len-1).nodeName == "mrow" && len>1 && - newFrag.childNodes.item(len-2).nodeName == "mo" && - newFrag.childNodes.item(len-2).firstChild.nodeValue == ",") { //matrix - var right = newFrag.childNodes.item(len-1).lastChild.firstChild.nodeValue; - if (right==")" || right=="]") { - var left = newFrag.childNodes.item(len-1).firstChild.firstChild.nodeValue; - if (left=="(" && right==")" && symbol.output != "}" || - left=="[" && right=="]") { - var pos = []; // positions of commas - var matrix = true; - var m = newFrag.childNodes.length; - for (i=0; matrix && i1) matrix = pos[i].length == pos[i-2].length; - } - if (matrix) { - var row, frag, n, k, table = document.createDocumentFragment(); - for (i=0; i(-,-,...,-,-) - n = node.childNodes.length; - k = 0; - node.removeChild(node.firstChild); //remove ( - for (j=1; j2) { - newFrag.removeChild(newFrag.firstChild); //remove ) - newFrag.removeChild(newFrag.firstChild); //remove , - } - table.appendChild(createMmlNode("mtr",row)); - } - node = createMmlNode("mtable",table); - if (typeof symbol.invisible == "boolean" && symbol.invisible) node.setAttribute("columnalign","left"); - newFrag.replaceChild(node,newFrag.firstChild); - } - } - } - } - str = AMremoveCharsAndBlanks(str,symbol.input.length); - if (typeof symbol.invisible != "boolean" || !symbol.invisible) { - node = createMmlNode("mo",document.createTextNode(symbol.output)); - newFrag.appendChild(node); - } - } - return [newFrag,str]; -} - -//MOD: The rest of the code is not required! - -//------------------------------------------------------------- - -/* ASCIIMathML.js has ended! */ - -initSymbols(); - -/* Parses the given ASCIIMathInput, returning a DOM Element */ -this.parseAsciiMathInput = function(asciiMathInput) { - var options = arguments[1] || {}; - - /* Call up ASCIIMath to do the actual parsing, generating a document fragment */ - var content = AMparseExpr(asciiMathInput.replace(/^\s+/g,""), false)[0]; - - /* If adding source annotation, then we need to wrap things up appropriately */ - if (options.addSourceAnnotation) { - var semantics = createMmlNode("semantics", content.length==1 ? content : createMmlNode("mrow", content)); - - var annotation = createMmlNode("annotation", document.createTextNode(asciiMathInput)); - annotation.setAttribute("encoding", "ASCIIMathInput"); - semantics.appendChild(annotation); - - content = semantics; - } - - /* Create the containing element */ - var math = createMmlNode("math", content); - if (options.displayMode) { - math.setAttribute("display", "block"); - } - return math; -}; - -// (end of unindented constructor defined at top of file) -}; -function plantuml(dom, asciiMathInput) { - var asciiMathParser = new AsciiMathParser(dom); - var mathElement = asciiMathParser.parseAsciiMathInput(asciiMathInput); - return mathElement; -} diff --git a/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java b/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java deleted file mode 100644 index 851b7ad..0000000 --- a/src/net/sourceforge/plantuml/mda/MDADiagramImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.mda; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.BlockUml; -import net.sourceforge.plantuml.SourceStringReader; -import net.sourceforge.plantuml.api.mda.option2.MDADiagram; -import net.sourceforge.plantuml.api.mda.option2.MDAPackage; -import net.sourceforge.plantuml.classdiagram.ClassDiagram; -import net.sourceforge.plantuml.core.Diagram; -import net.sourceforge.plantuml.cucadiagram.IGroup; -import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory; - -public class MDADiagramImpl implements MDADiagram { - - public static MDADiagram create(String uml) { - List blocks = new SourceStringReader(uml).getBlocks(); - if (blocks.size() == 0) { - uml = "@startuml\n" + uml + "\n@enduml"; - blocks = new SourceStringReader(uml).getBlocks(); - if (blocks.size() == 0) { - return null; - } - } - final BlockUml block = blocks.get(0); - final Diagram diagram = block.getDiagram(); - if (diagram instanceof ClassDiagram) { - return new MDADiagramImpl((ClassDiagram) diagram); - } - return null; - } - - private final Collection packages = new ArrayList(); - - private MDADiagramImpl(ClassDiagram classDiagram) { - final EntityFactory entityFactory = classDiagram.getEntityFactory(); - packages.add(new MDAPackageImpl(entityFactory.getRootGroup())); - for (IGroup group : entityFactory.getGroupsvalues()) { - packages.add(new MDAPackageImpl(group)); - } - } - - public Collection getPackages() { - return Collections.unmodifiableCollection(packages); - } - -} diff --git a/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java b/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java deleted file mode 100644 index 757fb94..0000000 --- a/src/net/sourceforge/plantuml/mda/MDAEntityImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.mda; - -import net.sourceforge.plantuml.api.mda.option2.MDAEntity; -import net.sourceforge.plantuml.cucadiagram.ILeaf; - -public class MDAEntityImpl implements MDAEntity { - - private final ILeaf leaf; - - public MDAEntityImpl(ILeaf leaf) { - this.leaf = leaf; - } - - public String getName() { - return leaf.getCode().getFullName(); - } - -} diff --git a/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java b/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java deleted file mode 100644 index 5d26810..0000000 --- a/src/net/sourceforge/plantuml/mda/MDAPackageImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.mda; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - -import net.sourceforge.plantuml.api.mda.option2.MDAEntity; -import net.sourceforge.plantuml.api.mda.option2.MDAPackage; -import net.sourceforge.plantuml.cucadiagram.GroupRoot; -import net.sourceforge.plantuml.cucadiagram.IGroup; -import net.sourceforge.plantuml.cucadiagram.ILeaf; - -public class MDAPackageImpl implements MDAPackage { - - private final Collection entities = new ArrayList(); - private final IGroup group; - - public MDAPackageImpl(IGroup group) { - this.group = group; - for (ILeaf leaf : group.getLeafsDirect()) { - entities.add(new MDAEntityImpl(leaf)); - } - } - - public Collection getEntities() { - return Collections.unmodifiableCollection(entities); - } - - public String getName() { - if (group instanceof GroupRoot) { - return ""; - } - return group.getCode().getFullName(); - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/BasicGame.java b/src/net/sourceforge/plantuml/oregon/BasicGame.java deleted file mode 100644 index ca48db0..0000000 --- a/src/net/sourceforge/plantuml/oregon/BasicGame.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -public interface BasicGame { - - void run(Keyboard keyboard) throws NoInputException; - - Screen getScreen(); -} diff --git a/src/net/sourceforge/plantuml/oregon/Keyboard.java b/src/net/sourceforge/plantuml/oregon/Keyboard.java deleted file mode 100644 index 8494417..0000000 --- a/src/net/sourceforge/plantuml/oregon/Keyboard.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -public interface Keyboard { - String input() throws NoInputException; - boolean hasMore(); - -} diff --git a/src/net/sourceforge/plantuml/oregon/KeyboardList.java b/src/net/sourceforge/plantuml/oregon/KeyboardList.java deleted file mode 100644 index 9c99e97..0000000 --- a/src/net/sourceforge/plantuml/oregon/KeyboardList.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; - -public class KeyboardList implements Keyboard { - - private final Iterator data; - - public KeyboardList(String... inputs) { - this(Arrays.asList(inputs)); - } - - public KeyboardList(Collection inputs) { - data = inputs.iterator(); - } - - - public String input() throws NoInputException { - if (data.hasNext()) { - return data.next(); - } - throw new NoInputException(); - } - - public boolean hasMore() { - return data.hasNext(); - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/MagicTable.java b/src/net/sourceforge/plantuml/oregon/MagicTable.java deleted file mode 100644 index 6a59981..0000000 --- a/src/net/sourceforge/plantuml/oregon/MagicTable.java +++ /dev/null @@ -1,233 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -import net.sourceforge.plantuml.Log; - -public class MagicTable { - - static enum Oc { - USED, NEAR - } - - private final Oc number[] = new Oc[10000]; - - private static ArrayList neighbours; - - static { - neighbours = new ArrayList(); - for (int i = 0; i < 10000; i++) { - neighbours.add(null); - } - } - - public static int[] getNeighbours(final int nb) { - if (neighbours.get(nb) == null) { - neighbours.set(nb, getNeighboursSlow(nb)); - } - return neighbours.get(nb); - } - - public static int[] getNeighboursSlow(final int nb) { - final int result[] = new int[36]; - - final int v1 = nb % 10; - int root = nb - v1; - int cpt = 0; - for (int i = 0; i < 10; i++) { - final int candidate = root + i; - if (candidate == nb) { - continue; - } - result[cpt++] = candidate; - } - final int v2 = (nb / 10) % 10; - root = nb - v2 * 10; - for (int i = 0; i < 10; i++) { - final int candidate = root + i * 10; - if (candidate == nb) { - continue; - } - result[cpt++] = candidate; - } - final int v3 = (nb / 100) % 10; - root = nb - v3 * 100; - for (int i = 0; i < 10; i++) { - final int candidate = root + i * 100; - if (candidate == nb) { - continue; - } - result[cpt++] = candidate; - } - final int v4 = nb / 1000; - root = nb - v4 * 1000; - for (int i = 0; i < 10; i++) { - final int candidate = root + i * 1000; - if (candidate == nb) { - continue; - } - result[cpt++] = candidate; - } - return result; - } - - public List getAllFree() { - final List result = new ArrayList(10000); - for (int i = 0; i < number.length; i++) { - if (number[i] == null) { - result.add(i); - } - } - return result; - } - - public List getAllUsed() { - final List result = new ArrayList(10000); - for (int i = 0; i < number.length; i++) { - if (number[i] == Oc.USED) { - result.add(i); - } - } - return result; - } - - public boolean isUsuable(int nb) { - if (number[nb] != null) { - return false; - } - for (int near : getNeighbours(nb)) { - if (number[near] != null) { - return false; - } - } - return true; - } - - public void burnNumber(int nb) { - if (number[nb] != null) { - throw new IllegalArgumentException(); - } - number[nb] = Oc.USED; - for (int near : getNeighbours(nb)) { - number[near] = Oc.NEAR; - } - } - - public int getRandomFree(Random rnd) { - final List frees = getAllFree(); - // final int size = frees.size(); - // for (int i = 0; i < size; i++) { - // final int pos = rnd.nextInt(frees.size()); - // final int nb = frees.get(pos); - // frees.remove(pos); - // if (isUsuable(nb)) { - // return nb; - // } - // } - Collections.shuffle(frees, rnd); - for (int nb : frees) { - if (isUsuable(nb)) { - return nb; - } - } - return -1; - - } - - public static int size(Random rnd, MagicTable mt) { - int i = 0; - while (true) { - final int candidate = mt.getRandomFree(rnd); - if (candidate == -1) { - break; - } - mt.burnNumber(candidate); - i++; - } - return i; - } - - public static void main(String[] args) { - int max = 0; - final long start = System.currentTimeMillis(); - final Random rnd = new Random(49); - final int nb = 200000; - for (int i = 0; i < nb; i++) { - if (i == 100) { - long dur = (System.currentTimeMillis() - start) / 1000L; - dur = dur * nb / 100; - dur = dur / 3600; - Log.println("Estimated duration = " + dur + " h"); - } - final MagicTable mt = new MagicTable(); - final int v = MagicTable.size(rnd, mt); - if (v > max) { - Log.println("v="+v); - Log.println("mt="+mt.getAllUsed()); - max = v; - } - } - final long duration = System.currentTimeMillis() - start; - Log.println("Duration = " + duration / 1000L / 60); - - } - - public static void main2(String[] args) { - int max = 0; - final long start = System.currentTimeMillis(); - for (int j = 1; j < 100; j++) { - final Random rnd = new Random(j); - for (int i = 0; i < 1000; i++) { - final MagicTable mt = new MagicTable(); - final int v = MagicTable.size(rnd, mt); - if (v > max) { - Log.println("v="+v); - Log.println("mt="+mt.getAllUsed()); - max = v; - } - } - } - final long duration = System.currentTimeMillis() - start; - Log.println("Duration = " + duration / 1000L / 60); - - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/NoInputException.java b/src/net/sourceforge/plantuml/oregon/NoInputException.java deleted file mode 100644 index 9dde2ad..0000000 --- a/src/net/sourceforge/plantuml/oregon/NoInputException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -public class NoInputException extends Exception { -} diff --git a/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java b/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java deleted file mode 100644 index 1f19cb0..0000000 --- a/src/net/sourceforge/plantuml/oregon/OregonBasicGame.java +++ /dev/null @@ -1,940 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import java.util.Random; - -import net.sourceforge.plantuml.StringUtils; - -public class OregonBasicGame implements BasicGame { - - private Screen screen; - private SmartKeyboard skb; - private Random rnd; - - private int ks; - private int kh; - private int kp; - private int kb; - private int km; - private int kq; - - private double ma; - - private final String da[] = new String[] { "March 29", "April 12", "April 26", "May 10", "May 24", "June 7", - "June 21", "July 5", "July 19", "August 2", "August 16", "August 31", "September 13", "September 27", - "October 11", "October 25", "November 8", "November 22", "December 6", "December 20" }; - - private final int ep[] = new int[] { 6, 11, 13, 15, 17, 22, 32, 35, 37, 42, 44, 54, 64, 69, 95 }; - - public Screen getScreen() { - return screen; - } - - private void print(String s) { - screen.print(s); - } - - private void printb(String s) { - screen.print("** " + s + " **"); - } - - private void print() { - screen.print(); - } - - public void run(Keyboard keyboard) throws NoInputException { - if (screen != null) { - throw new IllegalStateException(); - } - screen = new Screen(); - skb = new SmartKeyboard(keyboard); - init(); - } - - private double rnd() { - if (this.rnd == null) { - this.rnd = new Random(skb.getHistory().hashCode()); - } - return rnd.nextDouble(); - } - - private void init() throws NoInputException { - printInitialScenario490(); - initialPurchasesOfPlayer690(); - initialShootingRanking920(); - screen.clear(); - print("** Your trip is about to begin... **"); - print(); - for (int j = 0; j < 20; j++) { - if (m > 2039) { - madeIt3190(j); - break; - } - print("Monday, " + da[j] + ", 1847. You are " + whereAreWe()); - print(); - if (f < 6) { - print("** You're low on food. Better buy some or go hunting soon. **"); - print(); - } - if (ks == 1 || kh == 1) { - t = t - 10; - if (t < 0) { - needDoctorBadly3010(j); - } - print("Doctor charged $10 for his services"); - print("to treat your " + (ks == 1 ? "illness." : "injuries.")); - } - // MP flag to be done? - - m = (int) (m + .5); - print("Total mileage to date is: " + ((int) m) + ""); - m += 200 + (a - 110) / 2.5 + 10 * rnd(); - print(); - // Calculate how far we travel in 2 weeks - print("Here's what you now have (no. of bullets, $ worth of other items) :"); - printInventory3350(); - question1000(j); - eating1310(j); - screen.clear(); - riders1390(j); - // print(); - events1800(j); - // print(); - montains2640(j); - if (skb.hasMore()) { - screen.clear(); - } - } - } - - private void events1800(int j) throws NoInputException { - final int rn = (int) (100.0 * rnd()); - for (int i = 0; i < ep.length; i++) { - if (rn <= ep[i]) { - execEvent(i, j); - return; - } - } - execEvent(ep.length, j); - } - - private void execEvent(int i, int j) throws NoInputException { - switch (i) { - case 0: - printb("Your wagon breaks down. It costs you time and supplies to fix it."); - m = m - 15 - 5 * rnd(); - r = r - 4; - break; - case 1: - printb("An ox gores your leg. That slows you down for the rest of the trip."); - m = m - 25; - a = a - 10; - break; - case 2: - printb("Bad luck... your daughter breaks her arm. You must stop and"); - printb("make a splint and sling with some of your medical supplies."); - m = m - 5 - 4 * rnd(); - r = r - 1 - 2 * rnd(); - break; - case 3: - printb("An ox wanders off and you have to spend time looking for it."); - m = m - 17; - break; - case 4: - printb("Your son gets lost and you spend half a day searching for him."); - m = m - 10; - break; - case 5: - printb("Nothing but contaminated and stagnant water near the trail."); - printb("You lose time looking for a clean spring or creek."); - m = m - 2 - 10 * rnd(); - break; - - case 6: - if (m > 950) { - int c1 = 0; - if (c < 11 + 2 * rnd()) { - c1 = 1; - } - printb("Cold weather... Brrrrrrr! ... You " + (c1 == 1 ? "don't " : "") - + "have enough clothing to keep warm."); - if (c1 == 1) { - dealWithIllness2880(j); - } - } else { - printb("Heavy rains. Traveling is slow in the mud and you break your spare"); - printb("ox yoke using it to pry your wagon out of the mud. Worse yet, some"); - printb("of your ammo is damaged by the water."); - m = m - 5 - 10 * rnd(); - r = r - 7; - b = b - 400; - f = f - 5; - } - break; - - case 7: - printb("Bandits attacking!"); - final int br1 = shoot3870(); - b = b - 20 * br1; - if (b > 0) { - if (br1 <= 1) { - print("That was the quickest draw outside of Dodge City."); - print("You got at least one and drove 'em off."); - return; - } - } else { - t = t / 3; - print("You try to drive them off but you run out of bullets."); - print("They grab as much cash as they can find."); - - } - print("You get shot in the leg -"); - kh = 1; - print("and they grab one of your oxen."); - a = a - 10; - r = r - 2; - print("Better have a doc look at your leg... and soon!"); - break; - - case 8: - printb("You have a fire in your wagon. Food and supplies are damaged."); - m = m - 15; - f = f - 20; - b = b - 400; - r = r - 2 * 6 * rnd(); - break; - - case 9: - printb("You lose your way in heavy fog. Time lost regaining the trail."); - m = m - 10 - 5 * rnd(); - break; - - case 10: - printb("You come upon a rattlesnake and before you are able to get your gun"); - printb("out, it bites you."); - b = b - 10; - r = r - 2; - if (r < 0) { - printb("You have no medical supplies left, and you die of poison."); - die3060(j); - - } - print("Fortunately, you acted quickly, sucked out the poison, and"); - print("treated the wound. It is painful, but you'll survive."); - break; - - case 11: - print("Your wagon gets swamped fording a river; you lose food and clothes."); - m = m - 20 - 20 * rnd(); - f = f - 15; - c = c - 10; - break; - - case 12: - printb("You're sound asleep and you hear a noise... get up to investigate."); - printb("It's wild animals! They attack you!"); - final int br2 = shoot3870(); - if (b <= 39) { - print("You're almost out of ammo; can't reach more."); - print("The wolves come at you biting and clawing."); - kh = 1; - die3030(j); - } - if (br2 <= 2) { - print("Nice shooting, pardner... They didn't get much."); - } else { - print("Kind of slow on the draw. The wolves got at your food and clothes."); - b = b - 20 * br2; - c = c - 2 * br2; - f = f - 4 * br2; - } - break; - - case 13: - printb("You're caught in a fierce hailstorm; ammo and supplies are damaged."); - m = m - 5 - 10 * rnd(); - b = b - 150; - r = r - 2 - 2 * rnd(); - break; - - case 14: - if (e == 1) { - dealWithIllness2880(j); - } else if (e == 2 && rnd() > .25) { - dealWithIllness2880(j); - } else if (e == 3 && rnd() > .5) { - dealWithIllness2880(j); - } - break; - - case 15: - printb("Helpful Indians show you where to find more food."); - f = f + 7; - break; - - default: - printb("EVENT " + i); - } - print(); - - } - - private void madeIt3190(int j) throws NoInputException { - final double ml = (2040 - ma) / (m - ma); - f = f + (1 - ml) * (8 + 5 * e); - print("You finally arrived at Oregon City after 2040 long miles."); - print("You're exhausted and haggard, but you made it! A real pioneer!"); - final int d = (int) (14 * (j + ml)); - final int dm = (int) (d / 30.5); - final int dd = (int) (d - 30.5 * dm); - print("You've been on the trail for " + dm + " months and " + dd + " days."); - print("You have few supplies remaining :"); - printInventory3350(); - print(); - print("President James A. Polk sends you his heartiest"); - - print("congratulations and wishes you a prosperous life in your new home."); - throw new NoInputException(); - } - - private boolean riders1390(int j) throws NoInputException { - final double value = (Math.pow(m / 100 - 4, 2) + 72) / (Math.pow(m / 100 - 4, 2) + 12) - 1; - final double random = 10.0 * rnd(); - if (random > value) { - return false; - } - int gh = 0; - if (rnd() > .2) { - gh = 1; - } - print(); - print("Riders ahead! They " + (gh == 1 ? "don't " : "") + "look hostile."); - int gt; - do { - print("You can (1) run, (2) attack, (3) ignore them, or (4) circle wagons."); - gt = skb.inputInt(screen); - } while (gt < 0 || gt > 4); - if (rnd() < .2) { - gh = 1 - gh; - } - if (gh == 1) { - if (gt == 1) { - m = m + 15; - a = a - 5; - } else if (gt == 2) { - m = m - 5; - b = b - 100; - } else if (gt == 4) { - m = m - 20; - } - print("Riders were friendly, but check for possible losses."); - return true; - } - if (gt == 1) { - m = m + 20; - r = r - 7; - b = b - 150; - a = a - 20; - } else if (gt == 2) { - final int br = shoot3870(); - b = b - br * 40 - 80; - riderShoot(br); - } else if (gt == 3) { - if (rnd() > .8) { - print("They did not attack. Whew!"); - return true; - } - b = b - 150; - r = r - 7; - } else { - assert gt == 4; - final int br = shoot3870(); - b = b - br * 30 - 80; - m = m - 25; - riderShoot(br); - } - print("Riders were hostile. Better check for losses!"); - if (b >= 0) { - return true; - } - print(); - print("Oh, my gosh!"); - print("They're coming back and you're out of ammo! Your dreams turn to"); - print("dust as you and your family are massacred on the prairie."); - print3110(j); - return true; - - } - - private void riderShoot(final int br) { - if (br <= 1) { - print("Nice shooting - you drove them off."); - } else if (br <= 4) { - print("Kind of slow with your Colt .45."); - } else { - print("Pretty slow on the draw, partner. You got a nasty flesh wound."); - kh = 1; - print("You'll have to see the doc soon as you can."); - } - } - - private void montains2640(int j) throws NoInputException { - if (m <= 975) { - return; - } - final double mm = m / 100.0 - 15; - if (10 * rnd() > 9 - (mm * mm + 72) / (mm * mm + 12)) { - southPass2750(j); - return; - } - print("You're in rugged mountain country."); - if (rnd() <= .1) { - print("You get lost and lose valuable time trying to find the trail."); - m = m - 60; - southPass2750(j); - return; - } - if (rnd() > .11) { - print("The going is really slow; oxen are very tired."); - m = m - 45 - 50 * rnd(); - } else { - print("Trail cave in damages your wagon. You lose time and supplies."); - m = m - 20 - 30 * rnd(); - b = b - 200; - r = r - 3; - } - southPass2750(j); - - } - - private void southPass2750(int j) throws NoInputException { - if (kp == 0) { - kp = 1; - if (rnd() < .8) { - blizzard2840(j); - return; - } - print("You made it safely through the South Pass....no snow!"); - } - if (m < 1700) { - return; - } - if (km == 0) { - km = 1; - if (rnd() < .7) { - blizzard2840(j); - } - } - - } - - private void blizzard2840(int j) throws NoInputException { - print("Blizzard in the mountain pass. Going is slow; supplies are lost."); - kb = 1; - m = m - 30 - 40 * rnd(); - f = f - 12; - b = b - 200; - r = r - 5; - if (c < 18 + 2 * rnd()) { - dealWithIllness2880(j); - } - } - - private void dealWithIllness2880(int j) throws NoInputException { - if (100 * rnd() < 10 + 35 * (e - 1)) { - print("Mild illness. Your own medicine will cure it."); - m -= 5; - r -= 1; - } else if (100 * rnd() < 100.0 - 40.0 / Math.pow(4.0, e - 1)) { - print("The whole family is sick. Your medicine will probably work okay."); - m -= 5; - r -= 2.5; - } else { - print("Serious illness in the family. You'll have to stop and see a doctor"); - print("soon. For now, your medicine will work."); - r -= 5; - ks = 1; - } - if (r <= 0) { - print("...if only you had enough."); - outOfMedicalSupplies3020(j); - } - - } - - private void eating1310(int j) throws NoInputException { - if (f < 5) { - die3000(j); - return; - } - do { - print("Do you want to eat (1) poorly, (2) moderately or (3) well ?"); - e = skb.inputInt(screen); - if (e < 1 || e > 3) { - print("Enter 1, 2, or 3, please."); - break; - } - final int ee = (int) (4 + 2.5 * e); - if (e == 1 && ee > f) { - f = 0; - return; - } - if (ee > f) { - print("You don't have enough to eat that well."); - break; - } - f -= ee; - return; - } while (true); - - } - - private void needDoctorBadly3010(int j) throws NoInputException { - print("You need a doctor badly but can't afford one."); - die3030(j); - } - - private void outOfMedicalSupplies3020(int j) throws NoInputException { - print("You have run out of all medical supplies."); - print(); - die3030(j); - } - - private void die3000(int j) throws NoInputException { - screen.clear(); - print("You run out of food and starve to death."); - print(); - print3110(j); - } - - private void die3030(int j) throws NoInputException { - print("The wilderness is unforgiving and you die of " + (kh == 1 ? "your injuries" : "pneumonia")); - die3060(j); - } - - private void die3060(int j) throws NoInputException { - print("Your family tries to push on, but finds the going too rough"); - print(" without you."); - print3110(j); - } - - private void print3110(int j) throws NoInputException { - print("Some travelers find the bodies of you and your"); - print("family the following spring. They give you a decent"); - print("burial and notify your next of kin."); - print(); - print("At the time of your unfortunate demise, you had been on the trail"); - final int d = 14 * j; - final int dm = (int) (d / 30.5); - final int dd = (int) (d - 30.5 * dm); - print("for " + dm + " months and " + dd + " days and had covered " + (int) ((m + 70)) + " miles."); - print(); - print("You had a few supplies left :"); - printInventory3350(); - throw new NoInputException(); - } - - private void question1000(int j) throws NoInputException { - int x; - if (j % 2 == 1) { - do { - print("Want to (1) stop at the next fort, (2) hunt, or (3) push on ?"); - x = skb.inputInt(screen); - if (x == 3) { - return; - } - if (x == 1) { - stopAtFort1100(j); - return; - } - if (x == 2) { - hunt1200(j); - if (kq == 0) { - return; - } - } - } while (true); - } else { - do { - print("Would you like to (1) hunt or (2) continue on ?"); - x = skb.inputInt(screen); - if (x == 2) { - return; - } - } while (x < 1 || x > 2); - if (x == 1) { - hunt1200(j); - } - } - - } - - private void hunt1200(int j) throws NoInputException { - kq = 0; - if (b <= 39) { - print("Tough luck. You don't have enough ammo to hunt."); - kq = 1; - return; - } - m = m - 45; - final int br = shoot3870(); - if (br <= 1) { - print("Right between the eyes... you got a big one!"); - print("Full bellies tonight!"); - b = b - 10 - 4 * rnd(); - f = f + 26 + 3 * rnd(); - return; - } - if (100.0 * rnd() < 13 * br) { - print("You missed completely... and your dinner got away."); - return; - } - print("Nice shot... right on target... good eatin' tonight!"); - f = f + 24 - 2 * br; - b = b - 10 - 3 * br; - return; - } - - private void stopAtFort1100(int j) throws NoInputException { - if (t <= 0) { - print("You sing with the folks there and get a good"); - print("night's sleep, but you have no money to buy anything."); - return; - } - - while (true) { - print("What would you like to spend on each of the following"); - print("Food?"); - final double p1 = skb.inputInt(screen); - print("Ammunition?"); - final double p2 = skb.inputInt(screen); - print("Clothing?"); - final double p3 = skb.inputInt(screen); - print("Medicine and supplies?"); - final double p4 = skb.inputInt(screen); - final double p = p1 + p2 + p3 + p4; - print("The storekeeper tallies up your bill. It comes to $" + ((int) p)); - if (t >= p) { - t = t - p; - f = f + .67 * p1; - b = b + 33 * p2; - c = c + .67 * p3; - r = r + .67 * p4; - return; - } - print("Uh, oh. That's more than you have. Better start over."); - } - } - - private void printInventory3350() { - // print("+------+------+------+---------+--------------------+"); - print(); - print("| Cash | Food | Ammo | Clothes | Medicine/parts/... |"); - print("+------+------+------+---------+--------------------+"); - if (t < 0) { - t = 0; - } - if (f < 0) { - f = 0; - } - if (b < 0) { - b = 0; - } - if (c < 0) { - c = 0; - } - if (r < 0) { - r = 0; - } - print(String.format("|%5d |%5d |%5d | %5d | %5d |", (int) t, (int) f, (int) b, (int) c, (int) r)); - print("+------+------+------+---------+--------------------+"); - print(); - } - - private String whereAreWe() { - if (m < 5) { - return "on the high prairie."; - } - if (m < 200) { - return "near Independence Crossing on the Big Blue River."; - } - if (m < 350) { - return "following the Platte River."; - } - if (m < 450) { - return "near Fort Kearney."; - } - if (m < 600) { - return "following the North Platte River."; - } - if (m < 750) { - return "within sight of Chimney Rock."; - } - if (m < 850) { - return "near Fort Laramie."; - } - if (m < 1000) { - return "close upon Independence Rock."; - } - if (m < 1050) { - return "in the Big Horn Mountains."; - } - if (m < 1150) { - return "following the Green River."; - } - if (m < 1250) { - return "not too far from Fort Hall."; - } - if (m < 1400) { - return "following the Snake River."; - } - if (m < 1550) { - return "not far from Fort Boise."; - } - if (m < 1850) { - return "in the Blue Mountains."; - } - return "following the Columbia River"; - - } - - private void printInitialScenario490() { - print(" Your journey over the Oregon Trail takes place in 1847."); - print(); - print("Starting in Independence, Missouri, you plan to take your family of"); - print("five over 2040 tough miles to Oregon City."); - print(); - print(" Having saved $420 for the trip, you bought a wagon for $70 and"); - print("now have to purchase the following items :"); - print(); - print(" * Oxen (spending more will buy you a larger and better team which"); - print(" will be faster so you'll be on the trail for less time)"); - print(" * Food (you'll need ample food to keep up your strength and health)"); - print(" * Ammunition ($1 buys a belt of 50 bullets. You'll need ammo for"); - print(" hunting and for fighting off attacks by bandits and animals)"); - print(" * Clothing (you'll need warm clothes, especially when you hit the"); - print(" snow and freezing weather in the mountains)"); - print(" * Other supplies (includes medicine, first-aid supplies, tools, and"); - print(" wagon parts for unexpected emergencies)"); - print(); - print(" You can spend all your money at the start or save some to spend"); - print("at forts along the way. However, items cost more at the forts. You"); - print("can also hunt for food if you run low."); - print(); - - } - - private void initialPurchasesOfPlayer690() throws NoInputException { - if (skb.hasMore()) { - screen.clear(); - } - do { - print("How much do you want to pay for a team of oxen ?"); - a = skb.inputInt(screen); - if (a < 100) { - print("No one in town has a team that cheap"); - continue; - } - break; - } while (true); - if (a >= 151) { - print("You choose an honest dealer who tells you that $" + a + " is too much for"); - print("a team of oxen. He charges you $150 and gives you $" + (a - 150) + " change."); - a = 150; - } - do { - print(); - print("How much do you want to spend on food ?"); - f = skb.inputInt(screen); - if (f <= 13) { - print("That won't even get you to the Kansas River"); - print(" - better spend a bit more."); - continue; - } - if (a + f > 300) { - print("You wont't have any for ammo and clothes."); - continue; - } - break; - } while (true); - do { - print(); - print("How much do you want to spend on ammunition ?"); - b = skb.inputInt(screen); - if (b < 2) { - print("Better take a bit just for protection."); - continue; - } - if (a + f + b > 320) { - print("That won't leave any money for clothes."); - continue; - } - break; - } while (true); - do { - print(); - print("How much do you want to spend on clothes ?"); - c = skb.inputInt(screen); - if (c <= 24) { - print("Your family is going to be mighty cold in."); - print("the mountains."); - print("Better spend a bit more."); - continue; - } - if (a + f + b + c > 345) { - print("That leaves nothing for medicine."); - continue; - } - break; - } while (true); - do { - print(); - screen.print("How much for medicine, bandage, repair parts, etc. ?"); - r = skb.inputInt(screen); - if (r <= 5) { - print("That's not at all wise."); - continue; - } - if (a + f + b + c + r > 350) { - print("You don't have that much money."); - continue; - } - break; - } while (true); - t = 350 - a - f - b - c - r; - print(); - print("You now have $" + ((int) t) + " left."); - b = 50 * b; - } - - private void initialShootingRanking920() throws NoInputException { - print(); - print("Please rank your shooting (typing) ability as follows :"); - print(" (1) Ace marksman (2) Good shot (3) Fair to middlin'"); - print(" (4) Need more practice (5) Shaky knees"); - do { - print(); - print("How do you rank yourself ?"); - dr = skb.inputInt(screen); - if (dr >= 1 && dr <= 6) { - return; - } - print("Please enter 1, 2, 3, 4 or 5."); - } while (true); - } - - private int e; - private int a; - private double b; - private double f; - private double c; - private double r; - private double t; - private int dr; - private double m; - - enum ShootingWord { - POW, BANG, BLAM, WHOP, WHAM, ZING, ZACK, ZANG, WOOSH, BAM, ZAP, BOOM, WOW, CLANG, BOING, ZOW, PANG, ZOSH, KAZ, KOOG, ZOOP, PONG, PING, BAZ, ZONG, PAM, POOM, DOING; - - public static ShootingWord safeValueOf(String s) { - try { - return valueOf(StringUtils.goUpperCase(s)); - } catch (IllegalArgumentException e) { - return null; - } - } - - public int decode(ShootingWord key) { - return (ordinal() + key.ordinal()) % NB_WORDS; - } - - public ShootingWord encode(int v) { - v = v - this.ordinal(); - if (v < 0) { - v += NB_WORDS; - } - return ShootingWord.values()[v]; - } - } - - private static int NB_WORDS = ShootingWord.values().length; - - private int getTime() { - return (int) ((System.currentTimeMillis() / 1000L) % NB_WORDS); - } - - private int shoot3870() throws NoInputException { - final int time1 = getTime(); - final ShootingWord word1Printed = ShootingWord.values()[time1]; - if (skb.hasMore() == false) { - print("Type: " + word1Printed); - } - final String typed1 = skb.input(screen); - ShootingWord wordType1 = ShootingWord.safeValueOf(typed1); - final int delta; - if (wordType1 == null) { - delta = NB_WORDS - 1; - wordType1 = ShootingWord.values()[NB_WORDS - 1]; - } else { - delta = protect(getTime() - wordType1.ordinal()); - } - // print("delta="+delta); - final ShootingWord word2 = wordType1.encode(delta); - if (skb.hasMore() == false) { - print("Type: " + word2); - } - final String typed2 = skb.input(screen); - final ShootingWord wordType2 = ShootingWord.safeValueOf(typed2); - final int duration = wordType2 == null ? NB_WORDS : wordType1.decode(wordType2) - dr; - // print("duration=" + duration); - if (duration < 0) { - return 0; - } - return duration; - } - - private int protect(int v) { - while (v >= NB_WORDS) { - v -= NB_WORDS; - } - while (v < 0) { - v += NB_WORDS; - } - return v; - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/PSystemOregon.java b/src/net/sourceforge/plantuml/oregon/PSystemOregon.java deleted file mode 100644 index 2958650..0000000 --- a/src/net/sourceforge/plantuml/oregon/PSystemOregon.java +++ /dev/null @@ -1,115 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -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.ImageData; -import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.svek.TextBlockBackcolored; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.ImageBuilder; - -public class PSystemOregon extends AbstractPSystem { - - private Screen screen; - private List inputs; - - @Deprecated - public PSystemOregon(Keyboard keyboard) { - final BasicGame game = new OregonBasicGame(); - try { - game.run(keyboard); - this.screen = game.getScreen(); - // this.screen = new Screen(); - // screen.print("Game ended??"); - } catch (NoInputException e) { - this.screen = game.getScreen(); - } - } - - public PSystemOregon() { - this.inputs = new ArrayList(); - } - - public void add(String line) { - if (StringUtils.isNotEmpty(line)) { - inputs.add(line); - } - } - - private Screen getScreen() { - if (screen == null) { - final Keyboard keyboard = new KeyboardList(inputs); - final BasicGame game = new OregonBasicGame(); - try { - game.run(keyboard); - this.screen = game.getScreen(); - // this.screen = new Screen(); - // screen.print("Game ended??"); - } catch (NoInputException e) { - this.screen = game.getScreen(); - } - } - return screen; - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final TextBlockBackcolored result = getGraphicStrings(); - final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, result.getBackcolor(), - getMetadata(), null, 0, 0, null, false); - imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os); - } - - private TextBlockBackcolored getGraphicStrings() throws IOException { - return GraphicStrings.createGreenOnBlackMonospaced(getScreen().getLines()); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(The Oregon Trail)"); - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java b/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java deleted file mode 100644 index c6ae42b..0000000 --- a/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import net.sourceforge.plantuml.command.PSystemBasicFactory; - -public class PSystemOregonFactory extends PSystemBasicFactory { - - // public PSystemOregon getSystem() { - // final Keyboard keyboard; - // if (inputs == null) { - // keyboard = new KeyboardList(""); - // } else { - // keyboard = new KeyboardList(inputs); - // } - // system = new PSystemOregon(keyboard); - // return system; - // } - - @Override - public PSystemOregon executeLine(PSystemOregon system, String line) { - if (system == null && line.equalsIgnoreCase("run oregon trail")) { - return new PSystemOregon(); - } - if (system == null) { - return null; - } - system.add(line); - return system; - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/Screen.java b/src/net/sourceforge/plantuml/oregon/Screen.java deleted file mode 100644 index fdd034c..0000000 --- a/src/net/sourceforge/plantuml/oregon/Screen.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class Screen { - private final List lines = new ArrayList(); - - public void clear() { - lines.clear(); - } - - public void print(String s) { - lines.add(s); - } - - public void print() { - lines.add(" "); - } - - public List getLines() { - return Collections.unmodifiableList(lines); - } - - public String getLastLine() { - return lines.get(lines.size()-1); - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/SecureCoder.java b/src/net/sourceforge/plantuml/oregon/SecureCoder.java deleted file mode 100644 index 378388b..0000000 --- a/src/net/sourceforge/plantuml/oregon/SecureCoder.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -public class SecureCoder { - - private static final int m[] = { 38, 152, 264, 491, 573, 616, 727, 880, 905, 1090, 1188, 1315, 1544, 1603, 1756, - 1831, 1962, 2025, 2100, 2257, 2381, 2469, 2536, 2714, 2948, 3077, 3166, 3219, 3340, 3455, 3701, 3892, 3934, - 4193, 4372, 4404, 4521, 4650, 4739, 4865, 4987, 5053, 5135, 5282, 5309, 5446, 5628, 5817, 5970, 6002, 6174, - 6295, 6367, 6420, 6558, 6689, 6913, 7061, 7129, 7206, 7333, 7510, 7697, 7742, 7854, 8084, 8147, 8230, 8326, - 8412, 8599, 8675, 8763, 8808, 8951, 9049, 9111, 9223, 9394, 9478, 9507, 9632, 9785 }; - - private static final int dec[] = new int[10000]; - - static { - for (int i = 0; i < dec.length; i++) { - dec[i] = -1; - } - for (int i = 0; i < m.length; i++) { - final int enc = m[i]; - dec[enc] = i; - for (int n : MagicTable.getNeighbours(enc)) { - if (dec[n] != -1) { - throw new IllegalStateException(); - } - dec[n] = i + 1000; - } - } - } - - public int encode(int i) { - return m[i]; - } - - public int decode(int v) { - return dec[v]; - } - -} diff --git a/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java b/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java deleted file mode 100644 index 21aca01..0000000 --- a/src/net/sourceforge/plantuml/oregon/SmartKeyboard.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.oregon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class SmartKeyboard { - - private final Keyboard keyboard; - private final List history = new ArrayList(); - - public SmartKeyboard(Keyboard keyboard) { - this.keyboard = keyboard; - } - - public String input(Screen screen) throws NoInputException { - final String s = keyboard.input(); - history.add(s); - screen.print("? " + s); - return s; - } - - public int inputInt(Screen screen) throws NoInputException { - final String s = input(screen); - if (s.matches("\\d+") == false) { - screen.print("Please enter a valid number instead of " + s); - throw new NoInputException(); - } - return Integer.parseInt(s); - } - - public boolean hasMore() { - return keyboard.hasMore(); - } - - public List getHistory() { - return Collections.unmodifiableList(history); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java b/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java deleted file mode 100644 index 4f1c22e..0000000 --- a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UFont; - -abstract class AbstractEntityImage2 implements IEntityImageBlock { - - private final IEntity entity; - private final ISkinParam skinParam; - - private final Rose rose = new Rose(); - - public AbstractEntityImage2(IEntity entity, ISkinParam skinParam) { - if (entity == null) { - throw new IllegalArgumentException("entity null"); - } - this.entity = entity; - this.skinParam = skinParam; - } - - public abstract Dimension2D getDimension(StringBounder stringBounder); - - protected final IEntity getEntity() { - return entity; - } - - protected UFont getFont(FontParam fontParam) { - return skinParam.getFont(null, false, fontParam); - } - - protected HtmlColor getFontColor(FontParam fontParam) { - return skinParam.getFontHtmlColor(null, fontParam); - } - - protected final HtmlColor getColor(ColorParam colorParam) { - return rose.getHtmlColor(skinParam, colorParam); - } - - protected final ISkinParam getSkinParam() { - return skinParam; - } -} diff --git a/src/net/sourceforge/plantuml/posimo/Decor.java b/src/net/sourceforge/plantuml/posimo/Decor.java deleted file mode 100644 index a583616..0000000 --- a/src/net/sourceforge/plantuml/posimo/Decor.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.ugraphic.UGraphic; - -public interface Decor { - - void drawDecor(UGraphic ug, Point2D start, double direction); -} diff --git a/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java b/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java deleted file mode 100644 index fdc7f11..0000000 --- a/src/net/sourceforge/plantuml/posimo/DecorInterfaceProvider.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.cucadiagram.LinkStyle; -import net.sourceforge.plantuml.ugraphic.UEllipse; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class DecorInterfaceProvider implements Decor { - - private final double radius = 5; - private final double radius2 = 9; - private final LinkStyle style; - - // private final double distanceCircle = 16; - - public DecorInterfaceProvider(LinkStyle style) { -// if (style != LinkStyle.__toremove_INTERFACE_PROVIDER && style != LinkStyle.__toremove_INTERFACE_USER) { -// throw new IllegalArgumentException(); -// } - this.style = style; - } - - public void drawDecor(UGraphic ug, Point2D start, double direction) { - final double cornerX = start.getX() - radius; - final double cornerY = start.getY() - radius; - final double cornerX2 = start.getX() - radius2 - 0 * Math.sin(direction * Math.PI / 180.0); - final double cornerY2 = start.getY() - radius2 - 0 * Math.cos(direction * Math.PI / 180.0); - -// if (style == LinkStyle.__toremove_INTERFACE_USER) { -// direction += 180; -// } - if (direction >= 360) { - direction -= 360; - } - - final UEllipse arc = new UEllipse(2 * radius2, 2 * radius2, direction + 15, 180 - 30); - ug = ug.apply(new UStroke(1.5)); - ug.apply(new UTranslate(cornerX2, cornerY2)).draw(arc); - ug.apply(new UTranslate(cornerX, cornerY)).draw(new UEllipse(2 * radius, 2 * radius)); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java b/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java deleted file mode 100644 index 37fd779..0000000 --- a/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Dimension2D; -import java.util.Collection; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.cucadiagram.Link; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.Component; -import net.sourceforge.plantuml.skin.ComponentType; -import net.sourceforge.plantuml.skin.SimpleContext2D; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class EntityImageNote2 extends AbstractEntityImage2 { - - private final Component comp; - - public EntityImageNote2(IEntity entity, ISkinParam skinParam, Collection links) { - super(entity, skinParam); - - final Rose skin = new Rose(); - - comp = skin.createComponent(ComponentType.NOTE, null, skinParam, entity.getDisplay()); - - } - - @Override - public Dimension2D getDimension(StringBounder stringBounder) { - final double height = comp.getPreferredHeight(stringBounder); - final double width = comp.getPreferredWidth(stringBounder); - return new Dimension2DDouble(width, height); - } - - public void drawU(UGraphic ug, double xTheoricalPosition, double yTheoricalPosition, double marginWidth, - double marginHeight) { - ug = ug.apply(new UTranslate(xTheoricalPosition, yTheoricalPosition)); - comp.drawU(ug, new Area(getDimension(ug.getStringBounder())), new SimpleContext2D(false)); - - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/Frame.java b/src/net/sourceforge/plantuml/posimo/Frame.java deleted file mode 100644 index 8443bcf..0000000 --- a/src/net/sourceforge/plantuml/posimo/Frame.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Dimension2D; -import java.util.List; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.Component; -import net.sourceforge.plantuml.skin.Context2D; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.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; -import net.sourceforge.plantuml.ugraphic.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class Frame implements Component { - - private final List name; - private final ISkinParam skinParam; - private final Rose rose = new Rose(); - - // private final Color textColor; - // private final Color lineColor; - // private final Font font; - - public Frame(List name, ISkinParam skinParam) { - this.name = name; - this.skinParam = skinParam; - // this.textColor = textColor; - // this.lineColor = lineColor; - // this.font = font; - } - - public void drawU(UGraphic ug, Area area, Context2D context) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final HtmlColor lineColor = rose.getHtmlColor(skinParam, ColorParam.packageBorder); - ug = ug.apply(new UChangeColor(lineColor)); - ug = ug.apply(new UChangeBackColor(null)); - ug.apply(new UStroke(1.4)).draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight())); - - final TextBlock textBlock = createTextBloc(); - textBlock.drawU(ug.apply(new UTranslate(2, 2))); - - final Dimension2D textDim = getTextDim(ug.getStringBounder()); - final double x = textDim.getWidth() + 6; - final double y = textDim.getHeight() + 6; - final UPolygon poly = new UPolygon(); - poly.addPoint(x, 0); - poly.addPoint(x, y - 6); - poly.addPoint(x - 6, y); - poly.addPoint(0, y); - poly.addPoint(0, 0); - ug.apply(new UStroke(1.4)).draw(poly); - - } - - public double getPreferredHeight(StringBounder stringBounder) { - final Dimension2D dim = getTextDim(stringBounder); - return dim.getHeight() + 8; - } - - public double getPreferredWidth(StringBounder stringBounder) { - final Dimension2D dim = getTextDim(stringBounder); - return dim.getWidth() + 8; - } - - public Dimension2D getTextDim(StringBounder stringBounder) { - final TextBlock bloc = createTextBloc(); - return bloc.calculateDimension(stringBounder); - } - - private TextBlock createTextBloc() { - final UFont font = skinParam.getFont(null, false, FontParam.PACKAGE); - final 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) { - final double w = getPreferredWidth(stringBounder); - final double h = getPreferredHeight(stringBounder); - return new Dimension2DDouble(w, h); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java b/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java deleted file mode 100644 index 8e63966..0000000 --- a/src/net/sourceforge/plantuml/posimo/IEntityImageBlock.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.ugraphic.UGraphic; - -public interface IEntityImageBlock { - - Dimension2D getDimension(StringBounder stringBounder); - - void drawU(UGraphic ug, double xTheoricalPosition, double yTheoricalPosition, double marginWidth, - double marginHeight); -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/posimo/LabelImage.java b/src/net/sourceforge/plantuml/posimo/LabelImage.java deleted file mode 100644 index f09504b..0000000 --- a/src/net/sourceforge/plantuml/posimo/LabelImage.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.cucadiagram.Link; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class LabelImage { - - // private final Entity entity; - final private ISkinParam param; - final private Rose rose; - final private TextBlock name; - - public LabelImage(Link link, Rose rose, ISkinParam param) { - if (link == null) { - throw new IllegalArgumentException(); - } - // this.entity = entity; - this.param = param; - this.rose = rose; -// 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) { - final Dimension2D dim = name.calculateDimension(stringBounder); - return dim; - // return Dimension2DDouble.delta(dim, 2 * margin); - } - - public void drawU(UGraphic ug, double x, double y) { - // final Dimension2D dim = getDimension(ug.getStringBounder()); - // ug.getParam().setBackcolor(rose.getHtmlColor(param, - // ColorParam.classBackground).getColor()); - // ug.getParam().setColor(rose.getHtmlColor(param, - // ColorParam.classBorder).getColor()); - // ug.draw(x, y, new URectangle(dim.getWidth(), dim.getHeight())); - name.drawU(ug.apply(new UTranslate(x, y))); - } -} diff --git a/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java b/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java deleted file mode 100644 index 2f17e73..0000000 --- a/src/net/sourceforge/plantuml/posimo/LineRectIntersection.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - -public class LineRectIntersection { - - private final Point2D inter; - - public LineRectIntersection(Line2D line, Rectangle2D rect) { - final Point2D p1 = new Point2D.Double(rect.getMinX(), rect.getMinY()); - final Point2D p2 = new Point2D.Double(rect.getMaxX(), rect.getMinY()); - final Point2D p3 = new Point2D.Double(rect.getMaxX(), rect.getMaxY()); - final Point2D p4 = new Point2D.Double(rect.getMinX(), rect.getMaxY()); - - final Point2D inter1 = new LineSegmentIntersection(new Line2D.Double(p1, p2), line).getIntersection(); - final Point2D inter2 = new LineSegmentIntersection(new Line2D.Double(p2, p3), line).getIntersection(); - final Point2D inter3 = new LineSegmentIntersection(new Line2D.Double(p3, p4), line).getIntersection(); - final Point2D inter4 = new LineSegmentIntersection(new Line2D.Double(p4, p1), line).getIntersection(); - - final Point2D o = line.getP1(); - inter = getCloser(o, inter1, inter2, inter3, inter4); - - } - - public static Point2D getCloser(final Point2D o, final Point2D... other) { - double minDist = Double.MAX_VALUE; - Point2D result = null; - - for (Point2D pt : other) { - if (pt != null) { - final double dist = pt.distanceSq(o); - if (dist < minDist) { - minDist = dist; - result = pt; - } - } - } - - return result; - } - - public final Point2D getIntersection() { - return inter; - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java b/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java deleted file mode 100644 index 0d2117b..0000000 --- a/src/net/sourceforge/plantuml/posimo/LineSegmentIntersection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; - -public class LineSegmentIntersection { - - private final Point2D inter; - - // http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ - - public LineSegmentIntersection(Line2D segment, Line2D lineB) { - final double x1 = segment.getX1(); - final double y1 = segment.getY1(); - final double x2 = segment.getX2(); - final double y2 = segment.getY2(); - final double x3 = lineB.getX1(); - final double y3 = lineB.getY1(); - final double x4 = lineB.getX2(); - final double y4 = lineB.getY2(); - - final double den = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1); - - if (den == 0) { - inter = null; - } else { - - final double uA1 = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3); - final double uA = uA1 / den; - - final double x = x1 + uA * (x2 - x1); - final double y = y1 + uA * (y2 - y1); - - if (uA >= 0 && uA <= 1) { - inter = new Point2D.Double(x, y); - } else { - inter = null; - } - } - } - - public final Point2D getIntersection() { - return inter; - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/MargedBlock.java b/src/net/sourceforge/plantuml/posimo/MargedBlock.java deleted file mode 100644 index fca9f0b..0000000 --- a/src/net/sourceforge/plantuml/posimo/MargedBlock.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Dimension2D; -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.graphic.StringBounder; - -public class MargedBlock { - - private final Block block; - private final IEntityImageBlock imageBlock; - private final double marginDecorator; - private final Dimension2D imageDimension; - - static private int uid = 1; - - public MargedBlock(StringBounder stringBounder, IEntityImageBlock imageBlock, double marginDecorator, Cluster parent) { - this.imageBlock = imageBlock; - this.marginDecorator = marginDecorator; - this.imageDimension = imageBlock.getDimension(stringBounder); - this.block = new Block(uid++, imageDimension.getWidth() + 2 * marginDecorator, imageDimension.getHeight() + 2 - * marginDecorator, parent); - } - - public Block getBlock() { - return block; - } - - public double getMarginDecorator() { - return marginDecorator; - } - - public IEntityImageBlock getImageBlock() { - return imageBlock; - } - - public Positionable getImagePosition() { - return new Positionable() { - - public Dimension2D getSize() { - return imageDimension; - } - - public Point2D getPosition() { - final Point2D pos = block.getPosition(); - return new Point2D.Double(pos.getX() + marginDecorator, pos.getY() + marginDecorator); - } - - public void moveSvek(double deltaX, double deltaY) { - throw new UnsupportedOperationException(); - } - }; - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/Mirror.java b/src/net/sourceforge/plantuml/posimo/Mirror.java deleted file mode 100644 index e51723a..0000000 --- a/src/net/sourceforge/plantuml/posimo/Mirror.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -public class Mirror { - - private final double max; - - public Mirror(double max) { - this.max = max; - } - - public double getMirrored(double v) { - if (v < 0 || v > max) { - throw new IllegalArgumentException(); - } - //return v; - return max - v; - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/PathDrawer.java b/src/net/sourceforge/plantuml/posimo/PathDrawer.java deleted file mode 100644 index d4a87c8..0000000 --- a/src/net/sourceforge/plantuml/posimo/PathDrawer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import net.sourceforge.plantuml.ugraphic.UGraphic; - -public interface PathDrawer { - - public void drawPathBefore(UGraphic ug, Positionable start, Positionable end, Path path); - - public void drawPathAfter(UGraphic ug, Positionable start, Positionable end, Path path); - -} diff --git a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java b/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java deleted file mode 100644 index 2707b21..0000000 --- a/src/net/sourceforge/plantuml/posimo/PathDrawerInterface.java +++ /dev/null @@ -1,329 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Point2D; -import java.util.Collection; -import java.util.Map; - -import net.sourceforge.plantuml.ColorParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.cucadiagram.LinkDecor; -import net.sourceforge.plantuml.cucadiagram.LinkStyle; -import net.sourceforge.plantuml.cucadiagram.LinkType; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UChangeBackColor; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UPolygon; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class PathDrawerInterface implements PathDrawer { - - private final Rose rose; - private final ISkinParam param; - private final LinkType linkType; - - public static PathDrawerInterface create(ISkinParam param, LinkType linkType) { - return new PathDrawerInterface(new Rose(), param, linkType); - } - - private PathDrawerInterface(Rose rose, ISkinParam param, LinkType linkType) { - this.rose = rose; - this.param = param; - this.linkType = linkType; - } - - public void drawPathBefore(UGraphic ug, Positionable start, Positionable end, Path path) { - // // final DotPath dotPath = path.getDotPath(); - // // goDash(ug); - // // ug.draw(0, 0, dotPath); - // // noDash(ug); - } - - private void noDash(UGraphic ug) { - // ug.getParam().resetStroke(); - throw new UnsupportedOperationException(); - } - - private void goDash(UGraphic ug) { - // ug.getParam().setStroke(new UStroke(8, 8, 1.0)); - throw new UnsupportedOperationException(); - } - - public void drawPathAfter(UGraphic ug, Positionable start, Positionable end, Path path) { - DotPath dotPath = path.getDotPath(); - final Racorder racorder = new RacorderOrthogonal(); - // final Racorder racorder = new RacorderInToCenter(); - // final Racorder racorder = new RacorderFollowTangeante(); - - final Point2D endPath = dotPath.getEndPoint(); - final DotPath in = racorder.getRacordIn(PositionableUtils.convert(end), dotPath.getEndTangeante()); - // final Point2D inPoint = in.getFrontierIntersection(end); - final Point2D inPoint = in.getEndPoint(); - // final double theta1_ = in.getEndAngle() + Math.PI / 2; - // Log.println("theta1_=" + theta1_ + " " + theta1_ * 180 / - // Math.PI); - final double theta1 = atan2(endPath, inPoint); - // Log.println("theta1=" + theta1 + " " + theta1 * 180 / - // Math.PI); - final Point2D middle1 = drawSymbol(ug, theta1, inPoint, linkType.getDecor1()); - - final Point2D startPath = dotPath.getStartPoint(); - final DotPath out = racorder.getRacordOut(PositionableUtils.convert(start), dotPath.getStartTangeante()); - // final Point2D outPoint = out.getFrontierIntersection(start); - final Point2D outPoint = out.getStartPoint(); - // final double theta2_ = out.getStartAngle() - Math.PI / 2; - // Log.println("theta2_=" + theta2_ + " " + theta2_ * 180 / - // Math.PI); - final double theta2 = atan2(startPath, outPoint); - // Log.println("theta2=" + theta2 + " " + theta2 * 180 / - // Math.PI); - final Point2D middle2 = drawSymbol(ug, theta2, outPoint, linkType.getDecor2()); - - if (middle1 != null) { - final CubicCurve2D.Double after = getLine(endPath, middle1); - dotPath = dotPath.addAfter(after); - // dotPath = dotPath.addAfter(in); - } - - if (middle2 != null) { - final CubicCurve2D.Double before = getLine(middle2, startPath); - dotPath = dotPath.addBefore(before); - // dotPath = dotPath.addBefore(out); - } - - final LinkStyle style = linkType.getStyle(); -// if (style == LinkStyle.__toremove_INTERFACE_PROVIDER || style == LinkStyle.__toremove_INTERFACE_USER) { -// final Decor decor = new DecorInterfaceProvider(style); -// final Map all = dotPath.somePoints(); -// final Point2D p = getFarest(outPoint, inPoint, all.keySet()); -// -// ug = ug.apply(new UChangeBackColor(rose.getHtmlColor(param, ColorParam.background))); -// ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder))); -// -// decor.drawDecor(ug, p, all.get(p)); -// } - - throw new UnsupportedOperationException(); -// ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder))); -// if (linkType.isDashed()) { -// goDash(ug); -// } -// ug.draw(dotPath); -// if (linkType.isDashed()) { -// noDash(ug); -// } - } - - private double atan2(final Point2D endPath, final Point2D inPoint) { - final double y = -endPath.getX() + inPoint.getX(); - final double x = endPath.getY() - inPoint.getY(); - final double angle = Math.atan2(y, x); - // Log.println("x=" + x + " y=" + y + " angle=" + angle + " " + angle * 180.0 / Math.PI); - return angle; - } - - private Point2D drawSymbol(UGraphic ug, double theta, final Point2D position, LinkDecor decor) { - // if (1==1) { - // return null; - // } - // Point2D middle1 = null; - // // final double theta = Math.atan2( - // // -direction.getX() + position.getX(), direction.getY() - // // - position.getY()); - // if (decor == LinkDecor.SQUARRE) { - // middle1 = drawSquare(ug, position.getX(), position.getY()); - // } else if (decor == LinkDecor.EXTENDS) { - // middle1 = drawExtends(ug, position.getX(), position.getY(), theta); - // } else if (decor == LinkDecor.AGREGATION) { - // ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.background)); - // ug.getParam().setColor(rose.getHtmlColor(param, ColorParam.classBorder)); - // middle1 = drawDiamond(ug, position.getX(), position.getY(), theta); - // } else if (decor == LinkDecor.COMPOSITION) { - // ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.classBorder)); - // ug.getParam().setColor(null); - // middle1 = drawDiamond(ug, position.getX(), position.getY(), theta); - // } else if (decor == LinkDecor.NONE) { - // middle1 = position; - // } else if (decor == LinkDecor.ARROW) { - // ug.getParam().setBackcolor(rose.getHtmlColor(param, ColorParam.classBorder)); - // ug.getParam().setColor(rose.getHtmlColor(param, ColorParam.classBorder)); - // middle1 = drawArrow(ug, position.getX(), position.getY(), theta); - // } - // return middle1; - throw new UnsupportedOperationException(); - } - - private CubicCurve2D.Double getLine(final Point2D p1, Point2D p2) { - return new CubicCurve2D.Double(p1.getX(), p1.getY(), p1.getX(), p1.getY(), p2.getX(), p2.getY(), p2.getX(), - p2.getY()); - } - - private static Point2D getFarest(Point2D p1, Point2D p2, Collection all) { - Point2D result = null; - double farest = 0; - for (Point2D p : all) { - if (result == null) { - result = p; - farest = p1.distanceSq(result) + p2.distanceSq(result); - continue; - } - final double candidat = p1.distanceSq(p) + p2.distanceSq(p); - if (candidat < farest) { - result = p; - farest = candidat; - } - } - if (result == null) { - throw new IllegalArgumentException(); - } - return result; - } - - private Point2D drawSquare(UGraphic ug, double centerX, double centerY) { - ug = ug.apply(new UChangeBackColor(rose.getHtmlColor(param, ColorParam.classBackground))); - ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder))); - final double width = 10; - final double height = 10; - ug.apply(new UTranslate(centerX - width / 2, centerY - height / 2)).draw(new URectangle(width, height)); - return new Point2D.Double(centerX, centerY); - } - - Point2D drawExtends(UGraphic ug, double x, double y, double theta) { - ug = ug.apply(new UChangeBackColor(rose.getHtmlColor(param, ColorParam.background))); - ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder))); - - // final double theta = Math.atan2(-pathPoint.getX() + x, - // pathPoint.getY() - y); - - final UPolygon triangle = new UPolygon(); - triangle.addPoint(0, 1); - final double width = 18; - final double height = 26; - triangle.addPoint(-width / 2, height); - triangle.addPoint(width / 2, height); - triangle.rotate(theta); - ug.apply(new UTranslate(x, y)).draw(triangle); - - final Point2D middle = BezierUtils.middle(triangle.getPoints().get(1), triangle.getPoints().get(2)); - middle.setLocation(middle.getX() + x, middle.getY() + y); - return middle; - } - - private Point2D drawDiamond(UGraphic ug, double x, double y, double theta) { - - // final double theta = Math.atan2(-pathPoint.getX() + x, - // pathPoint.getY() - y); - - final UPolygon triangle = new UPolygon(); - triangle.addPoint(0, 0); - final double width = 10; - final double height = 14; - triangle.addPoint(-width / 2, height / 2); - triangle.addPoint(0, height); - triangle.addPoint(width / 2, height / 2); - triangle.rotate(theta); - ug.apply(new UTranslate(x, y)).draw(triangle); - - final Point2D middle = triangle.getPoints().get(2); - middle.setLocation(middle.getX() + x, middle.getY() + y); - return middle; - - } - - private Point2D drawArrow(UGraphic ug, double x, double y, double theta) { - - // final double theta = Math.atan2(-pathPoint.getX() + x, - // pathPoint.getY() - y); - - final UPolygon triangle = new UPolygon(); - triangle.addPoint(0, 0); - final double width = 12; - final double height = 10; - triangle.addPoint(-width / 2, height); - final double height2 = 4; - triangle.addPoint(0, height2); - triangle.addPoint(width / 2, height); - triangle.rotate(theta); - ug.apply(new UTranslate(x, y)).draw(triangle); - - final Point2D middle = triangle.getPoints().get(2); - middle.setLocation(middle.getX() + x, middle.getY() + y); - return middle; - } - - private Point2D nullIfContained(Point2D p, Positionable start, Positionable end) { - if (PositionableUtils.contains(start, p)) { - return null; - } - if (PositionableUtils.contains(end, p)) { - return null; - } - return p; - } - - // private void drawPath(UGraphic ug, PointList points, Positionable start, - // Positionable end) { - // Decor decor = new DecorInterfaceProvider(); - // Point2D last = null; - // final int nb = 10; - // final double t1 = - // points.getIntersectionDouble(PositionableUtils.convert(start)); - // final double t2 = - // points.getIntersectionDouble(PositionableUtils.convert(end)); - // for (int i = 0; i <= nb; i++) { - // final double d = t1 + (t2 - t1) * i / nb; - // final Point2D cur = nullIfContained(points.getPoint(d), start, end); - // if (last != null && cur != null) { - // ug.draw(last.getX(), last.getY(), new ULine(cur.getX() - last.getX(), - // cur.getY() - last.getY())); - // if (decor != null) { - // decor.drawLine(ug, last, cur); - // decor = null; - // } - // } - // last = cur; - // } - // - // for (Point2D p : points.getPoints()) { - // ug.draw(p.getX() - 1, p.getY() - 1, new UEllipse(2, 2)); - // } - // } - -} diff --git a/src/net/sourceforge/plantuml/posimo/Racorder.java b/src/net/sourceforge/plantuml/posimo/Racorder.java deleted file mode 100644 index 05a2858..0000000 --- a/src/net/sourceforge/plantuml/posimo/Racorder.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Line2D; -import java.awt.geom.Rectangle2D; - -public interface Racorder { - public DotPath getRacordIn(Rectangle2D rect, Line2D tangeante); - public DotPath getRacordOut(Rectangle2D rect, Line2D tangeante); -} diff --git a/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java b/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java deleted file mode 100644 index f6c478e..0000000 --- a/src/net/sourceforge/plantuml/posimo/RacorderAbstract.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Line2D; -import java.awt.geom.Rectangle2D; - -public abstract class RacorderAbstract implements Racorder { - - public final DotPath getRacordOut(Rectangle2D rect, Line2D tangeante) { - tangeante = symetric(tangeante); - return getRacordIn(rect, tangeante).reverse(); - } - - private static Line2D symetric(Line2D line) { - final double x1 = line.getX1(); - final double y1 = line.getY1(); - final double x2 = line.getX2(); - final double y2 = line.getY2(); - final double dx = x2 - x1; - final double dy = y2 - y1; - return new Line2D.Double(x1, y1, x1 - dx, y1 - dy); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java b/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java deleted file mode 100644 index e9af35e..0000000 --- a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeante.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - -public class RacorderFollowTangeante extends RacorderAbstract implements Racorder { - - public DotPath getRacordIn(Rectangle2D rect, Line2D tangeante) { - -// Log.println("rect x=" + rect.getX() + " y=" + rect.getY() + " w=" + rect.getWidth() + " h=" -// + rect.getHeight()); -// Log.println("tangeante (" + tangeante.getX1() + "," + tangeante.getY1() + ") (" + tangeante.getX2() -// + "," + tangeante.getY2() + ")"); - - final DotPath result = new DotPath(); - - // final Point2D inter = BezierUtils.intersect((Line2D.Double) - // tangeante, rect); - Point2D inter = new LineRectIntersection(tangeante, rect).getIntersection(); -// Log.println("inter=" + inter); - - if (inter == null) { - final Point2D p1 = new Point2D.Double(rect.getMinX(), rect.getMinY()); - final Point2D p2 = new Point2D.Double(rect.getMaxX(), rect.getMinY()); - final Point2D p3 = new Point2D.Double(rect.getMaxX(), rect.getMaxY()); - final Point2D p4 = new Point2D.Double(rect.getMinX(), rect.getMaxY()); - - inter = LineRectIntersection.getCloser(tangeante.getP1(), p1, p2, p3, p4); - } - - final CubicCurve2D.Double curv = new CubicCurve2D.Double(tangeante.getX1(), tangeante.getY1(), - tangeante.getX1(), tangeante.getY1(), inter.getX(), inter.getY(), inter.getX(), inter.getY()); - return result.addAfter(curv); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java b/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java deleted file mode 100644 index ea15f31..0000000 --- a/src/net/sourceforge/plantuml/posimo/RacorderFollowTangeanteOld.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - -public class RacorderFollowTangeanteOld extends RacorderAbstract implements Racorder { - - public DotPath getRacordIn(Rectangle2D rect, Line2D tangeante) { - - final DotPath result = new DotPath(); - - final Point2D center = new Point2D.Double(rect.getCenterX(), rect.getCenterY()); - final Line2D.Double line = new Line2D.Double(tangeante.getP1(), center); - final Point2D inter = BezierUtils.intersect(line, rect); - - final CubicCurve2D.Double curv = new CubicCurve2D.Double(tangeante.getX1(), tangeante.getY1(), tangeante - .getX2(), tangeante.getY2(), tangeante.getX2(), tangeante.getY2(), inter.getX(), inter.getY()); - return result.addAfter(curv); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java b/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java deleted file mode 100644 index 606b200..0000000 --- a/src/net/sourceforge/plantuml/posimo/RacorderInToCenter.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - -public class RacorderInToCenter extends RacorderAbstract implements Racorder { - - public DotPath getRacordIn(Rectangle2D rect, Line2D tangeante) { - final DotPath result = new DotPath(); - - final Point2D center = new Point2D.Double(rect.getCenterX(), rect.getCenterY()); - final Line2D.Double line = new Line2D.Double(tangeante.getP1(), center); - final Point2D inter = BezierUtils.intersect(line, rect); - - final CubicCurve2D.Double curv = new CubicCurve2D.Double(line.getX1(), line.getY1(), line.getX1(), - line.getY1(), inter.getX(), inter.getY(), inter.getX(), inter.getY()); - return result.addAfter(curv); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java b/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java deleted file mode 100644 index 65ab209..0000000 --- a/src/net/sourceforge/plantuml/posimo/RacorderOrthogonal.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.CubicCurve2D; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - -public class RacorderOrthogonal extends RacorderAbstract implements Racorder { - - public DotPath getRacordIn(Rectangle2D rect, Line2D tangeante) { - - final Point2D in = tangeante.getP1(); - - final DotPath result = new DotPath(); - Point2D inter = null; - - if (in.getX() > rect.getMinX() && in.getX() < rect.getMaxX()) { - if (in.getY() < rect.getMinY()) { - inter = new Point2D.Double(in.getX(), rect.getMinY()); - } else if (in.getY() > rect.getMaxY()) { - inter = new Point2D.Double(in.getX(), rect.getMaxY()); - } else { - throw new IllegalArgumentException(); - } - } else if (in.getY() > rect.getMinY() && in.getY() < rect.getMaxY()) { - if (in.getX() < rect.getMinX()) { - inter = new Point2D.Double(rect.getMinX(), in.getY()); - } else if (in.getX() > rect.getMaxX()) { - inter = new Point2D.Double(rect.getMaxX(), in.getY()); - } else { - throw new IllegalArgumentException(); - } - } else { - final Point2D p1 = new Point2D.Double(rect.getMinX(), rect.getMinY()); - final Point2D p2 = new Point2D.Double(rect.getMaxX(), rect.getMinY()); - final Point2D p3 = new Point2D.Double(rect.getMaxX(), rect.getMaxY()); - final Point2D p4 = new Point2D.Double(rect.getMinX(), rect.getMaxY()); - - inter = LineRectIntersection.getCloser(tangeante.getP1(), p1, p2, p3, p4); - - } - - final CubicCurve2D.Double curv = new CubicCurve2D.Double(tangeante.getX1(), tangeante.getY1(), - tangeante.getX1(), tangeante.getY1(), inter.getX(), inter.getY(), inter.getX(), inter.getY()); - return result.addAfter(curv); - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java b/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java deleted file mode 100644 index 37169ea..0000000 --- a/src/net/sourceforge/plantuml/posimo/SimpleDrawer.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.Collection; - -public class SimpleDrawer { - - private final Cluster root; - private final Collection paths; - - public SimpleDrawer(Cluster root, Collection paths) { - this.root = root; - this.paths = paths; - } - - public void draw(Graphics2D g2d) { - g2d.setColor(Color.BLACK); - for (Clusterable cl : root.getContents()) { - final Block b = (Block) cl; - final Point2D pos = b.getPosition(); - final Dimension2D dim = b.getSize(); - // drawRectCentered(g2d, pos, dim); - drawRect(g2d, pos, dim); - } - - g2d.setColor(Color.GREEN); - for (Path p : paths) { - final Label label = p.getLabel(); - final Point2D labelPos = label.getPosition(); - final Dimension2D labelDim = label.getSize(); - // final double x1 = labelPos.getX(); - // final double y1 = labelPos.getY(); - // g2d.draw(new Ellipse2D.Double(x1 - 1, y1 - 1, 3, 3)); - // drawRectCentered(g2d, labelPos, labelDim); - drawRect(g2d, labelPos, labelDim); - } - - g2d.setColor(Color.RED); - for (Path p : paths) { - p.getDotPath().draw(g2d, 0, 0); - } - - for (Cluster sub : root.getSubClusters()) { - new SimpleDrawer(sub, new ArrayList()).draw(g2d); - } - - } - - private void drawRectCentered(Graphics2D g2d, final Point2D pos, final Dimension2D dim) { - final Rectangle2D rect = new Rectangle2D.Double(pos.getX() - dim.getWidth() / 2, pos.getY() - dim.getHeight() - / 2, dim.getWidth(), dim.getHeight()); - g2d.draw(rect); - } - - private void drawRect(Graphics2D g2d, final Point2D pos, final Dimension2D dim) { - final Rectangle2D rect = new Rectangle2D.Double(pos.getX(), pos.getY(), dim.getWidth(), dim.getHeight()); - g2d.draw(rect); - } -} diff --git a/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java b/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java deleted file mode 100644 index 963496e..0000000 --- a/src/net/sourceforge/plantuml/posimo/TwoLinesIntersection.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.posimo; - -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; - -public class TwoLinesIntersection { - - private final Point2D inter; - - public TwoLinesIntersection(Line2D lineA, Line2D lineB) { - final double x1 = lineA.getX1(); - final double y1 = lineA.getY1(); - final double x2 = lineA.getX2(); - final double y2 = lineA.getY2(); - final double x3 = lineB.getX1(); - final double y3 = lineB.getY1(); - final double x4 = lineB.getX2(); - final double y4 = lineB.getY2(); - - final double den = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1); - - final double uA1 = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3); - final double uA = uA1 / den; - - // final double uB1 = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3); - // uB = uB1 / den; - - final double x = x1 + uA * (x2 - x1); - final double y = y1 + uA * (y2 - y1); - - inter = new Point2D.Double(x, y); - } - - public final Point2D getIntersection() { - return inter; - } - -} diff --git a/src/net/sourceforge/plantuml/posimo/data.txt b/src/net/sourceforge/plantuml/posimo/data.txt deleted file mode 100644 index 2fe8aec..0000000 --- a/src/net/sourceforge/plantuml/posimo/data.txt +++ /dev/null @@ -1,38 +0,0 @@ -@startuml -interface Positionable { - + Dimension2D getSize(); - + Point2D getPosition(); -} - -interface Clusterable { - +Cluster getParent(); -} - -Positionable <|-- Clusterable - -class Cluster - -Cluster *-- Cluster : subclusters -Clusterable <|.. Cluster -Cluster *-- Block -Clusterable <|.. Block - -Path *-- "2" Cluster -Path --> Label : has one -Positionable <|-- Label - -SimpleDrawer --> Cluster -SimpleDrawer *--> Path - -class GraphvizSolver { - + Dimension2D solve(Cluster root, Collection paths) -} -GraphvizSolver --> Cluster -GraphvizSolver *--> Path - - -'Clusterable --> Cluster : Parent - - - -@enduml diff --git a/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java b/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java deleted file mode 100644 index 2f6a554..0000000 --- a/src/net/sourceforge/plantuml/project/BasicInstantArithmetic.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class BasicInstantArithmetic implements InstantArithmetic { - - private final DayClose dayClose; - - BasicInstantArithmetic(DayClose dayClose) { - if (dayClose == null) { - throw new IllegalArgumentException(); - } - this.dayClose = dayClose; - } - - public Instant add(Instant i1, Duration duration) { - Instant result = i1; - final long min = duration.getMinutes(); - if (min < 0) { - throw new IllegalArgumentException(); - } - for (long i = 0; i < min; i += 24 * 60 * 60) { - result = result.next(dayClose); - } - return result; - } - - public Instant sub(Instant i1, Duration duration) { - Instant result = i1; - final long min = duration.getMinutes(); - if (min < 0) { - throw new IllegalArgumentException(); - } - for (long i = 0; i < min; i += 24 * 60 * 60) { - result = result.prev(dayClose); - } - return result; - } - - public Duration diff(Instant i1, Instant i2) { - if (i2.compareTo(i1) < 0) { - throw new IllegalArgumentException(); - } - long minutes = 0; - while (i2.compareTo(i1) > 0) { - minutes += 24 * 60 * 60; - i1 = i1.next(null); - } - return new Duration(minutes); - } -} diff --git a/src/net/sourceforge/plantuml/project/Constant.java b/src/net/sourceforge/plantuml/project/Constant.java deleted file mode 100644 index d76b5a3..0000000 --- a/src/net/sourceforge/plantuml/project/Constant.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class Constant implements Expression { - - private final Numeric value; - - public Constant(Numeric value) { - this.value = value; - } - - public String getDescription() { - return "Constant:" + value; - } - - public NumericType getNumericType() { - return value.getNumericType(); - } - - public Numeric getValue() { - return value; - } - -} diff --git a/src/net/sourceforge/plantuml/project/Day.java b/src/net/sourceforge/plantuml/project/Day.java deleted file mode 100644 index 5cba10e..0000000 --- a/src/net/sourceforge/plantuml/project/Day.java +++ /dev/null @@ -1,177 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.Calendar; -import java.util.GregorianCalendar; - -public class Day implements Comparable { - - private final int numDay; - private final Month month; - private final int year; - private final WeekDay weekDay; - - private Day(int year, Month month, int numDay, WeekDay weekDay) { - this.year = year; - this.month = month; - this.numDay = numDay; - this.weekDay = weekDay; - } - - public static boolean isValidDesc(String desc) { - if (desc.matches("^\\d{4}/\\d{2}/\\d{2}$")) { - return true; - } - if (desc.matches("^\\d{2}-[A-Za-z]{3}-\\d{4}$")) { - return true; - } - return false; - } - - public Day(String desc) { - if (desc.matches("^\\d{4}/\\d{2}/\\d{2}$")) { - this.year = Integer.parseInt(desc.substring(0, 4)); - this.month = Month.fromNum(Integer.parseInt(desc.substring(5, 7))); - this.numDay = Integer.parseInt(desc.substring(8, 10)); - } else if (desc.matches("^\\d{2}-[A-Za-z]{3}-\\d{4}$")) { - this.year = Integer.parseInt(desc.substring(7, 11)); - this.month = Month.valueOf(desc.substring(3, 6)); - this.numDay = Integer.parseInt(desc.substring(0, 2)); - } else { - throw new IllegalArgumentException(desc); - } - final int wd = new GregorianCalendar(year, month.getNum() - 1, numDay).get(Calendar.DAY_OF_WEEK); - this.weekDay = WeekDay.values()[wd - 1]; - } - - public Day next(DayClose dayClose) { - if (dayClose == null) { - return nextInternal(); - } - if (dayClose.isClose(this)) { - throw new IllegalArgumentException(); - } - Day result = nextInternal(); - while (dayClose.isClose(result)) { - result = result.nextInternal(); - } - return result; - } - - public Day prev(DayClose dayClose) { - if (dayClose == null) { - return prevInternal(); - } - if (dayClose.isClose(this)) { - throw new IllegalArgumentException(); - } - Day result = prevInternal(); - while (dayClose.isClose(result)) { - result = result.prevInternal(); - } - return result; - } - - private Day nextInternal() { - if (numDay < month.getNbDays(year)) { - return new Day(year, month, numDay + 1, weekDay.next()); - } - final Month next = month.next(); - if (next == null) { - return new Day(year + 1, Month.JAN, 1, weekDay.next()); - } - return new Day(year, next, 1, weekDay.next()); - } - - private Day prevInternal() { - if (numDay > 1) { - return new Day(year, month, numDay - 1, weekDay.prev()); - } - final Month prev = month.prev(); - if (prev == null) { - return new Day(year - 1, Month.DEC, 31, weekDay.prev()); - } - return new Day(year, prev, prev.getNbDays(year), weekDay.prev()); - } - - @Override - public String toString() { - return "" + weekDay + " " + year + "-" + month + "-" + String.format("%02d", numDay); - } - - public final int getNumDay() { - return numDay; - } - - public final Month getMonth() { - return month; - } - - public final int getYear() { - return year; - } - - public int compareTo(Day other) { - if (year > other.year) { - return 1; - } - if (year < other.year) { - return -1; - } - final int cmpMonth = month.compareTo(other.month); - if (cmpMonth != 0) { - return cmpMonth; - } - return numDay - other.numDay; - } - - @Override - public boolean equals(Object obj) { - final Day this2 = (Day) obj; - return this.numDay == this2.numDay && this.month == this2.month && this.year == this2.year; - } - - @Override - public int hashCode() { - return numDay * 420 + year + month.hashCode(); - } - - public final WeekDay getWeekDay() { - return weekDay; - } - -} diff --git a/src/net/sourceforge/plantuml/project/DayClose.java b/src/net/sourceforge/plantuml/project/DayClose.java deleted file mode 100644 index 676bc55..0000000 --- a/src/net/sourceforge/plantuml/project/DayClose.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -interface DayClose { - - boolean isClose(Day day); - -} diff --git a/src/net/sourceforge/plantuml/project/DayCloseNone.java b/src/net/sourceforge/plantuml/project/DayCloseNone.java deleted file mode 100644 index 4add1aa..0000000 --- a/src/net/sourceforge/plantuml/project/DayCloseNone.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class DayCloseNone implements DayClose { - - public boolean isClose(Day day) { - return false; - } - -} diff --git a/src/net/sourceforge/plantuml/project/DayCloseOr.java b/src/net/sourceforge/plantuml/project/DayCloseOr.java deleted file mode 100644 index ce91e1d..0000000 --- a/src/net/sourceforge/plantuml/project/DayCloseOr.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.ArrayList; -import java.util.List; - -class DayCloseOr implements DayClose { - - private final List all = new ArrayList(); - - public boolean isClose(Day day) { - for (DayClose dc : all) { - if (dc.isClose(day)) { - return true; - } - } - return false; - } - - public void add(DayClose dayClose) { - all.add(dayClose); - } - -} diff --git a/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java b/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java deleted file mode 100644 index 5b0ff6f..0000000 --- a/src/net/sourceforge/plantuml/project/DayCloseWeekDay.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class DayCloseWeekDay implements DayClose { - - private final WeekDay weekDay; - - public DayCloseWeekDay(WeekDay weekDay) { - this.weekDay = weekDay; - } - - public boolean isClose(Day day) { - if (day.getWeekDay() == weekDay) { - return true; - } - return false; - } - -} diff --git a/src/net/sourceforge/plantuml/project/Duration.java b/src/net/sourceforge/plantuml/project/Duration.java deleted file mode 100644 index 05f562d..0000000 --- a/src/net/sourceforge/plantuml/project/Duration.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class Duration implements Numeric { - - private final long minutes; - - public Duration(long minutes) { - this.minutes = minutes; - } - - public Duration(NumericNumber value) { - this(value.getIntValue() * 24L * 60 * 60); - } - - public Numeric add(Numeric other) { - return new Duration(((Duration) other).minutes + minutes); - } - - public static Duration of(long days) { - return new Duration(days * 24 * 60 * 60); - } - - public NumericType getNumericType() { - return NumericType.DURATION; - } - - public long getMinutes() { - return minutes; - } - - @Override - public String toString() { - return "DURATION:" + minutes / (24 * 60 * 60); - } - - public int compareTo(Numeric other) { - final Duration this2 = (Duration) other; - if (this2.minutes > minutes) { - return -1; - } - if (this2.minutes < minutes) { - return 1; - } - return 0; - } - -} diff --git a/src/net/sourceforge/plantuml/project/Expression.java b/src/net/sourceforge/plantuml/project/Expression.java deleted file mode 100644 index 61b6fc6..0000000 --- a/src/net/sourceforge/plantuml/project/Expression.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -public interface Expression { - - Numeric getValue(); - - String getDescription(); - - NumericType getNumericType(); - -} diff --git a/src/net/sourceforge/plantuml/project/Formal.java b/src/net/sourceforge/plantuml/project/Formal.java deleted file mode 100644 index 2f6f960..0000000 --- a/src/net/sourceforge/plantuml/project/Formal.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -interface Formal extends Expression { - -} diff --git a/src/net/sourceforge/plantuml/project/FormalAddition.java b/src/net/sourceforge/plantuml/project/FormalAddition.java deleted file mode 100644 index 212c333..0000000 --- a/src/net/sourceforge/plantuml/project/FormalAddition.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class FormalAddition implements Formal { - - private final Expression exp1; - private final Expression exp2; - - public FormalAddition(Expression exp1, Expression exp2) { - this.exp1 = exp1; - this.exp2 = exp2; - } - - public String getDescription() { - return "add " + exp1 + " " + exp2; - } - - public NumericType getNumericType() { - return exp1.getNumericType(); - } - - public Numeric getValue() { - return exp1.getValue().add(exp2.getValue()); - } - -} diff --git a/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java b/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java deleted file mode 100644 index 0e6a135..0000000 --- a/src/net/sourceforge/plantuml/project/FormalAdditionInstantDuration.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class FormalAdditionInstantDuration implements Formal { - - private final Expression exp1; - private final Expression exp2; - private final InstantArithmetic math; - - public FormalAdditionInstantDuration(Expression exp1, Expression exp2, InstantArithmetic math) { - this.exp1 = exp1; - this.exp2 = exp2; - this.math = math; - } - - public String getDescription() { - return "addID " + exp1 + " " + exp2; - } - - public NumericType getNumericType() { - return exp1.getNumericType(); - } - - public Numeric getValue() { - if (exp2.getNumericType() == NumericType.NUMBER) { - final Duration d = new Duration((NumericNumber) exp2.getValue()); - return math.add((Instant) exp1.getValue(), d); - } - - return math.add((Instant) exp1.getValue(), (Duration) exp2.getValue()); - } - -} diff --git a/src/net/sourceforge/plantuml/project/FreeVariable.java b/src/net/sourceforge/plantuml/project/FreeVariable.java deleted file mode 100644 index c72933d..0000000 --- a/src/net/sourceforge/plantuml/project/FreeVariable.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class FreeVariable implements Expression { - - private Expression value; - private final String name; - private final NumericType type; - - public FreeVariable(String name, NumericType type) { - this.name = name; - this.type = type; - } - - public String getDescription() { - return "$" + name + "=" + (value == null ? "null" : value.getDescription()); - } - - public NumericType getNumericType() { - return type; - } - - public Numeric getValue() { - if (value == null) { - return null; - } - return value.getValue(); - } - - public void setValue(Expression expression) { - if (expression.getNumericType() != type) { - throw new IllegalArgumentException("Bad type"); - } - this.value = expression; - } - -} diff --git a/src/net/sourceforge/plantuml/project/IncompleteItem.java b/src/net/sourceforge/plantuml/project/IncompleteItem.java deleted file mode 100644 index 96b5012..0000000 --- a/src/net/sourceforge/plantuml/project/IncompleteItem.java +++ /dev/null @@ -1,192 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.List; -import java.util.Map; - -class IncompleteItem implements Item { - - private Map data = new EnumMap(ItemCaract.class); - - private final InstantArithmetic math; - - private final Item parent; - - private final String code; - - public IncompleteItem(String code, Item parent, InstantArithmetic math) { - this.math = math; - this.code = code; - this.parent = parent; - } - - public void setData(ItemCaract caract, Numeric value) { - if (caract.getNumericType() != value.getNumericType()) { - throw new IllegalArgumentException(); - } - if (data.containsKey(caract.getNumericType())) { - throw new IllegalStateException(); - } - data.put(caract, value); - boolean change = false; - do { - change = false; - change = eventuallyUseBeginComplete() || change; - change = eventuallyUseBeginDuration() || change; - change = eventuallyUseCompleteDuration() || change; - change = eventuallyUseDurationWork() || change; - change = eventuallyUseDurationLoad() || change; - change = eventuallyUseLoadWork() || change; - } while (change); - } - - private boolean eventuallyUseDurationWork() { - if (data.containsKey(ItemCaract.DURATION) && data.containsKey(ItemCaract.WORK) - && data.containsKey(ItemCaract.LOAD) == false) { - final Duration d = (Duration) data.get(ItemCaract.DURATION); - final NumericNumber w = (NumericNumber) data.get(ItemCaract.WORK); - data.put(ItemCaract.LOAD, new Load(d.getMinutes() * w.getIntValue())); - return true; - } - return false; - } - - private boolean eventuallyUseLoadWork() { - if (data.containsKey(ItemCaract.LOAD) && data.containsKey(ItemCaract.WORK) - && data.containsKey(ItemCaract.DURATION) == false) { - final Load l = (Load) data.get(ItemCaract.LOAD); - final NumericNumber w = (NumericNumber) data.get(ItemCaract.WORK); - data.put(ItemCaract.DURATION, new Duration(l.getMinuteMen() / w.getIntValue())); - return true; - } - return false; - } - - private boolean eventuallyUseDurationLoad() { - if (data.containsKey(ItemCaract.DURATION) && data.containsKey(ItemCaract.LOAD) - && data.containsKey(ItemCaract.WORK) == false) { - final Duration d = (Duration) data.get(ItemCaract.DURATION); - final Load l = (Load) data.get(ItemCaract.LOAD); - data.put(ItemCaract.WORK, new NumericNumber((int) (l.getMinuteMen() / d.getMinutes()))); - return true; - } - return false; - } - - private boolean eventuallyUseBeginDuration() { - if (data.containsKey(ItemCaract.BEGIN) && data.containsKey(ItemCaract.DURATION) - && data.containsKey(ItemCaract.COMPLETED) == false) { - final Instant i1 = (Instant) data.get(ItemCaract.BEGIN); - final Duration d = (Duration) data.get(ItemCaract.DURATION); - data.put(ItemCaract.COMPLETED, math.add(i1, d)); - return true; - } - return false; - } - - private boolean eventuallyUseCompleteDuration() { - if (data.containsKey(ItemCaract.COMPLETED) && data.containsKey(ItemCaract.DURATION) - && data.containsKey(ItemCaract.BEGIN) == false) { - final Instant i2 = (Instant) data.get(ItemCaract.COMPLETED); - final Duration d = (Duration) data.get(ItemCaract.DURATION); - data.put(ItemCaract.BEGIN, math.sub(i2, d)); - return true; - } - return false; - } - - private boolean eventuallyUseBeginComplete() { - if (data.containsKey(ItemCaract.BEGIN) && data.containsKey(ItemCaract.COMPLETED) - && data.containsKey(ItemCaract.DURATION) == false) { - final Instant i1 = (Instant) data.get(ItemCaract.BEGIN); - final Instant i2 = (Instant) data.get(ItemCaract.COMPLETED); - if (i2.compareTo(i1) <= 0) { - throw new IllegalArgumentException(); - } - data.put(ItemCaract.DURATION, math.diff(i1, i2)); - return true; - } - return false; - } - - public boolean isValid() { - return data.size() == EnumSet.allOf(ItemCaract.class).size(); - } - - public Instant getBegin() { - return (Instant) data.get(ItemCaract.BEGIN); - } - - public Instant getCompleted() { - return (Instant) data.get(ItemCaract.COMPLETED); - } - - public Duration getDuration() { - return (Duration) data.get(ItemCaract.DURATION); - } - - public Load getLoad() { - return (Load) data.get(ItemCaract.LOAD); - } - - public NumericNumber getWork() { - return (NumericNumber) data.get(ItemCaract.WORK); - } - - public boolean isLeaf() { - return true; - } - - public Item getParent() { - return parent; - } - - public List getChildren() { - return null; - } - - public String getCode() { - return code; - } - - @Override - public String toString() { - return code + " " + data.toString(); - } -} diff --git a/src/net/sourceforge/plantuml/project/Instant.java b/src/net/sourceforge/plantuml/project/Instant.java deleted file mode 100644 index c9afe8a..0000000 --- a/src/net/sourceforge/plantuml/project/Instant.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -public class Instant implements Numeric { - - private final Day value; - - public Instant(Day d) { - this.value = d; - } - - public Numeric add(Numeric other) { - throw new UnsupportedOperationException(); - } - - public NumericType getNumericType() { - return NumericType.INSTANT; - } - - public Day getDay() { - return value; - } - - public Instant next(DayClose dayClose) { - return new Instant(value.next(dayClose)); - } - - public Instant prev(DayClose dayClose) { - return new Instant(value.prev(dayClose)); - } - - @Override - public String toString() { - return "Instant:" + value; - } - - public int compareTo(Numeric other) { - final Instant this2 = (Instant) other; - return value.compareTo(this2.value); - } - - @Override - public int hashCode() { - return value.hashCode(); - } - - @Override - public boolean equals(Object obj) { - final Instant other = (Instant) obj; - return value.equals(other.value); - } - -} diff --git a/src/net/sourceforge/plantuml/project/InstantArithmetic.java b/src/net/sourceforge/plantuml/project/InstantArithmetic.java deleted file mode 100644 index 2baf2c8..0000000 --- a/src/net/sourceforge/plantuml/project/InstantArithmetic.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -interface InstantArithmetic { - - public Instant add(Instant i1, Duration duration); - - public Instant sub(Instant i1, Duration duration); - - public Duration diff(Instant i1, Instant i2); -} diff --git a/src/net/sourceforge/plantuml/project/Item.java b/src/net/sourceforge/plantuml/project/Item.java deleted file mode 100644 index 9c871a1..0000000 --- a/src/net/sourceforge/plantuml/project/Item.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.List; - -public interface Item { - - Instant getBegin(); - - Instant getCompleted(); - - Duration getDuration(); - - Load getLoad(); - - NumericNumber getWork(); - - boolean isLeaf(); - - Item getParent(); - - List getChildren(); - - public String getCode(); - - public boolean isValid(); - -} diff --git a/src/net/sourceforge/plantuml/project/ItemCaract.java b/src/net/sourceforge/plantuml/project/ItemCaract.java deleted file mode 100644 index 7399124..0000000 --- a/src/net/sourceforge/plantuml/project/ItemCaract.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -enum ItemCaract { - BEGIN(NumericType.INSTANT), // - COMPLETED(NumericType.INSTANT), // - DURATION(NumericType.DURATION), // - LOAD(NumericType.LOAD), // - WORK(NumericType.NUMBER); - - private final NumericType type; - - private ItemCaract(NumericType type) { - this.type = type; - } - - public NumericType getNumericType() { - return type; - } - - public Numeric getData(Item item) { - if (this == BEGIN) { - return item.getBegin(); - } - if (this == COMPLETED) { - return item.getCompleted(); - } - if (this == DURATION) { - return item.getDuration(); - } - if (this == LOAD) { - return item.getLoad(); - } - if (this == WORK) { - return item.getWork(); - } - throw new UnsupportedOperationException(); - } -} diff --git a/src/net/sourceforge/plantuml/project/ItemComparator.java b/src/net/sourceforge/plantuml/project/ItemComparator.java deleted file mode 100644 index c18e5e0..0000000 --- a/src/net/sourceforge/plantuml/project/ItemComparator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.Comparator; - -public class ItemComparator implements Comparator { - - public int compare(Item it1, Item it2) { - final int cmp1 = it1.getBegin().compareTo(it2.getBegin()); - if (cmp1 != 0) { - return cmp1; - } - if (it1 instanceof Jalon && it2 instanceof Jalon == false) { - return -1; - } - if (it2 instanceof Jalon && it1 instanceof Jalon == false) { - return 1; - } - final int cmp2 = it2.getCompleted().compareTo(it1.getCompleted()); - if (cmp2 != 0) { - return cmp2; - } - return it1.getCode().compareTo(it2.getCode()); - } - -} diff --git a/src/net/sourceforge/plantuml/project/Jalon.java b/src/net/sourceforge/plantuml/project/Jalon.java deleted file mode 100644 index a82dd83..0000000 --- a/src/net/sourceforge/plantuml/project/Jalon.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.List; - -public class Jalon implements Item { - - private Instant begin; - private final String code; - private final Item parent; - - public Jalon(String code, Item parent) { - this.code = code; - this.parent = parent; - } - - public Instant getBegin() { - return begin; - } - - public Instant getCompleted() { - return begin; - } - - public Duration getDuration() { - return new Duration(0); - } - - public Load getLoad() { - return new Load(0); - } - - public NumericNumber getWork() { - return new NumericNumber(1); - } - - public boolean isLeaf() { - return true; - } - - public Item getParent() { - return parent; - } - - public List getChildren() { - return null; - } - - public String getCode() { - return code; - } - - public boolean isValid() { - return begin != null; - } - - public void setInstant(Numeric value) { - this.begin = (Instant) value; - } - -} diff --git a/src/net/sourceforge/plantuml/project/Load.java b/src/net/sourceforge/plantuml/project/Load.java deleted file mode 100644 index a4f7b19..0000000 --- a/src/net/sourceforge/plantuml/project/Load.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class Load implements Numeric { - - private final long minuteMen; - - public Load(long minuteMen) { - this.minuteMen = minuteMen; - } - - public Load(NumericNumber value) { - this(value.getIntValue() * 24L * 60 * 60); - } - - public Numeric add(Numeric other) { - return new Load(((Load) other).minuteMen + minuteMen); - } - - public NumericType getNumericType() { - return NumericType.LOAD; - } - - public int compareTo(Numeric other) { - final Load this2 = (Load) other; - if (this2.minuteMen > minuteMen) { - return -1; - } - if (this2.minuteMen < minuteMen) { - return 1; - } - return 0; - } - - public final long getMinuteMen() { - return minuteMen; - } - - @Override - public String toString() { - return "LOAD:" + minuteMen / (24 * 60 * 60); - } - - - -} diff --git a/src/net/sourceforge/plantuml/project/Month.java b/src/net/sourceforge/plantuml/project/Month.java deleted file mode 100644 index b8932a8..0000000 --- a/src/net/sourceforge/plantuml/project/Month.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; - -public enum Month { - - JAN(31), FEB(28), MAR(31), APR(30), MAY(31), JUN(30), JUL(31), AUG(31), SEP(30), OCT(31), NOV(30), DEC(31); - - final private int nbDays; - - private Month(int nbDays) { - this.nbDays = nbDays; - } - - public final int getNbDays(int year) { - if (this == FEB && year % 4 == 0) { - return 29; - } - return nbDays; - } - - public final int getNum() { - return ordinal() + 1; - } - - public final int getNumNormal() { - return ordinal(); - } - - public Month next() { - if (this == DEC) { - return null; - } - final List all = new ArrayList(EnumSet.allOf(Month.class)); - return all.get(getNum()); - } - - public Month prev() { - if (this == JAN) { - return null; - } - final List all = new ArrayList(EnumSet.allOf(Month.class)); - return all.get(getNum() - 2); - } - - public static Month fromNum(int num) { - if (num < 1 || num > 12) { - throw new IllegalArgumentException(); - } - final List all = new ArrayList(EnumSet.allOf(Month.class)); - return all.get(num - 1); - } -} diff --git a/src/net/sourceforge/plantuml/project/Numeric.java b/src/net/sourceforge/plantuml/project/Numeric.java deleted file mode 100644 index 3b0e15f..0000000 --- a/src/net/sourceforge/plantuml/project/Numeric.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -public interface Numeric extends Comparable { - Numeric add(Numeric other); - - NumericType getNumericType(); - -} diff --git a/src/net/sourceforge/plantuml/project/NumericNumber.java b/src/net/sourceforge/plantuml/project/NumericNumber.java deleted file mode 100644 index 17d9231..0000000 --- a/src/net/sourceforge/plantuml/project/NumericNumber.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -class NumericNumber implements Numeric { - - private final int value; - - public NumericNumber(int v) { - this.value = v; - } - - public Numeric add(Numeric other) { - if (other.getNumericType() != getNumericType()) { - throw new IllegalArgumentException(); - } - return new NumericNumber(value + ((NumericNumber) other).value); - } - - public NumericType getNumericType() { - return NumericType.NUMBER; - } - - public int getIntValue() { - return value; - } - - @Override - public String toString() { - return "Number:" + value; - } - - public int compareTo(Numeric other) { - final NumericNumber this2 = (NumericNumber) other; - if (this2.value > value) { - return -1; - } - if (this2.value < value) { - return 1; - } - return 0; - } - -} diff --git a/src/net/sourceforge/plantuml/project/NumericType.java b/src/net/sourceforge/plantuml/project/NumericType.java deleted file mode 100644 index e71e3f9..0000000 --- a/src/net/sourceforge/plantuml/project/NumericType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -enum NumericType { - - NUMBER, INSTANT, LOAD, DURATION; - - public NumericType add(NumericType other) { - if (this == NUMBER) { - return addNumber(other); - } - if (this == INSTANT) { - return null; - } - if (this == LOAD) { - return addLoad(other); - } - if (this == DURATION) { - return addDuration(other); - } - throw new UnsupportedOperationException(); - - } - - private NumericType addDuration(NumericType other) { - if (other == DURATION) { - return DURATION; - } - return null; - } - - private NumericType addLoad(NumericType other) { - if (other == LOAD) { - return LOAD; - } - return null; - } - - private NumericType addNumber(NumericType other) { - if (other == NUMBER) { - return NUMBER; - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/project/PSystemProject.java b/src/net/sourceforge/plantuml/project/PSystemProject.java deleted file mode 100644 index bb20a6c..0000000 --- a/src/net/sourceforge/plantuml/project/PSystemProject.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.EmptyImageBuilder; -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.api.ImageDataSimple; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.eps.EpsStrategy; -import net.sourceforge.plantuml.png.PngIO; -import net.sourceforge.plantuml.project.graphic.GanttDiagramUnused; -import net.sourceforge.plantuml.ugraphic.ColorMapper; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps; -import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d; -import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg; - -public class PSystemProject extends AbstractPSystem { - - private final Project project = new Project(); - private final Color background = Color.WHITE; - private final ColorMapper colorMapper = new ColorMapperIdentity(); - - public int getNbImages() { - return 1; - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Project)"); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormatOption, long seed) - throws IOException { - final GanttDiagramUnused diagram = new GanttDiagramUnused(project); - final FileFormat fileFormat = fileFormatOption.getFileFormat(); - if (fileFormat == FileFormat.PNG) { - final BufferedImage im = createImage(diagram); - PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96); - } else if (fileFormat == FileFormat.SVG) { - final UGraphicSvg svg = new UGraphicSvg(true, new Dimension2DDouble(0, 0), colorMapper, - StringUtils.getAsHtml(background), false, 1.0, fileFormatOption.getSvgLinkTarget(), - fileFormatOption.getHoverColor(), seed()); - diagram.draw(svg, 0, 0); - svg.createXml(os, fileFormatOption.isWithMetadata() ? getMetadata() : null); - } else if (fileFormat == FileFormat.EPS) { - final UGraphicEps eps = new UGraphicEps(colorMapper, EpsStrategy.getDefault2()); - diagram.draw(eps, 0, 0); - os.write(eps.getEPSCode().getBytes()); - } else if (fileFormat == FileFormat.EPS_TEXT) { - final UGraphicEps eps = new UGraphicEps(colorMapper, EpsStrategy.WITH_MACRO_AND_TEXT); - diagram.draw(eps, 0, 0); - os.write(eps.getEPSCode().getBytes()); - } else { - throw new UnsupportedOperationException(); - } - return ImageDataSimple.ok(); - } - - private BufferedImage createImage(GanttDiagramUnused diagram) { - EmptyImageBuilder builder = new EmptyImageBuilder(10, 10, background); - Graphics2D g2d = builder.getGraphics2D(); - UGraphicG2d ug = new UGraphicG2d(colorMapper, g2d, 1.0); - - final double height = diagram.getHeight(ug.getStringBounder()); - final double width = diagram.getWidth(ug.getStringBounder()); - - g2d.dispose(); - - builder = new EmptyImageBuilder(width, height, background); - final BufferedImage im = builder.getBufferedImage(); - g2d = builder.getGraphics2D(); - - ug = new UGraphicG2d(colorMapper, g2d, 1.0); - ug.setBufferedImage(im); - diagram.draw(ug, 0, 0); - g2d.dispose(); - return im; - } - - public final Project getProject() { - return project; - } - -} diff --git a/src/net/sourceforge/plantuml/project/ParentItem.java b/src/net/sourceforge/plantuml/project/ParentItem.java deleted file mode 100644 index b356376..0000000 --- a/src/net/sourceforge/plantuml/project/ParentItem.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -public class ParentItem implements Item { - - private final String code; - private final Item parent; - - private final List children = new ArrayList(); - - public ParentItem(String code, Item parent) { - this.code = code; - this.parent = parent; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder(code + " {"); - for (final Iterator it = children.iterator(); it.hasNext();) { - final Item child = it.next(); - sb.append(child.getCode()); - if (it.hasNext()) { - sb.append(", "); - } - } - sb.append("}"); - return sb.toString(); - } - - public Instant getBegin() { - Instant result = null; - for (Item it : children) { - if (result == null || result.compareTo(it.getBegin()) > 0) { - result = it.getBegin(); - } - } - return result; - } - - public Instant getCompleted() { - Instant result = null; - for (Item it : children) { - if (result == null || result.compareTo(it.getCompleted()) < 0) { - result = it.getCompleted(); - } - } - return result; - } - - public Duration getDuration() { - throw new UnsupportedOperationException(); - } - - public Load getLoad() { - throw new UnsupportedOperationException(); - } - - public NumericNumber getWork() { - throw new UnsupportedOperationException(); - } - - public boolean isLeaf() { - return false; - } - - public Item getParent() { - return parent; - } - - public List getChildren() { - return Collections.unmodifiableList(children); - } - - public String getCode() { - return code; - } - - public void addChild(Item child) { - this.children.add(child); - } - - public boolean isValid() { - if (children.size() == 0) { - return false; - } - for (Item it : children) { - if (it.isValid() == false) { - return false; - } - } - return true; - } - -} diff --git a/src/net/sourceforge/plantuml/project/Project.java b/src/net/sourceforge/plantuml/project/Project.java deleted file mode 100644 index 13bf076..0000000 --- a/src/net/sourceforge/plantuml/project/Project.java +++ /dev/null @@ -1,283 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import net.sourceforge.plantuml.StringUtils; - -public class Project { - - private final Map variables = new TreeMap(); - - private final Map items = new TreeMap(); - - private final Map ressources = new TreeMap(); - - private final DayCloseOr dayClose = new DayCloseOr(); - - public Project() { - } - - public final Instant getStart() { - Instant result = null; - for (Item it : getValidItems()) { - if (result == null || result.compareTo(it.getBegin()) > 0) { - result = it.getBegin(); - } - } - return result; - } - - public final Instant getEnd() { - Instant result = null; - for (Item it : getValidItems()) { - if (result == null || result.compareTo(it.getCompleted()) < 0) { - result = it.getCompleted(); - } - } - return result; - } - - public FreeVariable createVariable(String name, NumericType type) { - if (variables.containsKey(name)) { - throw new IllegalArgumentException("Already exist: " + name); - } - final FreeVariable variable = new FreeVariable(name, type); - variables.put(name, variable); - return variable; - } - - public Expression getExpression(String desc) { - desc = StringUtils.trin(desc); - final int plus = desc.indexOf('+'); - - if (plus != -1) { - final Expression exp1 = getExpression(desc.substring(0, plus)); - final Expression exp2 = getExpression(desc.substring(plus + 1)); - if (exp1.getNumericType() == NumericType.INSTANT - && (exp2.getNumericType() == NumericType.DURATION || exp2.getNumericType() == NumericType.NUMBER)) { - return new FormalAdditionInstantDuration(exp1, exp2, new BasicInstantArithmetic(dayClose)); - } - if (exp2.getNumericType() == NumericType.INSTANT - && (exp1.getNumericType() == NumericType.DURATION || exp1.getNumericType() == NumericType.NUMBER)) { - return new FormalAdditionInstantDuration(exp2, exp1, new BasicInstantArithmetic(dayClose)); - } - return new FormalAddition(exp1, exp2); - } - - if (desc.matches("^\\d+$")) { - return new Constant(new NumericNumber(Integer.parseInt(desc))); - } - if (desc.matches("^\\$\\w+$")) { - final String varName = desc.substring(1); - final FreeVariable v = variables.get(varName); - if (v != null) { - return v; - } - throw new IllegalArgumentException("No such variable: " + desc); - } - if (Day.isValidDesc(desc)) { - final Day d = new Day(desc); - return new Constant(new Instant(d)); - } - if (desc.matches("^[\\w/]+\\$(begin|completed|work|load|duration)$")) { - final int idx = desc.indexOf('$'); - final String varName = desc.substring(0, idx); - final Item item = items.get(varName); - if (item == null) { - throw new IllegalArgumentException("No such variable: " + desc); - } - return new Constant(ItemCaract.valueOf(StringUtils.goUpperCase(desc.substring(idx + 1))).getData(item)); - } - if (desc.startsWith("^")) { - final Item item = items.get(desc.substring(1)); - if (item == null) { - throw new IllegalArgumentException("No such variable: " + desc); - } - return new Constant(item.getBegin()); - } - throw new IllegalArgumentException("cannot parse"); - } - - public boolean affectation(String destination, Expression expression) { - if (destination.startsWith("^")) { - return affectationJalon(destination, expression); - } - if (destination.startsWith("~")) { - return affectationRessource(destination, expression); - } - final int idx = destination.indexOf('$'); - if (idx == -1) { - return affectationVariable(destination, expression); - } - final String itemName = destination.substring(0, idx); - final Item item = getItem(itemName); - if (item instanceof IncompleteItem == false) { - return false; - } - final IncompleteItem incompleteItem = (IncompleteItem) item; - final String suf = destination.substring(idx + 1); - if (suf.equalsIgnoreCase("begin")) { - incompleteItem.setData(ItemCaract.BEGIN, expression.getValue()); - } else if (suf.equalsIgnoreCase("completed")) { - incompleteItem.setData(ItemCaract.COMPLETED, expression.getValue()); - } else if (suf.equalsIgnoreCase("work")) { - incompleteItem.setData(ItemCaract.WORK, expression.getValue()); - } else if (suf.equalsIgnoreCase("duration")) { - if (expression.getNumericType() == NumericType.NUMBER) { - expression = new Constant(new Duration((NumericNumber) expression.getValue())); - } - incompleteItem.setData(ItemCaract.DURATION, expression.getValue()); - } else if (suf.equalsIgnoreCase("LOAD")) { - if (expression.getNumericType() == NumericType.NUMBER) { - expression = new Constant(new Load((NumericNumber) expression.getValue())); - } - incompleteItem.setData(ItemCaract.LOAD, expression.getValue()); - } else { - return false; - } - return true; - } - - private boolean affectationRessource(String res, Expression expression) { - res = res.substring(1); - final int idx = res.indexOf('$'); - final String suf = res.substring(idx + 1); - if (suf.equals("capacity")) { - final Ressource ressource = getRessource(res.substring(0, idx)); - ressource.setCapacity(((NumericNumber) expression.getValue()).getIntValue()); - return true; - } - return false; - } - - private Ressource getRessource(String code) { - Ressource result = ressources.get(code); - if (result == null) { - result = new Ressource(code); - ressources.put(code, result); - } - return result; - } - - private boolean affectationJalon(String jalon, Expression expression) { - final Jalon it = getItemJalon(jalon.substring(1)); - it.setInstant(expression.getValue()); - return true; - } - - private Jalon getItemJalon(String jalon) { - Jalon result = (Jalon) items.get(jalon); - if (result == null) { - result = new Jalon(jalon, null); - items.put(jalon, result); - - } - return result; - } - - private Item getItem(String code) { - Item result = items.get(code); - if (result == null) { - final int idx = code.indexOf('/'); - if (idx == -1) { - result = new IncompleteItem(code, null, new BasicInstantArithmetic(dayClose)); - } else { - final ParentItem parent = getItemParent(code.substring(0, idx)); - result = new IncompleteItem(code, parent, new BasicInstantArithmetic(dayClose)); - parent.addChild(result); - } - items.put(code, result); - } - return result; - } - - private ParentItem getItemParent(String code) { - Item result = items.get(code); - if (result == null) { - final int idx = code.indexOf('/'); - if (idx == -1) { - result = new ParentItem(code, null); - items.put(code, result); - } else { - throw new UnsupportedOperationException(); - } - } - return (ParentItem) result; - } - - private boolean affectationVariable(String destination, Expression expression) { - if (variables.containsKey(destination) == false) { - return false; - } - variables.get(destination).setValue(expression); - return true; - } - - public List getValidItems() { - final List result = new ArrayList(); - for (Item item : items.values()) { - if (item.isValid()) { - result.add(item); - } - } - Collections.sort(result, new ItemComparator()); - return Collections.unmodifiableList(result); - } - - public final DayClose getDayClose() { - return dayClose; - } - - public void closeWeekDay(WeekDay weekDay) { - dayClose.add(new DayCloseWeekDay(weekDay)); - } - - // public Item getItem(String code) { - // BasicItem result = items.get(code); - // if (result == null) { - // result = new BasicItem(code); - // items.put(code, result); - // } - // return result; - // } - -} diff --git a/src/net/sourceforge/plantuml/project/Ressource.java b/src/net/sourceforge/plantuml/project/Ressource.java deleted file mode 100644 index 7de543f..0000000 --- a/src/net/sourceforge/plantuml/project/Ressource.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -public class Ressource { - - private final String code; - - private int capacity = 1; - - public Ressource(String code) { - this.code = code; - } - - public DayClose getDayClose() { - return new DayCloseNone(); - } - - public final int getCapacity() { - return capacity; - } - - public final void setCapacity(int capacity) { - this.capacity = capacity; - } - -} diff --git a/src/net/sourceforge/plantuml/project/WeekDay.java b/src/net/sourceforge/plantuml/project/WeekDay.java deleted file mode 100644 index 82322a3..0000000 --- a/src/net/sourceforge/plantuml/project/WeekDay.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; - -public enum WeekDay { - - SUN, MON, TUE, WED, THU, FRI, SAT; - - public WeekDay next() { - if (this.ordinal() == 6) { - return SUN; - } - final List all = new ArrayList(EnumSet.allOf(WeekDay.class)); - return all.get(this.ordinal() + 1); - } - - public WeekDay prev() { - if (this.ordinal() == 0) { - return SAT; - } - final List all = new ArrayList(EnumSet.allOf(WeekDay.class)); - return all.get(this.ordinal() - 1); - } - -} diff --git a/src/net/sourceforge/plantuml/project/command/CommandAffectation.java b/src/net/sourceforge/plantuml/project/command/CommandAffectation.java deleted file mode 100644 index 539b8d9..0000000 --- a/src/net/sourceforge/plantuml/project/command/CommandAffectation.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.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; -import net.sourceforge.plantuml.project.PSystemProject; - -public class CommandAffectation extends SingleLineCommand { - - public CommandAffectation() { - super("(?i)^\\s*([~\\^]?[\\w$/]+)\\s*:=\\s*(.+)$"); - } - - @Override - protected CommandExecutionResult executeArg(PSystemProject diagram, List arg) { - 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(); - } - return CommandExecutionResult.error("Cannot execute"); - } -} diff --git a/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java b/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java deleted file mode 100644 index 388ecf5..0000000 --- a/src/net/sourceforge/plantuml/project/command/CommandCloseWeekDay.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.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.PSystemProject; -import net.sourceforge.plantuml.project.WeekDay; - -public class CommandCloseWeekDay extends SingleLineCommand { - - public CommandCloseWeekDay() { - super("(?i)^\\s*close\\s+(\\w{3,}day)\\s*$"); - } - - @Override - protected CommandExecutionResult executeArg(PSystemProject diagram, List arg) { - final WeekDay weekDay = WeekDay.valueOf(StringUtils.goUpperCase(arg.get(0).substring(0, 3))); - diagram.getProject().closeWeekDay(weekDay); - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/project/graphic/GanttDiagramUnused.java b/src/net/sourceforge/plantuml/project/graphic/GanttDiagramUnused.java deleted file mode 100644 index e849f4d..0000000 --- a/src/net/sourceforge/plantuml/project/graphic/GanttDiagramUnused.java +++ /dev/null @@ -1,140 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project.graphic; - -import java.util.Map; -import java.util.SortedMap; - -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorSetSimple; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.project.Instant; -import net.sourceforge.plantuml.project.Item; -import net.sourceforge.plantuml.project.Jalon; -import net.sourceforge.plantuml.project.Project; -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.UShape; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class GanttDiagramUnused { - - private final Project project; - private final TimeScale timeScale; - private final ItemHeader itemHeader; - - public GanttDiagramUnused(Project project) { - this.project = project; - this.timeScale = new TimeScale(project); - this.itemHeader = new ItemHeader(project); - } - - public void draw(UGraphic ug, double x, double y) { - final StringBounder stringBounder = ug.getStringBounder(); - final double x0start = itemHeader.getWidth(stringBounder); - - final double timeScaleHeight = timeScale.getHeight(stringBounder); - - final SortedMap pos = timeScale.getAbscisse(stringBounder); - for (Item it : project.getValidItems()) { - final Instant start = it.getBegin(); - final Instant completed = it.getCompleted(); - if (pos.get(start) == null || pos.get(completed) == null) { - Log.println("PB " + it); - continue; - } - final double x1 = pos.get(start) + 3; - final double x2 = pos.get(completed) - 3; - - final double yitem = timeScaleHeight + itemHeader.getPosition(stringBounder, it) + 3; - - final UShape rect; - if (it instanceof Jalon) { - rect = new UPolygon(); - ((UPolygon) rect).addPoint(0, 3); - ((UPolygon) rect).addPoint(3, 0); - ((UPolygon) rect).addPoint(6, 3); - ((UPolygon) rect).addPoint(3, 6); - } else { - rect = new URectangle(x2 - x1, 3); - } - ug = ug.apply(new UChangeColor(HtmlColorUtils.GREEN)); - ug = ug.apply(new UChangeBackColor(HtmlColorUtils.GRAY)); - ug.apply(new UTranslate(x0start + x1, yitem)).draw(rect); - - } - - drawGrid(ug, x + x0start, y + timeScaleHeight, pos); - - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - ug = ug.apply(new UChangeBackColor(null)); - timeScale.draw(ug, x + x0start, y); - itemHeader.draw(ug, x, y + timeScaleHeight); - - } - - private final HtmlColor lightGray = new HtmlColorSetSimple().getColorIfValid("#C8C8C8"); - - private void drawGrid(UGraphic ug, double x, double y, SortedMap pos) { - final ULine line = new ULine(0, itemHeader.getHeight(ug.getStringBounder())); - Instant last = null; - for (Map.Entry ent : pos.entrySet()) { - final double xcur = ent.getValue(); - if (last == null || last.next(null).equals(ent.getKey())) { - ug = ug.apply(new UChangeColor(lightGray)); - } else { - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - } - ug.apply(new UTranslate(x + xcur, y)).draw(line); - last = ent.getKey(); - } - } - - public double getWidth(StringBounder stringBounder) { - return itemHeader.getWidth(stringBounder) + timeScale.getWidth(stringBounder) + 3; - } - - public double getHeight(StringBounder stringBounder) { - return itemHeader.getHeight(stringBounder) + timeScale.getHeight(stringBounder) + 3; - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java b/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java deleted file mode 100644 index e5764e0..0000000 --- a/src/net/sourceforge/plantuml/project/graphic/ItemHeader.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project.graphic; - -import java.awt.Font; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.SpriteContainerEmpty; -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.project.Item; -import net.sourceforge.plantuml.project.Project; -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; - -class ItemHeader { - - private final UFont font = UFont.serif(9); - private final Project project; - private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font); - - public ItemHeader(Project project) { - this.project = project; - } - - public void draw(UGraphic ug, double x, double y) { - - final StringBounder stringBounder = ug.getStringBounder(); - - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - ug.apply(new UTranslate(x, y)).draw(new URectangle(getWidth(stringBounder), getHeight(stringBounder))); - - for (Item it : project.getValidItems()) { - 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(); - ug.apply(new UTranslate(x, y)).draw(new ULine(getWidth(stringBounder), 0)); - } - } - - public double getWidth(StringBounder stringBounder) { - double width = 0; - for (Item it : project.getValidItems()) { - final Dimension2D dim = stringBounder.calculateDimension(font, it.getCode()); - width = Math.max(width, dim.getWidth()); - } - return width; - } - - public double getHeight(StringBounder stringBounder) { - double height = 0; - for (Item it : project.getValidItems()) { - final Dimension2D dim = stringBounder.calculateDimension(font, it.getCode()); - height += dim.getHeight(); - - } - return height; - } - - public double getPosition(StringBounder stringBounder, Item item) { - double pos = 0; - for (Item it : project.getValidItems()) { - if (it == item) { - return pos; - } - final Dimension2D dim = stringBounder.calculateDimension(font, it.getCode()); - pos += dim.getHeight(); - - } - throw new IllegalArgumentException(); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/project/graphic/TimeScale.java b/src/net/sourceforge/plantuml/project/graphic/TimeScale.java deleted file mode 100644 index 30a84b7..0000000 --- a/src/net/sourceforge/plantuml/project/graphic/TimeScale.java +++ /dev/null @@ -1,159 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project.graphic; - -import java.awt.Font; -import java.awt.geom.Dimension2D; -import java.util.Collections; -import java.util.SortedMap; -import java.util.TreeMap; - -import net.sourceforge.plantuml.SpriteContainerEmpty; -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.project.Day; -import net.sourceforge.plantuml.project.Instant; -import net.sourceforge.plantuml.project.Month; -import net.sourceforge.plantuml.project.Project; -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; - -class TimeScale { - - private final UFont font = UFont.serif(9); - private final Project project; - private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font); - - public TimeScale(Project project) { - this.project = project; - } - - public void draw(UGraphic ug, final double x, double y) { - final StringBounder stringBounder = ug.getStringBounder(); - final double monthHeight = getMonthHeight(stringBounder); - final double caseWidth = getCaseWidth(stringBounder); - final double caseHeight = getCaseHeight(stringBounder); - final int nb = getNbCase(); - - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - ug.apply(new UTranslate(x, y)).draw(new URectangle(nb * caseWidth, monthHeight)); - final Instant end = project.getEnd(); - - Month printed = null; - - double curx = x; - for (Instant cur = project.getStart(); cur.compareTo(end) <= 0; cur = cur.next(project.getDayClose())) { - final Day d = cur.getDay(); - if (printed == null || d.getMonth() != printed) { - ug.apply(new UTranslate(curx, y)).draw(new ULine(0, monthHeight)); - printed = d.getMonth(); - 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)))); - } - curx += caseWidth; - } - - curx = x; - y += monthHeight; - ug.apply(new UTranslate(x, y)).draw(new URectangle(nb * caseWidth, caseHeight)); - - for (Instant cur = project.getStart(); cur.compareTo(end) <= 0; cur = cur.next(project.getDayClose())) { - final Day d = cur.getDay(); - 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)))); - curx += caseWidth; - ug.apply(new UTranslate(curx, y)).draw(new ULine(0, caseHeight)); - } - } - - public SortedMap getAbscisse(StringBounder stringBounder) { - final SortedMap pos = new TreeMap(); - final double caseWidth = getCaseWidth(stringBounder); - final Instant end = project.getEnd(); - double x = 0; - for (Instant cur = project.getStart(); cur.compareTo(end) <= 0; cur = cur.next(project.getDayClose())) { - pos.put(cur, x); - x += caseWidth; - } - return Collections.unmodifiableSortedMap(pos); - } - - private int getNbCase() { - int result = 0; - final Instant end = project.getEnd(); - for (Instant cur = project.getStart(); cur.compareTo(end) <= 0; cur = cur.next(project.getDayClose())) { - result++; - } - return result; - } - - private double getCaseWidth(StringBounder stringBounder) { - final Dimension2D dim00 = stringBounder.calculateDimension(font, "00"); - return dim00.getWidth() + 3; - } - - private double getCaseHeight(StringBounder stringBounder) { - final Dimension2D dim00 = stringBounder.calculateDimension(font, "00"); - return dim00.getHeight() + 3; - } - - private double getMonthHeight(StringBounder stringBounder) { - final Dimension2D dimZZ = stringBounder.calculateDimension(font, "ZZ"); - return dimZZ.getHeight() + 3; - } - - public double getWidth(StringBounder stringBounder) { - return getCaseWidth(stringBounder) * getNbCase(); - } - - public double getHeight(StringBounder stringBounder) { - return getCaseHeight(stringBounder) + getMonthHeight(stringBounder); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java deleted file mode 100644 index dbca1f8..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategy.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.graphic; - -import net.sourceforge.plantuml.sequencediagram.Event; - -interface FreeYStrategy { - - double peekPosition(Event event, ParticipantRange range); - - void addElement(Event event, ParticipantRange range, double height); -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java deleted file mode 100644 index c4e87e0..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/FreeYStrategyBasic.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.graphic; - -import net.sourceforge.plantuml.sequencediagram.Event; - -class FreeYStrategyBasic implements FreeYStrategy { - - public double peekPosition(Event event, ParticipantRange range) { - return 0; - } - - public void addElement(Event event, ParticipantRange range, double height) { - } - -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java b/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java deleted file mode 100644 index 6b58713..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/FixedLink.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -public class FixedLink { - - final private SegmentPosition segmentPosition1; - final private SegmentPosition segmentPosition2; - - public FixedLink(SegmentPosition segmentPosition1, SegmentPosition segmentPosition2) { - this.segmentPosition1 = segmentPosition1; - this.segmentPosition2 = segmentPosition2; - } - - public boolean pushIfNeed() { - final double p1 = segmentPosition1.getPosition(); - final double p2 = segmentPosition2.getPosition(); - if (p1 == p2) { - return false; - } - final double diff = p1 - p2; - segmentPosition2.getSegment().push(diff); - assert segmentPosition1.getPosition() == segmentPosition2.getPosition(); - return true; - } - -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java deleted file mode 100644 index 287102d..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/PSegment.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -public class PSegment { - - private final double minsize; - private double startx; - private double endx; - - public PSegment(double minsize) { - this.minsize = minsize; - this.startx = 0; - this.endx = minsize; - } - - public double getMinsize() { - return minsize; - } - - public void push(double delta) { - this.startx += delta; - this.endx += delta; - } - - public String getDebugPosition() { - return "" + ((int) startx) + "-" + ((int) endx); - } - - public double getPosition(double position) { - if (position == 0) { - return startx; - } - if (position == 1) { - return endx; - } - throw new UnsupportedOperationException(); - } - -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java deleted file mode 100644 index 6fd4bed..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/PUnivers.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -import java.util.ArrayList; -import java.util.Collection; - -public class PUnivers { - - private final Collection all = new ArrayList(); - private final Collection links = new ArrayList(); - - public PSegment createPSegment(double minsize) { - final PSegment result = new PSegment(minsize); - all.add(result); - return result; - } - - public void addFixedLink(PSegment segment1, double position1, PSegment segment2, double position2) { - final FixedLink link = new FixedLink(new SegmentPosition(segment1, position1), new SegmentPosition(segment2, - position2)); - links.add(link); - - } - - public void solve() { - boolean changed = false; - do { - changed = false; - for (FixedLink link : links) { - if (link.pushIfNeed()) { - changed = true; - } - } - } while (changed); - - } -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java deleted file mode 100644 index 0fc06d4..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/PushDirection.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -public enum PushDirection { - - TOLEFT, TORIGHT -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java deleted file mode 100644 index 32b3b00..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/PushSide.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -public enum PushSide { - - START, END -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java b/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java deleted file mode 100644 index 9139380..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/PushStrategy.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -public enum PushStrategy { - - MOVE, ENLARGE -} diff --git a/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java b/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java deleted file mode 100644 index 272cb8a..0000000 --- a/src/net/sourceforge/plantuml/sequencediagram/puma/SegmentPosition.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sequencediagram.puma; - -public class SegmentPosition { - - final private PSegment segment; - final private double position; - - public SegmentPosition(PSegment segment, double position) { - this.segment = segment; - this.position = position; - } - - public double getPosition() { - return segment.getPosition(position); - } - - public PSegment getSegment() { - return segment; - - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java b/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java deleted file mode 100644 index f90e701..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/AbstractComponentBlueModernArrow.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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.skin.AbstractTextualComponent; -import net.sourceforge.plantuml.skin.ArrowComponent; -import net.sourceforge.plantuml.skin.ArrowConfiguration; - -public abstract class AbstractComponentBlueModernArrow extends AbstractTextualComponent implements ArrowComponent { - - private final int arrowDeltaX = 12; - private final int arrowDeltaY = 10; - - private final int arrowDeltaX2 = 10; - private final int arrowDeltaY2 = 5; - private final ArrowConfiguration arrowConfiguration; - private final HtmlColor foregroundColor; - - public AbstractComponentBlueModernArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, stringsToDisplay, font, HorizontalAlignment.LEFT, 17, 17, - 2, spriteContainer, false, null, null); - this.arrowConfiguration = arrowConfiguration; - this.foregroundColor = foregroundColor; - } - - protected final HtmlColor getForegroundColor() { - return foregroundColor; - } - - final protected int getArrowDeltaX() { - return arrowDeltaX; - } - - final protected int getArrowDeltaY() { - return arrowDeltaY; - } - - final protected int getArrowDeltaY2() { - return arrowDeltaY2; - } - - final protected int getArrowDeltaX2() { - return arrowDeltaX2; - } - - @Override - public final double getPaddingY() { - return 6; - } - - final protected ArrowConfiguration getArrowConfiguration() { - return arrowConfiguration; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java b/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java deleted file mode 100644 index b53948c..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/BlueModern.java +++ /dev/null @@ -1,188 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import net.sourceforge.plantuml.FontParam; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.LineParam; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.SymbolContext; -import net.sourceforge.plantuml.skin.ArrowConfiguration; -import net.sourceforge.plantuml.skin.Component; -import net.sourceforge.plantuml.skin.ComponentType; -import net.sourceforge.plantuml.skin.Skin; -import net.sourceforge.plantuml.skin.rose.ComponentRoseDestroy; -import net.sourceforge.plantuml.skin.rose.ComponentRoseGroupingElse; -import net.sourceforge.plantuml.skin.rose.ComponentRoseGroupingSpace; -import net.sourceforge.plantuml.skin.rose.ComponentRoseReference; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UFont; - -public class BlueModern implements Skin { - - private final UFont bigFont = UFont.sansSerif(20).bold(); - private final UFont participantFont = UFont.sansSerif(17); - private final UFont normalFont = UFont.sansSerif(13); - private final UFont smallFont = UFont.sansSerif(11).bold(); - - private final HtmlColor hyperlinkColor = HtmlColorUtils.BLUE; - private final boolean useUnderlineForHyperlink = true; - private final HtmlColor blue1 = HtmlColorUtils.COL_527BC6; - private final HtmlColor blue2 = HtmlColorUtils.COL_D1DBEF; - private final HtmlColor blue3 = HtmlColorUtils.COL_D7E0F2; - - private final HtmlColor red = HtmlColorUtils.MY_RED; - - private final HtmlColor lineColor = HtmlColorUtils.COL_989898; - private final HtmlColor borderGroupColor = HtmlColorUtils.COL_BBBBBB; - - public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param, - Display stringsToDisplay) { - - if (type.isArrow()) { - final HtmlColor sequenceArrow = config.getColor() == null ? HtmlColorUtils.BLACK : config.getColor(); - if (config.isSelfArrow()) { - return new ComponentBlueModernSelfArrow(sequenceArrow, normalFont.toFont2(HtmlColorUtils.BLACK, - useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay, config, param); - } - return new ComponentBlueModernArrow(sequenceArrow, useUnderlineForHyperlink, normalFont.toFont2( - 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, param.getTabSize()), stringsToDisplay, param); - } - if (type == ComponentType.PARTICIPANT_TAIL) { - return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE, - useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), stringsToDisplay, param); - } - if (type == ComponentType.PARTICIPANT_LINE) { - return new ComponentBlueModernLine(lineColor); - } - if (type == ComponentType.CONTINUE_LINE) { - return new ComponentBlueModernLine(lineColor); - } - if (type == ComponentType.ACTOR_HEAD) { - return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink, - hyperlinkColor, param.getTabSize()), stringsToDisplay, true, param); - } - if (type == ComponentType.ACTOR_TAIL) { - return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink, - hyperlinkColor, param.getTabSize()), stringsToDisplay, false, param); - } - if (type == ComponentType.NOTE) { - return new ComponentBlueModernNote(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK, normalFont.toFont2( - HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor, param.getTabSize()), - stringsToDisplay, param); - } - if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) { - return new ComponentBlueModernActiveLine(blue1, true, true); - } - if (type == ComponentType.ALIVE_BOX_CLOSE_OPEN) { - return new ComponentBlueModernActiveLine(blue1, true, false); - } - if (type == ComponentType.ALIVE_BOX_OPEN_CLOSE) { - return new ComponentBlueModernActiveLine(blue1, false, true); - } - if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) { - return new ComponentBlueModernActiveLine(blue1, false, false); - } - if (type == ComponentType.DELAY_LINE) { - return new ComponentBlueModernDelayLine(lineColor); - } - if (type == ComponentType.DELAY_TEXT) { - 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, - param.getTabSize()), smallFont, stringsToDisplay, param); - } - if (type == ComponentType.GROUPING_ELSE) { - return new ComponentRoseGroupingElse(HtmlColorUtils.BLACK, smallFont.toFont2(HtmlColorUtils.BLACK, - 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, param.getTabSize()), stringsToDisplay, param); - // } - if (type == ComponentType.REFERENCE) { - return new ComponentRoseReference(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, - 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, param.getTabSize()), blue2, blue1, HtmlColorUtils.BLACK, stringsToDisplay, param); - } - // if (type == ComponentType.SIGNATURE) { - // return new ComponentRoseTitle(smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, - // 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(null, false, - FontParam.SEQUENCE_BOX).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor, - param.getTabSize()), param); - } - - return null; - - } - - public Object getProtocolVersion() { - return 1; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java deleted file mode 100644 index c388a70..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActiveLine.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.AbstractComponent; -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.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernActiveLine extends AbstractComponent { - - private final int shadowview = 3; - private final HtmlColor foregroundColor; - - public ComponentBlueModernActiveLine(HtmlColor foregroundColor, boolean closeUp, boolean closeDown) { - this.foregroundColor = foregroundColor; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final StringBounder stringBounder = ug.getStringBounder(); - final int x = (int) (dimensionToUse.getWidth() - getPreferredWidth(stringBounder)) / 2; - final ShadowShape shadowShape = new ShadowShape(getPreferredWidth(stringBounder), dimensionToUse.getHeight() - - shadowview, 3); - shadowShape.drawU(ug.apply(new UTranslate(shadowview, shadowview))); - - ug.apply(new UChangeColor(foregroundColor)) - .apply(new UChangeBackColor(foregroundColor)).apply(new UTranslate(x, 0)).draw(new URectangle(getPreferredWidth(stringBounder), dimensionToUse.getHeight() - shadowview)); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return 0; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return 10; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java deleted file mode 100644 index 42f78fc..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernActor.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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.skin.AbstractTextualComponent; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.StickMan; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernActor extends AbstractTextualComponent { - - private final StickMan stickman; - private final boolean head; - - public ComponentBlueModernActor(HtmlColor backgroundColor, HtmlColor foregroundColor, FontConfiguration font, - Display stringsToDisplay, boolean head, ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, - 0, spriteContainer, false, null, null); - this.head = head; - stickman = new StickMan(backgroundColor, foregroundColor); - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - ug = ug.apply(new UChangeColor(getFontColor())); - final TextBlock textBlock = getTextBlock(); - final StringBounder stringBounder = ug.getStringBounder(); - final double delta = (getPreferredWidth(stringBounder) - stickman.getPreferredWidth()) / 2; - - if (head) { - textBlock - .drawU(ug.apply(new UTranslate(getTextMiddlePostion(stringBounder), stickman.getPreferredHeight()))); - ug = ug.apply(new UTranslate(delta, 0)); - } else { - textBlock.drawU(ug.apply(new UTranslate(getTextMiddlePostion(stringBounder), 0))); - ug = ug.apply(new UTranslate(delta, getTextHeight(stringBounder))); - } - stickman.drawU(ug); - - } - - private double getTextMiddlePostion(StringBounder stringBounder) { - return (getPreferredWidth(stringBounder) - getTextWidth(stringBounder)) / 2.0; - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return stickman.getPreferredHeight() + getTextHeight(stringBounder); - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return Math.max(stickman.getPreferredWidth(), getTextWidth(stringBounder)); - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java deleted file mode 100644 index 36ab05a..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernArrow.java +++ /dev/null @@ -1,197 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.Graphics2D; -import java.awt.geom.Dimension2D; -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.ArrowConfiguration; -import net.sourceforge.plantuml.skin.ArrowDirection; -import net.sourceforge.plantuml.skin.ArrowPart; -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.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow { - - public ComponentBlueModernArrow(HtmlColor foregroundColor, boolean useUnderlineForHyperlink, - FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, - ISkinSimple spriteContainer) { - super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer); - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - if (getArrowConfiguration().isHidden()) { - return; - } - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final StringBounder stringBounder = ug.getStringBounder(); - final int textHeight = (int) getTextHeight(stringBounder); - - ug = ug.apply(new UChangeColor(getForegroundColor())); - ug = ug.apply(new UChangeBackColor(getForegroundColor())); - - final int x2 = (int) dimensionToUse.getWidth(); - - if (getArrowConfiguration().isDotted()) { - ug = ArrowConfiguration.stroke(ug, 5, 2, 1); - } else { - ug = ug.apply(new UStroke(2)); - } - - ug.apply(new UTranslate(2, textHeight)).draw(new ULine(x2 - 4, 0)); - ug = ug.apply(new UStroke()); - - final int direction = getDirection(); - final UPolygon polygon = new UPolygon(); - - if (getArrowConfiguration().isAsync()) { - ug = ug.apply(new UStroke(1.5)); - if (direction == 1) { - if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) { - ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw( - new ULine(getArrowDeltaX2(), getArrowDeltaY2())); - } - if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) { - ug.apply(new UTranslate(x2 - getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw( - new ULine(getArrowDeltaX2(), -getArrowDeltaY2())); - } - } else { - if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) { - ug.apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2())).draw( - new ULine(-getArrowDeltaX2(), getArrowDeltaY2())); - } - if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) { - ug.apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2())).draw( - new ULine(-getArrowDeltaX2(), -getArrowDeltaY2())); - } - } - ug = ug.apply(new UStroke()); - } else if (direction == 1) { - createPolygonNormal(textHeight, x2, polygon); - } else { - createPolygonReverse(textHeight, polygon); - } - ug.draw(polygon); - - getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), 0))); - } - - private void createPolygonReverse(final int textHeight, final UPolygon polygon) { - if (getArrowConfiguration().getPart() == ArrowPart.TOP_PART) { - polygon.addPoint(getArrowDeltaX(), textHeight - getArrowDeltaY()); - polygon.addPoint(0, textHeight); - polygon.addPoint(getArrowDeltaX(), textHeight); - } else if (getArrowConfiguration().getPart() == ArrowPart.BOTTOM_PART) { - polygon.addPoint(getArrowDeltaX(), textHeight); - polygon.addPoint(0, textHeight); - polygon.addPoint(getArrowDeltaX(), textHeight + getArrowDeltaY()); - } else { - polygon.addPoint(getArrowDeltaX(), textHeight - getArrowDeltaY()); - polygon.addPoint(0, textHeight); - polygon.addPoint(getArrowDeltaX(), textHeight + getArrowDeltaY()); - } - } - - private void createPolygonNormal(final int textHeight, final int x2, final UPolygon polygon) { - if (getArrowConfiguration().getPart() == ArrowPart.TOP_PART) { - polygon.addPoint(x2 - getArrowDeltaX(), textHeight - getArrowDeltaY()); - polygon.addPoint(x2, textHeight); - polygon.addPoint(x2 - getArrowDeltaX(), textHeight); - } else if (getArrowConfiguration().getPart() == ArrowPart.BOTTOM_PART) { - polygon.addPoint(x2 - getArrowDeltaX(), textHeight); - polygon.addPoint(x2, textHeight); - polygon.addPoint(x2 - getArrowDeltaX(), textHeight + getArrowDeltaY()); - } else { - polygon.addPoint(x2 - getArrowDeltaX(), textHeight - getArrowDeltaY()); - polygon.addPoint(x2, textHeight); - polygon.addPoint(x2 - getArrowDeltaX(), textHeight + getArrowDeltaY()); - } - } - - protected int getDirection(Graphics2D g2d) { - return getDirection(); - } - - protected int getDirection() { - if (getArrowConfiguration().getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) { - return 1; - } - if (getArrowConfiguration().getArrowDirection() == ArrowDirection.RIGHT_TO_LEFT_REVERSE) { - return -1; - } - throw new IllegalStateException(); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + getArrowDeltaY() + 2 * getPaddingY(); - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return getTextWidth(stringBounder); - } - - public Point2D getStartPoint(StringBounder stringBounder, Dimension2D dimensionToUse) { - final int textHeight = (int) getTextHeight(stringBounder); - if (getArrowConfiguration().getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) { - return new Point2D.Double(getPaddingX(), textHeight + getPaddingY()); - } - return new Point2D.Double(dimensionToUse.getWidth() + getPaddingX(), textHeight + getPaddingY()); - } - - public Point2D getEndPoint(StringBounder stringBounder, Dimension2D dimensionToUse) { - final int textHeight = (int) getTextHeight(stringBounder); - if (getArrowConfiguration().getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) { - return new Point2D.Double(dimensionToUse.getWidth() + getPaddingX(), textHeight + getPaddingY()); - } - return new Point2D.Double(getPaddingX(), textHeight + getPaddingY()); - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java deleted file mode 100644 index 6d128db..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayLine.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.AbstractComponent; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.ArrowConfiguration; -import net.sourceforge.plantuml.ugraphic.UAntiAliasing; -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.UTranslate; - -public class ComponentBlueModernDelayLine extends AbstractComponent { - - private final HtmlColor color; - - public ComponentBlueModernDelayLine(HtmlColor color) { - this.color = color; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - ug = ug.apply(new UChangeColor(color)); - ug = ArrowConfiguration.stroke(ug, 1, 4, 1); - final int x = (int) (dimensionToUse.getWidth() / 2); - ug.apply(new UChangeBackColor(color)).apply(UAntiAliasing.ANTI_ALIASING_OFF).apply(new UTranslate(x + 1, 0)).draw(new ULine(0, dimensionToUse.getHeight())); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return 20; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return 2; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java deleted file mode 100644 index f661910..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDelayText.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -import net.sourceforge.plantuml.cucadiagram.Display; -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.skin.AbstractTextualComponent; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernDelayText extends AbstractTextualComponent { - - public ComponentBlueModernDelayText(FontConfiguration font, Display stringsToDisplay, - ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, - 4, spriteContainer, false, null, null); - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final TextBlock textBlock = getTextBlock(); - final StringBounder stringBounder = ug.getStringBounder(); - final double textWidth = getTextWidth(stringBounder); - final double textHeight = getTextHeight(stringBounder); - - final double xpos = (dimensionToUse.getWidth() - textWidth) / 2; - final double ypos = (dimensionToUse.getHeight() - textHeight) / 2; - - textBlock.drawU(ug.apply(new UTranslate(xpos, (ypos + getMarginY())))); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + 20; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return getTextWidth(stringBounder) + 30; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java deleted file mode 100644 index 06b32b6..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernDivider.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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; -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.ULine; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernDivider extends AbstractTextualComponent { - - private final HtmlColor background1; - private final HtmlColor background2; - private final HtmlColor borderColor; - - public ComponentBlueModernDivider(FontConfiguration font, HtmlColor background1, HtmlColor background2, - HtmlColor borderColor, Display stringsToDisplay, ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, - 4, spriteContainer, false, null, null); - this.background1 = background1; - this.background2 = background2; - this.borderColor = borderColor; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final TextBlock textBlock = getTextBlock(); - final StringBounder stringBounder = ug.getStringBounder(); - final double textWidth = getTextWidth(stringBounder); - final double textHeight = getTextHeight(stringBounder); - - final double deltaX = 6; - final double xpos = (dimensionToUse.getWidth() - textWidth - deltaX) / 2; - final double ypos = (dimensionToUse.getHeight() - textHeight) / 2; - - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - ug = ug.apply(new UChangeBackColor(HtmlColorUtils.BLACK)); - ug = ug.apply(new UStroke(2)); - - ug.apply(new UTranslate(0, dimensionToUse.getHeight() / 2 - 1)).draw(new ULine(dimensionToUse.getWidth(), 0)); - ug.apply(new UTranslate(0, dimensionToUse.getHeight() / 2 + 2)).draw(new ULine(dimensionToUse.getWidth(), 0)); - - final FillRoundShape shape = new FillRoundShape(textWidth + deltaX, textHeight, background1, background2, 5); - shape.drawU(ug.apply(new UTranslate(xpos, ypos))); - - ug = ug.apply(new UChangeColor(borderColor)); - ug = ug.apply(new UChangeBackColor(null)); - ug.apply(new UTranslate(xpos, ypos)).draw(new URectangle(textWidth + deltaX, textHeight, 5, 5)); - ug = ug.apply(new UStroke()); - - textBlock.drawU(ug.apply(new UTranslate(xpos + deltaX, ypos + getMarginY()))); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + 20; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return getTextWidth(stringBounder) + 30; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java deleted file mode 100644 index a063996..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernEnglober.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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.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.URectangle; -import net.sourceforge.plantuml.ugraphic.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernEnglober extends AbstractTextualComponent { - - private final HtmlColor borderColor; - private final HtmlColor backColor; - - public ComponentBlueModernEnglober(HtmlColor borderColor, HtmlColor backColor, Display strings, - FontConfiguration font, ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.CENTER, 4, 4, 1, spriteContainer, false, - null, null); - this.borderColor = borderColor; - this.backColor = backColor; - } - - @Override - protected void drawBackgroundInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - ug = ug.apply(new UChangeColor(borderColor)); - ug = ug.apply(new UChangeBackColor(backColor)); - ug.apply(new UStroke(2)).draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight(), 9, 9)); - final double xpos = (dimensionToUse.getWidth() - getPureTextWidth(ug.getStringBounder())) / 2; - - getTextBlock().drawU(ug.apply(new UTranslate(xpos, 0))); - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - // ug.getParam().setColor(Color.RED); - // ug.getParam().setBackcolor(Color.YELLOW); - // ug.draw(0, 0, new URectangle(dimensionToUse.getWidth(), - // dimensionToUse.getHeight())); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + 3; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return getTextWidth(stringBounder) + 10; - } -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java deleted file mode 100644 index a683aa7..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernGroupingHeader.java +++ /dev/null @@ -1,161 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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.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.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 ComponentBlueModernGroupingHeader extends AbstractTextualComponent { - - private final int cornersize = 10; - private final int commentMargin = 0; // 8; - - private final TextBlock commentTextBlock; - - private final HtmlColor headerBackgroundColor; - private final HtmlColor generalBackgroundColor; - private final HtmlColor borderColor; - - public ComponentBlueModernGroupingHeader(HtmlColor headerBackgroundColor, HtmlColor generalBackgroundColor, - HtmlColor borderColor, HtmlColor fontColor2, FontConfiguration bigFont, UFont smallFont, Display strings, - ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, null, null); - this.headerBackgroundColor = headerBackgroundColor; - this.generalBackgroundColor = generalBackgroundColor; - this.borderColor = borderColor; - if (strings.size() == 1 || strings.get(1) == null) { - this.commentTextBlock = null; - } else { - 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); - } - } - - // @Override - // public double getPaddingY() { - // return 6; - // } - - @Override - final public double getPreferredWidth(StringBounder stringBounder) { - final double sup; - if (commentTextBlock == null) { - sup = commentMargin * 2; - } else { - final Dimension2D size = commentTextBlock.calculateDimension(stringBounder); - sup = getMarginX1() + commentMargin + size.getWidth(); - - } - return getTextWidth(stringBounder) + sup; - } - - @Override - final public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + 2 * getPaddingY(); - } - - @Override - protected void drawBackgroundInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - ug.apply(new UChangeColor(borderColor)).apply(new UStroke(2)) - .apply(new UChangeBackColor(generalBackgroundColor)) - .draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight())); - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - ug = ug.apply(new UChangeColor(borderColor)); - ug.apply(new UStroke(2)).draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight())); - - final StringBounder stringBounder = ug.getStringBounder(); - final int textWidth = (int) getTextWidth(stringBounder); - final int textHeight = (int) getTextHeight(stringBounder); - - final UPolygon polygon = new UPolygon(); - polygon.addPoint(0, 0); - polygon.addPoint(textWidth, 0); - - polygon.addPoint(textWidth, textHeight - cornersize); - polygon.addPoint(textWidth - cornersize, textHeight); - - polygon.addPoint(0, textHeight); - polygon.addPoint(0, 0); - - ug = ug.apply(new UStroke(2)); - ug = ug.apply(new UChangeBackColor(headerBackgroundColor)); - ug.draw(polygon); - ug.draw(new ULine(dimensionToUse.getWidth(), 0)); - - final double heightWithoutPadding = dimensionToUse.getHeight() - getPaddingY(); - - ug.apply(new UTranslate(dimensionToUse.getWidth(), 0)).draw(new ULine(0, heightWithoutPadding)); - ug.apply(new UTranslate(0, textHeight)).draw(new ULine(0, heightWithoutPadding - textHeight)); - ug = ug.apply(new UStroke()); - - getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY()))); - - if (commentTextBlock != null) { - final int x1 = getMarginX1() + textWidth; - final int y2 = getMarginY() + 1; - - commentTextBlock.drawU(ug.apply(new UChangeColor(generalBackgroundColor)).apply( - new UTranslate(x1 + commentMargin, y2))); - } - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java deleted file mode 100644 index d0670ff..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernLine.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.AbstractComponent; -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.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernLine extends AbstractComponent { - - private final HtmlColor color; - - public ComponentBlueModernLine(HtmlColor color) { - this.color = color; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - final int x = (int) (dimensionToUse.getWidth() / 2); - final StringBounder stringBounder = ug.getStringBounder(); - ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color)).apply(new UTranslate(x, 0)).draw(new URectangle(getPreferredWidth(stringBounder), dimensionToUse.getHeight())); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return 20; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return 2; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java deleted file mode 100644 index 2e5dae5..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNewpage.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.AbstractComponent; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.ArrowConfiguration; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.ULine; - -public class ComponentBlueModernNewpage extends AbstractComponent { - - private final HtmlColor foregroundColor; - - public ComponentBlueModernNewpage(HtmlColor foregroundColor) { - this.foregroundColor = foregroundColor; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final Dimension2D dimensionToUse = area.getDimensionToUse(); - ug = ArrowConfiguration.stroke(ug, 10, 2, 1); - ug.apply(new UChangeColor(foregroundColor)).draw(new ULine(dimensionToUse.getWidth(), 0)); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return 2; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return 0; - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java deleted file mode 100644 index 10df111..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernNote.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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.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.ULine; -import net.sourceforge.plantuml.ugraphic.UPolygon; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -final public class ComponentBlueModernNote extends AbstractTextualComponent { - - private final int shadowview = 4; - private final int cornersize = 10; - private final HtmlColor back; - private final HtmlColor foregroundColor; - - public ComponentBlueModernNote(HtmlColor back, HtmlColor foregroundColor, FontConfiguration font, - Display strings, ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, false, - null, null); - this.back = back; - this.foregroundColor = foregroundColor; - } - - @Override - final public double getPreferredWidth(StringBounder stringBounder) { - final double result = getTextWidth(stringBounder) + 2 * getPaddingX(); - return result; - } - - @Override - final public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + 2 * getPaddingY(); - } - - @Override - public double getPaddingX() { - return 9; - } - - @Override - public double getPaddingY() { - return 9; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final StringBounder stringBounder = ug.getStringBounder(); - final double textHeight = getTextHeight(stringBounder); - - final double textWidth = getTextWidth(stringBounder); - - final ShadowShape shadowShape = new ShadowShape(textWidth, textHeight, 3); - shadowShape.drawU(ug.apply(new UTranslate(shadowview, shadowview))); - - final UPolygon polygon = new UPolygon(); - polygon.addPoint(0, 0); - polygon.addPoint(0, textHeight); - polygon.addPoint(textWidth, textHeight); - polygon.addPoint(textWidth, cornersize); - polygon.addPoint(textWidth - cornersize, 0); - polygon.addPoint(0, 0); - - ug = ug.apply(new UChangeBackColor(back)); - ug = ug.apply(new UChangeColor(foregroundColor)); - ug.draw(polygon); - - ug.apply(new UTranslate(textWidth - cornersize, 0)).draw(new ULine(0, cornersize)); - ug.apply(new UTranslate(textWidth, cornersize)).draw(new ULine(-cornersize, 0)); - - getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY()))); - - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java deleted file mode 100644 index 405ea4f..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernParticipant.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.LineBreakStrategy; -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.skin.AbstractTextualComponent; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernParticipant extends AbstractTextualComponent { - - private final int shadowview = 3; - private final HtmlColor blue1; - private final HtmlColor blue2; - - public ComponentBlueModernParticipant(HtmlColor blue1, HtmlColor blue2, FontConfiguration font, - Display stringsToDisplay, ISkinSimple spriteContainer) { - super(LineBreakStrategy.NONE, stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, - 7, spriteContainer, false, null, null); - this.blue1 = blue1; - this.blue2 = blue2; - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - final StringBounder stringBounder = ug.getStringBounder(); - - final ShadowShape shadowShape = new ShadowShape(getTextWidth(stringBounder), getTextHeight(stringBounder), 10); - final UGraphic ugShadow = ug.apply(new UTranslate(shadowview, shadowview)).apply(new UChangeColor(null)); - // ug.translate(shadowview, shadowview); - shadowShape.drawU(ugShadow); - // ug.translate(-shadowview, -shadowview); - - final FillRoundShape shape = new FillRoundShape(getTextWidth(stringBounder), getTextHeight(stringBounder), - blue1, blue2, 10); - shape.drawU(ug); - - getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), getMarginY()))); - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + shadowview; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return getTextWidth(stringBounder); - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java b/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java deleted file mode 100644 index 65eaf39..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ComponentBlueModernSelfArrow.java +++ /dev/null @@ -1,157 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.geom.Dimension2D; -import java.awt.geom.Point2D; - -import net.sourceforge.plantuml.ISkinSimple; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.ArrowConfiguration; -import net.sourceforge.plantuml.skin.ArrowPart; -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.UStroke; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArrow { - - private final double arrowWidth = 45; - - public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, - ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) { - super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer); - } - - @Override - protected void drawInternalU(UGraphic ug, Area area) { - if (getArrowConfiguration().isHidden()) { - return; - } - final StringBounder stringBounder = ug.getStringBounder(); - final int textHeight = (int) getTextHeight(stringBounder); - - ug = ug.apply(new UChangeBackColor(getForegroundColor())).apply(new UChangeColor(getForegroundColor())); - final double x2 = arrowWidth - 3; - - if (getArrowConfiguration().isDotted()) { - ug = ArrowConfiguration.stroke(ug, 5, 2, 1); - } else { - ug = ug.apply(new UStroke(2)); - } - - ug.apply(new UTranslate(0, textHeight)).draw(new ULine(x2, 0)); - - final int textAndArrowHeight = (int) (textHeight + getArrowOnlyHeight(stringBounder)); - - ug.apply(new UTranslate(x2, textHeight)).draw(new ULine(0, textAndArrowHeight - textHeight)); - ug.apply(new UTranslate(x2, textAndArrowHeight)).draw(new ULine(2 - x2, 0)); - - ug = ug.apply(new UStroke()); - - final int delta = (int) getArrowOnlyHeight(stringBounder); - - if (getArrowConfiguration().isAsync()) { - if (getArrowConfiguration().getPart() != ArrowPart.BOTTOM_PART) { - ug.apply(new UStroke(1.5)) - .apply(new UTranslate(getArrowDeltaX2(), textHeight - getArrowDeltaY2() + delta)) - .draw(new ULine(-getArrowDeltaX2(), getArrowDeltaY2())); - } - if (getArrowConfiguration().getPart() != ArrowPart.TOP_PART) { - ug.apply(new UStroke(1.5)) - .apply(new UTranslate(getArrowDeltaX2(), textHeight + getArrowDeltaY2() + delta)) - .draw(new ULine(-getArrowDeltaX2(), -getArrowDeltaY2())); - } - } else { - final UPolygon polygon = getPolygon(textHeight, delta); - ug.draw(polygon); - } - - getTextBlock().drawU(ug.apply(new UTranslate(getMarginX1(), 0))); - - } - - private UPolygon getPolygon(final int textHeight, final int delta) { - final UPolygon polygon = new UPolygon(); - if (getArrowConfiguration().getPart() == ArrowPart.TOP_PART) { - polygon.addPoint(getArrowDeltaX(), textHeight - getArrowDeltaY() + delta); - polygon.addPoint(0, textHeight + delta); - polygon.addPoint(getArrowDeltaX(), textHeight + delta); - } else if (getArrowConfiguration().getPart() == ArrowPart.BOTTOM_PART) { - polygon.addPoint(getArrowDeltaX(), textHeight + delta); - polygon.addPoint(0, textHeight + delta); - polygon.addPoint(getArrowDeltaX(), textHeight + getArrowDeltaY() + delta); - } else { - polygon.addPoint(getArrowDeltaX(), textHeight - getArrowDeltaY() + delta); - polygon.addPoint(0, textHeight + delta); - polygon.addPoint(getArrowDeltaX(), textHeight + getArrowDeltaY() + delta); - } - return polygon; - } - - @Override - public double getPreferredHeight(StringBounder stringBounder) { - return getTextHeight(stringBounder) + getArrowDeltaY() + getArrowOnlyHeight(stringBounder) + 2 * getPaddingY(); - } - - private double getArrowOnlyHeight(StringBounder stringBounder) { - return 13; - } - - @Override - public double getPreferredWidth(StringBounder stringBounder) { - return Math.max(getTextWidth(stringBounder), arrowWidth); - } - - public Point2D getStartPoint(StringBounder stringBounder, Dimension2D dimensionToUse) { - final int textHeight = (int) getTextHeight(stringBounder); - return new Point2D.Double(getPaddingX(), textHeight + getPaddingY()); - } - - public Point2D getEndPoint(StringBounder stringBounder, Dimension2D dimensionToUse) { - final int textHeight = (int) getTextHeight(stringBounder); - final int textAndArrowHeight = (int) (textHeight + getArrowOnlyHeight(stringBounder)); - return new Point2D.Double(getPaddingX(), textAndArrowHeight + getPaddingY()); - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java b/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java deleted file mode 100644 index 5183b0e..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/FillRoundShape.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import java.awt.GradientPaint; -import java.awt.Graphics2D; -import java.awt.geom.RoundRectangle2D; - -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorGradient; -import net.sourceforge.plantuml.ugraphic.ColorMapper; -import net.sourceforge.plantuml.ugraphic.UChangeBackColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.URectangle; - -public class FillRoundShape { - - final private double width; - final private double height; - final private double corner; - final private HtmlColor c1; - final private HtmlColor c2; - - public FillRoundShape(double width, double height, HtmlColor c1, HtmlColor c2, double corner) { - this.width = width; - this.height = height; - this.c1 = c1; - this.c2 = c2; - this.corner = corner; - - } - - public void draw(ColorMapper mapper, Graphics2D g2d) { - final GradientPaint paint = new GradientPaint(0, 0, mapper.getMappedColor(c1), (float) width, (float) height, - mapper.getMappedColor(c2)); - final RoundRectangle2D r = new RoundRectangle2D.Double(0, 0, width, height, corner * 2, corner * 2); - g2d.setPaint(paint); - g2d.fill(r); - } - - public void drawU(UGraphic ug) { - final HtmlColorGradient gradient = new HtmlColorGradient(c1, c2, '\\'); - final URectangle r = new URectangle(width, height, corner * 2, corner * 2); - ug.apply(new UChangeBackColor(gradient)).draw(r); - } - -} diff --git a/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java b/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java deleted file mode 100644 index 2c3c427..0000000 --- a/src/net/sourceforge/plantuml/skin/bluemodern/ShadowShape.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.skin.bluemodern; - -import net.sourceforge.plantuml.graphic.HtmlColorUtils; - -public class ShadowShape extends FillRoundShape { - - public ShadowShape(double width, double height, double corner) { - super(width, height, HtmlColorUtils.LIGHT_GRAY, HtmlColorUtils.GRAY, corner); - - } - -} diff --git a/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java b/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java index 7d8af87..d92bbaa 100644 --- a/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java +++ b/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java @@ -35,11 +35,6 @@ */ package net.sourceforge.plantuml.stats; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.prefs.Preferences; - import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.PSystemError; import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3; @@ -51,7 +46,11 @@ import net.sourceforge.plantuml.jcckit.PSystemJcckit; import net.sourceforge.plantuml.math.PSystemMath; import net.sourceforge.plantuml.salt.PSystemSalt; import net.sourceforge.plantuml.stats.api.Stats; -import net.sourceforge.plantuml.sudoku.PSystemSudoku; + +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.prefs.Preferences; public class StatsUtilsIncrement { @@ -122,9 +121,6 @@ public class StatsUtilsIncrement { if (type == PSystemSalt.class) { return "Salt"; } - if (type == PSystemSudoku.class) { - return "Sudoku"; - } if (type == PSystemDot.class) { return "Dot"; } diff --git a/src/net/sourceforge/plantuml/sudoku/DLXEngine.java b/src/net/sourceforge/plantuml/sudoku/DLXEngine.java deleted file mode 100644 index 2055c11..0000000 --- a/src/net/sourceforge/plantuml/sudoku/DLXEngine.java +++ /dev/null @@ -1,1175 +0,0 @@ -/**************************************************************************** - * DLXEngine.java - * - * Created on den 30 december 2005, 01:04 - * - * DLXEngine - * Sudoku puzzle generator and solver based on the suexg and suexk by - * Gunter Stertenbrink. Suexg and suexk are C implementations of the - * Dancing Links algorithm by Donald Knuth and optimized for performance - * which means that certain cleanup work has been done. There is still - * lots of these activities left to do, however, the code is nasty and - * hard to read - but extremely efficient. - * - * The code is public domain so feel free to use it. - *****************************************************************************/ - -package net.sourceforge.plantuml.sudoku; - -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Random; - -/******************************************************************************* - * dlx_solver solve any Sudoku in a fraction of a second. Input is a string of - * dots and digits representing the puzzle to solve and output is the solved - * puzzle. - * - * @author Rolf Sandberg - ******************************************************************************/ -class dlx_solver { - static final int M = 8; // change this for larger grids. Use symbols as in - // L[] below - static final int M2 = M * M; - static final int M4 = M2 * M2; - - /** Pseudo-random number generator */ - long MWC() { - return random.nextLong(); - } - - int A0[][] = new int[M2 + 9][M2 + 9], A[][] = new int[M2 + 9][M2 + 9], Rows[] = new int[4 * M4 + 9], - Cols[] = new int[M2 * M4 + 9], Row[][] = new int[4 * M4 + 9][M2 + 9]; - int Col[][] = new int[M2 * M4 + 9][5], Ur[] = new int[M2 * M4 + 9], Uc[] = new int[4 * M4 + 9], V[] = new int[M2 - * M4 + 9]; - int C[] = new int[M4 + 9], I[] = new int[M4 + 9], T[] = new int[M2 * M4 + 9], P[] = new int[M2 * M4 + 9]; - int Mr[] = { 0, 1, 63, 1023, 4095, 16383, 46655, 131071, 262143 }; - int Mc[] = { 0, 1, 63, 511, 1023, 4095, 8191, 16383, 16383 }; - int Mw[] = { 0, 1, 3, 15, 15, 31, 63, 63, 63 }; - - int nocheck = 0, max, _try_; - final int rnd = 0; - int min, clues, gu, tries; - long Node[] = new long[M4 + 9]; - long nodes, tnodes, solutions, vmax, smax, time0, time1, t1, x1; - double xx, yy; - int q, a, p, i, i1, j, k, l, r, r1, c, c1, c2, n, N = 0, N2, N4, m, m0, m1, x, y, s; - char L[] = { '.', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', - 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', - 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '#', '*', '~' }; - - /** State machine states */ - static final int M6 = 10; - static final int M7 = 11; - static final int RESTART = 12; - static final int M22 = 13; - static final int M3 = 14; - static final int M44 = 15; - static final int NEXT_TRY = 16; - static final int END = 30; - - /** - * Solver function. Input parameter: A puzzle to solve Output: The solved - * puzzle - */ - String solve(String puzzle) { - String result = new String(); - int STATE = M6; - - vmax = 4000000; - smax = 25; - p = 1; - q = 0; - - if (q > 0) { - vmax = 99999999; - smax = 99999999; - } - - N = 3; - N2 = N * N; - N4 = N2 * N2; - m = 4 * N4; - n = N2 * N4; - - if (puzzle.length() < N4) { - return "Error, puzzle incomplete"; - } - - while (STATE != END) { - switch (STATE) { - case M6: - clues = 0; - i = 0; - for (x = 0; x < N2; x++) - for (y = 0; y < N2; y++) { - c = puzzle.charAt(x * N2 + y); - j = 0; - - if (c == '-' || c == '.' || c == '0' || c == '*') { - A0[x][y] = j; - i++; - } else { - while (L[j] != c && j <= N2) - j++; - - if (j <= N2) { - A0[x][y] = j; - if (j > 0) - clues++; - i++; - } - } - } - - if (clues == N4) { - clues--; - A0[1][1] = 0; - } - - if (p < 8) { - for (i = 0; i <= N4; i++) - Node[i] = 0; - } - tnodes = 0; - - case RESTART: - r = 0; - for (x = 1; x <= N2; x++) - for (y = 1; y <= N2; y++) - for (s = 1; s <= N2; s++) { - r++; - Cols[r] = 4; - Col[r][1] = x * N2 - N2 + y; - Col[r][4] = (N * ((x - 1) / N) + (y - 1) / N) * N2 + s + N4; - - Col[r][3] = x * N2 - N2 + s + N4 * 2; - Col[r][2] = y * N2 - N2 + s + N4 * 3; - } - for (c = 1; c <= m; c++) - Rows[c] = 0; - - for (r = 1; r <= n; r++) - for (c = 1; c <= Cols[r]; c++) { - x = Col[r][c]; - Rows[x]++; - Row[x][Rows[x]] = r; - } - - for (x = 0; x < N2; x++) - for (y = 0; y < N2; y++) - A[x][y] = A0[x][y]; - - for (i = 0; i <= n; i++) - Ur[i] = 0; - for (i = 0; i <= m; i++) - Uc[i] = 0; - - solutions = 0; - - for (x = 1; x <= N2; x++) - for (y = 1; y <= N2; y++) - if (A[x - 1][y - 1] > 0) { - r = x * N4 - N4 + y * N2 - N2 + A[x - 1][y - 1]; - - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - if (Uc[c1] > 0 && nocheck == 0) { - STATE = NEXT_TRY; - break; - } - - Uc[c1]++; - - for (k = 1; k <= Rows[c1]; k++) { - r1 = Row[c1][k]; - Ur[r1]++; - } - } - if (STATE == NEXT_TRY) - break; - } - if (STATE == NEXT_TRY) - break; - - if (rnd > 0 && rnd != 17 && rnd != 18) - shuffle(); - - for (c = 1; c <= m; c++) { - V[c] = 0; - for (r = 1; r <= Rows[c]; r++) - if (Ur[Row[c][r]] == 0) - V[c]++; - } - - i = clues; - nodes = 0; - m0 = 0; - m1 = 0; - gu = 0; - solutions = 0; - - case M22: - i++; - I[i] = 0; - min = n + 1; - if (i > N4 || m0 > 0) { - STATE = M44; - break; - } - if (m1 > 0) { - C[i] = m1; - STATE = M3; - break; - } - for (c = 1; c <= m; c++) - if (Uc[c] == 0) { - if (V[c] <= min) - c1 = c; - if (V[c] < min) { - min = V[c]; - C[i] = c; - if (min < 2) { - STATE = M3; - break; - } - } - } - if (STATE == M3) - break; - - gu++; - if (min > 2) { - STATE = M3; - break; - } - - if ((rnd & 255) == 18) - if ((nodes & 1) > 0) { - c = m + 1; - c--; - while (Uc[c] > 0 || V[c] != 2) - c--; - C[i] = c; - } - - if ((rnd & 255) == 17) { - c1 = (int) (MWC() & Mc[N]); - while (c1 >= m) - c1 = (int) (MWC() & Mc[N]); - c1++; - - for (c = c1; c <= m; c++) - if (Uc[c] == 0) - if (V[c] == 2) { - C[i] = c; - STATE = M3; - break; - } - for (c = 1; c < c1; c++) - if (Uc[c] == 0) - if (V[c] == 2) { - C[i] = c; - STATE = M3; - break; - } - } - - case M3: - c = C[i]; - I[i]++; - if (I[i] > Rows[c]) { - STATE = M44; - break; - } - - r = Row[c][I[i]]; - if (Ur[r] > 0) { - STATE = M3; - break; - } - m0 = 0; - m1 = 0; - - if (q > 0 && i > 32 && i < 65) - if ((MWC() & 127) < q) { - STATE = M3; - break; - } - - k = N4; - x = (r - 1) / k + 1; - y = ((r - 1) % k) / j + 1; - s = (r - 1) % j + 1; - - if ((p & 1) > 0) { - j = N2; - k = N4; - x = (r - 1) / k + 1; - y = ((r - 1) % k) / j + 1; - s = (r - 1) % j + 1; - A[x - 1][y - 1] = s; - if (i == k) { - for (x = 0; x < j; x++) - for (y = 0; y < j; y++) - result = result.concat(String.valueOf(L[A[x][y]])); - result = result.concat(" #\n"); - } - } - - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - Uc[c1]++; - } - - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - - for (k = 1; k <= Rows[c1]; k++) { - r1 = Row[c1][k]; - Ur[r1]++; - if (Ur[r1] == 1) - for (l = 1; l <= Cols[r1]; l++) { - c2 = Col[r1][l]; - V[c2]--; - - if (Uc[c2] + V[c2] < 1) - m0 = c2; - if (Uc[c2] == 0 && V[c2] < 2) - m1 = c2; - } - } - } - Node[i]++; - tnodes++; - nodes++; - if (rnd > 99 && nodes > rnd) { - STATE = RESTART; - break; - } - if (i == N4) - solutions++; - - if (solutions >= smax) { - System.out.println("smax xolutions found"); - if (_try_ == 1) - System.out.print("+"); - STATE = NEXT_TRY; - break; - } - if (tnodes > vmax) { - if (_try_ == 1) - System.out.print("-"); - STATE = NEXT_TRY; - break; - } - STATE = M22; - break; - - case M44: - i--; - c = C[i]; - r = Row[c][I[i]]; - if (i == clues) { - STATE = NEXT_TRY; - break; - } - - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - Uc[c1]--; - - for (k = 1; k <= Rows[c1]; k++) { - r1 = Row[c1][k]; - Ur[r1]--; - - if (Ur[r1] == 0) - for (l = 1; l <= Cols[r1]; l++) { - c2 = Col[r1][l]; - V[c2]++; - } - } - } - if (p > 0) { - j = N2; - k = N4; - x = (r - 1) / k + 1; - y = ((r - 1) % k) / j + 1; - s = (r - 1) % j + 1; - A[x - 1][y - 1] = 0; - } - if (i > clues) { - STATE = M3; - break; - } - - case NEXT_TRY: - time1 = System.currentTimeMillis(); - x1 = time1 - time0; - - time0 = time1; - - if (q > 0) { - xx = 128; - yy = 128 - q; - xx = xx / yy; - yy = solutions; - for (i = 1; i < 33; i++) - yy = yy * xx; - System.out.println("clues: " + clues + " estimated solutions:" + yy + " time " + x1 + "ms"); - - STATE = END; - break; - } - if ((p == 0 || p == 1) && tnodes <= 999999) { - if (solutions >= smax) - result = result.concat("More than " + solutions + " solutions ( bad sudoku!! ), rating " - + (100 * tnodes / solutions) + ", time " + x1 + " ms"); - else if (solutions == 1) - result = result.concat(solutions + " solution, rating " + (100 * tnodes) + ", time " + x1 - + " ms"); - else if (solutions == 0) - result = result.concat("0 solutions, no rating possible, time " + x1 + " ms"); - else - result = result.concat(solutions + " solutions ( bad sudoku!! ), rating " - + (100 * tnodes / solutions) + ", time " + x1 + " ms"); - - STATE = END; - break; - } - if (p == 6) { - System.out.println(solutions); - STATE = END; - break; - } - if (p == 0 || p == 1) { - System.out.println(solutions + " solution(s), rating " + (100 * tnodes) + ", time " + x1 + "ms"); - } - if (p > 5) { - x = 0; - for (i = 1; i <= N4; i++) { - x += Node[i]; - System.out.print(Node[i]); - if (i % 9 == 0) - System.out.println(); - } - System.out.println(x); - } - STATE = END; - break; - } // end of switch statement - } // end of while loop - return result; - } - - /** - * Helper function. - */ - int shuffle() { - for (i = 1; i <= m; i++) { - a = (int) ((MWC() >> 8) & Mc[N]); - while (a >= i) - a = (int) ((MWC() >> 8) & Mc[N]); - a++; - P[i] = P[a]; - P[a] = i; - } - - for (c = 1; c <= m; c++) { - Rows[c] = 0; - T[c] = Uc[c]; - } - - for (c = 1; c <= m; c++) - Uc[P[c]] = T[c]; - - for (r = 1; r <= n; r++) - for (i = 1; i <= Cols[r]; i++) { - c = P[Col[r][i]]; - Col[r][i] = c; - Rows[c]++; - Row[c][Rows[c]] = r; - } - - for (i = 1; i <= n; i++) { - a = (int) ((MWC() >> 8) & Mr[N]); - while (a >= i) - a = (int) ((MWC() >> 8) & Mr[N]); - a++; - P[i] = P[a]; - P[a] = i; - } - - for (r = 1; r <= n; r++) { - Cols[r] = 0; - T[r] = Ur[r]; - } - - for (r = 1; r <= n; r++) - Ur[P[r]] = T[r]; - - for (c = 1; c <= m; c++) - for (i = 1; i <= Rows[c]; i++) { - r = P[Row[c][i]]; - Row[c][i] = r; - Cols[r]++; - Col[r][Cols[r]] = c; - } - - for (r = 1; r <= n; r++) { - for (i = 1; i <= Cols[r]; i++) { - a = (int) ((MWC() >> 8) & 7); - while (a >= i) - a = (int) ((MWC() >> 8) & 7); - a++; - P[i] = P[a]; - P[a] = i; - } - - for (i = 1; i <= Cols[r]; i++) - T[i] = Col[r][P[i]]; - - for (i = 1; i <= Cols[r]; i++) - Col[r][i] = T[i]; - } - - for (c = 1; c <= m; c++) { - for (i = 1; i <= Rows[c]; i++) { - a = (int) ((MWC() >> 8) & Mw[N]); - while (a >= i) - a = (int) ((MWC() >> 8) & Mw[N]); - a++; - P[i] = P[a]; - P[a] = i; - } - - for (i = 1; i <= Rows[c]; i++) - T[i] = Row[c][P[i]]; - - for (i = 1; i <= Rows[c]; i++) - Row[c][i] = T[i]; - } - return 0; - } - - private final Random random; - - /** Creates a new instance of dlx_solver */ - public dlx_solver(Random random) { - this.random = random; - } -} - -/******************************************************************************* - * dlx_generator generate single solution locally minimized Sudoku puzzles. - * Locally minimized means that all keys that can be removed without creating a - * degenerate Sudoku (multiple solutions) are removed. - ******************************************************************************/ -class dlx_generator { - long MWC() { - return random.nextLong(); - } - - int Rows[] = new int[325], Cols[] = new int[730], Row[][] = new int[325][10], Col[][] = new int[730][5], - Ur[] = new int[730], Uc[] = new int[325], V[] = new int[325], W[] = new int[325]; - int P[] = new int[88], A[] = new int[88], C[] = new int[88], I[] = new int[88], Two[] = new int[888]; - char B[] = { '0', '1', '1', '1', '2', '2', '2', '3', '3', '3', '1', '1', '1', '2', '2', '2', '3', '3', '3', '1', - '1', '1', '2', '2', '2', '3', '3', '3', '4', '4', '4', '5', '5', '5', '6', '6', '6', '4', '4', '4', '5', - '5', '5', '6', '6', '6', '4', '4', '4', '5', '5', '5', '6', '6', '6', '7', '7', '7', '8', '8', '8', '9', - '9', '9', '7', '7', '7', '8', '8', '8', '9', '9', '9', '7', '7', '7', '8', '8', '8', '9', '9', '9' }; - char H[][] = new char[326][7]; - long c2, w; - int b, f, s1, m0, c1, r1, l, i1, m1, m2, a, p, i, j, k, r, c, d, n = 729, m = 324, x, y, s, z, fi; - int mi1, mi2, q7, part, nt, rate, nodes, solutions, min, samples, sam1, clues; - char L[] = { '.', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; - - /** State machine states */ - static final int M0S = 10; - static final int M0 = 11; - static final int MR1 = 12; - static final int MR3 = 13; - static final int MR4 = 14; - static final int M2 = 15; - static final int M3 = 16; - static final int M4 = 17; - static final int M9 = 18; - static final int MR = 19; - static final int END = 20; - static final int M6 = 21; - - /** Set to true to generate debug output */ - boolean DBG = false; - - /** Output trace messages */ - void dbg(String s) { - if (DBG) - System.out.println(s); - } - - private final Random random; - - public dlx_generator(Random random) { - dbg("In constructor"); - this.random = random; - } - - /** - * Save the generated Sudoku to a file. - */ - void saveSudokuToFile(String s) { - FileOutputStream FO = null; - byte[] buffer = new byte[s.length() + 1]; - int i = 0; - - while (i < s.length()) { - buffer[i] = (byte) s.charAt(i); - i++; - } - - try { - FO = new FileOutputStream("generated_sudoku.sdk"); - FO.write(buffer); - FO.close(); - } catch (IOException IOE) { - // Well, well, well.... - return; - } - } - - /** - * Initialization code for both generate() and rate() - */ - void initialize() { - for (i = 0; i < 888; i++) { - j = 1; - while (j <= i) - j += j; - Two[i] = j - 1; - } - - r = 0; - for (x = 1; x <= 9; x++) - for (y = 1; y <= 9; y++) - for (s = 1; s <= 9; s++) { - r++; - Cols[r] = 4; - Col[r][1] = x * 9 - 9 + y; - Col[r][2] = (B[x * 9 - 9 + y] - 48) * 9 - 9 + s + 81; - Col[r][3] = x * 9 - 9 + s + 81 * 2; - Col[r][4] = y * 9 - 9 + s + 81 * 3; - } - - for (c = 1; c <= m; c++) - Rows[c] = 0; - - for (r = 1; r <= n; r++) - for (c = 1; c <= Cols[r]; c++) { - a = Col[r][c]; - Rows[a]++; - Row[a][Rows[a]] = r; - } - - c = 0; - for (x = 1; x <= 9; x++) - for (y = 1; y <= 9; y++) { - c++; - H[c][0] = 'r'; - H[c][1] = L[x]; - H[c][2] = 'c'; - H[c][3] = L[y]; - H[c][4] = 0; - } - - c = 81; - for (b = 1; b <= 9; b++) - for (s = 1; s <= 9; s++) { - c++; - H[c][0] = 'b'; - H[c][1] = L[b]; - H[c][2] = 's'; - H[c][3] = L[s]; - H[c][4] = 0; - } - - c = 81 * 2; - for (x = 1; x <= 9; x++) - for (s = 1; s <= 9; s++) { - c++; - H[c][0] = 'r'; - H[c][1] = L[x]; - H[c][2] = 's'; - H[c][3] = L[s]; - H[c][4] = 0; - } - - c = 81 * 3; - for (y = 1; y <= 9; y++) - for (s = 1; s <= 9; s++) { - c++; - H[c][0] = 'c'; - H[c][1] = L[y]; - H[c][2] = 's'; - H[c][3] = L[s]; - H[c][4] = 0; - } - } - - /* - * Rating function - */ - public long rate(String puzzle) { - int STATE = M6; - int Solutions; - - z = 100; - fi = 0; - rate = 1; - - for (i = 0; i < 88; i++) - A[i] = 0; - - initialize(); - - while (STATE != END) { - switch (STATE) { - case M6: - clues = 0; - for (i = 1; i <= 81; i++) { - c = puzzle.charAt(i - 1); - j = 0; - - if (c == '-' || c == '.' || c == '0' || c == '*') { - A[i] = j; - } else { - while (L[j] != c && j <= 9) - j++; - - if (j <= 9) { - A[i] = j; - } - } - } - - if (clues == 81) { - clues--; - A[1] = 0; - } - - nt = 0; - mi1 = 9999; - for (f = 0; f < z; f++) { - Solutions = solve(); - if (Solutions != 1) { - if (Solutions > 1) - nt = -1 * Solutions; - STATE = END; - break; - } - nt += nodes; - if (nodes < mi1) { - mi1 = nodes; - mi2 = C[clues]; - } - } - if (STATE == END) - break; - - if (fi > 0) - if ((nt / z) > fi) { - for (i = 1; i <= 81; i++) - System.out.println(L[A[i]]); - System.out.println(); - STATE = M6; - break; - } - - if (fi > 0) { - STATE = M6; - break; - } - - if ((z & 1) > 0) { - System.out.println(nt / z); - STATE = M6; - break; - } - - if (rate > 1) - System.out.println("hint: " + H[mi2]); - - STATE = END; - break; - } // End of switch statement - } // End of while loop - return (nt); - } - - public String[] generate(int Samples, int Rate) { - int STATE = M0S; - String result[] = new String[Samples]; - - dbg("Entering generate"); - - samples = 1000; - if (Samples > 0) - samples = Samples; - - for (i = 0; i < samples; i++) - result[i] = new String(); - - // Set to 1 for rating, set to 2 for rating and hint - rate = 0; - if (Rate > 0) - rate = Rate; - if (rate > 2) - rate = 2; - - initialize(); - - dbg("Entering state machine"); - - sam1 = -1; - while (STATE != END) { - switch (STATE) { - case M0S: - sam1++; - if (sam1 >= samples) { - STATE = END; - break; - } - - case M0: - for (i = 1; i <= 81; i++) - A[i] = 0; - part = 0; - q7 = 0; - - case MR1: - i1 = (int) ((MWC() >> 8) & 127); - if (i1 > 80) { - STATE = MR1; - break; - } - - i1++; - if (A[i1] > 0) { - STATE = MR1; - break; - } - - case MR3: - s = (int) ((MWC() >> 9) & 15); - if (s > 8) { - STATE = MR3; - break; - } - - s++; - A[i1] = s; - m2 = solve(); - q7++; - - if (m2 < 1) - A[i1] = 0; - - if (m2 != 1) { - STATE = MR1; - break; - } - - part++; - if (solve() != 1) { - STATE = M0; - break; - } - - case MR4: - for (i = 1; i <= 81; i++) { - x = (int) ((MWC() >> 8) & 127); - while (x >= i) { - x = (int) ((MWC() >> 8) & 127); - } - x++; - P[i] = P[x]; - P[x] = i; - } - - for (i1 = 1; i1 <= 81; i1++) { - s1 = A[P[i1]]; - A[P[i1]] = 0; - if (solve() > 1) - A[P[i1]] = s1; - } - - if (rate > 0) { - nt = 0; - mi1 = 9999; - for (f = 0; f < 100; f++) { - solve(); - nt += nodes; - if (nodes < mi1) { - mi1 = nodes; - mi2 = C[clues]; - } - } - result[sam1] = result[sam1].concat("Rating:" + nt + "# "); - if (rate > 1) { - result[sam1] = result[sam1].concat("hint: " + String.valueOf(H[mi2]).substring(0, 4) + " #\n"); - } else - result[sam1] = result[sam1].concat("\n"); - } - - for (i = 1; i <= 81; i++) { - result[sam1] = result[sam1].concat(String.valueOf(L[A[i]])); - if (i % 9 == 0) { - result[sam1] = result[sam1].concat("\n"); - } - } - result[sam1] = result[sam1].concat("\n"); - - default: - dbg("Default case. New state M0S"); - STATE = M0S; - break; - } // end of switch statement - } // end of while loop - return result; - } - - int solve() {// returns 0 (no solution), 1 (unique sol.), 2 (more than - // one sol.) - int STATE = M2; - - for (i = 0; i <= n; i++) - Ur[i] = 0; - for (i = 0; i <= m; i++) - Uc[i] = 0; - clues = 0; - - for (i = 1; i <= 81; i++) - if (A[i] > 0) { - clues++; - r = i * 9 - 9 + A[i]; - - for (j = 1; j <= Cols[r]; j++) { - d = Col[r][j]; - if (Uc[d] > 0) - return 0; - Uc[d]++; - - for (k = 1; k <= Rows[d]; k++) { - Ur[Row[d][k]]++; - } - } - } - - for (c = 1; c <= m; c++) { - V[c] = 0; - for (r = 1; r <= Rows[c]; r++) - if (Ur[Row[c][r]] == 0) - V[c]++; - } - - i = clues; - m0 = 0; - m1 = 0; - solutions = 0; - nodes = 0; - - dbg("Solve: Entering state machine"); - - while (STATE != END) { - switch (STATE) { - case M2: - i++; - I[i] = 0; - min = n + 1; - if ((i > 81) || (m0 > 0)) { - STATE = M4; - break; - } - - if (m1 > 0) { - C[i] = m1; - STATE = M3; - break; - } - - w = 0; - for (c = 1; c <= m; c++) - if (Uc[c] == 0) { - if (V[c] < 2) { - C[i] = c; - STATE = M3; - break; - } - - if (V[c] <= min) { - w++; - W[(int) w] = c; - } - ; - - if (V[c] < min) { - w = 1; - W[(int) w] = c; - min = V[c]; - } - } - - if (STATE == M3) { - // break in for loop detected, continue breaking - break; - } - - case MR: - c2 = (MWC() & Two[(int) w]); - while (c2 >= w) { - c2 = (MWC() & Two[(int) w]); - } - C[i] = W[(int) c2 + 1]; - - case M3: - c = C[i]; - I[i]++; - if (I[i] > Rows[c]) { - STATE = M4; - break; - } - - r = Row[c][I[i]]; - if (Ur[r] > 0) { - STATE = M3; - break; - } - m0 = 0; - m1 = 0; - nodes++; - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - Uc[c1]++; - } - - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - for (k = 1; k <= Rows[c1]; k++) { - r1 = Row[c1][k]; - Ur[r1]++; - if (Ur[r1] == 1) - for (l = 1; l <= Cols[r1]; l++) { - c2 = Col[r1][l]; - V[(int) c2]--; - if (Uc[(int) c2] + V[(int) c2] < 1) - m0 = (int) c2; - if (Uc[(int) c2] == 0 && V[(int) c2] < 2) - m1 = (int) c2; - } - } - } - - if (i == 81) - solutions++; - - if (solutions > 1) { - STATE = M9; - break; - } - STATE = M2; - break; - - case M4: - i--; - if (i == clues) { - STATE = M9; - break; - } - c = C[i]; - r = Row[c][I[i]]; - - for (j = 1; j <= Cols[r]; j++) { - c1 = Col[r][j]; - Uc[c1]--; - for (k = 1; k <= Rows[c1]; k++) { - r1 = Row[c1][k]; - Ur[r1]--; - if (Ur[r1] == 0) - for (l = 1; l <= Cols[r1]; l++) { - c2 = Col[r1][l]; - V[(int) c2]++; - } - } - } - - if (i > clues) { - STATE = M3; - break; - } - - case M9: - STATE = END; - break; - default: - STATE = END; - break; - } // end of switch statement - } // end of while statement - return solutions; - } -} - -/** - * - * @author Rolf Sandberg - */ - -public class DLXEngine { - dlx_generator generator; - dlx_solver solver; - - public DLXEngine(Random random) { - generator = new dlx_generator(random); - solver = new dlx_solver(random); - } - - String generate(int minrating, int maxrating) { - // Date t = new Date(); - // long start = t.getTime(); - // int tries = 0, i, samples = 5; - // long rating = 0; - String ss[] = generator.generate(1, 0); - return ss[0]; - - // Generator: - // First arg: rand seed - // Second arg: #samples, ignored if <= 0 - // Third arg: rating and hints, ignored if <= 0 - - // Task: Find a Sudoku with a rating in a specified interval. - // Do it by generating samples and examine them - // Continue until an appropriate puzzle is found. - // while(tries < 9999999) { - // tries++; - // t = new Date(); - // ss = generator.generate(samples, 0); - // for(i = 0; i < samples; i++) { - // rating = generator.rate(ss[i].replace("\n","").trim()); - // if(rating > minrating && rating < maxrating) { - // return ss[i]; - // } - // } - // System.out.println(minrating + ", " + maxrating + ", " + rating + ", - // looping"); - // } - // return ss[0]; - } - - long rate(String s) { - return generator.rate(s); - } - - String solve(String s) { - String result = solver.solve(s); - return result; - } -} diff --git a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java deleted file mode 100644 index 8f921f4..0000000 --- a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java +++ /dev/null @@ -1,170 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sudoku; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.EmptyImageBuilder; -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.SpriteContainerEmpty; -import net.sourceforge.plantuml.TikzFontDistortion; -import net.sourceforge.plantuml.api.ImageDataSimple; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.eps.EpsStrategy; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.png.PngIO; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -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.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps; -import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d; -import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg; -import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz; - -public class GraphicsSudoku { - - private final ISudoku sudoku; - private final UFont numberFont = UFont.sansSerif(20).bold(); - private final UFont font = UFont.sansSerif(11); - - public GraphicsSudoku(ISudoku sudoku) { - this.sudoku = sudoku; - } - - public ImageData writeImageEps(OutputStream os) throws IOException { - final UGraphicEps ug = new UGraphicEps(new ColorMapperIdentity(), EpsStrategy.WITH_MACRO_AND_TEXT); - drawInternal(ug); - os.write(ug.getEPSCode().getBytes()); - return ImageDataSimple.ok(); - } - - public ImageData writeImageSvg(OutputStream os) throws IOException { - final UGraphicSvg ug = new UGraphicSvg(true, new Dimension2DDouble(0, 0), new ColorMapperIdentity(), - (String) null, false, 1.0, null, null, 0); - drawInternal(ug); - ug.createXml(os, null); - return ImageDataSimple.ok(); - } - - public ImageData writeImageLatex(OutputStream os, FileFormat fileFormat) throws IOException { - final UGraphicTikz ug = new UGraphicTikz(new ColorMapperIdentity(), 1, fileFormat == FileFormat.LATEX, - TikzFontDistortion.getDefault()); - drawInternal(ug); - ug.createTikz(os); - return ImageDataSimple.ok(); - } - - public ImageData writeImagePng(OutputStream os) throws IOException { - final EmptyImageBuilder builder = new EmptyImageBuilder(sudoWidth, sudoHeight + textTotalHeight, Color.WHITE); - final BufferedImage im = builder.getBufferedImage(); - final Graphics2D g3d = builder.getGraphics2D(); - - final UGraphic ug = new UGraphicG2d(new ColorMapperIdentity(), g3d, 1.0); - - drawInternal(ug); - g3d.dispose(); - PngIO.write(im, os, 96); - return new ImageDataSimple(im.getWidth(), im.getHeight()); - } - - final private int xOffset = 5; - final private int yOffset = 5; - - final private int cellWidth = 30; - final private int cellHeight = 32; - - final private int numberxOffset = 10; - final private int numberyOffset = 5; - - final private int textTotalHeight = 50; - - final private int boldWidth = 3; - final private int sudoHeight = 9 * cellHeight + 2 * yOffset + boldWidth; - final private int sudoWidth = 9 * cellWidth + 2 * xOffset + boldWidth; - - private void drawInternal(UGraphic ug) { - ug = ug.apply(new UTranslate(xOffset, yOffset)); - - for (int x = 0; x < 9; x++) { - for (int y = 0; y < 9; y++) { - final int num = sudoku.getGiven(x, y); - if (num > 0) { - final TextBlock text = Display.create("" + num).create(FontConfiguration.blackBlueTrue(numberFont), - HorizontalAlignment.CENTER, new SpriteContainerEmpty()); - text.drawU(ug.apply(new UTranslate((numberxOffset + x * cellWidth), - (numberyOffset + y * cellHeight)))); - } - } - } - - ug = ug.apply(new UChangeBackColor(HtmlColorUtils.BLACK)).apply(new UChangeColor(null)); - for (int i = 0; i < 10; i++) { - final boolean bold = i % boldWidth == 0; - final int w = bold ? boldWidth : 1; - ug.apply(new UTranslate(0, i * cellHeight)).draw(new URectangle(9 * cellWidth + boldWidth, w)); - } - for (int i = 0; i < 10; i++) { - final boolean bold = i % boldWidth == 0; - final int w = bold ? boldWidth : 1; - ug.apply(new UTranslate(i * cellWidth, 0)).draw(new URectangle(w, 9 * cellHeight + boldWidth)); - } - - ug = ug.apply(new UTranslate(0, sudoHeight)); - final List texts = new ArrayList(); - texts.add("http://plantuml.com"); - texts.add("Seed " + Long.toString(sudoku.getSeed(), 36)); - texts.add("Difficulty " + sudoku.getRatting()); - final TextBlock textBlock = Display.create(texts).create(FontConfiguration.blackBlueTrue(font), - HorizontalAlignment.LEFT, new SpriteContainerEmpty()); - textBlock.drawU(ug); - } - -} diff --git a/src/net/sourceforge/plantuml/sudoku/ISudoku.java b/src/net/sourceforge/plantuml/sudoku/ISudoku.java deleted file mode 100644 index 1db78ae..0000000 --- a/src/net/sourceforge/plantuml/sudoku/ISudoku.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sudoku; - -public interface ISudoku { - - int getGiven(int x, int y); - - long getRatting(); - - long getSeed(); - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java b/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java deleted file mode 100644 index f207faa..0000000 --- a/src/net/sourceforge/plantuml/sudoku/PSystemSudoku.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sudoku; - -import java.io.IOException; -import java.io.OutputStream; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; - -public class PSystemSudoku extends AbstractPSystem { - - final private ISudoku sudoku; - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) - throws IOException { - final GraphicsSudoku sud = new GraphicsSudoku(sudoku); - if (fileFormat.getFileFormat() == FileFormat.EPS) { - return sud.writeImageEps(os); - } - if (fileFormat.getFileFormat() == FileFormat.SVG) { - return sud.writeImageSvg(os); - } - if (fileFormat.getFileFormat() == FileFormat.LATEX - || fileFormat.getFileFormat() == FileFormat.LATEX_NO_PREAMBLE) { - return sud.writeImageLatex(os, fileFormat.getFileFormat()); - } - return sud.writeImagePng(os); - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Sudoku)"); - } - - public PSystemSudoku(Long seed) { - sudoku = new SudokuDLX(seed); - } - -} diff --git a/src/net/sourceforge/plantuml/sudoku/PSystemSudokuFactory.java b/src/net/sourceforge/plantuml/sudoku/PSystemSudokuFactory.java deleted file mode 100644 index 57362d3..0000000 --- a/src/net/sourceforge/plantuml/sudoku/PSystemSudokuFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sudoku; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.command.PSystemSingleLineFactory; -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; - -public class PSystemSudokuFactory extends PSystemSingleLineFactory { - - final private static Pattern2 p = MyPattern.cmpile("(?i)^sudoku(?:[%s]+([0-9a-zA-Z]+))?[%s]*$"); - - @Override - protected AbstractPSystem executeLine(String line) { - final Matcher2 m = p.matcher(line); - if (m.find() == false) { - return null; - } - - if (m.group(1) == null) { - return new PSystemSudoku(null); - } - return new PSystemSudoku(Long.parseLong(StringUtils.goLowerCase(m.group(1)), 36)); - } - -} diff --git a/src/net/sourceforge/plantuml/sudoku/SudokuDLX.java b/src/net/sourceforge/plantuml/sudoku/SudokuDLX.java deleted file mode 100644 index b9b498b..0000000 --- a/src/net/sourceforge/plantuml/sudoku/SudokuDLX.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.sudoku; - -import java.util.Random; - -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.StringUtils; - -public class SudokuDLX implements ISudoku { - - private final String tab[]; - private final long seed; - private final long rate; - - public SudokuDLX(Long seed) { - if (seed == null) { - this.seed = Math.abs(new Random().nextLong()); - } else { - this.seed = Math.abs(seed.longValue()); - } - final DLXEngine engine = new DLXEngine(new Random(this.seed)); - final String s = engine.generate(10000, 100000); - rate = engine.rate(s.replace("\n", "").trim()); - tab = s.split("\\s"); - } - - public long getRatting() { - return rate; - } - - public long getSeed() { - return seed; - } - - public int getGiven(int x, int y) { - final char c = tab[x].charAt(y); - if (c == '.') { - return 0; - } - return c - '0'; - } - - public void print() { - for (String s : tab) { - Log.println(s); - } - Log.println("Rate=" + rate); - Log.println("Seed=" + StringUtils.goUpperCase(Long.toString(seed, 36))); - } - - public static void main(String[] args) { - for (int i = 0; i < 1; i++) { - final SudokuDLX sudoku = new SudokuDLX(null); - sudoku.print(); - } - } - -} diff --git a/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java b/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java deleted file mode 100644 index f1cc9e5..0000000 --- a/src/net/sourceforge/plantuml/svek/ArithmeticStrategyMax.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.svek; - -public class ArithmeticStrategyMax implements ArithmeticStrategy { - - private double max; - - public void eat(double v) { - if (v > max) { - max = v; - } - } - - public double getResult() { - return max; - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/svek/Line.java b/src/net/sourceforge/plantuml/svek/Line.java index ba4fed8..3d4573b 100644 --- a/src/net/sourceforge/plantuml/svek/Line.java +++ b/src/net/sourceforge/plantuml/svek/Line.java @@ -841,26 +841,6 @@ public class Line implements Moveable, Hideable { } - private void avoid(Point2D.Double move, Positionable pos, Shape sh) { - final Oscillator oscillator = new Oscillator(); - final Point2D.Double orig = new Point2D.Double(move.x, move.y); - while (cut(pos, sh)) { - final Point2D.Double m = oscillator.nextPosition(); - move.setLocation(orig.x + m.x, orig.y + m.y); - } - } - - private boolean cut(Positionable pos, Shape sh) { - return BezierUtils.intersect(pos, sh) || tooClose(pos); - } - - private boolean tooClose(Positionable pos) { - final double dist = dotPath.getMinDist(BezierUtils.getCenter(pos)); - final Dimension2D dim = pos.getSize(); - // Log.println("dist=" + dist); - return dist < (dim.getWidth() / 2 + 2) || dist < (dim.getHeight() / 2 + 2); - } - public void moveSvek(double deltaX, double deltaY) { this.dx += deltaX; this.dy += deltaY; diff --git a/src/net/sourceforge/plantuml/svek/Oscillator.java b/src/net/sourceforge/plantuml/svek/Oscillator.java deleted file mode 100644 index 9ef4348..0000000 --- a/src/net/sourceforge/plantuml/svek/Oscillator.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.svek; - -import java.awt.geom.Point2D; - -public class Oscillator { - - private int n = 3; - private int i = 0; - private char seg = 'A'; - - private int x = -1; - private int y = -1; - - public Point2D.Double nextPosition() { - assert n % 2 == 1; - final int halfN = (n - 1) / 2; - final Point2D.Double result = new Point2D.Double(x, y); - i++; - if (seg == 'A') { - x++; - if (x > halfN) { - seg = 'B'; - x = halfN; - y = -halfN + 1; - } - } else if (seg == 'B') { - y++; - if (y > halfN) { - seg = 'C'; - x = halfN - 1; - y = halfN; - } - } else if (seg == 'C') { - x--; - if (x < -halfN) { - seg = 'D'; - x = -halfN; - y = halfN - 1; - } - } else if (seg == 'D') { - y--; - if (y == -halfN) { - n += 2; - i = 0; - x = -((n - 1) / 2); - y = x; - seg = 'A'; - } - } else { - throw new UnsupportedOperationException(); - } - return result; - } -} diff --git a/src/net/sourceforge/plantuml/swing/MainWindow2.java b/src/net/sourceforge/plantuml/swing/MainWindow2.java index ad1628b..bcf1fb6 100644 --- a/src/net/sourceforge/plantuml/swing/MainWindow2.java +++ b/src/net/sourceforge/plantuml/swing/MainWindow2.java @@ -79,7 +79,7 @@ import javax.swing.SwingUtilities; import javax.swing.Timer; import javax.swing.border.CompoundBorder; -import net.sourceforge.plantuml.DirWatcher2; +import net.sourceforge.plantuml.DirWatcher; import net.sourceforge.plantuml.GeneratedImage; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.Option; @@ -101,7 +101,7 @@ public class MainWindow2 extends JFrame { final private Set openWindows2 = new HashSet(); final private Option option; - private DirWatcher2 dirWatcher; + private DirWatcher dirWatcher; private String getExtensions() { return prefs.get(KEY_PATTERN, getDefaultFileExtensions()); @@ -160,7 +160,7 @@ public class MainWindow2 extends JFrame { final File dir = getDirectory(arg); setIconImage(PSystemVersion.getPlantumlSmallIcon2()); this.option = option; - dirWatcher = new DirWatcher2(dir, option, getRegexpPattern(getExtensions())); + dirWatcher = new DirWatcher(dir, option, getRegexpPattern(getExtensions())); Log.info("Showing MainWindow"); scrollPane = new JScrollPane(jList1); @@ -306,7 +306,7 @@ public class MainWindow2 extends JFrame { private void changeDir(File dir) { prefs.put(KEY_DIR, dir.getAbsolutePath()); dirWatcher.cancel(); - dirWatcher = new DirWatcher2(dir, option, getRegexpPattern(getExtensions())); + dirWatcher = new DirWatcher(dir, option, getRegexpPattern(getExtensions())); setTitle(dir.getAbsolutePath()); Log.info("Creating DirWatcher"); currentDirectoryListing2.clear(); diff --git a/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java b/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java deleted file mode 100644 index 22f0f5e..0000000 --- a/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.telnet; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.Socket; - -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.SourceStringReader; - -class AcceptTelnetClient extends Thread { - final private Socket clientSocket; - final private BufferedReader br; - final private OutputStream os; - - AcceptTelnetClient(Socket socket) throws Exception { - clientSocket = socket; - System.out.println("Client Connected ..."); - br = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); - os = clientSocket.getOutputStream(); - - start(); - } - - public String runInternal() throws IOException { - final StringBuilder sb = new StringBuilder(); - while (true) { - final String s = br.readLine(); - if (s == null) { - return sb.toString(); - } - Log.println("S=" + s); - sb.append(s); - sb.append('\n'); - if (s.equalsIgnoreCase("@enduml")) { - return sb.toString(); - } - } - } - - public void run() { - try { - final String uml = runInternal(); - Log.println("UML=" + uml); - final SourceStringReader s = new SourceStringReader(uml); - s.outputImage(os, new FileFormatOption(FileFormat.ATXT)); - os.close(); - br.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/telnet/TelnetServer.java b/src/net/sourceforge/plantuml/telnet/TelnetServer.java deleted file mode 100644 index 91f77b3..0000000 --- a/src/net/sourceforge/plantuml/telnet/TelnetServer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.telnet; - -import java.net.ServerSocket; -import java.net.Socket; - -public class TelnetServer { - public static void main(String args[]) throws Exception { - final ServerSocket server = new ServerSocket(4242); - while (true) { - final Socket socket = server.accept(); - new AcceptTelnetClient(socket); - } - } - -} diff --git a/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java b/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java deleted file mode 100644 index cd455d5..0000000 --- a/src/net/sourceforge/plantuml/ugraphic/InflaterSet.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.ugraphic; - -import java.util.ArrayList; -import java.util.List; - -public class InflaterSet { - - static class Inflater { - private final double start; - private final double size; - - private Inflater(double start, double size) { - this.start = start; - this.size = size; - } - } - - private final List all = new ArrayList(); - - public void addInflater(double start, double size) { - all.add(new Inflater(start, size)); - } - - public double inflate(double v) { - double result = v; - for (Inflater in : all) { - if (v > in.start) { - result += in.size; - } - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java index 2d1951c..80c311c 100644 --- a/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java +++ b/src/net/sourceforge/plantuml/ugraphic/sprite/SpriteGrayLevel.java @@ -47,8 +47,6 @@ import net.sourceforge.plantuml.code.AsciiEncoder; import net.sourceforge.plantuml.code.AsciiEncoderFinalZeros; import net.sourceforge.plantuml.code.CompressionZlib; import net.sourceforge.plantuml.code.CompressionZopfliZlib; -import net.sourceforge.plantuml.code.PairInt; -import net.sourceforge.plantuml.code.SpiralOnRectangle; import net.sourceforge.plantuml.ugraphic.ColorChangerMonochrome; public enum SpriteGrayLevel { @@ -255,22 +253,6 @@ public enum SpriteGrayLevel { return cut(new AsciiEncoderFinalZeros().encode(comp)); } - private List encodeZSpiral(BufferedImage img) { - final int width = img.getWidth(); - final int height = img.getHeight(); - final byte raw[] = new byte[width * height]; - final int coef = 16 / nbColor; - final SpiralOnRectangle spiral = new SpiralOnRectangle(width, height); - for (int cpt = 0; cpt < width * height; cpt++) { - final PairInt pt = spiral.nextPoint(); - final int color = getGrayOn16(img, pt.getX(), pt.getY()) / coef; - raw[cpt] = (byte) color; - } - // final byte[] comp = new CompressionZlib().compress(raw); - final byte[] comp = new CompressionZopfliZlib().compress(raw); - return cut(new AsciiEncoderFinalZeros().encode(comp)); - } - private List cut(String s) { final List result = new ArrayList(); for (int i = 0; i < s.length(); i += 120) { diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/DriverNoneSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/DriverNoneSvg.java deleted file mode 100644 index 0afc848..0000000 --- a/src/net/sourceforge/plantuml/ugraphic/svg/DriverNoneSvg.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - */ -package net.sourceforge.plantuml.ugraphic.svg; - -import net.sourceforge.plantuml.svg.SvgGraphics; -import net.sourceforge.plantuml.ugraphic.ColorMapper; -import net.sourceforge.plantuml.ugraphic.UDriver; -import net.sourceforge.plantuml.ugraphic.UParam; -import net.sourceforge.plantuml.ugraphic.UShape; - -public class DriverNoneSvg implements UDriver { - - public void draw(UShape shape, double x, double y, ColorMapper mapper, UParam param, SvgGraphics object) { - } - -} -- cgit v1.2.3